Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross-site ancestor flag to environment. (privacycg/storage-parti… #8036

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 55 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -82005,9 +82005,18 @@ popup4.close();</code></pre></div>
otherwise <var>embedder</var>'s <span>relevant settings object</span>'s <span>top-level
origin</span>.</p></li>

<li><p>Let <var>crossSiteAncestorFlag</var> be false if <var>embedder</var> is null; otherwise
<var>embedder</var>'s <span data-x="concept-environment-cross-site-ancestor">cross-site ancestor
flag</span>.</p></li>

<li><p>If <var>crossSiteAncestorFlag</var> is false, <var>embedder</var> is not null, and
<var>origin</var> is not <span>same site</span> with <var>embedder</var>'s <span
data-x="concept-settings-object-origin">origin</span>, then set <var>crossSiteAncestorFlag</var>
to true.</p></li>

<li><p><span>Set up a window environment settings object</span> with <code>about:blank</code>,
<var>realm execution context</var>, null, <var>topLevelCreationURL</var>, and
<var>topLevelOrigin</var>.</p></li>
<var>realm execution context</var>, null, <var>topLevelCreationURL</var>,
<var>topLevelOrigin</var>, and <var>crossSiteAncestorFlag</var>.</p></li>

<li><p>Let <var>loadTimingInfo</var> be a new <span>document load timing info</span> with
its <span>navigation start time</span> set to the result of calling <span>coarsen time</span>
Expand Down Expand Up @@ -84300,8 +84309,8 @@ interface <dfn interface>BarProp</dfn> {
<p>To <dfn>set up a window environment settings object</dfn>, given a <span>URL</span>
<var>creationURL</var>, a <span>JavaScript execution context</span> <var>execution context</var>,
null or an <span>environment</span> <var>reservedEnvironment</var>, a <span>URL</span>
<var>topLevelCreationURL</var>, and an <span>origin</span> <var>topLevelOrigin</var>, run these
steps:</p>
<var>topLevelCreationURL</var>, an <span>origin</span> <var>topLevelOrigin</var>, and a boolean
<var>crossSiteAncestorFlag</var>, run these steps:</p>

<ol>
<li><p>Let <var>realm</var> be the value of <var>execution context</var>'s Realm
Expand Down Expand Up @@ -84410,8 +84419,10 @@ interface <dfn interface>BarProp</dfn> {

<li><p>Set <var>settings object</var>'s <span data-x="concept-environment-creation-url">creation
URL</span> to <var>creationURL</var>, <var>settings object</var>'s <span>top-level creation
URL</span> to <var>topLevelCreationURL</var>, and <var>settings object</var>'s <span>top-level
origin</span> to <var>topLevelOrigin</var>.</p></li>
URL</span> to <var>topLevelCreationURL</var>, <var>settings object</var>'s <span>top-level
origin</span> to <var>topLevelOrigin</var>, and <var>settings object</var>'s <span
data-x="concept-environment-cross-site-ancestor">cross-site ancestor flag</span> to
<var>crossSiteAncestorFlag</var>.</p></li>

<li><p>Set <var>realm</var>'s [[HostDefined]] field to <var>settings object</var>.</p></li>
</ol>
Expand Down Expand Up @@ -89817,6 +89828,8 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location

<li><p>Let <var>topLevelOrigin</var> be null.</p></li>

<li><p>Let <var>crossSiteAncestorFlag</var> be false.</p></li>

<li>
<p>If <var>browsingContext</var> is not a <span>top-level browsing context</span>, then:</p>

Expand All @@ -89827,6 +89840,14 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
<li><p>Set <var>topLevelCreationURL</var> to <var>parentEnvironment</var>'s <span>top-level
creation URL</span> and <var>topLevelOrigin</var> to <var>parentEnvironment</var>'s
<span>top-level origin</span>.</p></li>

<li><p>Set <var>crossSiteAncestorFlag</var> to <var>parentEnvironment</var>'s <span
data-x="concept-environment-cross-site-ancestor">cross-site ancestor flag</span>.</p></li>

<li><p>If <var>crossSiteAncestorFlag</var> is false and <var>parentEnvironment</var>'s
<span data-x="concept-settings-object-origin">origin</span> is not <span>same site</span>
with <var>currentURL</var>'s <span data-x="concept-url-origin">origin</span>, then set
<var>crossSiteAncestorFlag</var> to true.
</ol>
</li>

Expand All @@ -89837,8 +89858,9 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
data-x="concept-environment-target-browsing-context">target browsing context</span> is
<var>browsingContext</var>, <span data-x="concept-environment-creation-url">creation
URL</span> is <var>currentURL</var>, <span>top-level creation URL</span> is
<var>topLevelCreationURL</var>, and <span>top-level origin</span> is
<var>topLevelOrigin</var>.</p>
<var>topLevelCreationURL</var>, <span>top-level origin</span> is
<var>topLevelOrigin</var>, and <span data-x="concept-environment-cross-site-ancestor">
cross-site ancestor flag</span> is <var>crossSiteAncestorFlag</var>.</p>

<p class="note">The created environment's <span
data-x="concept-environment-active-service-worker">active service worker</span> is set in
Expand Down Expand Up @@ -90462,6 +90484,8 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
<li><p>Let <var>topLevelOrigin</var> be <var>navigationParams</var>'s <span
data-x="navigation-params-request">origin</span>.</p></li>

<li><p>Let <var>crossSiteAncestorFlag</var> be false.</p></li>

<li>
<p>If <var>browsingContext</var> is not a <span>top-level browsing context</span>, then:</p>

Expand All @@ -90474,13 +90498,22 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location

<li><p>Set <var>topLevelOrigin</var> to <var>parentEnvironment</var>'s <span>top-level
origin</span>.</p></li>

<li><p>Set <var>crossSiteAncestorFlag</var> to <var>parentEnvironment</var>'s <span
data-x="concept-environment-cross-site-ancestor">cross-site ancestor flag</span>.</p></li>

<li><p>If <var>crossSiteAncestorFlag</var> is false and <var>navigationParams</var>'s <span
data-x="navigation-params-request">origin</span> is not <span>same site</span> with
<var>parentEnvironment</var>'s <span data-x="concept-settings-object-origin">origin</span>,
then set <var>crossSiteAncestorFlag</var> to true.</p>
</ol>
</li>

<li><p><span>Set up a window environment settings object</span> with <var>creationURL</var>,
<var>realm execution context</var>, <var>navigationParams</var>'s <span
data-x="navigation-params-reserved-environment">reserved environment</span>,
<var>topLevelCreationURL</var>, and <var>topLevelOrigin</var>.</p></li>
<var>topLevelCreationURL</var>, <var>topLevelOrigin</var>, and
<var>crossSiteAncestorFlag</var>.</p></li>
</ol>

<p class="note">This is the usual case, where the new <code>Document</code> we're about to
Expand Down Expand Up @@ -92834,6 +92867,15 @@ interface <dfn interface>BeforeUnloadEvent</dfn> : <span>Event</span> {
involved.</p>
</dd>

<dt>A <dfn data-x="concept-environment-cross-site-ancestor" export for="environment">cross-site
ancestor flag</dfn></dt>
<dd><p>A boolean. For window <span>environment settings object</span>s this will be set to true
if an ancestor frame has an <span data-x="concept-settings-object-origin">origin</span> that is
not <span>same site</span> with the current window's <span
data-x="concept-settings-object-origin">origin</span> and otherwise false. For workers and
worklets it is set to the <span data-x="concept-environment-cross-site-ancestor">cross-site
ancestor flag</span> of its creator.</p></dd>

<dt>A <dfn data-x="concept-environment-target-browsing-context" export
for="environment">target browsing context</dfn></dt>
<dd><p>Null or a target <span>browsing context</span> for a <span
Expand Down Expand Up @@ -105005,8 +105047,10 @@ interface <dfn interface>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope
unique opaque string, <span data-x="concept-environment-creation-url">creation URL</span> to
<var>worker global scope</var>'s <span>url</span>, <span>top-level creation URL</span> to null,
<span data-x="concept-environment-target-browsing-context">target browsing context</span> to
null, and <span data-x="concept-environment-active-service-worker">active service worker</span>
to null.</p></li>
null, <span data-x="concept-environment-active-service-worker">active service worker</span>
to null, and <span data-x="concept-environment-cross-site-ancestor">cross-site ancestor flag
</span> to <var>outside settings</var>'s <span data-x="concept-environment-cross-site-ancestor">
cross-site ancestor flag</span>.</p></li>

<li><p>If <var>worker global scope</var> is a <code>DedicatedWorkerGlobalScope</code> object,
then set <var>settings object</var>'s <span>top-level origin</span> to <var>outside
Expand Down