Skip to content

Commit

Permalink
Use Window's associated Document to define Window's named getter
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Mar 13, 2019
1 parent e8e2d90 commit eb547fa
Showing 1 changed file with 39 additions and 44 deletions.
83 changes: 39 additions & 44 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -78999,22 +78999,22 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
running these steps:</p>

<ol>
<li><p>Let <var>activeDocument</var> be <var>window</var>'s <span data-x="window bc">browsing
context</span>'s <span>active document</span>.</p></li>
<li><p>If <var>window</var>'s <span data-x="window bc">browsing context</span> is null, then
return the empty list.</p></li>

<li><p>Let <var>childBrowsingContexts</var> be all <span data-x="document-tree child browsing
context">document-tree child browsing contexts</span> of <var>activeDocument</var>'s <span
data-x="concept-document-bc">browsing context</span> whose <span>browsing context name</span> is
not the empty string, in order, and including only the first <span>document-tree child browsing
context</span> with a given <span data-x="browsing context name">name</span> if multiple <span
data-x="document-tree child browsing context">document-tree child browsing contexts</span> have
the same one.</p></li>
context">document-tree child browsing contexts</span> of <var>window</var>'s <span data-x="window
bc">browsing context</span> whose <span>browsing context name</span> is not the empty string, in
order, and including only the first <span>document-tree child browsing context</span> with a
given <span data-x="browsing context name">name</span> if multiple <span data-x="document-tree
child browsing context">document-tree child browsing contexts</span> have the same one.</p></li>

<li><p>Remove each <span>browsing context</span> from <var>childBrowsingContexts</var> whose
<span>active document</span>'s <span>origin</span> is not <span>same origin</span> with
<var>activeDocument</var>'s <span>origin</span> and whose <span>browsing context name</span> does
not match the name of its <span>browsing context container</span>'s <code data-x="">name</code>
content attribute value.</p></li>
<var>window</var>'s <span>relevant settings object</span>'s <span
data-x="concept-settings-object-origin">origin</span> and whose <span>browsing context
name</span> does not match the name of its <span>browsing context container</span>'s <code
data-x="">name</code> content attribute value.</p></li>

<li><p>Return the <span data-x="browsing context name">browsing context names</span> of
<var>childBrowsingContexts</var>, in the same order.</p></li>
Expand Down Expand Up @@ -79043,75 +79043,69 @@ dictionary <dfn>WindowPostMessageOptions</dfn> : <span>PostMessageOptions</span>
<li><p>the value of the <code data-x="">name</code> content attribute for all <code>embed</code>,
<code>form</code>, <code>frameset</code>, <code>img</code>, and <code>object</code> elements that
have a non-empty <code data-x="">name</code> content attribute and are <span>in a document
tree</span> with <var>window</var>'s <span data-x="window bc">browsing context</span>'s
<span>active document</span> as their <span>root</span>; and</p></li>
tree</span> with <var>window</var>'s <span data-x="concept-document-window">associated
<code>Document</code></span> as their <span>root</span>; and</p></li>

<li><p>the value of the <code data-x="attr-id">id</code> content attribute for all <span>HTML
elements</span> that have a non-empty <code data-x="attr-id">id</code> content attribute and are
<span>in a document tree</span> with <var>window</var>'s <span data-x="window bc">browsing
context</span>'s <span>active document</span> as their <span>root</span>.</p></li>
<span>in a document tree</span> with <var>window</var>'s <span
data-x="concept-document-window">associated <code>Document</code></span> as their
<span>root</span>.</p></li>
</ul>

<p id="dom-window-nameditem">To <span>determine the value of a named property</span>
<var>name</var> in a <code>Window</code>, the user agent must return the value obtained using the
following steps:</p>
<var>name</var> in a <code>Window</code> object <var>window</var>, the user agent must return the
value obtained using the following steps:</p>

<ol>

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

<li>

<p>Let <var>objects</var> be the list of <span data-x="dom-window-namedItem-filter">named
objects</span> with the name <var>name</var>.</p>
objects</span> of <var>window</var> with the name <var>name</var>.</p>

<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>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>nested browsing context</span> is in <var>objects</var>.</p>

</li>

<li>

<p>Otherwise, if <var>objects</var> has only one element, return that element.</p>

</li>

<li>

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

</li>

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

<p><dfn data-x="dom-window-nameditem-filter">Named objects</dfn> with the name <var>name</var>,
for the purposes of the above algorithm, consist of the following:</p>
<p><dfn data-x="dom-window-nameditem-filter">Named objects</dfn> of <code>Window</code> object
<var>window</var> with the name <var>name</var>, for the purposes of the above algorithm, consist
of the following:</p>

<!-- KEEP THIS LIST IN SYNC WITH SUPPORTED PROPERTY NAMES ABOVE -->
<ul>
<li><p><span data-x="document-tree child browsing context">document-tree child browsing
contexts</span> of the <span>active document</span> whose name is <var>name</var>;</p></li>
contexts</span> of <var>window</var>'s <span data-x="concept-document-window">associated
<code>Document</code></span> whose <span data-x="browsing context name">name</span> is
<var>name</var>;</p></li>

<li><p><code>embed</code>, <code>form</code>, <code>frameset</code>, <code>img</code>, or
<code>object</code> elements that have a <code data-x="">name</code> content attribute whose
value is <var>name</var> and are <span>in a document tree</span> with the <span>active
document</span> as their <span>root</span>; and</p></li>
value is <var>name</var> and are <span>in a document tree</span> with <var>window</var>'s <span
data-x="concept-document-window">associated <code>Document</code></span> as their
<span>root</span>; and</p></li>

<li><p><span>HTML elements</span> that have an <code data-x="attr-id">id</code> content attribute
whose value is <var>name</var> and are <span>in a document tree</span> with the <span>active
document</span> as their <span>root</span>.</p></li>
whose value is <var>name</var> and are <span>in a document tree</span> with <var>window</var>'s
<span data-x="concept-document-window">associated <code>Document</code></span> as their
<span>root</span>.</p></li>
</ul>

</div>
Expand Down Expand Up @@ -79612,8 +79606,9 @@ interface <dfn>BarProp</dfn> {
child browsing context name property set</span>, then:</p>

<ol>
<li><p>Let <var>value</var> be the <code>WindowProxy</code> object of the
<span data-x="dom-window-nameditem-filter">named object</span> with the name <var>P</var>.
<li><p>Let <var>value</var> be the <code>WindowProxy</code> object of the <span
data-x="dom-window-nameditem-filter">named object</span> of <var>W</var> with the name
<var>P</var>.

<li>
<p>Return <span>PropertyDescriptor</span>{
Expand Down

0 comments on commit eb547fa

Please sign in to comment.