Skip to content

Commit 0c2858c

Browse files
committedOct 30, 2024
Use actions queue when dispatching undo actions from "Release Actions"
1 parent db06684 commit 0c2858c

File tree

1 file changed

+38
-10
lines changed

1 file changed

+38
-10
lines changed
 

‎index.html

+38-10
Original file line numberDiff line numberDiff line change
@@ -10314,6 +10314,35 @@ <h3><dfn>Release Actions</dfn></h3>
1031410314
as if the state was released by an explicit series of actions.
1031510315
It also clears all the internal state of the virtual devices.
1031610316

10317+
<p>The algorithm to <a>get undo actions</a> takes an input state and returns its <a>input cancel list</a> in reverse order.
10318+
10319+
<p>To <dfn>get undo actions</dfn> given <var>input
10320+
state</var>:
10321+
10322+
<ol class=algorithm>
10323+
<li><p>Let <var>token</var> be a new unique identifier.
10324+
10325+
<li><p>Enqueue <var>token</var> in <var>input state</var>&apos;s <a>actions
10326+
queue</a>.
10327+
10328+
<li><p>Wait for <var>token</var> to be the first item
10329+
in <var>input state</var>&apos;s <a>actions queue</a>.
10330+
10331+
<aside class=note>
10332+
<p>This ensures that only one set of actions can be run at a time,
10333+
and therefore different actions commands using the same underlying
10334+
state don&apos;t race. In a session that is only a HTTP session only one
10335+
command can run at a time, so this will never block. But other
10336+
session types can allow running multiple commands in parallel, in
10337+
which case this is necessary to ensure sequential access.
10338+
</aside>
10339+
10340+
<li><p>Let <var>undo actions</var> be <var>input
10341+
state</var>&apos;s <a>input cancel list</a> in reverse order.
10342+
10343+
<li><p>Return <var>undo actions</var>.
10344+
</ol>
10345+
1031710346
<p>The <a>remote end steps</a>, given <var>session</var>, <var>URL
1031810347
variables</var> and <var>parameters</var> are:
1031910348

@@ -10323,25 +10352,24 @@ <h3><dfn>Release Actions</dfn></h3>
1032310352
code</a> <a>no such window</a>.
1032410353

1032510354
<li><p>Let <var>input state</var> be the result of <a>get the
10326-
input state</a> with <a>session</a> and <a>current
10327-
top-level browsing context</a>.
10355+
input state</a> with <a>session</a> and <a>current
10356+
top-level browsing context</a>.
1032810357

1032910358
<li><p>Let <var>actions options</var> be a new <a>actions options</a>
1033010359
with the <a>is element origin</a> steps set to <a>represents a web
1033110360
element</a>, and the <a>get element origin</a> steps set
1033210361
to <a>get a WebElement origin</a>.
1033310362

10334-
<li><p>Let <var>undo actions</var> be <var>input
10335-
state</var>&apos;s <a>input cancel list</a> in reverse order.
10363+
<li><p>Let <var>undo actions</var> be the result of <a>get undo actions</a>.
1033610364

10337-
<li><p><a>Try</a> to <a>dispatch tick actions</a> with arguments
10338-
<var>undo
10339-
actions</var>, <code>0</code>,<var>session</var>&apos;s <a>current
10340-
browsing context</a>, and <a>actions options</a>.
10365+
<li><p><a>Dispatch actions</a> with <var>input state</var>,
10366+
<var>undo actions</var>, <a>current browsing context</a>,
10367+
and <var>actions options</var>. If this results in an <a>error</a>
10368+
return that error.
1034110369

1034210370
<li><p><a>Reset the input state</a> with <var>session</var>
10343-
and <var>session</var>&apos;s <a>current top-level browsing
10344-
context</a>.
10371+
and <var>session</var>&apos;s <a>current top-level browsing
10372+
context</a>.
1034510373

1034610374
<li><p>Return <a>success</a> with data <a><code>null</code></a>.
1034710375
</ol>

0 commit comments

Comments
 (0)