@@ -2655,8 +2655,12 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a
2655
2655
<pre class="cddl remote-cddl">
2656
2656
browser.CreateUserContext = (
2657
2657
method: "browser.createUserContext",
2658
- params: EmptyParams ,
2658
+ params: browser.CreateUserContextParams ,
2659
2659
)
2660
+
2661
+ browser.CreateUserContextParams = {
2662
+ ? unhandledPromptBehavior: session.UserPromptHandler
2663
+ }
2660
2664
</pre>
2661
2665
</dd>
2662
2666
<dt> Return Type</dt>
@@ -2669,10 +2673,14 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a
2669
2673
2670
2674
<div algorithm="remote end steps for browser.createUserContext">
2671
2675
2672
- The [=remote end steps=] are:
2676
+ The [=remote end steps=] with |command parameters| are:
2673
2677
2674
2678
1. Let |user context| be a new [=user context=] .
2675
2679
2680
+ 1. If |command parameters| [=map/contains=] "<code> unhandledPromptBehavior</code> ",
2681
+ [=map/set=] [=unhandled prompt behavior overrides map=] [|user context|] to
2682
+ |command parameters|["<code>unhandledPromptBehavior</code>"] .
2683
+
2676
2684
1. [=set/Append=] |user context| to the [=set of user contexts=] .
2677
2685
2678
2686
1. Let |user context info| be a [=/map=] matching the
@@ -3030,11 +3038,6 @@ A [=remote end=] has an <dfn>unhandled prompt behavior overrides map</dfn> which
3030
3038
weak map between [=user contexts=] and [=/map=] matching the
3031
3039
<code> session.UserPromptHandlerType</code> production.
3032
3040
3033
- A [=remote end=] has a <dfn>navigable to unhandled prompt behavior map</dfn> which is a weak map
3034
- between [=navigables=] and and [=/map=] matching the <code> session.UserPromptHandlerType</code> production.
3035
-
3036
- Issue: check the wording.
3037
-
3038
3041
### Types ### {#module-browsingcontext-types}
3039
3042
3040
3043
#### The browsingContext.BrowsingContext Type #### {#type-browsingContext-Browsingcontext}
@@ -4784,10 +4787,6 @@ TODO: Move it as a hook in the html spec instead.
4784
4787
1. If [=geolocation overrides map=] [=map/contains=] |user context|,
4785
4788
[=set emulated position data=] with |navigable| and [=geolocation overrides map=] [|user context|] .
4786
4789
4787
- 1. If [=unhandled prompt behavior overrides map=] [=map/contains=] |user context|,
4788
- set |navigable|'s [=navigable to unhandled prompt behavior map=] [|navigable|]
4789
- to [=unhandled prompt behavior overrides map=] [|user context|] .
4790
-
4791
4790
1. If [=viewport overrides map=] [=map/contains=] |user context|:
4792
4791
4793
4792
1. If |navigable| is a [=/top-level traversable=] and the <code> viewport</code> field of
@@ -4878,75 +4877,6 @@ The [=remote end steps=] with |command parameters| are:
4878
4877
4879
4878
</div>
4880
4879
4881
- #### The browsingContext.setUnhandledUserPromptBehavior Command #### {#command-browsingContext-setUnhandledUserPromptBehavior}
4882
-
4883
- The <dfn export for=commands>browsingContext.setUnhandledUserPromptBehavior</dfn>
4884
- command allows closing an open prompt
4885
-
4886
- <dl>
4887
- <dt> Command Type</dt>
4888
- <dd>
4889
- <pre class="cddl remote-cddl">
4890
- browsingContext.SetUnhandledUserPromptBehavior = (
4891
- method: "browsingContext.setUnhandledUserPromptBehavior",
4892
- params: browsingContext.SetUnhandledUserPromptBehaviorParameters
4893
- )
4894
-
4895
- browsingContext.SetUnhandledUserPromptBehaviorParameters = {
4896
- unhandledPromptBehavior: session.UserPromptHandler / null,
4897
- ? contexts: [+browsingContext.BrowsingContext] ,
4898
- ? userContexts: [+browser.UserContext] ,
4899
- }
4900
- </pre>
4901
- </dd>
4902
- <dt> Result Type</dt>
4903
- <dd>
4904
- <code>
4905
- EmptyResult
4906
- </code>
4907
- </dd>
4908
- </dl>
4909
-
4910
- <div algorithm="remote end steps for browsingContext.setUnhandledUserPromptBehavior">
4911
-
4912
- The [=remote end steps=] with |command parameters| are:
4913
-
4914
- 1. If |command parameters| [=map/contains=] "<code> userContexts</code> "
4915
- and |command parameters| [=map/contains=] "<code> context</code> ",
4916
- return [=error=] with [=error code=] [=invalid argument=] .
4917
-
4918
- 1. If |command parameters| doesn't [=map/contain=] "<code> userContexts</code> "
4919
- and |command parameters| doesn't [=map/contain=] "<code> context</code> ",
4920
- return [=error=] with [=error code=] [=invalid argument=] .
4921
-
4922
- 1. Let |navigables| be a [=/set=] .
4923
-
4924
- 1. If the <code> contexts</code> field of |command parameters| is present:
4925
-
4926
- 1. Let |navigables| be the result of [=trying=] to [=get valid top-level traversables by ids=] with |command parameters|["<code>contexts</code>"] .
4927
-
4928
- 1. Otherwise, if the <code> userContexts</code> field of |command parameters| is present:
4929
-
4930
- 1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=] with |command parameters|["<code>userContexts</code>"] .
4931
-
4932
- 1. For each |user context| of |user contexts|:
4933
-
4934
- 1. [=map/Set=] [=unhandled prompt behavior overrides map=] [|user context|] to |command parameters|["<code>unhandledPromptBehavior</code>"] .
4935
-
4936
- 1. [=list/For each=] |top-level traversable| of the list of all [=/top-level traversables=]
4937
- whose [=associated user context=] is |user context|:
4938
-
4939
- 1. [=list/Append=] |top-level traversable| to |navigables|.
4940
-
4941
- 1. For each |navigable| of |navigables|:
4942
-
4943
- 1. Set |navigable|'s [=navigable to unhandled prompt behavior map=] [|navigable|]
4944
- to |command parameters|["<code>unhandledPromptBehavior</code>"] .
4945
-
4946
- 1. Return [=success=] with data null.
4947
-
4948
- </div>
4949
-
4950
4880
#### The browsingContext.traverseHistory Command #### {#command-browsingContext-traverseHistory}
4951
4881
4952
4882
The <dfn export for=commands>browsingContext.traverseHistory</dfn> command
@@ -5627,16 +5557,16 @@ closed</dfn> steps given |window|, |type|, |accepted| and optional |user text|
5627
5557
<div algorithm>
5628
5558
To <dfn>get navigable's user prompt handler</dfn> given |type| and |navigable|:
5629
5559
5630
- 1. If [=navigable to unhandled prompt behavior map=] contains |navigable|:
5560
+ 1. Let |user context| be |navigable|'s [=associated user context=] .
5631
5561
5632
- 1. Let |behavior map| be [=navigable to unhandled prompt behavior map=][|navigable|] .
5562
+ 1. If [= unhandled prompt behavior overrides map=] contains |user context|:
5633
5563
5634
- 1. If |behavior map| is not null:
5564
+ 1. Let |behavior map| be [=unhandled prompt behavior overrides map=] [|user context|] .
5635
5565
5636
- 1. If |behavior map| contains |type|, return |behavior map|[|type|] .
5566
+ 1. If |behavior map| contains |type|, return |behavior map|[|type|] .
5637
5567
5638
- 1. If |behavior map| contains <code> "default"</code> , return
5639
- |behavior map|[<code>"default"</code>] .
5568
+ 1. If |behavior map| contains <code> "default"</code> , return
5569
+ |behavior map|[<code>"default"</code>] .
5640
5570
5641
5571
1. Let |handler configuration| be [=get the prompt handler=] with |type|.
5642
5572
0 commit comments