From 244d97e5017bccab59574b726c6fe29934249807 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 24 Jun 2020 13:20:43 -0400 Subject: [PATCH] Editorial: introduce browsing context's "active window" This abstracts away having to say "browsing context's WindowProxy object's [[Window]] internal slot value", and replaces a few imprecise instances of "browsing context's Window object". --- source | 118 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 58 insertions(+), 60 deletions(-) diff --git a/source b/source index 06deb36ff95..088ff07af71 100644 --- a/source +++ b/source @@ -29971,9 +29971,9 @@ interface HTMLIFrameElement : HTMLElement { the allow-top-navigation-by-user-activation keyword behaves similarly but allows such navigation only when the - browsing context's WindowProxy's [[Window]] value has transient - activation; and the allow-forms, - allow-modals, active window has transient activation; and the allow-forms, allow-modals, allow-orientation-lock, allow-pointer-lock, allow-popups,
  • Let windows be the list of Window objects constructed by taking - the [[Window]] internal slot value of browsingContext's WindowProxy - object for each browsingContext in browsingContexts.

  • + the active window of each item in browsingContexts.

  • For each window in windows, set window's last activation timestamp to the current high resolution @@ -71696,8 +71695,7 @@ END:VCARD browsingContexts.

  • Let windows be the list of Window objects constructed by taking - the [[Window]] internal slot value of browsingContext's WindowProxy - object for each browsingContext of browsingContexts.

  • + the active window of each item in browsingContexts.

  • For each window in windows, if window's last activation timestamp is not positive infinity, then set @@ -76437,34 +76435,6 @@ dictionary DragEventInit : MouseEventInit {

    A browsing context has an is closing boolean. It is initially false.

    -

    A browsing context has a session history, which lists the - Document objects that the browsing context has presented, is presenting, - or will present. A browsing context's active document is - its WindowProxy object's [[Window]] - internal slot value's associated - Document. A Document's browsing context is the - browsing context whose session history contains the - Document, if any such browsing context exists and has not been discarded, and null otherwise.

    - -

    In general, there is a 1-to-1 mapping from the Window object to the - Document object, as long as the Document object has a non-null browsing context. There is one exception. A - Window can be reused for the presentation of a second Document in the - same browsing context, such that the mapping is then 1-to-2. This occurs when a - browsing context is navigated from the initial - about:blank Document to another, with replacement enabled. - -

    A Document does not necessarily have a non-null browsing context. In particular, data mining tools are likely - to never instantiate browsing contexts. A Document created using an API such as createDocument() never has a non-null browsing context. And the Document originally - created for an iframe element, which has since been removed from the document, has no associated browsing context, since that - browsing context was discarded.

    -

    The following example illustrates the various possibilities of a browsing context. It can be disowned, is closing, neither, or both.

    @@ -76485,6 +76455,37 @@ const popup4 = window.open(); popup4.opener = null; popup4.close();
    +

    A browsing context has a session history, which lists the + Document objects that the browsing context has presented, is presenting, + or will present. A Document's browsing context is the + browsing context whose session history contains the + Document, if any such browsing context exists and has not been discarded, and null otherwise.

    + +

    A Document does not necessarily have a non-null browsing context. In particular, data mining tools are likely + to never instantiate browsing contexts. A Document created using an API such as createDocument() never has a non-null browsing context. And the Document originally + created for an iframe element, which has since been removed from the document, has no associated browsing context, since that + browsing context was discarded.

    + +

    A browsing context's active + window is its WindowProxy object's [[Window]] internal slot value. A browsing + context's active document is its active window's + associated Document. + +

    In general, there is a 1-to-1 mapping from the Window object to the + Document object, as long as the Document object has a non-null browsing context. There is one exception. A + Window can be reused for the presentation of a second Document in the + same browsing context, such that the mapping is then 1-to-2. This occurs when a + browsing context is navigated from the initial + about:blank Document to another, with replacement enabled. +

    Creating browsing contexts

    @@ -76501,9 +76502,7 @@ popup4.close();
    #2688.

  • -
  • Set browsingContext's WindowProxy object's [[Window]] internal slot value to - window.

  • +
  • Set browsingContext's active window to window.

  • Set window's associated Document to document.

  • @@ -77116,15 +77115,15 @@ console.assert(iframeWindow.frameElement === null); then:

      -
    1. If A's WindowProxy's [[Window]] value has transient +

    2. If A's active window has transient activation and + A's active document's active sandboxing flag set has its + sandboxed top-level navigation with user activation browsing context flag set, + then return false.

    3. + +
    4. Otherwise, if A's active window does not have transient activation and A's active document's active sandboxing - flag set has its sandboxed top-level navigation with user activation browsing + flag set has its sandboxed top-level navigation without user activation browsing context flag set, then return false.

    5. - -
    6. Otherwise, if A's WindowProxy's [[Window]] value does not have - transient activation and A's active document's - active sandboxing flag set has its sandboxed top-level navigation without - user activation browsing context flag set, then return false.

    @@ -77436,9 +77435,9 @@ console.assert(iframeWindow.frameElement === null); applicable option from the following list:

    - +

    The user agent may inform the user that a popup has been blocked.

    @@ -78077,8 +78076,8 @@ dictionary WindowPostMessageOptions : PostMessageOptions
  • If urlRecord is "about:blank" and new is true, then queue a task to fire an event named load at target browsing context's Window - object, with the legacy target override flag set.

    + data-x="event-load">load at target browsing context's active + window, with the legacy target override flag set.

  • Otherwise, navigate target browsing context to request, with the exceptions enabled flag @@ -79617,8 +79616,7 @@ interface BarProp {

    This flag prevents content from navigating their top-level browsing context and prevents content from closing their top-level browsing context. It is consulted only when the sandboxed browsing - context's WindowProxy's [[Window]] value does not have transient - activation.

    + context's active window does not have transient activation.

    When the sandboxed top-level navigation without user activation browsing context flag is not set, content can navigate its top-level browsing @@ -79635,7 +79633,7 @@ interface BarProp {

    This flag prevents content from navigating their top-level browsing context and prevents content from closing their top-level browsing context. It is consulted only when the sandboxed browsing - context's WindowProxy's [[Window]] value has transient activation.

    + context's active window has transient activation.

    As with the sandboxed top-level navigation without user activation browsing context flag, this flag only affects the top-level browsing context; if it is not @@ -82178,9 +82176,9 @@ interface Location { // but see also For example, there could be a vulnerability in the target software's URL handler which a hostile page would attempt to exploit by tricking a user into clicking a link.

    @@ -83264,10 +83262,10 @@ new PaymentRequest(…); // Allowed to use
  • If hash changed is true, then fire an event named hashchange at the browsing - context's Window object, using HashChangeEvent, with the - oldURL attribute initialized to old - URL and the newURL attribute - initialized to new URL.

  • + context's active window, using HashChangeEvent, with the oldURL attribute initialized to old URL + and the newURL attribute initialized to + new URL.