From 4438b7eb6b3290fe3eb01cba1c6161053b692ff1 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 9 Nov 2015 12:53:13 +0100 Subject: [PATCH] Fix #313: make disowning a browsing context work This change attempts to make it so that when using rel=noopener, rel=noreferrer, and when setting window.opener to null, the browsing contexts involve can no longer directly reach each other. They end up in their own unit of related browsing contexts. (This is what some in the ECMAScript community refer to as a vat or continent.) We do this by making directly reachable account for disowning, by making familiar with account for directly reachable, and by changing the rules for choosing a browsing context given a browsing context name to no longer say "related enough", but instead clearly say that the browsing contexts have to be familiar with each other, and by extension, have to be directly reachable. --- source | 51 ++++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/source b/source index 2ed247a2530..fdf60da51d2 100644 --- a/source +++ b/source @@ -21628,8 +21628,8 @@ interface HTMLHyperlinkElementUtils {
  • If subject's link types include the noreferrer or noopener keyword, - and replace is true, then disown - target's opener.

  • + and replace is true, then disown + target.

  • Parse the URL given by subject's href attribute, relative to subject's @@ -22141,7 +22141,9 @@ interface HTMLHyperlinkElementUtils { 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 that the user agent will not send an HTTP `Referer` (sic) header if the user follows the hyperlink. @@ -22149,7 +22151,8 @@ interface HTMLHyperlinkElementUtils { not allowed Annotation · - Requires that any browsing context created by following the hyperlink must not have an opener browsing context. + Indicates that any browsing context created by following the hyperlink is + disowned. @@ -78152,17 +78155,18 @@ dictionary DragEventInit : MouseEventInit { the browsing context from which the auxiliary browsing context was created.

    +

    An auxiliary browsing context can be disowned. + This means it is no longer directly + reachable.

    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 + object, on getting, must return the WindowProxy object of the current browsing + context's opener browsing context, if there is one and it is not + disowned; otherwise, it must return null. On setting, if the new value is null then + the current browsing context must be disowned; if the new value is + anything else then the user agent must call the [[DefineOwnProperty]] internal method of the Window object, passing the @@ -78181,8 +78185,9 @@ dictionary DragEventInit : MouseEventInit {

    Security

    A browsing context A is familiar - with a second browsing context B if one of the following - conditions is true:

    + with a second browsing context B if A can directly reach B and one of the + following conditions is true:

    @@ -78520,11 +78527,10 @@ dictionary DragEventInit : MouseEventInit {

    If the given browsing context name is not _blank and there exists a browsing context whose name is the same as the given browsing context name, and the current browsing context is familiar with that - browsing context, and the user agent determines that the two browsing contexts are related - enough that it is ok if they reach each other, then that browsing context must be the chosen - one. If there are multiple matching browsing contexts, the user agent should select one in some - arbitrary consistent manner, such as the most recently opened, most recently focused, or more - closely related.

    + browsing context, then that browsing context must be the chosen one. If there are multiple + matching browsing contexts the current browsing context is familiar with, the user + agent should select one in some arbitrary consistent manner, such as the most recently opened, + most recently focused, or more closely related.

  • @@ -79351,9 +79357,8 @@ callback FrameRequestCallback = void (DOMHighResTimeStamp
  • If the result of splitting features - on commas contains the token "noopener", disown target browsing context's opener, and return null.

  • + on commas contains the token "noopener", disown target browsing context, and return null.

  • Otherwise, return the WindowProxy object of target browsing context.