You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+40-14Lines changed: 40 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1222,8 +1222,14 @@ Issue: Define how this works.
1222
1222
# User Contexts # {#user-contexts}
1223
1223
1224
1224
A <dfn>user context</dfn> represents a collection of top-level navigables within a remote
1225
-
end. Each top-level navigable belongs to exactly one user contexts, and child
1226
-
navigables belong to the same user context as their parent.
1225
+
end. Each top-level navigable belongs to exactly one user context, and child
1226
+
navigables belong to the same user context as their parent. A [=user context=] without
1227
+
navigables belonging to it is an <dfn>empty user context</dfn>.
1228
+
1229
+
The remote end always contains one [=user context=] referred as the <dfn>default user
1230
+
context</dfn>.
1231
+
1232
+
Issue: Should we have a default user context?
1227
1233
1228
1234
Each user context represents an additional [=storage key=], so that no storage
1229
1235
state is shared between different user contexts.
@@ -1856,6 +1862,16 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a [
1856
1862
1857
1863
<div algorithm="remote end steps for browser.createUserContext">
1858
1864
1865
+
The [=remote end steps=] are:
1866
+
1867
+
1. Let |user context| be the result of performing implementation defined steps to create an [=empty user context=].
1868
+
1869
+
1. Let |result| be a [=/map=] matching the
1870
+
<code>browser.createUserContextResult</code> production with the <code>userContext</code>
1871
+
field set to |user context|'s [=user context id=].
1872
+
1873
+
1. Return [=success=] with data |result|.
1874
+
1859
1875
</div>
1860
1876
1861
1877
#### The browser.closeUserContext Command #### {#command-browser-closeUserContext}
@@ -1876,11 +1892,9 @@ The <dfn export for=commands>browser.closeUserContext</dfn> command closes a use
1876
1892
</dd>
1877
1893
<dt>Return Type</dt>
1878
1894
<dd>
1879
-
<pre class="cddl local-cddl">
1880
-
browser.closeUserContextResult = {
1881
-
userContext: browser.UserContext
1882
-
}
1883
-
</pre>
1895
+
<pre class="cddl">
1896
+
EmptyResult
1897
+
</pre>
1884
1898
</dd>
1885
1899
</dl>
1886
1900
@@ -1894,7 +1908,7 @@ The [=remote end steps=] with |command parameters| are:
1894
1908
1895
1909
Issue: Do we need to define "find" to be able to combine it with [=trying=]?
1896
1910
1897
-
Issue: Should we allow closing the default context?
1911
+
Issue: Should we allow closing the default context? Probably not.
1898
1912
1899
1913
1. [=Close=] any [=top-level browsing contexts=] contained that belong to the
1900
1914
|user context| without [=prompting to unload=].
@@ -1938,7 +1952,8 @@ The <dfn export for=commands>browser.getUserContexts</dfn> command returns a lis
1938
1952
1939
1953
The [=remote end steps=] are:
1940
1954
1941
-
1. Let |user contexts| be the result of implementation-specific steps to get [=user contexts=] from the user agent.
1955
+
1. Let |user contexts| be the result of performing implementation defined steps
1956
+
to get [=user contexts=] from the user agent.
1942
1957
1943
1958
1. Let |user context info list| be an empty [=/list=].
1944
1959
@@ -2132,6 +2147,10 @@ To <dfn>get the browsing context info</dfn> given |context|,
2132
2147
2133
2148
Note: This includes the fragment component of the URL.
2134
2149
2150
+
1. Let |user context| be null if |context| belongs to the [=default user
2151
+
context=] or the [=user context id=] if the [=user context=] the |context|
2152
+
belongs to otherwise.
2153
+
2135
2154
1. Let |child infos| be null.
2136
2155
2137
2156
1. If |max depth| is null, or |max depth| is greater than 0:
@@ -2153,7 +2172,7 @@ To <dfn>get the browsing context info</dfn> given |context|,
2153
2172
<code>browsingContext.Info</code> production with the <code>context</code>
2154
2173
field set to |context id|, the <code>parent</code> field set to |parent id|
2155
2174
if |is root| is <code>true</code>, or unset otherwise, the <code>url</code>
2156
-
field set to |url|, and the <code>children</code> field set to |child infos|.
2175
+
field set to |url|, the <code>userContext</code> field set to |user context| and the <code>children</code> field set to |child infos|.
2157
2176
2158
2177
1. Return |context info|.
2159
2178
@@ -2755,13 +2774,20 @@ The [=remote end steps=] with |command parameters| are:
2755
2774
1. If the implementation is unable to create a new browsing context for any
2756
2775
reason then return [=error=] with [=error code=][=unsupported operation=].
2757
2776
2777
+
1. Let |user context| be the [=default user context=].
2778
+
2779
+
1. If |command parameters|[<code>userContext</code>] is present and is not null:
2780
+
2781
+
1. Let |user context| be the result of [=trying=] to find a [=user context=] whose [=user context id=] equals |command parameters|[<code>userContext</code>].
2782
+
2758
2783
<!-- This is based on step 5 of https://w3c.github.io/webdriver/#new-window,
2759
2784
but without using the "current browsing context" concept. -->
2760
2785
1. Create a new [=top-level browsing context=] by running the [=window open
2761
-
steps=] with <var ignore>url</var> set to "<code>about:blank</code>",
2762
-
<var ignore>target</var> set to the empty string, and
2763
-
<var ignore>features</var> set to "<code>noopener</code>". Which OS window the new [=/browsing context=]
2764
-
is created in depends on |type| and |reference context|:
2786
+
steps=] in the |user context| with <var ignore>url</var> set to
2787
+
"<code>about:blank</code>", <var ignore>target</var> set to the empty
2788
+
string, and <var ignore>features</var> set to "<code>noopener</code>".
2789
+
Which OS window the new [=/browsing context=] is created in depends on
2790
+
|type| and |reference context|:
2765
2791
2766
2792
* If |type| is "<code>tab</code>" and the implementation supports
0 commit comments