From 676114b350c9a7551884812da3ee252c5834ce7b Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Fri, 26 Mar 2021 01:16:12 +0900 Subject: [PATCH] Standardize the condition to open popup with window.open Fixes #5872 Define an "is popup" member in top-level browsing context, and set it to true only when the browsing context is created by calling `window.open` with `width` features provided. Also add non-normative notes/example for using popup UI depending on "is popup" member. --- source | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/source b/source index c127ef318d6..547194a0886 100644 --- a/source +++ b/source @@ -77889,6 +77889,23 @@ popup4.close();

A top-level browsing context has an associated group (null or a browsing context group). It is initially null.

+

A top-level browsing context has an is popup + boolean. It is initially false.

+ +

User agent can use is popup + value to decide what kind of web browser interface to provide for the + browsing context.

+ +

For example, user agent can provide + minimal UI if is popup is true. In the minimal UI, it's + recommended not to hide the browser interface element + that displays the URL or the domain of the + active document.

+ +

User agent can use is popup + value to decide whether to perform the optional steps in + set up browsing context features steps or not.

+

It is possible to create new browsing contexts that are related to a top-level browsing context while their container is null. Such browsing contexts are called WindowPostMessageOptions : PostMessageOptions

  • If target browsing context is null, then return null.

  • -
  • If new is true, then set up browsing context features for - target browsing context given tokenizedFeatures.

  • +
  • +

    If new is true, then:

    +
      +
    1. +

      If tokenizedFeatures["width"] + exists, then:

      +
        +
      1. Let isPopupRequested be true.

      2. +
      +
    2. +
    3. +

      Otherwise:

      +
        +
      1. Let isPopupRequested be false.

      2. +
      +
    4. +
    5. +

      If the user agent has been configured to override + isPopupRequested:

      +
        +
      1. +

        Let isPopup be user-configured value, possibly depending + on isPopupRequested.

        +
      2. +
      +
    6. +
    7. +

      Otherwise:

      +
        +
      1. +

        Let isPopup be isPopupRequested.

        +
      2. +
      +
    8. +
    9. +

      Set the target browsing context's is + popup to isPopup.

      +
    10. +
    11. +

      Set up browsing context features for + target browsing context given + tokenizedFeatures.

      +
    12. +
    +
  • Let urlRecord be the URL "about:blank".