Skip to content

Commit

Permalink
Refine hrefTranslate
Browse files Browse the repository at this point in the history
- Adjust IDL to be camelcase
- Add example
- Remove supported text around content attribute
  • Loading branch information
dtapuska committed Aug 9, 2018
1 parent 65d8252 commit 6b35912
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -19450,7 +19450,7 @@ interface <dfn>HTMLAnchorElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-a-rel">rel</span>;
[SameObject, PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-a-relList">relList</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-a-hreflang">hreflang</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-a-hreftranslate">hreftranslate</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-a-hrefTranslate">hrefTranslate</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-a-type">type</span>;

[<span>CEReactions</span>] attribute DOMString <span data-x="dom-a-text">text</span>;
Expand Down Expand Up @@ -19582,8 +19582,8 @@ interface <dfn>HTMLAnchorElement</dfn> : <span>HTMLElement</span> {

<p>The IDL attribute <dfn><code data-x="dom-a-hreftranslate">hreftranslate</code></dfn> must
<span>reflect</span> the <code data-x="attr-hyperlink-hreftranslate">hrefttranslate</code>
content attribute. If the UA does not support a client side translation service this attribute
must not be supported.</p>
content attribute. If the user agent does not support a client side translation service this
IDL attribute must not be implemented, to allow feature detection.</p>

<p>The IDL attribute <dfn><code data-x="dom-a-rellist">relList</code></dfn> must
<span>reflect</span> the <code data-x="attr-hyperlink-rel">rel</code> content attribute.</p>
Expand Down Expand Up @@ -22560,9 +22560,15 @@ document.body.appendChild(wbr);</code></pre>
<code>a</code> elements that create <span data-x="hyperlink">hyperlinks</span>, if present,
provides the desired translation language of the linked resource. The value must be a valid BCP 47
language tag. <ref spec=BCP47> When nativating the anchor, user agents that support client side
translation should invoke the translation engine providing the value of the attribute.
User agents that do not have a client side translation must not support this attribute
so that feature detection of this feature is possible.</p>
translation should display the page in the desired language.</p>

<div class="example">
<p>The following example shows how you can specify different hreflang and hreftranlsate attribute.
In this example the links are in German and French but will be translated to English when
navigated.</p>
<pre><code class="html" data-x="">&lt;a href="/de/html" hreflang=de hreftranslate=en>German Version&lt;/a&gt;
&lt;a href="/fr/html" hreflang=fr hreftranslate=en>French Version&lt;/a&gt;</code></pre>
</div>

<p>The <dfn><code data-x="attr-hyperlink-type">type</code></dfn> attribute, if present, gives the
<span>MIME type</span> of the linked resource. It is purely advisory. The value must be a
Expand Down

0 comments on commit 6b35912

Please sign in to comment.