Skip to content

Commit

Permalink
Fix #358: use DOMTokenList exclusively
Browse files Browse the repository at this point in the history
In whatwg/dom#120 the DOM spec merged DOMSettableTokenList into
DOMTokenList. Switch to DOMTokenList with [PutForwards=value]
for all instances that used DOMTokenList or DOMSettableTokenList.

Simplify the reflecting attributes prose involving DOMTokenList.
  • Loading branch information
zcorpan authored and annevk committed Jan 28, 2016
1 parent 8c6c3eb commit 98183f9
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@
interface WebGLRenderingContext { }; // WebGL
interface XMLDocument { }; // DOM
interface HTMLCollection { }; // DOM
interface DOMTokenList { }; // DOM
interface DOMSettableTokenList { attribute any value; }; // DOM
interface DOMTokenList { attribute any value; }; // DOM
interface DOMMatrix { }; // Geometry
// fake interfaces that map to JS object types:
interface ArrayBuffer { };
Expand Down Expand Up @@ -3024,8 +3023,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li>The terms <dfn data-noexport="" data-x="concept-collection">collection</dfn> and <dfn data-noexport="">represented by the collection</dfn></li>

<li><dfn data-noexport=""><code>DOMTokenList</code></dfn> interface</li>
<li><dfn data-noexport=""><code>DOMSettableTokenList</code></dfn> interface</li>
<li><dfn data-noexport=""><code data-x="dom-DOMSettableTokenList-value">DOMSettableTokenList.value</code></dfn> attribute</li>
<li><dfn data-noexport=""><code data-x="dom-DOMTokenList-value">DOMTokenList.value</code></dfn> attribute</li>

<li><dfn data-noexport=""><code data-x="dom-DOMImplementation-createDocument">createDocument()</code></dfn> method</li>
<li><dfn data-noexport=""><code data-x="dom-DOMImplementation-createHTMLDocument">createHTMLDocument()</code></dfn> method</li>
Expand Down Expand Up @@ -6870,12 +6868,10 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<p class="note">The values Infinity and Not-a-Number (NaN) values throw an exception on setting,
as defined in the Web IDL specification. <ref spec=WEBIDL></p>

<p>If a reflecting IDL attribute has the type <code>DOMTokenList</code> or
<code>DOMSettableTokenList</code>, then on getting it must return a <code>DOMTokenList</code> or
<code>DOMSettableTokenList</code> object (as appropriate) whose associated element is the element
in question and whose associated attribute's local name is the name of the attribute in question.
The same <code>DOMTokenList</code> or <code>DOMSettableTokenList</code> object must be returned
every time for each attribute.</p>
<p>If a reflecting IDL attribute has the type <code>DOMTokenList</code>, then on getting it must
return a <code>DOMTokenList</code> object whose associated element is the element in question and
whose associated attribute's local name is the name of the attribute in question. The same
<code>DOMTokenList</code> object must be returned every time for each attribute.</p>

<p>If a reflecting IDL attribute has the type <code>HTMLElement</code>, or an interface that
descends from <code>HTMLElement</code>, then, on getting, it must run the following algorithm
Expand Down Expand Up @@ -8963,7 +8959,7 @@ partial /*sealed*/ interface <dfn>Document</dfn> {
attribute DOMString <span data-x="dom-accessKey">accessKey</span>;
readonly attribute DOMString <span data-x="dom-accessKeyLabel">accessKeyLabel</span>;
attribute boolean <span data-x="dom-draggable">draggable</span>;
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-dropzone">dropzone</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-dropzone">dropzone</span>;
attribute <span>HTMLMenuElement</span>? <span data-x="dom-contextMenu">contextMenu</span>;
attribute boolean <span data-x="dom-spellcheck">spellcheck</span>;
void <span data-x="dom-forceSpellCheck">forceSpellCheck</span>();
Expand Down Expand Up @@ -11551,11 +11547,11 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>
attribute DOMString <span data-x="dom-link-href">href</span>;
attribute DOMString? <span data-x="dom-link-crossOrigin">crossOrigin</span>;
attribute DOMString <span data-x="dom-link-rel">rel</span>;
readonly attribute <span>DOMTokenList</span> <span data-x="dom-link-relList">relList</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-link-relList">relList</span>;
attribute DOMString <span data-x="dom-link-media">media</span>;
attribute DOMString <span data-x="dom-link-hreflang">hreflang</span>;
attribute DOMString <span data-x="dom-link-type">type</span>;
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-link-sizes">sizes</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-link-sizes">sizes</span>;
};
<span>HTMLLinkElement</span> implements <span>LinkStyle</span>;</pre>
</dd>
Expand Down Expand Up @@ -17195,9 +17191,9 @@ included with Exhibit B.
<pre class="idl">interface <dfn>HTMLAnchorElement</dfn> : <span>HTMLElement</span> {
attribute DOMString <span data-x="dom-a-target">target</span>;
attribute DOMString <span data-x="dom-a-download">download</span>;
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-a-ping">ping</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-a-ping">ping</span>;
attribute DOMString <span data-x="dom-a-rel">rel</span>;
readonly attribute <span>DOMTokenList</span> <span data-x="dom-a-relList">relList</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-a-relList">relList</span>;
attribute DOMString <span data-x="dom-a-hreflang">hreflang</span>;
attribute DOMString <span data-x="dom-a-type">type</span>;

Expand Down Expand Up @@ -26395,7 +26391,7 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
attribute DOMString <span data-x="dom-iframe-src">src</span>;
attribute DOMString <span data-x="dom-iframe-srcdoc">srcdoc</span>;
attribute DOMString <span data-x="dom-iframe-name">name</span>;
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-iframe-sandbox">sandbox</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-iframe-sandbox">sandbox</span>;
attribute boolean <span data-x="dom-iframe-allowFullscreen">allowFullscreen</span>;
attribute DOMString <span data-x="dom-dim-width">width</span>;
attribute DOMString <span data-x="dom-dim-height">height</span>;
Expand Down Expand Up @@ -26939,8 +26935,9 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
attributes of the same name.</p>

<p>The <span data-x="concept-supported-tokens">supported tokens</span> for <code
data-x="attr-iframe-sandbox">sandbox</code> are the allowed values defined for the <code
data-x="attr-iframe-sandbox">sandbox</code> attribute that are supported by the user agent.</p>
data-x="dom-iframe-sandbox">sandbox</code>'s <code>DOMTokenList</code> are the allowed
values defined in the <code data-x="attr-iframe-sandbox">sandbox</code> attribute and supported by
the user agent.</p>

<p>The <dfn><code data-x="dom-iframe-allowFullscreen">allowFullscreen</code></dfn> IDL attribute
must <span>reflect</span> the <code data-x="attr-iframe-allowfullscreen">allowfullscreen</code>
Expand Down Expand Up @@ -36671,9 +36668,9 @@ dictionary <dfn>TrackEventInit</dfn> : <span>EventInit</span> {
attribute DOMString <span data-x="dom-area-shape">shape</span>;
attribute DOMString <span data-x="dom-area-target">target</span>;
attribute DOMString <span data-x="dom-area-download">download</span>;
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-area-ping">ping</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-area-ping">ping</span>;
attribute DOMString <span data-x="dom-area-rel">rel</span>;
readonly attribute <span>DOMTokenList</span> <span data-x="dom-area-relList">relList</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-area-relList">relList</span>;
};
<span>HTMLAreaElement</span> implements <span>HTMLHyperlinkElementUtils</span>;</pre>
</dd>
Expand Down Expand Up @@ -38894,7 +38891,7 @@ the cell that corresponds to the values of the two dice.
<pre class="idl">interface <dfn>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
attribute unsigned long <span data-x="dom-tdth-colSpan">colSpan</span>;
attribute unsigned long <span data-x="dom-tdth-rowSpan">rowSpan</span>;
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-tdth-headers">headers</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-tdth-headers">headers</span>;
readonly attribute long <span data-x="dom-tdth-cellIndex">cellIndex</span>;
};</pre>

Expand Down Expand Up @@ -50016,7 +50013,7 @@ Daddy">&lt;/textarea></pre>
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
<dd>
<pre class="idl">interface <dfn>HTMLOutputElement</dfn> : <span>HTMLElement</span> {
[PutForwards=<span data-x="dom-DOMSettableTokenList-value">value</span>] readonly attribute <span>DOMSettableTokenList</span> <span data-x="dom-output-htmlFor">htmlFor</span>;
[PutForwards=<span data-x="dom-DOMTokenList-value">value</span>] readonly attribute <span>DOMTokenList</span> <span data-x="dom-output-htmlFor">htmlFor</span>;
readonly attribute <span>HTMLFormElement</span>? <span data-x="dom-fae-form">form</span>;
attribute DOMString <span data-x="dom-fe-name">name</span>;

Expand Down

0 comments on commit 98183f9

Please sign in to comment.