Skip to content

Commit eaf64d6

Browse files
browser.createUserContext:unhandledPromptBehavior
1 parent a223cb7 commit eaf64d6

File tree

1 file changed

+16
-86
lines changed

1 file changed

+16
-86
lines changed

index.bs

Lines changed: 16 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,8 +2655,12 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a
26552655
<pre class="cddl remote-cddl">
26562656
browser.CreateUserContext = (
26572657
method: "browser.createUserContext",
2658-
params: EmptyParams,
2658+
params: browser.CreateUserContextParams,
26592659
)
2660+
2661+
browser.CreateUserContextParams = {
2662+
? unhandledPromptBehavior: session.UserPromptHandler
2663+
}
26602664
</pre>
26612665
</dd>
26622666
<dt>Return Type</dt>
@@ -2669,10 +2673,14 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a
26692673

26702674
<div algorithm="remote end steps for browser.createUserContext">
26712675

2672-
The [=remote end steps=] are:
2676+
The [=remote end steps=] with |command parameters| are:
26732677

26742678
1. Let |user context| be a new [=user context=].
26752679

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+
26762684
1. [=set/Append=] |user context| to the [=set of user contexts=].
26772685

26782686
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
30303038
weak map between [=user contexts=] and [=/map=] matching the
30313039
<code>session.UserPromptHandlerType</code> production.
30323040

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-
30383041
### Types ### {#module-browsingcontext-types}
30393042

30403043
#### The browsingContext.BrowsingContext Type #### {#type-browsingContext-Browsingcontext}
@@ -4784,10 +4787,6 @@ TODO: Move it as a hook in the html spec instead.
47844787
1. If [=geolocation overrides map=] [=map/contains=] |user context|,
47854788
[=set emulated position data=] with |navigable| and [=geolocation overrides map=][|user context|].
47864789

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-
47914790
1. If [=viewport overrides map=] [=map/contains=] |user context|:
47924791

47934792
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:
48784877

48794878
</div>
48804879

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-
49504880
#### The browsingContext.traverseHistory Command #### {#command-browsingContext-traverseHistory}
49514881

49524882
The <dfn export for=commands>browsingContext.traverseHistory</dfn> command
@@ -5627,16 +5557,16 @@ closed</dfn> steps given |window|, |type|, |accepted| and optional |user text|
56275557
<div algorithm>
56285558
To <dfn>get navigable's user prompt handler</dfn> given |type| and |navigable|:
56295559

5630-
1. If [=navigable to unhandled prompt behavior map=] contains |navigable|:
5560+
1. Let |user context| be |navigable|'s [=associated user context=].
56315561

5632-
1. Let |behavior map| be [=navigable to unhandled prompt behavior map=][|navigable|].
5562+
1. If [=unhandled prompt behavior overrides map=] contains |user context|:
56335563

5634-
1. If |behavior map| is not null:
5564+
1. Let |behavior map| be [=unhandled prompt behavior overrides map=][|user context|].
56355565

5636-
1. If |behavior map| contains |type|, return |behavior map|[|type|].
5566+
1. If |behavior map| contains |type|, return |behavior map|[|type|].
56375567

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>].
56405570

56415571
1. Let |handler configuration| be [=get the prompt handler=] with |type|.
56425572

0 commit comments

Comments
 (0)