Skip to content

Commit

Permalink
Clarify named access on the Window object
Browse files Browse the repository at this point in the history
Closes #9068, in conjunction with whatwg/webidl#1285.
  • Loading branch information
delan committed Mar 29, 2023
1 parent 2368dfe commit abf8fae
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2748,11 +2748,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-legacy-platform-object">legacy platform object</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-primary-interface">primary interface</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-interface-object">interface object</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-named-properties-object">named properties object</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#include">include</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-inherit">inherit</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-interface-prototype-object">interface prototype object</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#implements">implements</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#es-platform-objects">[[Realm]] field of a platform object</dfn></li>
<li><dfn data-x="named-properties-object-getownproperty" data-x-href="https://webidl.spec.whatwg.org/#named-properties-object-getownproperty">[[GetOwnProperty]] internal method of a named properties object</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-callback-context">callback context</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-frozen-array-type">frozen array</dfn> and
<dfn data-x-href="https://webidl.spec.whatwg.org/#dfn-create-frozen-array">creating a frozen array</dfn></li>
Expand All @@ -2767,10 +2769,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#a-promise-rejected-with">a promise rejected with</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#upon-rejection">upon rejection</dfn></li>
<li><dfn data-x-href="https://webidl.spec.whatwg.org/#upon-fulfillment">upon fulfillment</dfn></li>
<li><dfn data-x="Global" data-x-href="https://webidl.spec.whatwg.org/#Global"><code>[Global]</code></dfn></li>
<li><dfn data-x="LegacyFactoryFunction" data-x-href="https://webidl.spec.whatwg.org/#LegacyFactoryFunction"><code>[LegacyFactoryFunction]</code></dfn></li>
<li><dfn data-x="LegacyLenientThis" data-x-href="https://webidl.spec.whatwg.org/#LegacyLenientThis"><code>[LegacyLenientThis]</code></dfn></li>
<li><dfn data-x="LegacyNullToEmptyString" data-x-href="https://webidl.spec.whatwg.org/#LegacyNullToEmptyString"><code>[LegacyNullToEmptyString]</code></dfn></li>
<li><dfn data-x="LegacyOverrideBuiltIns" data-x-href="https://webidl.spec.whatwg.org/#LegacyOverrideBuiltIns"><code>[LegacyOverrideBuiltIns]</code></dfn></li>
<li><dfn data-x="LegacyPlatformObjectGetOwnProperty" data-x-href="https://webidl.spec.whatwg.org/#LegacyPlatformObjectGetOwnProperty">LegacyPlatformObjectGetOwnProperty</dfn></li>
<li><dfn data-x="LegacyTreatNonObjectAsNull" data-x-href="https://webidl.spec.whatwg.org/#LegacyTreatNonObjectAsNull"><code>[LegacyTreatNonObjectAsNull]</code></dfn></li>
<li><dfn data-x="LegacyUnenumerableNamedProperties" data-x-href="https://webidl.spec.whatwg.org/#LegacyUnenumerableNamedProperties"><code>[LegacyUnenumerableNamedProperties]</code></dfn></li>
<li><dfn data-x="LegacyUnforgeable" data-x-href="https://webidl.spec.whatwg.org/#LegacyUnforgeable"><code>[LegacyUnforgeable]</code></dfn></li>
Expand Down Expand Up @@ -11198,8 +11202,8 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
elements</span> with the name <var>name</var> that are <span>in a document tree</span> with the
<code>Document</code> as their <span>root</span>.</p>

<p class="note">There will be at least one such element, by definition.<!-- (If there wasn't,
then this algorithm wouldn't have been invoked by Web IDL.) --></p>
<p class="note">There will be at least one such element, since the algorithm would otherwise not
have been <span data-x="LegacyPlatformObjectGetOwnProperty">invoked by Web IDL</span>.</p>
</li>

<li><p>If <var>elements</var> has only one element, and that element is an <code>iframe</code>
Expand Down Expand Up @@ -86002,10 +86006,11 @@ interface <dfn interface>Window</dfn> : <span>EventTarget</span> {
[Replaceable] readonly attribute <span>WindowProxy</span>? <span data-x="dom-parent">parent</span>;
readonly attribute <span>Element</span>? <span data-x="dom-frameElement">frameElement</span>;
<span>WindowProxy</span>? <span data-x="dom-open">open</span>(optional USVString url = "", optional DOMString target = "_blank", optional [<span>LegacyNullToEmptyString</span>] DOMString features = "");
<a href="#dom-window-nameditem">getter</a> <span data-x="idl-object">object</span> (DOMString name);

// Since this is the global object, the IDL named getter adds a NamedPropertiesObject exotic
// object on the prototype chain. Indeed, this does not make the global object an exotic object.
// Indexed access is taken care of by the <span>WindowProxy</span> exotic object.
<a href="#dom-window-nameditem">getter</a> <span data-x="idl-object">object</span> (DOMString name);

// the user agent
readonly attribute <span>Navigator</span> <span data-x="dom-navigator">navigator</span>;
Expand Down Expand Up @@ -86723,8 +86728,8 @@ dictionary <dfn dictionary>WindowPostMessageOptions</dfn> : <span>StructuredSeri
<p>Let <var>objects</var> be the list of <span data-x="dom-window-namedItem-filter">named
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>
<p class="note">There will be at least one such object, since the algorithm would otherwise not
have been <span data-x="named-properties-object-getownproperty">invoked by Web IDL</span>.</p>
</li>

<li>
Expand Down Expand Up @@ -86772,6 +86777,11 @@ dictionary <dfn dictionary>WindowPostMessageOptions</dfn> : <span>StructuredSeri
<span>root</span>.</p></li>
</ul>

<p class="note">Since the <code>Window</code> interface has the <code
data-x="Global">[Global]</code> extended attribute, its named properties follow the rules for
<span data-x="named properties object">named properties objects</span> rather than <span
data-x="legacy platform object">legacy platform objects</span>.</p>

</div>


Expand Down

0 comments on commit abf8fae

Please sign in to comment.