Skip to content

Commit

Permalink
[giow] (3) Make the empty string no longer be a possible index for mo…
Browse files Browse the repository at this point in the history
…st objects that can be indexed by name.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=22291
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8010 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 2, 2013
1 parent 44e3160 commit f520be5
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 55 deletions.
47 changes: 28 additions & 19 deletions complete.html
Expand Up @@ -7476,19 +7476,21 @@ <h5 id=htmlallcollection-0><span class=secno>2.7.2.1 </span>HTMLAllCollection</h
<p>The object's <a href=#supported-property-indices>supported property indices</a> are as defined for
<code><a href=#htmlcollection>HTMLCollection</a></code> objects.</p>

<p>The <a href=#supported-property-names>supported property names</a> consist of the values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> attributes of all the elements <a href=#represented-by-the-collection>represented by the
collection</a>, and the values of all the <code title="">name</code> attributes of all the
<p>The <a href=#supported-property-names>supported property names</a> consist of the non-empty values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> attributes of all the elements <a href=#represented-by-the-collection>represented by the
collection</a>, and the non-empty values of all the <code title="">name</code> attributes of all the
<code><a href=#the-a-element>a</a></code>, <code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-area-element>area</a></code>, <code><a href=#the-embed-element>embed</a></code>, <code><a href=#the-form-element>form</a></code>,
<code><a href=#frame>frame</a></code>, <code><a href=#frameset>frameset</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, and
<code><a href=#the-object-element>object</a></code> elements <a href=#represented-by-the-collection>represented by the collection</a>, in <a href=#tree-order>tree
order</a>, ignoring later duplicates, with the <code title=attr-id><a href=#the-id-attribute>id</a></code> of an element
preceding its <code title="">name</code> if it has both, they differ from each other, and neither
preceding its <code title="">name</code> if it contributes both, they differ from each other, and neither
is the duplicate of an earlier entry.</p>

<p>The <dfn id=dom-htmlallcollection-item-string title=dom-HTMLAllCollection-item-string><code>item(<var title="">name</var>)</code></dfn> and <dfn id=dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem><code>namedItem(<var title="">name</var>)</code></dfn>
methods must act according to the following algorithm:</p>

<ol><li>
<ol><li>If <var title="">name</var> is the empty string, return null and stop the algorithm.</li>

<li>

<p>Let <var title="">collection</var> be an <code><a href=#htmlcollection>HTMLCollection</a></code> object rooted at the
same node as the <code><a href=#htmlallcollection>HTMLAllCollection</a></code> object on which the method was invoked, whose
Expand Down Expand Up @@ -7572,14 +7574,16 @@ <h5 id=htmlformcontrolscollection-0><span class=secno>2.7.2.2 </span>HTMLFormCon
<p>The object's <a href=#supported-property-indices>supported property indices</a> are as defined for
<code><a href=#htmlcollection>HTMLCollection</a></code> objects.</p>

<p>The <a href=#supported-property-names>supported property names</a> consist of the values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes of all the
<p>The <a href=#supported-property-names>supported property names</a> consist of the non-empty values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes of all the
elements <a href=#represented-by-the-collection>represented by the collection</a>, in <a href=#tree-order>tree order</a>, ignoring later
duplicates, with the <code title=attr-id><a href=#the-id-attribute>id</a></code> of an element preceding its <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> if it has both, they differ from each other, and neither is the
duplicates, with the <code title=attr-id><a href=#the-id-attribute>id</a></code> of an element preceding its <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> if it contributes both, they differ from each other, and neither is the
duplicate of an earlier entry.</p>

<p>The <dfn id=dom-htmlformcontrolscollection-nameditem title=dom-HTMLFormControlsCollection-namedItem><code>namedItem(<var title="">name</var>)</code></dfn> method must act according to the following algorithm:</p>

<ol><li>If, at the time the method is called, there is exactly one node in the collection that has
<ol><li>If <var title="">name</var> is the empty string, return null and stop the algorithm.</li>

<li>If, at the time the method is called, there is exactly one node in the collection that has
either an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute or a <code title=attr-fe-name><a href=#attr-fe-name>name</a></code>
attribute equal to <var title="">name</var>, then return that node and stop the algorithm.</li>

Expand Down Expand Up @@ -7703,13 +7707,13 @@ <h5 id=htmloptionscollection-0><span class=secno>2.7.2.3 </span>HTMLOptionsColle
or adds any <code><a href=#the-optgroup-element>optgroup</a></code> elements, and never adds new children to existing
<code><a href=#the-optgroup-element>optgroup</a></code> elements (though it can remove children from them).</p>

<p>The <a href=#supported-property-names>supported property names</a> consist of the values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-option-name><a href=#attr-option-name>name</a></code> attributes of all the
<p>The <a href=#supported-property-names>supported property names</a> consist of the non-empty values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-option-name><a href=#attr-option-name>name</a></code> attributes of all the
elements <a href=#represented-by-the-collection>represented by the collection</a>, in <a href=#tree-order>tree order</a>, ignoring later
duplicates, with the <code title=attr-id><a href=#the-id-attribute>id</a></code> of an element preceding its <code title=attr-option-name><a href=#attr-option-name>name</a></code> if it has both, they differ from each other, and neither is
duplicates, with the <code title=attr-id><a href=#the-id-attribute>id</a></code> of an element preceding its <code title=attr-option-name><a href=#attr-option-name>name</a></code> if it contributes both, they differ from each other, and neither is
the duplicate of an earlier entry.</p>

<p>The <dfn id=dom-htmloptionscollection-nameditem title=dom-HTMLOptionsCollection-namedItem><code>namedItem(<var title="">name</var>)</code></dfn> method must return the first node in the collection that has
either an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute or a <code title=attr-option-name><a href=#attr-option-name>name</a></code> attribute equal to <var title="">name</var>, if there is one;
either an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute or a <code title=attr-option-name><a href=#attr-option-name>name</a></code> attribute equal to <var title="">name</var>, if there is one and if <var title="">name</var> is not the empty string;
otherwise, it must return null.</p>

<p>When the user agent is to <dfn id=dom-htmloptionscollection-setter title=dom-HTMLOptionsCollection-setter>set the value of a new
Expand Down Expand Up @@ -8886,24 +8890,26 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors

<hr><p id=dom-document-namedItem-which>The <code><a href=#document>Document</a></code> interface <a href=#support-named-properties title="support
named properties">supports named properties</a>. The <a href=#supported-property-names>supported property names</a> at
any moment consist of the values of the <code title=attr-name>name</code> content attributes of
any moment consist of the values of the <code title="">name</code> content attributes of
all the
<code><a href=#the-applet-element>applet</a></code>,
<a href=#exposed>exposed</a> <code><a href=#the-embed-element>embed</a></code>,
<code><a href=#the-form-element>form</a></code>,
<code><a href=#the-iframe-element>iframe</a></code>,
<code><a href=#the-img-element>img</a></code>, and
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements in the <code><a href=#document>Document</a></code> that have <code title=attr-name>name</code> content
elements in the <code><a href=#document>Document</a></code> that have non-empty <code title="">name</code> content
attributes, and the values of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-applet-element>applet</a></code> and
<a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code>
elements in the <code><a href=#document>Document</a></code> that have <code title=attr-id><a href=#the-id-attribute>id</a></code> content
elements in the <code><a href=#document>Document</a></code> that have non-empty <code title=attr-id><a href=#the-id-attribute>id</a></code> content
attributes, and the values of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes of all the
<code><a href=#the-img-element>img</a></code>
elements in the <code><a href=#document>Document</a></code> that have both <code title=attr-name>name</code> content
attributes and <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes. The <a href=#supported-property-names>supported property
names</a> must be in <a href=#tree-order>tree order</a>, ignoring later duplicates.</p>
elements in the <code><a href=#document>Document</a></code> that have both non-empty <code title=attr-name>name</code> content
attributes and non-empty <code title=attr-id><a href=#the-id-attribute>id</a></code> content attributes. The <a href=#supported-property-names>supported property
names</a> must be in <a href=#tree-order>tree order</a>, ignoring later duplicates, with values from <code title=attr-id><a href=#the-id-attribute>id</a></code>
attributes coming before values from <code title="">name</code> attributes when the same element
contributes both.</p>

<p>To <a href=#determine-the-value-of-a-named-property>determine the value of a named property</a> <var title="">name</var> when <dfn id=dom-document-nameditem title=dom-document-namedItem>the <code>Document</code> object is indexed for property
retrieval</dfn>, the user agent must return the value obtained using the following steps:</p>
Expand Down Expand Up @@ -8957,7 +8963,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
<li><code><a href=#the-applet-element>applet</a></code> or <a href=#exposed>exposed</a> <code><a href=#the-object-element>object</a></code> elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>, or</li>

<li><code><a href=#the-img-element>img</a></code> elements that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute
whose value is <var title="">name</var>, and that have a <code title=attr-name>name</code>
whose value is <var title="">name</var>, and that have a non-empty <code title=attr-name>name</code>
content attribute present also.</li>

</ul><p>An <code><a href=#the-embed-element>embed</a></code> or <code><a href=#the-object-element>object</a></code> element is said to be <dfn id=exposed>exposed</dfn> if it has
Expand Down Expand Up @@ -44771,6 +44777,9 @@ <h4 id=categories><span class=secno>4.10.2 </span>Categories</h4>
first, then entries whose source is <i>name</i>, and finally entries whose source is <i>past</i>,
and sorting entries with the same element and source by their age, oldest first.</li>

<li><p>Remove any entries in <var title="">sourced names</var> that have the empty string as
their name.</li>

<li><p>Remove any entries in <var title="">sourced names</var> that have the same name as an
earlier entry in the map.</li>

Expand Down Expand Up @@ -65851,10 +65860,10 @@ <h4 id=named-access-on-the-window-object><span class=secno>6.2.4 </span>Named ac
<li>the value of the <code title="">name</code> content attribute for all <code><a href=#the-a-element>a</a></code>,
<code><a href=#the-applet-element>applet</a></code>, <code><a href=#the-area-element>area</a></code>, <code><a href=#the-embed-element>embed</a></code>, <code><a href=#the-form-element>form</a></code>,
<code><a href=#frameset>frameset</a></code>, <code><a href=#the-img-element>img</a></code>, and <code><a href=#the-object-element>object</a></code> elements in the <a href=#active-document>active
document</a> that have a <code title="">name</code> content attribute, and</li>
document</a> that have a non-empty <code title="">name</code> content attribute, and</li>

<li>the value of the <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute of any <a href=#html-elements title="HTML
elements">HTML element</a> in the <a href=#active-document>active document</a> with an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute.</li>
elements">HTML element</a> in the <a href=#active-document>active document</a> with a non-empty <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute.</li>

</ul><p>To <a href=#determine-the-value-of-a-named-property>determine the value of a named property</a> <var title="">name</var> when <dfn id=dom-window-nameditem title=dom-window-namedItem>the <code>Window</code> object is indexed for property
retrieval</dfn>, the user agent must return the value obtained using the following steps:</p>
Expand Down

0 comments on commit f520be5

Please sign in to comment.