Skip to content

Commit 59d550b

Browse files
committed
Make object-valued user prompt handler defaults always override
Previously an object value for the unhandledPromptBehavior capability like: { "default": "dismiss" } was equivalent to the string value "dismiss" which for legacy reasons does not affect "beforeUnload" prompts. For WebDriver-BiDi session we'd ideally like to remove this special case and have the default value apply to all prompt types. Therefore this changes things so that an object value with a default key provides a default that applies to all prompt types, whereas the traditional string values only apply to alert/confirm/prompt dialogs. This preserves classic semantics for string-only values, but makes the object values behave in a more uniform way.
1 parent 549d8aa commit 59d550b

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

index.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10481,8 +10481,11 @@ <h3>User Prompt Handler</h3>
1048110481
<p class="note">This is to avoid [[WebDriver-BiDi]] monkey-patching
1048210482
the current spec.
1048310483

10484+
<li><p>Let <var>is string value</var> be false.
10485+
1048410486
<li><p>If <var>value</var> is a <a>string</a> set <var>value</var> to
10485-
the <a data-cite=infra>map</a> «["<code>default</code>" → <var>value</var>]».
10487+
the <a data-cite=infra>map</a> «["<code>fallbackDefault</code>"
10488+
<var>value</var>]» and set <var>is string value</var> to true.
1048610489

1048710490
<li><p>If <var>value</var> is not a <a data-cite=infra>map</a> return
1048810491
<a>error</a> with <a>error code</a> <a>invalid argument</a>.
@@ -10492,9 +10495,9 @@ <h3>User Prompt Handler</h3>
1049210495
<li><p>For each <var>prompt type</var><var>handler</var> in <var>value</var>:
1049310496

1049410497
<ol>
10495-
<li><p>If <a>valid prompt types</a> does
10496-
not [=map/contain=] <var>prompt type</var> return <a>error</a>
10497-
with <a>error code</a> <a>invalid argument</a>.
10498+
<li><p>If <var>is string value</var> is false and <a>valid prompt
10499+
types</a> does not [=map/contain=] <var>prompt type</var>
10500+
return <a>error</a> with <a>error code</a> <a>invalid argument</a>.
1049810501

1049910502
<li><p>If <a>known prompt handlers</a> does not contain an entry
1050010503
with <a>handler key</a> <var>handler</var> return <a>error</a>
@@ -10584,9 +10587,9 @@ <h3>User Prompt Handler</h3>
1058410587

1058510588
<li><p>If the <a>user prompt handler</a> has [=map/size=] 1,
1058610589
and <a>user prompt handler</a> [=list/contains=]
10587-
"<code>default</code>", return the result of <a>serialize a prompt
10590+
"<code>fallbackDefault</code>", return the result of <a>serialize a prompt
1058810591
handler configuration</a> with <a>user prompt
10589-
handler</a>["<code>default</code>"].
10592+
handler</a>["<code>fallbackDefault</code>"].
1059010593

1059110594
<li><p>Let <var>serialized</var> be an empty <a data-cite=infra>map</a>.
1059210595

@@ -10623,12 +10626,15 @@ <h3>User Prompt Handler</h3>
1062310626
<li><p>If <var>handlers</var> contains <var>type</var>
1062410627
return <var>handlers</var>[<var>type</var>].
1062510628

10629+
<li><p>If <var>handlers</var> contains "<code>default</code>"
10630+
return <var>handlers</var>["<code>default</code>"].
10631+
1062610632
<li><p>If <var>type</var> is "<code>beforeUnload</code>", return a
1062710633
<a>prompt handler configuration</a> with [=prompt
1062810634
handler configuration/handler=] "<code>accept</code>"
1062910635
and [=prompt handler configuration/notify=] false.
1063010636

10631-
<li><p>If <var>handlers</var> contains "<code>default</code>"
10637+
<li><p>If <var>handlers</var> contains "<code>fallbackDefault</code>"
1063210638
return <var>handlers</var>["<code>default</code>"].
1063310639

1063410640
<li><p>Return a <a>prompt handler

0 commit comments

Comments
 (0)