From 2133f2c51795c140dc2c3173ca2ba18eaadd4b67 Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Tue, 4 Jul 2017 21:06:51 +0900 Subject: [PATCH 1/2] Specify active service worker inheritance This adds steps to make clients that have creator browsing contexts to inherit the active service worker from their creators. While they have an initial inherited active service worker, if one exists, navigation matching still always wins. So, if the navigation goes through HTTP fetch, the inherited active service worker is replaced by the matched result. Also, if an iframe has a sandbox attribute set without allow-same-origin token, the inherited active service worker is set to null. Related issue: https://github.com/w3c/ServiceWorker/issues/765. --- source | 95 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 21 deletions(-) diff --git a/source b/source index 8cab36f5476..8724abafb12 100644 --- a/source +++ b/source @@ -76812,6 +76812,10 @@ dictionary DragEventInit : MouseEventInit {
creator context security
The result of executing Is environment settings object a secure context? on creator document's relevant settings object
+ +
creator active service worker
+
creator document's relevant settings object's active service worker
@@ -76854,27 +76858,32 @@ dictionary DragEventInit : MouseEventInit { document.

  • -

    Set the origin of document:

    +

    If browsingContext has a creator browsing context, then:

    -
      -
    • If browsingContext has a creator browsing context, then the - origin of document is the creator origin.

    • +
        +
      1. Set the origin of document to the + creator origin.

      2. -
      3. Otherwise, the origin of document is a unique opaque origin.

      4. -
    -
  • +
  • Set document's referrer to the + serialization of creator + URL.

  • -
  • If browsingContext has a creator browsing context, then set - document's referrer to the serialization of creator URL.

  • +
  • Set document's referrer + policy to the creator referrer policy.

  • -
  • If browsingContext has a creator browsing context, then set - document's referrer policy to - the creator referrer policy.

  • +
  • Set settingsObject's + active service worker to the + creator active service worker.

  • + +
  • Implement the sandboxing for document.

  • +
  • If document's active sandboxing flag set has its sandboxed + origin browsing context flag set, then set document's relevant settings + object's active service + worker to null.

  • +
  • Set the allow* flags for document.

  • Add document to browsingContext's session @@ -79251,8 +79260,10 @@ callback FrameRequestCallback = void (DOMHighResTimeStampIf the Document is the initial "about:blank" document -

    The one it was assigned when its browsing context was - created.

    +

    A unique opaque origin assigned when the + Document is created or the one it was assigned when + its browsing context was created if the browsing context had a creator + browsing context.

    If the Document is a non-initial "about:blank" document
    @@ -82134,11 +82145,47 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O additionally run the following algorithm after creating the new object:

      -
    1. If browsingContext's only entry in its session history is the - about:blank Document that was added when browsingContext - was created, and navigation is occurring - with replacement enabled, and that Document has the same - origin as the new Document, then do nothing.

    2. +
    3. +

      If browsingContext's only entry in its session history is the + about:blank Document that was added when browsingContext + was created, and navigation is occurring + with replacement enabled, and that Document has the same + origin as the new Document, then:

      + +
        +
      1. +

        If the new Document is not the about:blank + Document, then:

        + +
          +
        1. Let settingsObject be browsingContext's active + document's environment settings object.

        2. + +
        3. Set settingsObject's creation URL to + reservedEnvironment's creation + URL.

        4. + +
        5. Set settingsObject's active service worker to + reservedEnvironment's active service worker.

        6. +
        +
      2. + +
      3. Set reservedEnvironment's id + to the empty string.

      4. +
      + +

      The initial about:blank Document's environment + settings object is reused for the new Document in this case. The reserved + environment transfers its creation URL + and active service worker to + the reused environment settings object but does not transfer its id. The reserved environment is not searchable by the + environment’s id from this point + on.

      +
    4. Otherwise:

      @@ -82195,6 +82242,12 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
    5. Implement the sandboxing for the Document.

    6. +
    7. If the Document's active sandboxing flag set has its + sandboxed origin browsing context flag set, then set the Document's + relevant settings object's active service worker to + null.

    8. +
    9. Set the allow* flags for the Document.

  • From 3d8a6d160b67747b6bc0b7c7f3c66d33fc9f4900 Mon Sep 17 00:00:00 2001 From: Jungkee Song Date: Thu, 6 Jul 2017 10:07:08 +0900 Subject: [PATCH 2/2] Remove unnecessary conditional --- source | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/source b/source index 8724abafb12..60441e8c455 100644 --- a/source +++ b/source @@ -82153,25 +82153,18 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O origin as the new Document, then:

      -
    1. -

      If the new Document is not the about:blank - Document, then:

      +
    2. Let settingsObject be browsingContext's active + document's environment settings object.

    3. -
        -
      1. Let settingsObject be browsingContext's active - document's environment settings object.

      2. - -
      3. Set settingsObject's creation URL to - reservedEnvironment's creation - URL.

      4. - -
      5. Set settingsObject's active service worker to - reservedEnvironment's active service worker.

      6. -
      - +
    4. Set settingsObject's creation URL to + reservedEnvironment's creation + URL.

    5. + +
    6. Set settingsObject's active service worker to + reservedEnvironment's active service worker.

    7. Set reservedEnvironment's id to the empty string.

    8. @@ -82208,7 +82201,7 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
    9. Set up a window environment settings object with realm execution - context and reservedEnvironment, if present.

    10. + context and reservedEnvironment.