Skip to content

Commit

Permalink
Make <link>'s as="" attribute case-insensitive
Browse files Browse the repository at this point in the history
Closes whatwg#1665 by aligning with other enumerated attributes.
  • Loading branch information
domenic authored and Alice Boxhall committed Jan 7, 2019
1 parent 50f2d4b commit 2dd50b2
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -6910,13 +6910,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x="idl-USVString">USVString</code> attribute but doesn't fall into any of the above
categories, then the getting and setting must be done in a transparent, case-preserving manner.</p>

<p>If a reflecting IDL attribute is an <span>IDL enumeration</span> attribute, then, on getting,
if the corresponding content attribute's value <span
data-x="case-sensitive">case-sensitively</span> matches one of the enumerated values, then the IDL
attribute must return the content attribute's value; otherwise it must return the content
attribute's default value. On setting, the content attribute must be set to the specified new
value.</p>

<p>If a reflecting IDL attribute is a <code data-x="idl-boolean">boolean</code> attribute, then on
getting the IDL attribute must return true if the content attribute is set, and false if it is
absent. On setting, the content attribute must be removed if the IDL attribute is set to false,
Expand Down Expand Up @@ -12850,7 +12843,7 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
[<span>CEReactions</span>] attribute USVString <span data-x="dom-link-href">href</span>;
[<span>CEReactions</span>] attribute DOMString? <span data-x="dom-link-crossOrigin">crossOrigin</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-link-rel">rel</span>;
[<span>CEReactions</span>] attribute <span>RequestDestination</span> <span data-x="dom-link-as">as</span>; // (default "")
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-link-as">as</span>; // (default "")
[SameObject, PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-link-relList">relList</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-link-media">media</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-link-nonce">nonce</span>;
Expand Down Expand Up @@ -13045,11 +13038,13 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {

<p>The <dfn><code data-x="attr-link-as">as</code></dfn> attribute specifies the <span
data-x="concept-request-destination">destination</span> for a preload request for the resource
given by the <code data-x="attr-link-href">href</code> attribute. If the attribute is present, the
value must <span data-x="case-sensitive">case-sensitively</span> match one of the <span
data-x="concept-request-destination">destination keywords</span>. The default value is the empty
string. The attribute may be omitted. The attribute must not be specified on <code>link</code>
elements that do not have a <code data-x="attr-link-rel">rel</code> attribute that contains the
given by the <code data-x="attr-link-href">href</code> attribute. It is an <span>enumerated
attribute</span>. Each <span data-x="concept-request-destination">request destination</span>,
including the empty string, is a keyword for this attribute, mapping to a state of the same name.
The attribute's <i data-x="missing value default">missing value default</i> and <i data-x="invalid
value default">invalid value default</i> are both the empty string state. The attribute may be
omitted. The attribute must not be specified on <code>link</code> elements that do not have a
<code data-x="attr-link-rel">rel</code> attribute that contains the
<code data-x="rel-preload">preload</code> keyword.<span w-nodev> User agents must implement the
processing model of the <code data-x="attr-link-as">as</code> attribute described in
<cite>Preload</cite>. <ref spec=FETCH> <ref spec=PRELOAD></span></p>
Expand Down Expand Up @@ -13097,7 +13092,6 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<hr>

<p>The IDL attributes
<dfn><code data-x="dom-link-as">as</code></dfn>,
<dfn><code data-x="dom-link-href">href</code></dfn>,
<dfn><code data-x="dom-link-hreflang">hreflang</code></dfn>,
<dfn><code data-x="dom-link-integrity">integrity</code></dfn>,
Expand All @@ -13112,6 +13106,10 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<p class="note">There is no reflecting IDL attribute for the <code
data-x="attr-link-color">color</code> attribute, but this might be added later.</p>

<p>The <dfn><code data-x="dom-link-as">as</code></dfn> IDL attribute must <span>reflect</span> the
<code data-x="attr-link-as">as</code> content attribute, <span>limited to only known
values</span>.</p>

<p>The <dfn><code data-x="dom-link-crossOrigin">crossOrigin</code></dfn> IDL attribute must
<span>reflect</span> the <code data-x="attr-link-crossorigin">crossorigin</code> content
attribute.</p>
Expand Down

0 comments on commit 2dd50b2

Please sign in to comment.