From a0cdf7c03958894429523f6612245a2d0f7c184f Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Fri, 1 Aug 2025 08:30:34 -0400 Subject: [PATCH 1/7] Move `has cross-site ancestor` to the environment, from the ESO Updates #11133 This reverts commit c73625035d85925536c3e6d4f6d4d3932bcb5ff2. --- source | 119 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/source b/source index 07296f7c4ae..b58e4f9dc27 100644 --- a/source +++ b/source @@ -92621,8 +92621,8 @@ interface BarProp {

To set up a window environment settings object, given a URL creationURL, a JavaScript execution context execution context, null or an environment reservedEnvironment, a URL - topLevelCreationURL, and an origin topLevelOrigin, run these - steps:

+ topLevelCreationURL, an origin topLevelOrigin, and a + boolean hasCrossSiteAncestor:

  1. Let realm be the value of execution context's Realm @@ -92660,30 +92660,6 @@ interface BarProp { associated Document.

    -
    The has cross-site - ancestor
    -
    -
      -
    1. If window's navigable's parent is null, then return false.

    2. - -
    3. Let parentDocument be window's navigable's parent's active - document.

    4. - -
    5. If parentDocument's relevant settings object's has cross-site ancestor is - true, then return true.

    6. - -
    7. If parentDocument's origin - is not same site with window's associated Document's origin, then return true.

    8. - -
    9. Return false.

    10. -
    -
    -
    The policy container

    Return the policy container of @@ -92748,8 +92724,10 @@ interface BarProp {

  2. Set settings object's creation URL to creationURL, settings object's top-level creation - URL to topLevelCreationURL, and settings object's top-level - origin to topLevelOrigin.

  3. + URL to topLevelCreationURL, settings object's top-level + origin to topLevelOrigin, and settings object's has cross-site ancestor to + hasCrossSiteAncestor.

  4. Set realm's [[HostDefined]] field to settings object.

@@ -100111,9 +100089,20 @@ interface NotRestoredReasons { otherwise embedder's relevant settings object's top-level origin.

+
  • Let hasCrossSiteAncestor be false.

  • + +
  • If embedder is not null, then set hasCrossSiteAncestor to + embedder's relevant settings object's has cross-site ancestor.

  • + +
  • If embedder is not null, and origin is not same site + with embedder's relevant settings object's origin, then set hasCrossSiteAncestor + to true.

  • +
  • Set up a window environment settings object with about:blank, - realm execution context, null, topLevelCreationURL, and - topLevelOrigin.

  • + realm execution context, null, topLevelCreationURL, + topLevelOrigin, and hasCrossSiteAncestor.

  • Let loadTimingInfo be a new document load timing info with its navigation start time set to the result of calling coarsen time @@ -104209,6 +104198,8 @@ location.href = '#foo';

  • Let topLevelOrigin be null.

  • +
  • Let hasCrossSiteAncestor be false.

  • +
  • If navigable is not a top-level traversable, then:

    @@ -104222,6 +104213,15 @@ location.href = '#foo';
  • Set topLevelOrigin to parentEnvironment's top-level origin.

  • + +
  • Set hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

  • + +
  • If parentEnvironment's origin is not same site with + navigable's active document's relevant + settings object's origin, then + set hasCrossSiteAncestor to true.

  • @@ -104232,8 +104232,10 @@ location.href = '#foo'; data-x="concept-environment-target-browsing-context">target browsing context is navigable's active browsing context, creation URL is currentURL, - top-level creation URL is topLevelCreationURL, and top-level - origin is topLevelOrigin.

    + top-level creation URL is topLevelCreationURL, top-level + origin is topLevelOrigin, and has cross-site ancestor is + hasCrossSiteAncestor.

    The created environment's active service worker is set in @@ -106737,6 +106739,8 @@ location.href = '#foo';

  • Let topLevelOrigin be navigationParams's origin.

  • +
  • Let hasCrossSiteAncestor be false.

  • +
  • If navigable's container is not null, then:

    @@ -106750,13 +106754,22 @@ location.href = '#foo';
  • Set topLevelOrigin to parentEnvironment's top-level origin.

  • + +
  • Set hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

  • + +
  • If navigationParams's origin is not same site with + parentEnvironment's origin, + then set hasCrossSiteAncestor to true.

  • Set up a window environment settings object with creationURL, realmExecutionContext, navigationParams's reserved environment, - topLevelCreationURL, and topLevelOrigin.

  • + topLevelCreationURL, topLevelOrigin, and + hasCrossSiteAncestor.

    This is the usual case, where the new Document we're about to @@ -108624,6 +108637,15 @@ new PaymentRequest(…); // Allowed to use involved.

    +
    A has + cross-site ancestor
    +

    A boolean. For window environment settings objects this will be set to true + if an ancestor frame has an origin that is + not same site with the current window's origin and otherwise false. For workers and + worklets it is set to the has cross-site + ancestor of its creator.

    +
    A target browsing context

    Null or a target browsing context for a An origin used in security checks.

    -
    A has cross-site ancestor
    -

    A boolean used in security checks.

    -
    A policy container
    @@ -123514,23 +123532,6 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope origin otherwise.

    -
    The has cross-site - ancestry
    -
    -
      -
    1. If outside settings's has cross-site ancestor is - true, then return true.

    2. - -
    3. If worker global scope's url's scheme is "data", then return - true.

    4. - -
    5. Return false.

    6. -
    -
    -
    The policy container

    Return worker global scope's SharedWorkerGlobalScope : WorkerGlobalScope unique opaque string, creation URL to worker global scope's url, top-level creation URL to null, target browsing context to - null, and active service worker - to null.

    + null, active service worker + to null, and has cross-site + ancestor to outside settings's has cross-site ancestor.

  • If worker global scope is a DedicatedWorkerGlobalScope object, then set settings object's top-level origin to outside @@ -124813,10 +124816,6 @@ interface WorkletGlobalScope {};

    Return origin.

  • -
    The has cross-site - ancestor
    -

    Return true.

    -
    The policy container

    Return inheritedPolicyContainer.

    From dcb9bd4ca659b88a500b45894c5b9b9829567c2c Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Mon, 15 Sep 2025 14:10:30 -0400 Subject: [PATCH 2/7] fixing bug in review and nits --- source | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/source b/source index b58e4f9dc27..7dc6debd05a 100644 --- a/source +++ b/source @@ -104333,6 +104333,13 @@ location.href = '#foo'; will not be the location URL itself.

    +
  • If responseOrigin is not same site with + navigable's active document's relevant + settings object's origin, then + set request's reserved + client's has cross-site + ancestor to true.

  • +
  • If navigable is a top-level traversable, then:

    @@ -108639,12 +108646,13 @@ new PaymentRequest(…); // Allowed to use
    A has cross-site ancestor
    -

    A boolean. For window environment settings objects this will be set to true - if an ancestor frame has an origin that is - not same site with the current window's origin and otherwise false. For workers and - worklets it is set to the has cross-site - ancestor of its creator.

    +

    A boolean. For window environment settings + objects this will be set to true if an ancestor frame has an origin that is not same site + with the current window's origin and + otherwise false. For workers and worklets it is set to the has cross-site ancestor of its + creator.

    A target browsing context
    From 57be3c40b236c76123c4b30c77cdb4ef5cb5beb3 Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Tue, 16 Sep 2025 10:12:22 -0400 Subject: [PATCH 3/7] Use the request's currentURL's origin --- source | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source b/source index 7dc6debd05a..73bb804ab95 100644 --- a/source +++ b/source @@ -104219,9 +104219,8 @@ location.href = '#foo';
  • If parentEnvironment's origin is not same site with - navigable's active document's relevant - settings object's origin, then - set hasCrossSiteAncestor to true.

  • + currentURL's origin, then set + hasCrossSiteAncestor to true.

    @@ -104333,13 +104332,6 @@ location.href = '#foo'; will not be the location URL itself.

    -
  • If responseOrigin is not same site with - navigable's active document's relevant - settings object's origin, then - set request's reserved - client's has cross-site - ancestor to true.

  • -
  • If navigable is a top-level traversable, then:

    From ed33f0235e320a36e6d74d4e3a72aa426483843c Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Thu, 25 Sep 2025 12:42:16 -0400 Subject: [PATCH 4/7] fix trailing whitespace --- source | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source b/source index 73bb804ab95..aefe30c83fc 100644 --- a/source +++ b/source @@ -104219,7 +104219,7 @@ location.href = '#foo';
  • If parentEnvironment's origin is not same site with - currentURL's origin, then set + currentURL's origin, then set hasCrossSiteAncestor to true.

  • @@ -108638,12 +108638,12 @@ new PaymentRequest(…); // Allowed to use
    A has cross-site ancestor
    -

    A boolean. For window environment settings - objects this will be set to true if an ancestor frame has an origin that is not same site - with the current window's origin and - otherwise false. For workers and worklets it is set to the has cross-site ancestor of its +

    A boolean. For window environment settings + objects this will be set to true if an ancestor frame has an origin that is not same site + with the current window's origin and + otherwise false. For workers and worklets it is set to the has cross-site ancestor of its creator.

    A Date: Mon, 24 Nov 2025 15:14:44 -0500 Subject: [PATCH 5/7] clean up the assignment to if-otherwise structure --- source | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/source b/source index aefe30c83fc..74fce2aea0e 100644 --- a/source +++ b/source @@ -100091,14 +100091,19 @@ interface NotRestoredReasons {
  • Let hasCrossSiteAncestor be false.

  • -
  • If embedder is not null, then set hasCrossSiteAncestor to - embedder's relevant settings object's has cross-site ancestor.

  • +
  • +

    If embedder is not null:

    -
  • If embedder is not null, and origin is not same site - with embedder's relevant settings object's origin, then set hasCrossSiteAncestor - to true.

  • +
      +
    1. If origin is same site with embedder's + relevant settings object's origin, then set hasCrossSiteAncestor + to embedder's relevant settings object's has cross-site ancestor.

    2. + +
    3. Otherwise, set hasCrossSiteAncestor to true.

    4. +
    +
  • Set up a window environment settings object with about:blank, realm execution context, null, topLevelCreationURL, @@ -104214,13 +104219,13 @@ location.href = '#foo';

  • Set topLevelOrigin to parentEnvironment's top-level origin.

  • -
  • Set hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

  • -
  • If parentEnvironment's origin is not same site with + data-x="concept-settings-object-origin">origin is same site with currentURL's origin, then set - hasCrossSiteAncestor to true.

  • + hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

    + +
  • Otherwise, set hasCrossSiteAncestor to true.

  • @@ -106754,13 +106759,13 @@ location.href = '#foo';
  • Set topLevelOrigin to parentEnvironment's top-level origin.

  • -
  • Set hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

  • -
  • If navigationParams's origin is not same site with + data-x="navigation-params-request">origin is same site with parentEnvironment's origin, - then set hasCrossSiteAncestor to true.

    + then set hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

  • + +
  • Otherwise, set hasCrossSiteAncestor to true

  • From 192ccbe6c35d1109d2074a52c7c433fe0d8f00af Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Thu, 4 Dec 2025 12:50:53 -0500 Subject: [PATCH 6/7] p class="XXX" for the circular dependency --- source | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source b/source index 74fce2aea0e..d7d89833dfe 100644 --- a/source +++ b/source @@ -108647,9 +108647,10 @@ new PaymentRequest(…); // Allowed to use objects this will be set to true if an ancestor frame has an origin that is not same site with the current window's origin and - otherwise false. For workers and worklets it is set to the +

    For workers and worklets it should be set to the has cross-site ancestor of its - creator.

    + creator, but we don't gave a definition for they yet due to a circular dependencey.

    A target browsing context
    From f07cc3d7becaa1c2d5aa9027addaf09319ef09ef Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Thu, 15 Jan 2026 13:47:36 -0500 Subject: [PATCH 7/7] nits --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index d7d89833dfe..61c8bd1297b 100644 --- a/source +++ b/source @@ -106760,7 +106760,7 @@ location.href = '#foo'; origin
    .

  • If navigationParams's origin is same site with + data-x="navigation-params-origin">origin is same site with parentEnvironment's origin, then set hasCrossSiteAncestor to parentEnvironment's has cross-site ancestor.

  • @@ -108650,7 +108650,7 @@ new PaymentRequest(…); // Allowed to use otherwise false.

    For workers and worklets it should be set to the has cross-site ancestor of its - creator, but we don't gave a definition for they yet due to a circular dependencey.

    + creator, but we don't have a definition for that yet due to a circular dependency.

    A target browsing context