From 0e6d3b51ba8f555a700301abff81085f31500fea Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
Return the result of creating a new browsing context with null.
Let group be the result of creating a new browsing context + group.
Return group's browsing context set[0].
This creates a top-level browsing context.
@@ -77214,6 +77218,13 @@ dictionary DragEventInit : MouseEventInit {Let browsingContext be the result of creating a new browsing context with opener's active document.
Assert: opener's top-level browsing context's group is non-null, as navigating invokes this + directly.
Append browsingContext to opener's + top-level browsing context's group.
Set browsingContext's opener browsing context to opener.
A top-level browsing context has an associated group (null or a browsing context group). It is initially null.
+It is possible to create new browsing contexts that are related to a top-level browsing
context without being nested through an element. Such browsing contexts are called auxiliary
@@ -77694,36 +77708,72 @@ console.assert(iframeWindow.frameElement === null);
Each browsing context is defined as having a list of one or more directly
- reachable browsing contexts. These are: A user agent holds a browsing context group set (a set of browsing context groups). A browsing context group holds a browsing context set (a set
+ of top-level browsing contexts). To create a new browsing context
+ group, run these steps: Let group be a new browsing context group. Append group to the user agent's
+ browsing context group set. Append the result of creating a new browsing
+ context with null to group. Return group. To append a top-level browsing context
+ browsingContext to a browsing context group group, run these
+ steps: Append browsingContext to group's
+ browsing context set. Set browsingContext's group to
+ group. To remove a top-level browsing context
+ browsingContext, run these steps: Assert: browsingContext's group is non-null,
+ because a browsing context only gets discarded once. Let group be browsingContext's group. Set browsingContext's group to null. The transitive closure of all the browsing contexts that
- are directly reachable browsing contexts forms a unit of related browsing
- contexts. Remove browsingContext from
+ group's browsing context set. Each unit of related browsing contexts is then further divided into the smallest
- number of groups such that every member of each group has an active document with an
- origin that, through appropriate manipulation of the If group's browsing context set is
+ empty, then remove group from the user
+ agent's browsing context group set. Append and remove are primitive operations that help define the lifetime of a browsing
+ context group. They are called from creating a new browsing context group,
+ creating a new auxiliary browsing context, and discarding a browsing context. The HTML Standard used to define "Groupings of browsing contexts
-
+
+
+
-
+
+
+
+ document.domain
attribute, could be made to be same
- origin-domain with other members of the group, but could not be made the same as members of
- any other group. Each such group is a unit of related similar-origin browsing
- contexts.
+
+
This will be made more precise in issue #1440.
+ href="https://github.com/whatwg/html/issues/313">issue #313.A browsing context has a strong reference to each of its Document
- objects (due to its session history) and its WindowProxy
object, and the
- user agent itself has a strong reference to its top-level browsing contexts.
WindowProxy
object.
A Document
has a strong reference to its Window
object.
When a browsing context is discarded, the strong reference
- from the user agent itself to the browsing context must be severed, and all the
- Document
objects for all the entries in the browsing context's session
- history must be discarded as well.
To discard a browsing + context browsingContext, run these steps:
+ +Discard all Document
objects for all
+ the entries in browsingContext's session history.
If browsingContext is a top-level browsing context, then + remove browsingContext.
User agents may discard top-level browsing contexts at any time (typically, in
- response to user requests, e.g. when a user force-closes a window containing one or more top-level browsing contexts). Other browsing contexts must be discarded once their
WindowProxy
object is eligible for garbage collection, in addition to the other
@@ -89045,7 +89099,52 @@ import "https://example.com/foo/../module2.mjs";
Conceptually, the agent concept is an architecture-independent, idealized "thread" in which JavaScript code runs. Such code can involve multiple globals/realms that can synchronously access each other, and - thus need to run in a single execution thread.
+ thus needs to run in a single execution thread. + +To determine whether a Window
object A and a Window
object
+ B are considered same-agent Window
objects, run
+ these steps:
If A's relevant settings object's responsible browsing + context's top-level browsing context's group is not B's relevant settings object's + responsible browsing context's top-level browsing context's group, then return false.
+ +Unfortunately this model falls apart the moment a + browsing context is discarded. Issue + #4361 sketches a setup that could improve this situation.
+Let originA be A's relevant settings object's origin and originB be B's + relevant settings object's origin.
If originA is same origin with originB, then return + true.
If originA or originB is not a tuple origin, then return false.
If originA's scheme is not + originB's scheme, then return + false.
If originA's host is same + site with originB's host, then return + true.
Return false.
All same-agent Window
objects together represent a group
+ of Window
objects that can synchronously access each other, though sometimes only
+ after setting the document.domain
attribute
+ (in)appropriately.
Until such a time that this standard has a better handle on lifetimes, it defines five types of agents that user agents must allocate at the appropriate time.
@@ -89059,14 +89158,12 @@ import "https://example.com/foo/../module2.mjs";An agent whose [[CanBlock]] is false and whose set of realms consists of all realms of Window
objects whose
- relevant settings object's responsible browsing context is in the same
- unit of related similar-origin browsing contexts.
Window
+ objects.
Two Window
objects that are same origin can be in
different similar-origin window agents, for
- instance if they are each in their own unit of related similar-origin browsing
- contexts.