Skip to content

Commit

Permalink
Use actions queue when dispatching undo actions from "Release Actions"
Browse files Browse the repository at this point in the history
  • Loading branch information
whimboo committed Dec 2, 2024
1 parent 0ac18fa commit 20c5f83
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9120,18 +9120,16 @@ <h3>Dispatching actions</h3>
grouped by <a>tick</a>, and then causes each action to be run at the
appropriate point in the sequence.

<p>To <dfn>dispatch actions</dfn> given <var>input
state</var>, <var>actions by tick</var>, <var>browsing
context</var>, and <var>actions options</var>:
<p>To <dfn>wait for an action queue token</dfn> given <var>input state</var>:

<ol class=algorithm>
<li><p>Let <var>token</var> be a new unique identifier.

<li><p>Enqueue <var>token</var> in <var>input state</var>&apos;s <a>actions
queue</a>.
queue</a>.

<li><p>Wait for <var>token</var> to be the first item
in <var>input state</var>&apos;s <a>actions queue</a>.
in <var>input state</var>&apos;s <a>actions queue</a>.

<aside class=note>
<p>This ensures that only one set of actions can be run at a time,
Expand All @@ -9142,12 +9140,19 @@ <h3>Dispatching actions</h3>
which case this is necessary to ensure sequential access.
</aside>

<p>To <dfn>dispatch actions</dfn> given <var>input
state</var>, <var>actions by tick</var>, <var>browsing
context</var>, and <var>actions options</var>:

<ol class=algorithm>
<li><p>Call <a>wait for an action queue token</a> with <var>input state</var>.

<li><p>Let <var>actions result</var> be the result of <a>dispatch
actions inner</a> with <var>input state</var>, <var>actions by
tick</var>, <var>browsing context</var>, and <var>actions options</var>.
actions inner</a> with <var>input state</var>, <var>actions by
tick</var>, <var>browsing context</var>, and <var>actions options</var>.

<li><p>Dequeue <var>input state</var>&apos;s <a>actions queue</a>.
<p>Assert: this returns <var>token</var>
<p>Assert: this returns <var>token</var>

<li><p>Return <var>actions result</var>.
</ol>
Expand Down Expand Up @@ -10326,25 +10331,30 @@ <h3><dfn>Release Actions</dfn></h3>
code</a> <a>no such window</a>.

<li><p>Let <var>input state</var> be the result of <a>get the
input state</a> with <a>session</a> and <a>current
top-level browsing context</a>.
input state</a> with <a>session</a> and <a>current
top-level browsing context</a>.

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

<li><p>Call <a>wait for an action queue token</a> with <var>input state</var>.

<li><p>Let <var>undo actions</var> be <var>input
state</var>&apos;s <a>input cancel list</a> in reverse order.
state</var>&apos;s <a>input cancel list</a> in reverse order.

<li><p><a>Dispatch actions</a> with <var>input state</var>,
<var>undo actions</var>, <a>current browsing context</a>,
and <var>actions options</var>. If this results in an <a>error</a>
return that error.

<li><p><a>Try</a> to <a>dispatch tick actions</a> with arguments
<var>undo
actions</var>, <code>0</code>,<var>session</var>&apos;s <a>current
browsing context</a>, and <a>actions options</a>.
<li><p>Dequeue <var>input state</var>&apos;s <a>actions queue</a>.
<p>Assert: this returns <var>token</var>

<li><p><a>Reset the input state</a> with <var>session</var>
and <var>session</var>&apos;s <a>current top-level browsing
context</a>.
and <var>session</var>&apos;s <a>current top-level browsing
context</a>.

<li><p>Return <a>success</a> with data <a><code>null</code></a>.
</ol>
Expand Down

0 comments on commit 20c5f83

Please sign in to comment.