From 54acf228ae2db2adccaffbab032c06153c541510 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Thu, 12 Sep 2024 19:11:57 +0200 Subject: [PATCH] Editorial: rename cross-origin opener policy concepts This is a refactor-only change, that serves as a precursor to https://github.com/whatwg/html/pull/10394, and makes progress on https://github.com/whatwg/html/issues/10373. --- source | 303 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 148 insertions(+), 155 deletions(-) diff --git a/source b/source index 0eab3624402..ebc2fae096f 100644 --- a/source +++ b/source @@ -10790,9 +10790,8 @@ partial interface Document {

Each Document has a module map, which is a module map, initially empty.

-

Each Document has a cross-origin opener - policy, which is a cross-origin opener policy, initially a new cross-origin - opener policy.

+

Each Document has an opener policy, + which is an opener policy, initially a new opener policy.

Each Document has an is initial about:blank, which is a boolean, initially false.

@@ -86754,28 +86753,28 @@ dictionary DragEventInit : MouseEventInit {

Cross-origin opener policies

-

A cross-origin opener policy value allows a document which is navigated to in a - top-level browsing context to force the creation of a new top-level browsing - context, and a corresponding group. The possible values - are:

+

An opener policy value allows a document which + is navigated to in a top-level browsing context to force the creation of a new + top-level browsing context, and a corresponding group. The possible values are:

"unsafe-none"

This is the (current) default and means that the document will occupy the same top-level browsing context as its predecessor, unless that document specified a - different cross-origin opener policy.

+ different opener policy.

"same-origin-allow-popups"

This forces the creation of a new top-level browsing context for the - document, unless its predecessor specified the same cross-origin opener policy and - they are same origin.

+ document, unless its predecessor specified the same opener policy and they are + same origin.

"same-origin"

This behaves the same as "same-origin-allow-popups", with the addition that any auxiliary browsing context created needs to contain same origin - documents that also have the same cross-origin opener policy or it will appear - closed to the opener.

+ documents that also have the same opener policy or it will appear closed to the + opener.

"same-origin-plus-COEP"
@@ -86796,28 +86795,27 @@ dictionary DragEventInit : MouseEventInit {
-

A cross-origin opener policy consists of:

+

An opener policy consists of:

    -
  • A value, which is a cross-origin opener policy value, initially "

    A value, which is an opener policy value, initially "unsafe-none".

  • A reporting endpoint, which is string or null, initially null.

  • -
  • A report-only value, which is a cross-origin opener policy value, initially - "unsafe-none".

  • +
  • A report-only value, which is an opener policy value, initially "unsafe-none".

  • A report-only reporting endpoint, which is a string or null, initially null.

-

To match cross-origin opener policy values, given a - cross-origin opener policy value A, an origin - originA, a cross-origin opener policy value B, and an - origin originB:

+

To match opener policy values, given an opener policy + value A, an origin originA, an opener policy + value B, and an origin originB:

  1. If A is "unsafe-none" and B @@ -86845,7 +86843,7 @@ dictionary DragEventInit : MouseEventInit { be a token. STRUCTURED-FIELDS

    The valid token values are the opener policy values. The token may also have + data-x="opener policy value">opener policy values. The token may also have attached parameters; of these, the "report-to" parameter can have a valid URL string identifying an appropriate reporting endpoint. REPORTING

    @@ -86859,12 +86857,12 @@ dictionary DragEventInit : MouseEventInit {
    -

    To obtain a cross-origin opener policy given a To obtain an opener policy given a response response and an environment reservedEnvironment:

      -
    1. Let policy be a new cross-origin opener policy.

    2. +
    3. Let policy be a new opener policy.

    4. If reservedEnvironment is a non-secure context, then return policy.

    5. @@ -86961,14 +86959,14 @@ dictionary DragEventInit : MouseEventInit {
    -
    Browsing context group switches due to cross-origin opener policy
    +
    Browsing context group + switches due to opener policy

    To check if COOP values require a browsing context group switch, given a boolean isInitialAboutBlank, two origins responseOrigin and - activeDocumentNavigationOrigin, and two cross-origin - opener policy values responseCOOPValue and - activeDocumentCOOPValue:

    + activeDocumentNavigationOrigin, and two opener policy + values responseCOOPValue and activeDocumentCOOPValue:

    1. If the result of matching @@ -86997,9 +86995,8 @@ dictionary DragEventInit : MouseEventInit {

      To check if enforcing report-only COOP would require a browsing context group switch, given a boolean isInitialAboutBlank, two origins - responseOrigin, activeDocumentNavigationOrigin, and two cross-origin opener policies responseCOOP - and activeDocumentCOOP:

      + responseOrigin, activeDocumentNavigationOrigin, and two opener policies responseCOOP and activeDocumentCOOP:

      1. @@ -87013,8 +87010,8 @@ dictionary DragEventInit : MouseEventInit { false.

        Matching report-only policies allows a website to specify the same report-only - cross-origin opener policy on all its pages and not receive violation reports for navigations - between these pages.

        + opener policy on all its pages and not receive violation reports for navigations between these + pages.

      2. If the result of checking @@ -87036,8 +87033,8 @@ dictionary DragEventInit : MouseEventInit {

      3. Return false.

      -

      A cross-origin opener policy enforcement result is - a struct with the following items:

      +

      An opener policy enforcement result is a + struct with the following items:

      • A boolean needs a browsing context group @@ -87050,25 +87047,24 @@ dictionary DragEventInit : MouseEventInit {

      • An origin origin.

      • -
      • A cross-origin opener policy cross-origin opener policy.

      • +
      • An opener policy opener + policy.

      • A boolean current context is navigation source, initially false.

      -

      To enforce a response's cross-origin opener policy, given a - browsing context browsingContext, a URL - responseURL, an origin responseOrigin, a cross-origin - opener policy responseCOOP, a cross-origin opener policy enforcement result - currentCOOPEnforcementResult, and a To enforce a response's opener policy, given a browsing + context browsingContext, a URL responseURL, an + origin responseOrigin, an opener policy + responseCOOP, an opener policy enforcement + result currentCOOPEnforcementResult, and a referrer referrer:

      1. Let newCOOPEnforcementResult be a new cross-origin opener policy enforcement result with

        + data-x="coop-enforcement-result">opener policy enforcement result with

        needs a browsing context group switch
        @@ -87086,7 +87082,7 @@ dictionary DragEventInit : MouseEventInit {
        origin
        responseOrigin
        -
        cross-origin opener policy
        +
        opener policy
        responseCOOP
        current context is navigation source
        @@ -87106,7 +87102,7 @@ dictionary DragEventInit : MouseEventInit {

        If the result of checking if COOP values require a browsing context group switch given isInitialAboutBlank, currentCOOPEnforcementResult's cross-origin opener policy's opener policy's value, currentCOOPEnforcementResult's origin, responseCOOP's value, and responseOrigin is true, then:

        @@ -87131,10 +87127,10 @@ dictionary DragEventInit : MouseEventInit {
      2. Queue a violation report for browsing context group switch when navigating away from a COOP response with - currentCOOPEnforcementResult's cross-origin - opener policy, "enforce", - currentCOOPEnforcementResult's url, - responseURL, currentCOOPEnforcementResult's currentCOOPEnforcementResult's opener + policy, "enforce", currentCOOPEnforcementResult's + url, responseURL, + currentCOOPEnforcementResult's origin, responseOrigin, and currentCOOPEnforcementResult's current context is navigation source.

      3. @@ -87149,7 +87145,7 @@ dictionary DragEventInit : MouseEventInit { isInitialAboutBlank, responseOrigin, currentCOOPEnforcementResult's origin, responseCOOP, and currentCOOPEnforcementResult's cross-origin opener policy, is true, then:

        + data-x="coop-enforcement-coop">opener policy, is true, then:

        1. Set result's would @@ -87170,8 +87166,8 @@ dictionary DragEventInit : MouseEventInit {

        2. Queue a violation report for browsing context group switch when navigating away from a COOP response with - currentCOOPEnforcementResult's cross-origin - opener policy, "reporting", + currentCOOPEnforcementResult's opener + policy, "reporting", currentCOOPEnforcementResult's url, responseURL, currentCOOPEnforcementResult's origin, responseOrigin, and @@ -87187,10 +87183,9 @@ dictionary DragEventInit : MouseEventInit {

          To obtain a browsing context to use for a navigation response, given a browsing context browsingContext, a - sandboxing flag set sandboxFlags, a cross-origin opener - policy navigationCOOP, and a cross-origin opener policy enforcement result - coopEnforcementResult:

          + sandboxing flag set sandboxFlags, an opener policy + navigationCOOP, and an opener policy enforcement + result coopEnforcementResult:

          1. If browsingContext is not a top-level browsing context, then @@ -87317,7 +87312,7 @@ dictionary DragEventInit : MouseEventInit { return.

            This avoids leaking information about cross-origin iframes to a top level frame - with cross-origin opener policy reporting.

            + with opener policy reporting.

          2. If accessor's top-level browsing context's DragEventInit : MouseEventInit {

          3. Queue violation reports for accesses, given accessorAccessedRelationship, accessorTopDocument's cross-origin opener policy, - accessedTopDocument's cross-origin opener - policy, accessor's active document's URL, accessed's active document's - URL, accessor's top-level browsing context's opener policy, accessedTopDocument's opener policy, accessor's active + document's URL, accessed's + active document's URL, + accessor's top-level browsing context's initial URL, accessed's top-level browsing context's initial URL, accessor's active @@ -87381,9 +87375,9 @@ dictionary DragEventInit : MouseEventInit {

          To queue a violation report for browsing context - group switch when navigating to a COOP response given a cross-origin opener policy coop, a string disposition, a - URL coopURL, a URL previousResponseURL, two given an opener + policy coop, a string disposition, a URL + coopURL, a URL previousResponseURL, two origins coopOrigin and previousResponseOrigin, and a referrer referrer:

          @@ -87444,11 +87438,11 @@ dictionary DragEventInit : MouseEventInit {

        To queue a violation report for browsing context - group switch when navigating away from a COOP response given a cross-origin opener policy coop, a string - disposition, a URL coopURL, a URL - nextResponseURL, two origins coopOrigin and - nextResponseOrigin, and a boolean isCOOPResponseNavigationSource:

        + group switch when navigating away from a COOP response given an opener policy coop, a string disposition, a URL + coopURL, a URL nextResponseURL, two origins coopOrigin and nextResponseOrigin, and a + boolean isCOOPResponseNavigationSource:

        1. If coop's reporting endpoint @@ -87498,15 +87492,15 @@ dictionary DragEventInit : MouseEventInit {

        To queue violation reports for accesses, given an - accessor-accessed relationship accessorAccessedRelationship, two - cross-origin opener policies - accessorCOOP and accessedCOOP, four URLs - accessorURL, accessedURL, accessorInitialURL, - accessedInitialURL, four origins - accessorOrigin, accessedOrigin, accessorCreatorOrigin and - accessedCreatorOrigin, two referrers - accessorReferrer and accessedReferrer, a string propertyName, and - an environment settings object environment:

        + accessor-accessed relationship accessorAccessedRelationship, two opener policies accessorCOOP and accessedCOOP, + four URLs accessorURL, accessedURL, + accessorInitialURL, accessedInitialURL, four origins accessorOrigin, accessedOrigin, + accessorCreatorOrigin and accessedCreatorOrigin, two referrers accessorReferrer and + accessedReferrer, a string propertyName, and an environment settings + object environment:

        1. If coop's reporting endpoint @@ -87573,12 +87567,11 @@ dictionary DragEventInit : MouseEventInit {

        To queue a violation report for access to the - opener, given a cross-origin opener - policy coop, two URLs coopURL and - openerURL, two origins coopOrigin and - openerOrigin, a string propertyName, a referrer referrer, and an environment - settings object environment:

        + opener, given an opener policy coop, two + URLs coopURL and openerURL, two origins coopOrigin and openerOrigin, a string + propertyName, a referrer + referrer, and an environment settings object environment:

        1. Let sourceFile, lineNumber and columnNumber be the @@ -87650,12 +87643,12 @@ dictionary DragEventInit : MouseEventInit {

        To queue a violation report for access to an - opened window, given a cross-origin opener - policy coop, three URLs coopURL, - openedWindowURL and initialWindowURL, three origins coopOrigin, openedWindowOrigin, and - openerInitialOrigin, a string propertyName, and an environment - settings object environment:

        + opened window, given an opener policy coop, + three URLs coopURL, openedWindowURL and + initialWindowURL, three origins coopOrigin, + openedWindowOrigin, and openerInitialOrigin, a string + propertyName, and an environment settings object + environment:

        1. Let sourceFile, lineNumber and columnNumber be the @@ -87724,11 +87717,11 @@ dictionary DragEventInit : MouseEventInit {

          To queue a violation report for access to another - window, given a cross-origin opener policy - coop, two URLs coopURL and - otherURL, two origins coopOrigin and - otherOrigin, a string propertyName, and an environment settings - object environment:

          + window, given an opener policy coop, two + URLs coopURL and otherURL, two origins coopOrigin and otherOrigin, a string + propertyName, and an environment settings object + environment:

          1. Let sourceFile, lineNumber and columnNumber be the @@ -87790,11 +87783,11 @@ dictionary DragEventInit : MouseEventInit {

          To queue a violation report for access from the - opener, given a cross-origin opener policy - coop, two URLs coopURL and - openerURL, two origins coopOrigin and - openerOrigin, a string propertyName, and a referrer referrer:

          + opener, given an opener policy coop, two + URLs coopURL and openerURL, two origins coopOrigin and openerOrigin, a string + propertyName, and a referrer + referrer:

          1. If coop's reporting endpoint @@ -87853,11 +87846,11 @@ dictionary DragEventInit : MouseEventInit {

          To queue a violation report for access from an - opened window, given a cross-origin opener - policy coop, three URLs coopURL, - openedWindowURL and initialWindowURL, three origins coopOrigin, openedWindowOrigin, and - openerInitialOrigin, and a string propertyName:

          + opened window, given an opener policy coop, + three URLs coopURL, openedWindowURL and + initialWindowURL, three origins coopOrigin, + openedWindowOrigin, and openerInitialOrigin, and a string + propertyName:

          1. If coop's reporting endpoint @@ -87913,10 +87906,10 @@ dictionary DragEventInit : MouseEventInit {

          -

          To queue a violation report for access from another - window, given a cross-origin opener policy - coop, two URLs coopURL and otherURL, two - origins coopOrigin and otherOrigin, and a string +

          To queue a violation report for access from + another window, given an opener policy coop, + two URLs coopURL and otherURL, two origins coopOrigin and otherOrigin, and a string propertyName:

            @@ -97062,9 +97055,9 @@ interface NotRestoredReasons {
          1. Set windowType to "new with no opener".

          -

          In the presence of a cross-origin opener policy, nested - documents that are cross-origin with their top-level browsing context's active document - always set noopener to true.

          +

          In the presence of an opener policy, nested documents that are + cross-origin with their top-level browsing context's active document always set + noopener to true.

        2. Let chosen be null.

        3. @@ -97150,9 +97143,9 @@ interface NotRestoredReasons { null, initially null.

        4. A virtual browsing context group ID - integer, initially 0. This is used by cross-origin - opener policy reporting, to keep track of the browsing context group switches that would - have happened if the report-only policy had been enforced.

        5. + integer, initially 0. This is used by opener policy + reporting, to keep track of the browsing context group switches that would have happened + if the report-only policy had been enforced.

          A browsing context's active window is its WindowProxy @@ -97344,10 +97337,10 @@ interface NotRestoredReasons {

        6. If creator's origin is same origin with creator's relevant settings object's top-level origin, then set document's cross-origin opener policy to creator's opener policy to creator's browsing context's top-level browsing context's active document's cross-origin opener policy.

        7. + data-x="concept-document-coop">opener policy.

      4. @@ -98715,8 +98708,8 @@ location.href = '#foo';
        null or an algorithm accepting a Document, once it has been created
        COOP enforcement result
        -
        a cross-origin opener policy enforcement - result, used for reporting and potentially for causing a an opener policy enforcement result, used for + reporting and potentially for causing a browsing context group switch
        @@ -98732,8 +98725,8 @@ location.href = '#foo';
        final sandboxing flag set
        a sandboxing flag set to impose on the new Document
        -
        cross-origin opener policy
        -
        a cross-origin opener policy to use for the new Document
        +
        opener policy
        +
        an opener policy to use for the new Document
        navigation timing type
        a NavigationTimingType used for initiator origin.

        -
      5. Let coop be a new cross-origin opener policy.

      6. +
      7. Let coop be a new opener policy.

      8. Let coopEnforcementResult be a new cross-origin opener policy enforcement result + data-x="coop-enforcement-result">opener policy enforcement result with

        @@ -99221,7 +99214,7 @@ location.href = '#foo';
        origin
        responseOrigin
        -
        cross-origin opener policy
        +
        opener policy
        coop
      9. @@ -99263,7 +99256,7 @@ location.href = '#foo';
        final sandboxing flag set
        finalSandboxFlags
        -
        cross-origin opener policy
        +
        opener policy
        coop
        navigation timing type
        @@ -99604,8 +99597,8 @@ location.href = '#foo'; policy.

      10. -

        Let coopEnforcementResult be a new cross-origin opener policy enforcement result with

        +

        Let coopEnforcementResult be a new opener + policy enforcement result with

        url
        @@ -99614,7 +99607,7 @@ location.href = '#foo';
        origin
        newDocumentOrigin
        -
        cross-origin opener policy
        +
        opener policy
        coop
      11. @@ -99657,7 +99650,7 @@ location.href = '#foo';
        final sandboxing flag set
        finalSandboxFlags
        -
        cross-origin opener policy
        +
        opener policy
        coop
        navigation timing type
        @@ -100943,11 +100936,11 @@ location.href = '#foo'; flags, and entry's document state's origin.

        -
      12. Let coop be a new cross-origin opener policy.

      13. +
      14. Let coop be a new opener policy.

      15. -

        Let coopEnforcementResult be a new cross-origin opener policy enforcement result with

        +

        Let coopEnforcementResult be a new opener + policy enforcement result with

        url
        @@ -100956,7 +100949,7 @@ location.href = '#foo';
        origin
        responseOrigin
        -
        cross-origin opener policy
        +
        opener policy
        coop
      16. @@ -101007,7 +101000,7 @@ location.href = '#foo';
        targetSnapshotParams's sandboxing flags
        -
        cross-origin opener policy
        +
        opener policy
        coop
        navigation timing type
        @@ -101144,8 +101137,8 @@ location.href = '#foo';
      17. Let fetchController be null.

      18. -

        Let coopEnforcementResult be a new cross-origin opener policy enforcement result, with

        +

        Let coopEnforcementResult be a new opener + policy enforcement result, with

        url
        @@ -101156,9 +101149,9 @@ location.href = '#foo';
        navigable's active document's origin
        -
        cross-origin opener policy
        +
        opener policy
        navigable's active document's cross-origin opener policy
        + data-x="concept-document-coop">opener policy
current context is navigation source
true if navigable's active document's
  • Let responsePolicyContainer be null.

  • -
  • Let responseCOOP be a new cross-origin opener policy.

  • +
  • Let responseCOOP be a new opener policy.

  • Let locationURL be null.

  • @@ -101345,12 +101338,12 @@ location.href = '#foo';

    If navigable is a top-level traversable, then:

      -
    1. Set responseCOOP to the result of obtaining a - cross-origin opener policy given response and request's

      Set responseCOOP to the result of obtaining an + opener policy given response and request's reserved client.

    2. Set coopEnforcementResult to the result of enforcing the response's cross-origin opener policy given + data-x="coop-enforce">enforcing the response's opener policy given navigable's active browsing context, response's URL, responseOrigin, responseCOOP, coopEnforcementResult and @@ -101362,8 +101355,8 @@ location.href = '#foo'; data-x="coop-unsafe-none">unsafe-none", then set response to an appropriate network error and break.

      -

      This results in a network error as one cannot simultaneously provide a - clean slate to a response using cross-origin opener policy and sandbox the result of +

      This results in a network error as one cannot simultaneously provide a clean + slate to a response using opener policy and sandbox the result of navigating to that response.

    @@ -101630,7 +101623,7 @@ location.href = '#foo';
    commit early hints
    commitEarlyHints
    -
    cross-origin opener policy
    +
    opener policy
    responseCOOP
    reserved environment
    @@ -103773,7 +103766,7 @@ location.href = '#foo';
    navigationParams's final sandboxing flag set
    -
    cross-origin opener policy
    +
    opener policy
    navigationParams's cross-origin opener policy
    @@ -104249,11 +104242,11 @@ new PaymentRequest(…); // Allowed to use
  • Let origin be a new opaque origin.

  • -
  • Let coop be a new cross-origin opener policy.

  • +
  • Let coop be a new opener policy.

  • -

    Let coopEnforcementResult be a new cross-origin opener policy enforcement result with

    +

    Let coopEnforcementResult be a new opener + policy enforcement result with

    url
    @@ -104262,7 +104255,7 @@ new PaymentRequest(…); // Allowed to use
    origin
    origin
    -
    cross-origin opener policy
    +
    opener policy
    coop
  • @@ -104304,7 +104297,7 @@ new PaymentRequest(…); // Allowed to use
    final sandboxing flag set
    an empty set
    -
    cross-origin opener policy
    +
    opener policy
    coop
    navigation timing type