Skip to content

Commit

Permalink
[e] (0) moving sections around
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@6319 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 22, 2011
1 parent 1364003 commit 0e864b7
Show file tree
Hide file tree
Showing 3 changed files with 424 additions and 424 deletions.
280 changes: 140 additions & 140 deletions complete.html
Expand Up @@ -377,10 +377,10 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<li><a href=#htmlpropertiescollection-0><span class=secno>2.8.2.5 </span>HTMLPropertiesCollection</a></ol></li>
<li><a href=#domtokenlist-0><span class=secno>2.8.3 </span>DOMTokenList</a></li>
<li><a href=#domsettabletokenlist-0><span class=secno>2.8.4 </span>DOMSettableTokenList</a></li>
<li><a href=#transferable-objects><span class=secno>2.8.5 </span>Transferable objects</a></li>
<li><a href=#safe-passing-of-structured-data><span class=secno>2.8.6 </span>Safe passing of structured data</a></li>
<li><a href=#domstringmap-0><span class=secno>2.8.7 </span>DOMStringMap</a></li>
<li><a href=#domelementmap-0><span class=secno>2.8.8 </span>DOMElementMap</a></li>
<li><a href=#domstringmap-0><span class=secno>2.8.5 </span>DOMStringMap</a></li>
<li><a href=#domelementmap-0><span class=secno>2.8.6 </span>DOMElementMap</a></li>
<li><a href=#transferable-objects><span class=secno>2.8.7 </span>Transferable objects</a></li>
<li><a href=#safe-passing-of-structured-data><span class=secno>2.8.8 </span>Safe passing of structured data</a></li>
<li><a href=#dom-feature-strings><span class=secno>2.8.9 </span>DOM feature strings</a></li>
<li><a href=#exceptions><span class=secno>2.8.10 </span>Exceptions</a></li>
<li><a href=#garbage-collection><span class=secno>2.8.11 </span>Garbage collection</a></ol></li>
Expand Down Expand Up @@ -8645,8 +8645,141 @@ <h4 id=domsettabletokenlist-0><span class=secno>2.8.4 </span>DOMSettableTokenLis
</div>


<h4 id=domstringmap-0><span class=secno>2.8.5 </span>DOMStringMap</h4>

<h4 id=transferable-objects><span class=secno>2.8.5 </span>Transferable objects</h4>
<p>The <code><a href=#domstringmap>DOMStringMap</a></code> interface represents a set of
name-value pairs. It exposes these using the scripting language's
native mechanisms for property access.</p>

<div class=impl>

<p>When a <code><a href=#domstringmap>DOMStringMap</a></code> object is instantiated, it is
associated with three algorithms, one for getting the list of
name-value pairs, one for setting names to certain values, and one
for deleting names.</p>

<pre class=idl>interface <dfn id=domstringmap>DOMStringMap</dfn> {
<a href=#dom-domstringmap-nameditem title=dom-DOMStringMap-namedItem>getter</a> DOMString (in DOMString name);
<a href=#dom-domstringmap-setitem title=dom-DOMStringMap-setItem>setter</a> void (in DOMString name, in DOMString value);
<a href=#dom-domstringmap-additem title=dom-DOMStringMap-addItem>creator</a> void (in DOMString name, in DOMString value);
<a href=#dom-domstringmap-removeitem title=dom-DOMStringMap-removeItem>deleter</a> void (in DOMString name);
};</pre>

<p>The <a href=#supported-property-names>supported property names</a> on a
<code><a href=#domstringmap>DOMStringMap</a></code> object at any instant are the names of
each pair returned from the algorithm for getting the list of
name-value pairs at that instant.</p>

<p>To <dfn id=dom-domstringmap-nameditem title=dom-DOMStringMap-namedItem>determine the value of
a named property</dfn> <var title="">name</var> in a
<code><a href=#domstringmap>DOMStringMap</a></code>, the user agent must return the value
component of the name-value pair whose name component is <var title="">name</var> in the list returned by the algorithm for
getting the list of name-value pairs.</p>

<p>To set the value of a <dfn id=dom-domstringmap-additem title=dom-DOMStringMap-addItem>new</dfn> or <dfn id=dom-domstringmap-setitem title=dom-DOMStringMap-setItem>existing</dfn> named property <var title="">name</var> to value <var title="">value</var>, the
algorithm for setting names to certain values must be run, passing
<var title="">name</var> as the name and the result of converting
<var title="">value</var> to a <code>DOMString</code> as the
value.</p>

<p>To <dfn id=dom-domstringmap-removeitem title=dom-DOMStringMap-removeItem>delete an existing
named property</dfn> <var title="">name</var>, the algorithm for
deleting names must be run, passing <var title="">name</var> as the
name.</p>

<p class=note>The <code><a href=#domstringmap>DOMStringMap</a></code> interface definition
here is only intended for JavaScript environments. Other language
bindings will need to define how <code><a href=#domstringmap>DOMStringMap</a></code> is to be
implemented for those languages.</p>

</div>

<div class=example>

<p>The <code title=dom-dataset><a href=#dom-dataset>dataset</a></code> attribute on
elements exposes the <code title=attr-data-*><a href=#attr-data-*>data-*</a></code>
attributes on the element.</p>

<p>Given the following fragment and elements with similar
constructions:</p>

<pre>&lt;img class="tower" id="tower5" data-x="12" data-y="5"
data-ai="robotarget" data-hp="46" data-ability="flames"
src="towers/rocket.png alt="Rocket Tower"&gt;</pre>

<p>...one could imagine a function <code title="">splashDamage()</code> that takes some arguments, the first
of which is the element to process:</p>

<pre>function splashDamage(node, x, y, damage) {
if (node.classList.contains('tower') &amp;&amp; // checking the 'class' attribute
node.dataset.x == x &amp;&amp; // reading the 'data-x' attribute
node.dataset.y == y) { // reading the 'data-y' attribute
var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
hp = hp - damage;
if (hp &lt; 0) {
hp = 0;
node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
delete node.dataset.ability; // removing the 'data-ability' attribute
}
node.dataset.hp = hp; // setting the 'data-hp' attribute
}
}</pre>

</div>


<!--CSSREF-->
<h4 id=domelementmap-0><span class=secno>2.8.6 </span>DOMElementMap</h4>

<p>The <code><a href=#domelementmap>DOMElementMap</a></code> interface represents a set of
name-element mappings. It exposes these using the scripting
language's native mechanisms for property access.</p>

<div class=impl>

<p>When a <code><a href=#domelementmap>DOMElementMap</a></code> object is instantiated, it is
associated with three algorithms, one for getting the list of
name-element mappings, one for mapping a name to a certain element,
and one for deleting mappings by name.</p>

<pre class=idl>interface <dfn id=domelementmap>DOMElementMap</dfn> {
<a href=#dom-domelementmap-nameditem title=dom-DOMElementMap-namedItem>getter</a> DOMString (in DOMString name);
<a href=#dom-domelementmap-setitem title=dom-DOMElementMap-setItem>setter</a> void (in DOMString name, in <a href=#element>Element</a> value);
<a href=#dom-domelementmap-additem title=dom-DOMElementMap-addItem>creator</a> void (in DOMString name, in <a href=#element>Element</a> value);
<a href=#dom-domelementmap-removeitem title=dom-DOMElementMap-removeItem>deleter</a> void (in DOMString name);
};</pre>

<p>The <a href=#supported-property-names>supported property names</a> on a
<code><a href=#domelementmap>DOMElementMap</a></code> object at any instant are the names for
each mapping returned from the algorithm for getting the list of
name-element mappings at that instant.</p>

<p>To <dfn id=dom-domelementmap-nameditem title=dom-DOMElementMap-namedItem>determine the value
of a named property</dfn> <var title="">name</var> in a
<code><a href=#domelementmap>DOMElementMap</a></code>, the user agent must return the element
component of the name-element mapping whose name component is <var title="">name</var> in the list returned by the algorithm for
getting the list of name-element mappings.</p>

<p>To set the value of a <dfn id=dom-domelementmap-additem title=dom-DOMElementMap-addItem>new</dfn> or <dfn id=dom-domelementmap-setitem title=dom-DOMElementMap-setItem>existing</dfn> named property <var title="">name</var> to value <var title="">value</var>, the
algorithm for mapping a name to a certain element must be run,
passing <var title="">name</var> as the name <var title="">value</var> as the element.</p>

<p>To <dfn id=dom-domelementmap-removeitem title=dom-DOMElementMap-removeItem>delete an existing
named property</dfn> <var title="">name</var>, the algorithm for
deleting mappings must be run, passing <var title="">name</var> as
the name component of the mapping to be deleted.</p>

<p class=note>The <code><a href=#domelementmap>DOMElementMap</a></code> interface definition
here is only intended for JavaScript environments. Other language
bindings will need to define how <code><a href=#domelementmap>DOMElementMap</a></code> is to be
implemented for those languages.</p>

</div>
<!--CSSREF-->



<h4 id=transferable-objects><span class=secno>2.8.7 </span>Transferable objects</h4>

<p>Some objects support being copied and closed in one operation.
This is called <i>transferring</i> the object, and is used in
Expand All @@ -8671,9 +8804,9 @@ <h4 id=transferable-objects><span class=secno>2.8.5 </span>Transferable objects<

<ul class=brief><li><code><a href=#messageport>MessagePort</a></code>
<!--<li><code>ArrayBuffer</code>-->
</ul><div class=impl><!-- should move down two sections XXX -->
</ul><div class=impl>

<h4 id=safe-passing-of-structured-data><span class=secno>2.8.6 </span>Safe passing of structured data</h4>
<h4 id=safe-passing-of-structured-data><span class=secno>2.8.8 </span>Safe passing of structured data</h4>

<p>When a user agent is required to obtain a <dfn id=structured-clone>structured
clone</dfn> of a value, optionally with a <i>transfer map</i>, it
Expand Down Expand Up @@ -8853,139 +8986,6 @@ <h4 id=safe-passing-of-structured-data><span class=secno>2.8.6 </span>Safe passi
</div>


<h4 id=domstringmap-0><span class=secno>2.8.7 </span>DOMStringMap</h4>

<p>The <code><a href=#domstringmap>DOMStringMap</a></code> interface represents a set of
name-value pairs. It exposes these using the scripting language's
native mechanisms for property access.</p>

<div class=impl>

<p>When a <code><a href=#domstringmap>DOMStringMap</a></code> object is instantiated, it is
associated with three algorithms, one for getting the list of
name-value pairs, one for setting names to certain values, and one
for deleting names.</p>

<pre class=idl>interface <dfn id=domstringmap>DOMStringMap</dfn> {
<a href=#dom-domstringmap-nameditem title=dom-DOMStringMap-namedItem>getter</a> DOMString (in DOMString name);
<a href=#dom-domstringmap-setitem title=dom-DOMStringMap-setItem>setter</a> void (in DOMString name, in DOMString value);
<a href=#dom-domstringmap-additem title=dom-DOMStringMap-addItem>creator</a> void (in DOMString name, in DOMString value);
<a href=#dom-domstringmap-removeitem title=dom-DOMStringMap-removeItem>deleter</a> void (in DOMString name);
};</pre>

<p>The <a href=#supported-property-names>supported property names</a> on a
<code><a href=#domstringmap>DOMStringMap</a></code> object at any instant are the names of
each pair returned from the algorithm for getting the list of
name-value pairs at that instant.</p>

<p>To <dfn id=dom-domstringmap-nameditem title=dom-DOMStringMap-namedItem>determine the value of
a named property</dfn> <var title="">name</var> in a
<code><a href=#domstringmap>DOMStringMap</a></code>, the user agent must return the value
component of the name-value pair whose name component is <var title="">name</var> in the list returned by the algorithm for
getting the list of name-value pairs.</p>

<p>To set the value of a <dfn id=dom-domstringmap-additem title=dom-DOMStringMap-addItem>new</dfn> or <dfn id=dom-domstringmap-setitem title=dom-DOMStringMap-setItem>existing</dfn> named property <var title="">name</var> to value <var title="">value</var>, the
algorithm for setting names to certain values must be run, passing
<var title="">name</var> as the name and the result of converting
<var title="">value</var> to a <code>DOMString</code> as the
value.</p>

<p>To <dfn id=dom-domstringmap-removeitem title=dom-DOMStringMap-removeItem>delete an existing
named property</dfn> <var title="">name</var>, the algorithm for
deleting names must be run, passing <var title="">name</var> as the
name.</p>

<p class=note>The <code><a href=#domstringmap>DOMStringMap</a></code> interface definition
here is only intended for JavaScript environments. Other language
bindings will need to define how <code><a href=#domstringmap>DOMStringMap</a></code> is to be
implemented for those languages.</p>

</div>

<div class=example>

<p>The <code title=dom-dataset><a href=#dom-dataset>dataset</a></code> attribute on
elements exposes the <code title=attr-data-*><a href=#attr-data-*>data-*</a></code>
attributes on the element.</p>

<p>Given the following fragment and elements with similar
constructions:</p>

<pre>&lt;img class="tower" id="tower5" data-x="12" data-y="5"
data-ai="robotarget" data-hp="46" data-ability="flames"
src="towers/rocket.png alt="Rocket Tower"&gt;</pre>

<p>...one could imagine a function <code title="">splashDamage()</code> that takes some arguments, the first
of which is the element to process:</p>

<pre>function splashDamage(node, x, y, damage) {
if (node.classList.contains('tower') &amp;&amp; // checking the 'class' attribute
node.dataset.x == x &amp;&amp; // reading the 'data-x' attribute
node.dataset.y == y) { // reading the 'data-y' attribute
var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
hp = hp - damage;
if (hp &lt; 0) {
hp = 0;
node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
delete node.dataset.ability; // removing the 'data-ability' attribute
}
node.dataset.hp = hp; // setting the 'data-hp' attribute
}
}</pre>

</div>


<!--CSSREF-->
<h4 id=domelementmap-0><span class=secno>2.8.8 </span>DOMElementMap</h4>

<p>The <code><a href=#domelementmap>DOMElementMap</a></code> interface represents a set of
name-element mappings. It exposes these using the scripting
language's native mechanisms for property access.</p>

<div class=impl>

<p>When a <code><a href=#domelementmap>DOMElementMap</a></code> object is instantiated, it is
associated with three algorithms, one for getting the list of
name-element mappings, one for mapping a name to a certain element,
and one for deleting mappings by name.</p>

<pre class=idl>interface <dfn id=domelementmap>DOMElementMap</dfn> {
<a href=#dom-domelementmap-nameditem title=dom-DOMElementMap-namedItem>getter</a> DOMString (in DOMString name);
<a href=#dom-domelementmap-setitem title=dom-DOMElementMap-setItem>setter</a> void (in DOMString name, in <a href=#element>Element</a> value);
<a href=#dom-domelementmap-additem title=dom-DOMElementMap-addItem>creator</a> void (in DOMString name, in <a href=#element>Element</a> value);
<a href=#dom-domelementmap-removeitem title=dom-DOMElementMap-removeItem>deleter</a> void (in DOMString name);
};</pre>

<p>The <a href=#supported-property-names>supported property names</a> on a
<code><a href=#domelementmap>DOMElementMap</a></code> object at any instant are the names for
each mapping returned from the algorithm for getting the list of
name-element mappings at that instant.</p>

<p>To <dfn id=dom-domelementmap-nameditem title=dom-DOMElementMap-namedItem>determine the value
of a named property</dfn> <var title="">name</var> in a
<code><a href=#domelementmap>DOMElementMap</a></code>, the user agent must return the element
component of the name-element mapping whose name component is <var title="">name</var> in the list returned by the algorithm for
getting the list of name-element mappings.</p>

<p>To set the value of a <dfn id=dom-domelementmap-additem title=dom-DOMElementMap-addItem>new</dfn> or <dfn id=dom-domelementmap-setitem title=dom-DOMElementMap-setItem>existing</dfn> named property <var title="">name</var> to value <var title="">value</var>, the
algorithm for mapping a name to a certain element must be run,
passing <var title="">name</var> as the name <var title="">value</var> as the element.</p>

<p>To <dfn id=dom-domelementmap-removeitem title=dom-DOMElementMap-removeItem>delete an existing
named property</dfn> <var title="">name</var>, the algorithm for
deleting mappings must be run, passing <var title="">name</var> as
the name component of the mapping to be deleted.</p>

<p class=note>The <code><a href=#domelementmap>DOMElementMap</a></code> interface definition
here is only intended for JavaScript environments. Other language
bindings will need to define how <code><a href=#domelementmap>DOMElementMap</a></code> is to be
implemented for those languages.</p>

</div>
<!--CSSREF-->


<h4 id=dom-feature-strings><span class=secno>2.8.9 </span>DOM feature strings</h4>

<p>DOM3 Core defines mechanisms for checking for interface support,
Expand Down

0 comments on commit 0e864b7

Please sign in to comment.