Skip to content

Commit 7d8beb9

Browse files
whimboojgraham
andauthored
Use actions queue when dispatching undo actions from "Release Actions" (#1853)
--------- Co-authored-by: jgraham
1 parent 0ac18fa commit 7d8beb9

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

index.html

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9120,18 +9120,16 @@

Dispatching actions

91209120
grouped by <a>ticka>, and then causes each action to be run at the
91219121
appropriate point in the sequence.
91229122

9123-
<p>To <dfn>dispatch actionsdfn> given <var>input
9124-
statevar>, <var>actions by tickvar>, <var>browsing
9125-
contextvar>, and <var>actions optionsvar>:
9123+
<p>To <dfn>wait for an action queue tokendfn> given <var>input statevar>:
91269124

91279125
<ol class=algorithm>
91289126
<li><p>Let <var>tokenvar> be a new unique identifier.
91299127

9130-
<li><p>Enqueue <var>tokenvar> in <var>input statevar>'s <a>actions
9131-
queuea>.
9128+
<li><p>Enqueue <var>tokenvar> in <var>input statevar>'s
9129+
<a>actions queuea>.
91329130

91339131
<li><p>Wait for <var>tokenvar> to be the first item
9134-
in <var>input statevar>'s <a>actions queuea>.
9132+
in <var>input statevar>'s <a>actions queuea>.
91359133

91369134
<aside class=note>
91379135
<p>This ensures that only one set of actions can be run at a time,
@@ -9141,13 +9139,21 @@

Dispatching actions

91419139
session types can allow running multiple commands in parallel, in
91429140
which case this is necessary to ensure sequential access.
91439141
aside>
9142+
ol>
91449143

9145-
<li><p>Let <var>actions resultvar> be the result of <a>dispatch
9146-
actions innera> with <var>input statevar>, <var>actions by
9147-
tickvar>, <var>browsing contextvar>, and <var>actions optionsvar>.
9144+
<p>To <dfn>dispatch actionsdfn> given <var>input
9145+
statevar>, <var>actions by tickvar>, <var>browsing
9146+
contextvar>, and <var>actions optionsvar>:
9147+
9148+
<ol class=algorithm>
9149+
<li><p><a>Wait for an action queue tokena> with <var>input statevar>.
9150+
9151+
<li><p>Let <var>actions resultvar> be the result of
9152+
<a>dispatch actions innera> with <var>input statevar>, <var>actions by
9153+
tickvar>, <var>browsing contextvar>, and <var>actions optionsvar>.
91489154

91499155
<li><p>Dequeue <var>input statevar>'s <a>actions queuea>.
9150-
<p>Assert: this returns <var>tokenvar>
9156+
<p>Assert: this returns <var>tokenvar>
91519157

91529158
<li><p>Return <var>actions resultvar>.
91539159
ol>
@@ -10325,26 +10331,26 @@

Release Actions

1032510331
is <a>no longer opena>, return <a>errora> with <a>error
1032610332
codea> <a>no such windowa>.
1032710333

10328-
<li><p>Let <var>input statevar> be the result of <a>get the
10329-
input statea> with <a>sessiona> and <a>current
10330-
top-level browsing contexta>.
10334+
<li><p>Let <var>input statevar> be the result of <a>get the input statea>
10335+
with <a>sessiona> and <a>current top-level browsing contexta>.
1033110336

1033210337
<li><p>Let <var>actions optionsvar> be a new <a>actions optionsa>
1033310338
with the <a>is element origina> steps set to <a>represents a web
1033410339
elementa>, and the <a>get element origina> steps set
1033510340
to <a>get a WebElement origina>.
1033610341

10342+
<li><p><a>Wait for an action queue tokena> with <var>input statevar>.
10343+
1033710344
<li><p>Let <var>undo actionsvar> be <var>input
10338-
statevar>'s <a>input cancel lista> in reverse order.
10345+
statevar>'s <a>input cancel lista> in reverse order.
10346+
10347+
<li><p><a>Trya> to <a>dispatch actionsa> with <var>input statevar>,
10348+
<var>undo actionsvar>, <a>current browsing contexta>,
10349+
and <var>actions optionsvar>.
1033910350

10340-
<li><p><a>Trya> to <a>dispatch tick actionsa> with arguments
10341-
<var>undo
10342-
actionsvar>, <code>0code>,<var>sessionvar>'s <a>current
10343-
browsing contexta>, and <a>actions optionsa>.
1034410351

1034510352
<li><p><a>Reset the input statea> with <var>sessionvar>
10346-
and <var>sessionvar>'s <a>current top-level browsing
10347-
contexta>.
10353+
and <var>sessionvar>'s <a>current top-level browsing contexta>.
1034810354

1034910355
<li><p>Return <a>successa> with data <a><code>nullcode>a>.
1035010356
ol>

0 commit comments

Comments
 (0)