Skip to content

Commit

Permalink
Fix #119: Merge DOMSettableTokenList into DOMTokenList
Browse files Browse the repository at this point in the history
Move DOMSettableTokenList#value to DOMTokenList and remove the
DOMSettableTokenList interface.
  • Loading branch information
zcorpan committed Nov 26, 2015
1 parent fb45d52 commit 73ba296
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 46 deletions.
34 changes: 11 additions & 23 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -8522,8 +8522,7 @@ These constants can be used for the

<h2 id="sets">Sets</h2>

<p class="note no-backref">Yes, the names {{DOMTokenList}} and {{DOMSettableTokenList}}
are unfortunate legacy mishaps.
<p class="note no-backref">Yes, the name {{DOMTokenList}} is an unfortunate legacy mishap.

<h3 id="interface-domtokenlist">Interface {{DOMTokenList}}</h3>

Expand All @@ -8536,6 +8535,7 @@ interface DOMTokenList {
void remove(DOMString... tokens);
boolean toggle(DOMString token, optional boolean force);
void replace(DOMString token, DOMString newToken);
attribute DOMString value;
stringifier;
iterable&lt;DOMString>;
};
Expand Down Expand Up @@ -8653,6 +8653,11 @@ associated <a for="/">element</a>'s
<p>Throws a {{SyntaxError}} exception if one if the arguments is the empty string.
<p>Throws an {{InvalidCharacterError}} exception if one of the arguments contains any
<a>ASCII whitespace</a>.

<dt><code><var>tokenlist</var> . {{DOMTokenList/value}}</code>
<dd>
<p>Returns the associated set as string.
<p>Can be set, to change the associated attribute.
</dl>

<p>The <dfn attribute for=DOMTokenList><code>length</code></dfn> attribute' getter must return the
Expand Down Expand Up @@ -8783,32 +8788,15 @@ method, when invoked, must run these steps:
<li><p>Run the <a>update steps</a>.
</ol>

<p>The <dfn export for=DOMTokenList id=dom-domtokenlist-stringifier>stringification behavior</dfn>
must return the result of running <a>context object</a>'s <a>serialize steps</a>.


<h3 id="interface-domsettabletokenlist">Interface {{DOMSettableTokenList}}</h3>

<pre class="idl">
interface DOMSettableTokenList : DOMTokenList {
attribute DOMString value;
};
</pre>

<dl class="domintro">
<dt><code><var>tokenlist</var> . {{DOMSettableTokenList/value}}</code>
<dd>
<p>Returns the associated set as string.
<p>Can be set, to change the associated attribute.
</dl>

<p>The <dfn attribute for=DOMSettableTokenList><code>value</code></dfn> attribute must return the
<p>The <dfn attribute for=DOMTokenList><code>value</code></dfn> attribute must return the
result of running <a>context object</a>'s <a>serialize steps</a>.

<p>Setting the {{DOMSettableTokenList/value}} attribute must <a>set an attribute value</a> for the
<p>Setting the {{DOMTokenList/value}} attribute must <a>set an attribute value</a> for the
associated <a for="/">element</a> using associated <a>attribute</a>'s <a for=Attr>local name</a> and
the given value.

<p>The <dfn export for=DOMTokenList id=dom-domtokenlist-stringifier>stringification behavior</dfn>
must return the result of running <a>context object</a>'s <a>serialize steps</a>.


<h2 id='historical'>Historical</h2>
Expand Down
35 changes: 12 additions & 23 deletions dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div class="head">
<p data-fill-with="logo"><a class="logo" href="https://whatwg.org/"> <img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-dom.svg"> </a> </p>
<h1 class="p-name no-ref allcaps" id="title">DOM</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2015-11-25">25 November 2015</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2015-11-26">26 November 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>Participate:
Expand Down Expand Up @@ -183,7 +183,6 @@ <h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="cont
<a href="#sets"><span class="secno">7</span> <span class="content">Sets</span></a>
<ul class="toc">
<li><a href="#interface-domtokenlist"><span class="secno">7.1</span> <span class="content">Interface <code class="idl"><span>DOMTokenList</span></code></span></a>
<li><a href="#interface-domsettabletokenlist"><span class="secno">7.2</span> <span class="content">Interface <code class="idl"><span>DOMSettableTokenList</span></code></span></a>
</ul>
<li>
<a href="#historical"><span class="secno">8</span> <span class="content">Historical</span></a>
Expand Down Expand Up @@ -4034,7 +4033,7 @@ <h3 class="heading settled" data-level="6.3" id="interface-nodefilter"><span cla
<li><dfn class="idl-code" data-dfn-for="NodeFilter" data-dfn-type="const" data-export="" id="dom-nodefilter-show_document_fragment">SHOW_DOCUMENT_FRAGMENT<a class="self-link" href="#dom-nodefilter-show_document_fragment"></a></dfn> (1024, 400 in hexadecimal).
</ul>
<h2 class="heading settled" data-level="7" id="sets"><span class="secno">7. </span><span class="content">Sets</span><a class="self-link" href="#sets"></a></h2>
<p class="note no-backref" role="note">Yes, the names <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code> and <code class="idl"><a data-link-type="idl" href="#domsettabletokenlist">DOMSettableTokenList</a></code> are unfortunate legacy mishaps. </p>
<p class="note no-backref" role="note">Yes, the name <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code> is an unfortunate legacy mishap. </p>
<h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span class="secno">7.1. </span><span class="content">Interface <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code></span><a class="self-link" href="#interface-domtokenlist"></a></h3>
<pre class="idl">interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="domtokenlist">DOMTokenList<a class="self-link" href="#domtokenlist"></a></dfn> {
readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-domtokenlist-length">length</a>;
Expand All @@ -4044,6 +4043,7 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c
void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-remove">remove</a>(DOMString... <dfn class="idl-code" data-dfn-for="DOMTokenList/remove(tokens...), DOMTokenList/remove(tokens)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-remove-tokens-tokens">tokens<a class="self-link" href="#dom-domtokenlist-remove-tokens-tokens"></a></dfn>);
boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/toggle(token, force), DOMTokenList/toggle(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-toggle-token-force-token">token<a class="self-link" href="#dom-domtokenlist-toggle-token-force-token"></a></dfn>, optional boolean <dfn class="idl-code" data-dfn-for="DOMTokenList/toggle(token, force), DOMTokenList/toggle(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-toggle-token-force-force">force<a class="self-link" href="#dom-domtokenlist-toggle-token-force-force"></a></dfn>);
void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/replace(token, newToken)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-replace-token-newtoken-token">token<a class="self-link" href="#dom-domtokenlist-replace-token-newtoken-token"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/replace(token, newToken)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-replace-token-newtoken-newtoken">newToken<a class="self-link" href="#dom-domtokenlist-replace-token-newtoken-newtoken"></a></dfn>);
attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domtokenlist-value">value</a>;
<a data-link-type="dfn" href="#dom-domtokenlist-stringifier">stringifier</a>;
iterable&lt;DOMString>;
};
Expand Down Expand Up @@ -4121,6 +4121,10 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c
<p>Replaces <var>token</var> with <var>newToken</var>. </p>
<p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception if one if the arguments is the empty string. </p>
<p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p>
<dt><code><var>tokenlist</var> . <code class="idl"><a data-link-type="idl" href="#dom-domtokenlist-value">value</a></code></code>
<dd>
<p>Returns the associated set as string. </p>
<p>Can be set, to change the associated attribute. </p>
</dl>
<p>The <dfn class="idl-code" data-dfn-for="DOMTokenList" data-dfn-type="attribute" data-export="" id="dom-domtokenlist-length"><code>length</code><a class="self-link" href="#dom-domtokenlist-length"></a></dfn> attribute' getter must return the
number of tokens in the <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>. </p>
Expand Down Expand Up @@ -4219,23 +4223,12 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c
<li>
<p>Run the <a data-link-type="dfn" href="#concept-dtl-update">update steps</a>. </p>
</ol>
<p>The <dfn data-dfn-for="DOMTokenList" data-dfn-type="dfn" data-export="" id="dom-domtokenlist-stringifier">stringification behavior<a class="self-link" href="#dom-domtokenlist-stringifier"></a></dfn> must return the result of running <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-dtl-serialize">serialize steps</a>. </p>
<h3 class="heading settled" data-level="7.2" id="interface-domsettabletokenlist"><span class="secno">7.2. </span><span class="content">Interface <code class="idl"><a data-link-type="idl" href="#domsettabletokenlist">DOMSettableTokenList</a></code></span><a class="self-link" href="#interface-domsettabletokenlist"></a></h3>
<pre class="idl">interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="domsettabletokenlist">DOMSettableTokenList<a class="self-link" href="#domsettabletokenlist"></a></dfn> : <a data-link-type="idl-name" href="#domtokenlist">DOMTokenList</a> {
attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domsettabletokenlist-value">value</a>;
};
</pre>
<dl class="domintro">
<dt><code><var>tokenlist</var> . <code class="idl"><a data-link-type="idl" href="#dom-domsettabletokenlist-value">value</a></code></code>
<dd>
<p>Returns the associated set as string. </p>
<p>Can be set, to change the associated attribute. </p>
</dl>
<p>The <dfn class="idl-code" data-dfn-for="DOMSettableTokenList" data-dfn-type="attribute" data-export="" id="dom-domsettabletokenlist-value"><code>value</code><a class="self-link" href="#dom-domsettabletokenlist-value"></a></dfn> attribute must return the
<p>The <dfn class="idl-code" data-dfn-for="DOMTokenList" data-dfn-type="attribute" data-export="" id="dom-domtokenlist-value"><code>value</code><a class="self-link" href="#dom-domtokenlist-value"></a></dfn> attribute must return the
result of running <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-dtl-serialize">serialize steps</a>. </p>
<p>Setting the <code class="idl"><a data-link-type="idl" href="#dom-domsettabletokenlist-value">value</a></code> attribute must <a data-link-type="dfn" href="#concept-element-attributes-set-value">set an attribute value</a> for the
<p>Setting the <code class="idl"><a data-link-type="idl" href="#dom-domtokenlist-value">value</a></code> attribute must <a data-link-type="dfn" href="#concept-element-attributes-set-value">set an attribute value</a> for the
associated <a data-link-type="dfn" href="#concept-element">element</a> using associated <a data-link-type="dfn" href="#concept-attribute">attribute</a>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a> and
the given value. </p>
<p>The <dfn data-dfn-for="DOMTokenList" data-dfn-type="dfn" data-export="" id="dom-domtokenlist-stringifier">stringification behavior<a class="self-link" href="#dom-domtokenlist-stringifier"></a></dfn> must return the result of running <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-dtl-serialize">serialize steps</a>. </p>
<h2 class="heading settled" data-level="8" id="historical"><span class="secno">8. </span><span class="content">Historical</span><a class="self-link" href="#historical"></a></h2>
<p>As explained in <a href="#goals">goals</a> this specification is a
significant revision of various DOM specifications. This section attempts to
Expand Down Expand Up @@ -4746,7 +4739,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#domimplementationsource">DOMImplementationSource</a><span>, in §8.2</span>
<li><a href="#domlocator">DOMLocator</a><span>, in §8.2</span>
<li><a href="#domobject">DOMObject</a><span>, in §8.2</span>
<li><a href="#domsettabletokenlist">DOMSettableTokenList</a><span>, in §7.2</span>
<li><a href="#domstringlist">DOMStringList</a><span>, in §8.2</span>
<li><a href="#domtokenlist">DOMTokenList</a><span>, in §7.1</span>
<li><a href="#domuserdata">DOMUserData</a><span>, in §8.2</span>
Expand Down Expand Up @@ -5448,7 +5440,7 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#dom-element-setattributens-namespace-name-value-value">argument for Element/setAttributeNS(namespace, name, value)</a><span>, in §4.8</span>
<li><a href="#concept-attribute-value">dfn for Attr</a><span>, in §4.8.2</span>
<li><a href="#dom-attr-value">attribute for Attr</a><span>, in §4.8.2</span>
<li><a href="#dom-domsettabletokenlist-value">attribute for DOMSettableTokenList</a><span>, in §7.2</span>
<li><a href="#dom-domtokenlist-value">attribute for DOMTokenList</a><span>, in §7.1</span>
</ul>
<li><a href="#dom-element-webkitmatchesselector">webkitMatchesSelector(selectors)</a><span>, in §4.8</span>
<li>
Expand Down Expand Up @@ -6019,14 +6011,11 @@ <h2 class="no-num heading settled" id="idl-index"><span class="content">IDL Inde
void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-remove">remove</a>(DOMString... <a href="#dom-domtokenlist-remove-tokens-tokens">tokens</a>);
boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle</a>(DOMString <a href="#dom-domtokenlist-toggle-token-force-token">token</a>, optional boolean <a href="#dom-domtokenlist-toggle-token-force-force">force</a>);
void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace</a>(DOMString <a href="#dom-domtokenlist-replace-token-newtoken-token">token</a>, DOMString <a href="#dom-domtokenlist-replace-token-newtoken-newtoken">newToken</a>);
attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domtokenlist-value">value</a>;
<a data-link-type="dfn" href="#dom-domtokenlist-stringifier">stringifier</a>;
iterable&lt;DOMString>;
};

interface <a href="#domsettabletokenlist">DOMSettableTokenList</a> : <a data-link-type="idl-name" href="#domtokenlist">DOMTokenList</a> {
attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domsettabletokenlist-value">value</a>;
};

</pre>
</body>
</html>

0 comments on commit 73ba296

Please sign in to comment.