Skip to content

Commit

Permalink
Correct CrossOriginProperties and callers
Browse files Browse the repository at this point in the history
Having CrossOriginProperties include the document-tree child browsing context name properties was incorrect for all its callers.

The IDL object they are defined upon is not accessible across origins.

CrossOriginGetOwnPropertyHelper would end up checking the [[Value]] slot of undefined (i.e., a specification error), as they are not own properties of the global object.

And CrossOriginOwnPropertyKeys was excluding them deliberately (though then for "then" incorrectly assuming they were included anyway).

WPT html/browsers/origin/cross-origin-objects/cross-origin-objects.html seems to be testing all this as expected.

Closes #5393.
  • Loading branch information
annevk committed Mar 26, 2020
1 parent edf19e2 commit 1529ed1
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -77373,8 +77373,7 @@ console.assert(iframeWindow.frameElement === null);
then return.</p>

<li>
<p>Repeat for each <var>e</var> that is an element of !
<span>CrossOriginProperties</span>(<var>platformObject</var>):</p>
<p>For each <var>e</var> of ! <span>CrossOriginProperties</span>(<var>platformObject</var>):</p>

<ol>
<li>
Expand Down Expand Up @@ -77443,7 +77442,7 @@ console.assert(iframeWindow.frameElement === null);
{ [[Property]]: "<code data-x="">href</code>", [[NeedsGet]]: false, [[NeedsSet]]: true },
{ [[Property]]: "<code data-x="">replace</code>" } ».</p></li>

<li><p>Let <var>crossOriginWindowProperties</var> be «
<li><p>Return «
{ [[Property]]: "<code data-x="">window</code>", [[NeedsGet]]: true, [[NeedsSet]]: false },
{ [[Property]]: "<code data-x="">self</code>", [[NeedsGet]]: true, [[NeedsSet]]: false },
{ [[Property]]: "<code data-x="">location</code>", [[NeedsGet]]: true, [[NeedsSet]]: true },
Expand All @@ -77457,18 +77456,6 @@ console.assert(iframeWindow.frameElement === null);
{ [[Property]]: "<code data-x="">opener</code>", [[NeedsGet]]: true, [[NeedsSet]]: false },
{ [[Property]]: "<code data-x="">parent</code>", [[NeedsGet]]: true, [[NeedsSet]]: false },
{ [[Property]]: "<code data-x="">postMessage</code>" } ».</p></li>

<li>
<p>Repeat for each <var>e</var> that is an element of <var>O</var>'s <span>document-tree child
browsing context name property set</span>:</p>

<ol>
<li><p>Add { [[Property]]: <var>e</var>, [[HideFromKeys]]: true } as the last element of
<var>crossOriginWindowProperties</var>.</p></li>
</ol>
</li>

<li><p>Return <var>crossOriginWindowProperties</var>.</p></li>
</ol>

<p class="note">Indexed properties do not need to be safelisted as they are handled directly by
Expand Down Expand Up @@ -77508,8 +77495,7 @@ console.assert(iframeWindow.frameElement === null);
object</span>, <var>O</var>'s <span>relevant settings object</span>, and <var>P</var>.</p></li>

<li>
<p>Repeat for each <var>e</var> that is an element of !
<span>CrossOriginProperties</span>(<var>O</var>):</p>
<p>For each <var>e</var> of ! <span>CrossOriginProperties</span>(<var>O</var>):</p>

<ol>
<li>
Expand Down Expand Up @@ -77641,22 +77627,12 @@ console.assert(iframeWindow.frameElement === null);
<ol>
<li><p>Let <var>keys</var> be a new empty <span data-x="js-List">List</span>.</p></li>

<li>
<p>Repeat for each <var>e</var> that is an element of !
<span>CrossOriginProperties</span>(<var>O</var>):</p>

<ol>
<li><p>If <var>e</var>.[[HideFromKeys]] is not true, <span data-x="list append">append</span>
<var>e</var>.[[Property]] to <var>keys</var>.</p></li>
</ol>
</li>

<li><p>If <var>keys</var> <span data-x="list contains">does not contain</span> "<code
data-x="">then</code>", then <span data-x="list append">append</span> "<code
data-x="">then</code>" to <var>keys</var>.</p></li>
<li><p>For each <var>e</var> of ! <span>CrossOriginProperties</span>(<var>O</var>), <span
data-x="list append">append</span> <var>e</var>.[[Property]] to <var>keys</var>.</p></li>

<li><p>Return the concatenation of <var>keys</var> and « <span>@@toStringTag</span>,
<span>@@hasInstance</span>, <span>@@isConcatSpreadable</span> ».</p></li>
<li><p>Return the concatenation of <var>keys</var> and « "<code data-x="">then</code>",
<span>@@toStringTag</span>, <span>@@hasInstance</span>, <span>@@isConcatSpreadable</span>
».</p></li>
</ol>

</div>
Expand Down

0 comments on commit 1529ed1

Please sign in to comment.