diff --git a/index.bs b/index.bs index b72fbd650..c5e123120 100644 --- a/index.bs +++ b/index.bs @@ -1222,8 +1222,14 @@ Issue: Define how this works. # User Contexts # {#user-contexts} A user context represents a collection of top-level navigables within a remote -end. Each top-level navigable belongs to exactly one user contexts, and child -navigables belong to the same user context as their parent. +end. Each top-level navigable belongs to exactly one user context, and child +navigables belong to the same user context as their parent. A [=user context=] without +navigables belonging to it is an empty user context. + +The remote end always contains one [=user context=] referred as the default user +context. + +Issue: Should we have a default user context? Each user context represents an additional [=storage key=], so that no storage state is shared between different user contexts. @@ -1856,6 +1862,16 @@ The browser.createUserContext command creates a [
+The [=remote end steps=] are: + +1. Let |user context| be the result of performing implementation defined steps to create an [=empty user context=]. + +1. Let |result| be a [=/map=] matching the + browser.createUserContextResult production with the userContext + field set to |user context|'s [=user context id=]. + +1. Return [=success=] with data |result|. +
#### The browser.closeUserContext Command #### {#command-browser-closeUserContext} @@ -1876,11 +1892,9 @@ The browser.closeUserContext command closes a use
Return Type
-
-      browser.closeUserContextResult = {
-        userContext: browser.UserContext
-      }
-    
+
+      EmptyResult
+      
@@ -1894,7 +1908,7 @@ The [=remote end steps=] with |command parameters| are: Issue: Do we need to define "find" to be able to combine it with [=trying=]? - Issue: Should we allow closing the default context? + Issue: Should we allow closing the default context? Probably not. 1. [=Close=] any [=top-level browsing contexts=] contained that belong to the |user context| without [=prompting to unload=]. @@ -1938,7 +1952,8 @@ The browser.getUserContexts command returns a lis The [=remote end steps=] are: -1. Let |user contexts| be the result of implementation-specific steps to get [=user contexts=] from the user agent. +1. Let |user contexts| be the result of performing implementation defined steps + to get [=user contexts=] from the user agent. 1. Let |user context info list| be an empty [=/list=]. @@ -2132,6 +2147,10 @@ To get the browsing context info given |context|, Note: This includes the fragment component of the URL. +1. Let |user context| be null if |context| belongs to the [=default user + context=] or the [=user context id=] if the [=user context=] the |context| + belongs to otherwise. + 1. Let |child infos| be null. 1. If |max depth| is null, or |max depth| is greater than 0: @@ -2153,7 +2172,7 @@ To get the browsing context info given |context|, browsingContext.Info production with the context field set to |context id|, the parent field set to |parent id| if |is root| is true, or unset otherwise, the url - field set to |url|, and the children field set to |child infos|. + field set to |url|, the userContext field set to |user context| and the children field set to |child infos|. 1. Return |context info|. @@ -2755,13 +2774,20 @@ The [=remote end steps=] with |command parameters| are: 1. If the implementation is unable to create a new browsing context for any reason then return [=error=] with [=error code=] [=unsupported operation=]. + 1. Let |user context| be the [=default user context=]. + + 1. If |command parameters|[userContext] is present and is not null: + + 1. Let |user context| be the result of [=trying=] to find a [=user context=] whose [=user context id=] equals |command parameters|[userContext]. + 1. Create a new [=top-level browsing context=] by running the [=window open - steps=] with url set to "about:blank", - target set to the empty string, and - features set to "noopener". Which OS window the new [=/browsing context=] - is created in depends on |type| and |reference context|: + steps=] in the |user context| with url set to + "about:blank", target set to the empty + string, and features set to "noopener". + Which OS window the new [=/browsing context=] is created in depends on + |type| and |reference context|: * If |type| is "tab" and the implementation supports multiple browsing contexts in the same OS window: