Skip to content

Commit

Permalink
Integrate with WebDriver BiDi user prompt handling
Browse files Browse the repository at this point in the history
Each time we are about to pause for a user prompt, and after each pause, invoke the appropriate WebDriver BiDi algorithms.
  • Loading branch information
jgraham authored Jun 17, 2022
1 parent bfa6f2f commit 9af0600
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -4299,6 +4299,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-fragment-navigated">WebDriver BiDi fragment navigated</dfn></li>
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-dom-content-loaded">WebDriver BiDi DOM content loaded</dfn></li>
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-load-complete">WebDriver BiDi load complete</dfn></li>
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-user-prompt-closed">WebDriver BiDi user prompt closed</dfn></li>
<li><dfn data-x-href="https://w3c.github.io/webdriver-bidi/#webdriver-bidi-user-prompt-opened">WebDriver BiDi user prompt opened</dfn></li>
</ul>
</dd>

Expand Down Expand Up @@ -91929,11 +91931,21 @@ dictionary <dfn dictionary>PageTransitionEventInit</dfn> : <span>EventInit</span
<p>The user agent is encouraged to avoid asking the user for confirmation if it judges that
doing so would be annoying, deceptive, or pointless.</p>

<p>If the user agent asks the user for confirmation, it must <span>pause</span> while waiting
for the user's response.</p>
<p>If the user agent asks the user for confirmation, it must:</p>

<p>If the user confirmed the page navigation, then set <var>result</var> to "<code
data-x="">confirm</code>"; otherwise return "<code data-x="">refuse</code>".</p>
<ol>
<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <var>document</var>'s
<span>relevant global object</span>, "<code data-x="">beforeunload</code>", and "".</p></li>

<li><p><span>Pause</span> while waiting for the user's response.</p>

<li><p>If the user confirmed the page navigation, then set <var>result</var> to "<code
data-x="">confirm</code>"; otherwise to "<code data-x="">refuse</code>".</p>

<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <var>document</var>'s
<span>relevant global object</span> and true if <var>result</var> is "<code
data-x="">confirm</code>" or false otherwise.</p></li>
</ol>
</li>

<li>
Expand Down Expand Up @@ -99741,8 +99753,14 @@ function sendData(data) {

<li><p>Show <var>message</var> to the user, treating U+000A LF as a line break.</p></li>

<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <span>this</span>,
"<code data-x="">alert</code>", and <var>message</var>.</p></li>

<li><p>Optionally, <span>pause</span> while waiting for the user to acknowledge the
message.</p></li>

<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <span>this</span>
and true.</p></li>
</ol>

<p class="note">This method is defined using two overloads, instead of using an
Expand All @@ -99767,8 +99785,14 @@ function sendData(data) {
<li><p>Show <var>message</var> to the user, treating U+000A LF as a line break, and ask the user
to respond with a positive or negative response.</p></li>

<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <span>this</span>,
"<code data-x="">confirm</code>", and <var>message</var>.</p></li>

<li><p><span>Pause</span> until the user responds either positively or negatively.</p></li>

<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <span>this</span>,
and true if the user responded positively or false otherwise.</p></li>

<li><p>If the user responded positively, return true; otherwise, the user responded negatively:
return false.</p></li>
</ol>
Expand All @@ -99793,10 +99817,18 @@ function sendData(data) {
to either respond with a string value or abort. The response must be defaulted to the value given
by <var>default</var>.</p></li>

<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <span>this</span>,
"<code data-x="">prompt</code>" and <var>message</var>.</p></li>

<li><p><span>Pause</span> while waiting for the user's response.</p></li>

<li><p>If the user aborts, then return null; otherwise, return the string that the user responded
with.</p></li>
<li><p>Let <var>result</var> be null if the user aborts, or otherwise the string that the user
responded with.</p></li>

<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <span>this</span>,
false if <var>result</var> is null or true otherwise, and <var>result</var>.</p></li>

<li><p>Return <var>result</var>.</li>
</ol>

<p>To <dfn>optionally truncate a simple dialog string</dfn> <var>s</var>, return either
Expand Down

0 comments on commit 9af0600

Please sign in to comment.