From 0d01ae464eb2e528855d4c999e13eb6cbbeece2c Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 8 Feb 2018 18:24:50 +0100 Subject: [PATCH] Editorial: cleanup window.opener This feature has some outstanding issues and feature requests; see #323 and #1826. But this editorial cleanup creates a more solid foundation for future work. --- source | 104 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 46 deletions(-) diff --git a/source b/source index 99af8b445e8..24c9545211e 100644 --- a/source +++ b/source @@ -23043,8 +23043,8 @@ document.body.appendChild(wbr);
  • If target is null, then return.

  • -
  • If noopener and replace are true, then - disown target's opener.

  • +
  • If noopener and replace are true, then disown target.

  • Parse the URL given by subject's href attribute, relative to subject's @@ -23595,7 +23595,8 @@ document.body.appendChild(wbr); not allowed Annotation · - Requires any browsing context created by following the hyperlink to disown its opener. + Indicates that any browsing context created by following the hyperlink is + disowned. @@ -23603,7 +23604,9 @@ document.body.appendChild(wbr); not allowed Annotation · - Requires that the user agent not send an HTTP `Referer` (sic) header if the user follows the hyperlink. + Indicates that any browsing context created by following the hyperlink is + disowned and will not get a `Referer` (sic) + header. @@ -24353,9 +24356,8 @@ document.body.appendChild(wbr); implied hyperlink, if no other keywords create one).

    The keyword indicates that any newly created browsing context which results from - following the hyperlink will have disowned its opener, which means that - its window.opener property will be null.

    + following the hyperlink will be disowned, which means that its window.opener attribute will be null.

    Link type "noreferrer"
    @@ -24383,8 +24385,6 @@ document.body.appendChild(wbr); -
    Link type "pingback"
    @@ -77276,41 +77276,52 @@ console.assert(iframeWindow.frameElement === null);
    Navigating auxiliary browsing contexts in the DOM
    -

    The opener IDL attribute on the Window - object, on getting, must return the WindowProxy object of the browsing - context from which the current browsing context was created (its opener - browsing context), if there is one, if it is still available, and if the current - browsing context has not disowned its opener; - otherwise, it must return null. On setting, if the new value is null then the current - browsing context must disown its - opener; if the new value is anything else then the user agent must - - - call the [[DefineOwnProperty]] internal method of the Window object, passing the - property name "opener" as the property key, and the Property Descriptor { - [[Value]]: value, [[Writable]]: true, [[Enumerable]]: true, - [[Configurable]]: true } as the property descriptor, - - - where value is the new value.

    - -
    -

    If a browsing context has disowned its - opener, the value of its window.opener is null. That prevents scripts in the browsing context from changing - any properties of its opener browsing context's Window (i.e., the window - from which the browsing context was created).

    - -

    Otherwise, if a browsing context has not disowned its - opener, then scripts in that browsing context can use window.opener to change properties of its opener browsing - context's Window. For example, a script running in the browsing - context can change the value of window.opener.location, causing the - opener browsing context to navigate to a completely different document.

    -
    +

    An auxiliary browsing context can be disowned.

    + +

    The opener attribute's getter, must run these + steps:

    + +
      +
    1. If the current browsing context is disowned, then return + null.

    2. + +
    3. If the current browsing context has no opener browsing context, + then return null.

    4. + +
    5. Return the current browsing context's opener browsing context's + WindowProxy object.

    6. +
    + +

    The opener attribute's setter, must run these steps:

    + +
      +
    1. If the given value is null, then disown the current + browsing context and return.

    2. + +
    3. Return the result of calling OrdinaryDefineOwnProperty(this + Window object, "opener", { [[Value]]: the given value, + [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }). Rethrow any + exceptions.

    4. +
    + +
    +

    If a browsing context is disowned, its window.opener attribute is null. That prevents scripts in the + browsing context from changing any properties of its opener browsing + context's Window object (i.e., the Window object from which the + browsing context was created).

    + +

    Otherwise, if a browsing context is not disowned, then scripts in + that browsing context can use window.opener to + change properties of its opener browsing context's Window object. For + example, a script running in the browsing context can change the value of window.opener.location, causing the opener browsing context to + navigate to a completely different document.

    +
    + -

    Security

    @@ -77396,7 +77407,6 @@ console.assert(iframeWindow.frameElement === null); document.

    -
    @@ -77630,7 +77640,7 @@ console.assert(iframeWindow.frameElement === null); the most recently opened, most recently focused, or more closely related.

    This will be made more precise in issue #1440. + href="https://github.com/whatwg/html/issues/1440">issue #1440.

  • @@ -77697,7 +77707,9 @@ console.assert(iframeWindow.frameElement === null);

    User agents are encouraged to provide a way for users to configure the user agent to always reuse current.

    +
  • +
  • If new is true, then:

      @@ -78276,8 +78288,8 @@ callback FrameRequestCallback = void (DOMHighResTimeStamp -
    1. If noopener is true, then disown target - browsing context's opener and return null.

    2. +
    3. If noopener is true, then disown target + browsing context and return null.

    4. Return target browsing context's WindowProxy object.