Skip to content

Commit

Permalink
[giow] (3) Make window[name] lookup match more browsers.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=17888
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@7272 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 24, 2012
1 parent 3fe7ff6 commit 45bb63f
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 67 deletions.
55 changes: 32 additions & 23 deletions complete.html
Expand Up @@ -67992,8 +67992,9 @@ <h4 id=apis-for-creating-and-navigating-browsing-contexts-by-name><span class=se

<hr><p>The <dfn id=dom-name title=dom-name><code>name</code></dfn> attribute of
the <code><a href=#window>Window</a></code> object must, on getting, return the current
name of the <a href=#browsing-context>browsing context</a>, and, on setting, set the
name of the <a href=#browsing-context>browsing context</a> to the new value.</p>
<a href=#browsing-context-name title="browsing context name">name</a> of the
<a href=#browsing-context>browsing context</a>, and, on setting, set the <a href=#browsing-context-name title="browsing context name">name</a> of the <a href=#browsing-context>browsing
context</a> to the new value.</p>

<p class=note>The name <a href=#resetBCName>gets reset</a> when
the browsing context is navigated to another domain.</p>
Expand Down Expand Up @@ -68098,12 +68099,16 @@ <h4 id=named-access-on-the-window-object><span class=secno>6.2.4 </span>Named ac
properties">supports named properties</a>. The <a href=#supported-property-names>supported
property names</a> at any moment consist of:</p>

<ul><li>the value of the <code title="">name</code> content attribute
<ul><li>the <a href=#browsing-context-name>browsing context name</a> of any <a href=#child-browsing-context>child
browsing context</a> of the <a href=#active-document>active document</a> whose
name is not the empty string,</li>

<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=#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 in the <a href=#active-document>active document</a>
that have a <code title="">name</code> content attribute, and</li>
<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>

<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
Expand All @@ -68119,24 +68124,24 @@ <h4 id=named-access-on-the-window-object><span class=secno>6.2.4 </span>Named ac
the user agent must return the value obtained using the following
steps:</p>

<ol><li>
<ol><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1716 --><li>

<p>Let <var title="">elements</var> be the list of <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named elements</a> with the
<p>Let <var title="">objects</var> be the list of <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named objects</a> with the
name <var title="">name</var> in the <a href=#active-document>active document</a>.

<p class=note>There will be at least one such element, by
<p class=note>There will be at least one such object, by
definition.<!-- (If there wasn't, then this algorithm wouldn't
have been invoked by Web IDL.) --></p>

</li>

<li>

<p>If <var title="">elements</var> contains an <code><a href=#the-iframe-element>iframe</a></code>
element, then return the <code><a href=#windowproxy>WindowProxy</a></code> object of the
<a href=#nested-browsing-context>nested browsing context</a> represented by the first such
<code><a href=#the-iframe-element>iframe</a></code> element in <a href=#tree-order>tree order</a>, and abort
these steps.</p>
<p>If <var title="">objects</var> contains a <a href=#nested-browsing-context>nested browsing
context</a>, then return the <code><a href=#windowproxy>WindowProxy</a></code> object of
the <a href=#nested-browsing-context>nested browsing context</a> corresponding to the
first <a href=#browsing-context-container>browsing context container</a> in <a href=#tree-order>tree
order</a> whose <a href=#browsing-context>browsing context</a> is in <var title="">objects</var>, and abort these steps.</p>

</li>

Expand All @@ -68150,20 +68155,24 @@ <h4 id=named-access-on-the-window-object><span class=secno>6.2.4 </span>Named ac
<li>

<p>Otherwise return an <code><a href=#htmlcollection>HTMLCollection</a></code> rooted at the
<code><a href=#document>Document</a></code> node, whose filter matches only <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named elements</a> with
the name <var title="">name</var>.</p> <!-- the same one each time
is returned, because of the rule under collections -->
<code><a href=#document>Document</a></code> node, whose filter matches only <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named objects</a> with the
name <var title="">name</var>. (By definition, these will all be
elements.)</p> <!-- the same one each time is returned, because of
the rule under collections -->

</li>

</ol><p><dfn id=dom-window-nameditem-filter title=dom-window-nameditem-filter>Named elements</dfn>
</ol><p><dfn id=dom-window-nameditem-filter title=dom-window-nameditem-filter>Named objects</dfn>
with the name <var title="">name</var>, for the purposes of the
above algorithm, are those that are either:</p>

<ul><li><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>, or
<code><a href=#the-object-element>object</a></code> elements that have a <code title=attr-name>name</code> content attribute whose value is <var title="">name</var>, or</li>
<ul><li><a href=#child-browsing-context title="child browsing context">child browsing
contexts</a> of the <a href=#active-document>active document</a> whose name is
<var title="">name</var>

<li><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>, or <code><a href=#the-object-element>object</a></code> elements that have a <code title=attr-name>name</code> content attribute whose value is <var title="">name</var>, or</li>

<li><a href=#html-elements>HTML elements</a> that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>.</li>

Expand Down
55 changes: 32 additions & 23 deletions index
Expand Up @@ -67992,8 +67992,9 @@ interface <dfn id=window>Window</dfn> : <a href=#eventtarget>EventTarget</a> {

<hr><p>The <dfn id=dom-name title=dom-name><code>name</code></dfn> attribute of
the <code><a href=#window>Window</a></code> object must, on getting, return the current
name of the <a href=#browsing-context>browsing context</a>, and, on setting, set the
name of the <a href=#browsing-context>browsing context</a> to the new value.</p>
<a href=#browsing-context-name title="browsing context name">name</a> of the
<a href=#browsing-context>browsing context</a>, and, on setting, set the <a href=#browsing-context-name title="browsing context name">name</a> of the <a href=#browsing-context>browsing
context</a> to the new value.</p>

<p class=note>The name <a href=#resetBCName>gets reset</a> when
the browsing context is navigated to another domain.</p>
Expand Down Expand Up @@ -68098,12 +68099,16 @@ interface <dfn id=window>Window</dfn> : <a href=#eventtarget>EventTarget</a> {
properties">supports named properties</a>. The <a href=#supported-property-names>supported
property names</a> at any moment consist of:</p>

<ul><li>the value of the <code title="">name</code> content attribute
<ul><li>the <a href=#browsing-context-name>browsing context name</a> of any <a href=#child-browsing-context>child
browsing context</a> of the <a href=#active-document>active document</a> whose
name is not the empty string,</li>

<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=#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 in the <a href=#active-document>active document</a>
that have a <code title="">name</code> content attribute, and</li>
<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>

<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
Expand All @@ -68119,24 +68124,24 @@ interface <dfn id=window>Window</dfn> : <a href=#eventtarget>EventTarget</a> {
the user agent must return the value obtained using the following
steps:</p>

<ol><li>
<ol><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1716 --><li>

<p>Let <var title="">elements</var> be the list of <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named elements</a> with the
<p>Let <var title="">objects</var> be the list of <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named objects</a> with the
name <var title="">name</var> in the <a href=#active-document>active document</a>.

<p class=note>There will be at least one such element, by
<p class=note>There will be at least one such object, by
definition.<!-- (If there wasn't, then this algorithm wouldn't
have been invoked by Web IDL.) --></p>

</li>

<li>

<p>If <var title="">elements</var> contains an <code><a href=#the-iframe-element>iframe</a></code>
element, then return the <code><a href=#windowproxy>WindowProxy</a></code> object of the
<a href=#nested-browsing-context>nested browsing context</a> represented by the first such
<code><a href=#the-iframe-element>iframe</a></code> element in <a href=#tree-order>tree order</a>, and abort
these steps.</p>
<p>If <var title="">objects</var> contains a <a href=#nested-browsing-context>nested browsing
context</a>, then return the <code><a href=#windowproxy>WindowProxy</a></code> object of
the <a href=#nested-browsing-context>nested browsing context</a> corresponding to the
first <a href=#browsing-context-container>browsing context container</a> in <a href=#tree-order>tree
order</a> whose <a href=#browsing-context>browsing context</a> is in <var title="">objects</var>, and abort these steps.</p>

</li>

Expand All @@ -68150,20 +68155,24 @@ interface <dfn id=window>Window</dfn> : <a href=#eventtarget>EventTarget</a> {
<li>

<p>Otherwise return an <code><a href=#htmlcollection>HTMLCollection</a></code> rooted at the
<code><a href=#document>Document</a></code> node, whose filter matches only <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named elements</a> with
the name <var title="">name</var>.</p> <!-- the same one each time
is returned, because of the rule under collections -->
<code><a href=#document>Document</a></code> node, whose filter matches only <a href=#dom-window-nameditem-filter title=dom-window-namedItem-filter>named objects</a> with the
name <var title="">name</var>. (By definition, these will all be
elements.)</p> <!-- the same one each time is returned, because of
the rule under collections -->

</li>

</ol><p><dfn id=dom-window-nameditem-filter title=dom-window-nameditem-filter>Named elements</dfn>
</ol><p><dfn id=dom-window-nameditem-filter title=dom-window-nameditem-filter>Named objects</dfn>
with the name <var title="">name</var>, for the purposes of the
above algorithm, are those that are either:</p>

<ul><li><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>, or
<code><a href=#the-object-element>object</a></code> elements that have a <code title=attr-name>name</code> content attribute whose value is <var title="">name</var>, or</li>
<ul><li><a href=#child-browsing-context title="child browsing context">child browsing
contexts</a> of the <a href=#active-document>active document</a> whose name is
<var title="">name</var>

<li><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>, or <code><a href=#the-object-element>object</a></code> elements that have a <code title=attr-name>name</code> content attribute whose value is <var title="">name</var>, or</li>

<li><a href=#html-elements>HTML elements</a> that have an <code title=attr-id><a href=#the-id-attribute>id</a></code> content attribute whose value is <var title="">name</var>.</li>

Expand Down
55 changes: 34 additions & 21 deletions source
Expand Up @@ -79651,8 +79651,10 @@ interface <dfn>Window</dfn> : <span>EventTarget</span> {

<p>The <dfn title="dom-name"><code>name</code></dfn> attribute of
the <code>Window</code> object must, on getting, return the current
name of the <span>browsing context</span>, and, on setting, set the
name of the <span>browsing context</span> to the new value.</p>
<span title="browsing context name">name</span> of the
<span>browsing context</span>, and, on setting, set the <span
title="browsing context name">name</span> of the <span>browsing
context</span> to the new value.</p>

<p class="note">The name <a href="#resetBCName">gets reset</a> when
the browsing context is navigated to another domain.</p>
Expand Down Expand Up @@ -79775,12 +79777,16 @@ interface <dfn>Window</dfn> : <span>EventTarget</span> {

<ul>

<li>the <span>browsing context name</span> of any <span>child
browsing context</span> of the <span>active document</span> whose
name is not the empty string,</li>

<li>the value of the <code title="">name</code> content attribute
for all <code>a</code>, <code>applet</code>, <code>area</code>,
<code>embed</code>, <code>form</code>, <code>frame</code>,
<code>frameset</code>, <code>iframe</code>, <code>img</code>, and
<code>object</code> elements in the <span>active document</span>
that have a <code title="">name</code> content attribute, and</li>
<code>embed</code>, <code>form</code>, <code>frameset</code>,
<code>img</code>, and <code>object</code> elements in the
<span>active document</span> that have a <code title="">name</code>
content attribute, and</li>

<li>the value of the <code title="attr-id">id</code> content
attribute of any <span title="HTML elements">HTML element</span> in
Expand All @@ -79803,25 +79809,28 @@ interface <dfn>Window</dfn> : <span>EventTarget</span> {

<ol>

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1716 -->

<li>

<p>Let <var title="">elements</var> be the list of <span
title="dom-window-namedItem-filter">named elements</span> with the
<p>Let <var title="">objects</var> be the list of <span
title="dom-window-namedItem-filter">named objects</span> with the
name <var title="">name</var> in the <span>active document</span>.

<p class="note">There will be at least one such element, by
<p class="note">There will be at least one such object, by
definition.<!-- (If there wasn't, then this algorithm wouldn't
have been invoked by Web IDL.) --></p>

</li>

<li>

<p>If <var title="">elements</var> contains an <code>iframe</code>
element, then return the <code>WindowProxy</code> object of the
<span>nested browsing context</span> represented by the first such
<code>iframe</code> element in <span>tree order</span>, and abort
these steps.</p>
<p>If <var title="">objects</var> contains a <span>nested browsing
context</span>, then return the <code>WindowProxy</code> object of
the <span>nested browsing context</span> corresponding to the
first <span>browsing context container</span> in <span>tree
order</span> whose <span>browsing context</span> is in <var
title="">objects</var>, and abort these steps.</p>

</li>

Expand All @@ -79836,24 +79845,28 @@ interface <dfn>Window</dfn> : <span>EventTarget</span> {

<p>Otherwise return an <code>HTMLCollection</code> rooted at the
<code>Document</code> node, whose filter matches only <span
title="dom-window-namedItem-filter">named elements</span> with
the name <var title="">name</var>.</p> <!-- the same one each time
is returned, because of the rule under collections -->
title="dom-window-namedItem-filter">named objects</span> with the
name <var title="">name</var>. (By definition, these will all be
elements.)</p> <!-- the same one each time is returned, because of
the rule under collections -->

</li>

</ol>

<p><dfn title="dom-window-nameditem-filter">Named elements</dfn>
<p><dfn title="dom-window-nameditem-filter">Named objects</dfn>
with the name <var title="">name</var>, for the purposes of the
above algorithm, are those that are either:</p>

<ul>

<li><span title="child browsing context">child browsing
contexts</span> of the <span>active document</span> whose name is
<var title="">name</var,</li>

<li><code>a</code>, <code>applet</code>, <code>area</code>,
<code>embed</code>, <code>form</code>, <code>frame</code>,
<code>frameset</code>, <code>iframe</code>, <code>img</code>, or
<code>object</code> elements that have a <code
<code>embed</code>, <code>form</code>, <code>frameset</code>,
<code>img</code>, or <code>object</code> elements that have a <code
title="attr-name">name</code> content attribute whose value is <var
title="">name</var>, or</li>

Expand Down

0 comments on commit 45bb63f

Please sign in to comment.