You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"? #1970
When it comes to touch input, in probably-all UAs gesture recognisers affect which DOM events are generated and when, and this interacts badly with per-tick completion.
"dispatch actions inner" waits, per tick, until the event loop has "spun enough times to process the DOM events generated by" that tick. It's unclear whether "the DOM events generated by [a tick]" includes events produced by a gesture recogniser that the tick's input started. For example, consider on Safari on iOS:
Tick 1: pointerDown
Tick 2: pointerUp
pointerDown fires pointerdown and starts a long-press (touch-and-hold) gesture recogniser, which fires once the touch has been held past its threshold without a pointerUp. But: the pointerUp is in Tick 2 which cannot dispatch until Tick 1 completes. So, if Tick 1 waits for the recogniser to resolve, the touch is necessarily held past the threshold with no pointerUp, the long-press fires, and it dispatches pointercancel plus contextmenu/selectstart as appropriate for the target.
And you can't get around this by putting them in the same tick: the action model only allows one action per input source per tick, so pointerDown and pointerUp are always in separate ticks. So you can never send a tap.
However, if a tick didn't wait for gesture recognisers, you get the surprising behaviour that the pointerUp doesn't wait for the click event to fire, because that too is tied to a gesture recogniser, waiting to see if it is a single or double tap.
The Browser Testing and Tools Working Group just discussed What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps".
The full IRC log of that discussion
<AutomatedTester> topic: What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"
<AutomatedTester> github: https://github.com//issues/1970
<AutomatedTester> gsnedders: I posted this a few weeks ago around the behaviours of actions on mobile
<AutomatedTester> ... there are a lot cases where waiting for a tick could lead to certain gestures never actually happening
<AutomatedTester> ... this could lead to OS interpretations of gestures not doing what the user wanted .e.g. a tap waiting for something could look like a press and hold while the other item finishes
<AutomatedTester> q?
<jgraham> q+
<AutomatedTester> ack next
<AutomatedTester> jgraham: we have talked about this before, I would need to check what firefox is doing but I think we just inject things into the event loop. The best person for this is whimboo who isnt around at the moment
<AutomatedTester> ... I expect we want to improve the spec here
<AutomatedTester> ... do you have a proposal on how to fix it
<AutomatedTester> gsnedders: not at the moment
<AutomatedTester> ... the longer asnwer is there are times when we want to wait and times we dont and it is hard to decide
<AutomatedTester> ... and this can make WPT fail en masse
<orkon> q+
<AutomatedTester> ... I would like to avoid "wait for any click or events to fire"
<AutomatedTester> ... this is around how gestures are done and none of that is really specified
<AutomatedTester> ack next
<AutomatedTester> RRSAgent, make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/08/12-webdriver-minutes.html AutomatedTester
<jgraham> q+
<gsnedders> q+
<AutomatedTester> orkon: in the past I think we decided to make sure that we didn't do things that lasted more than the `performActions` call
<AutomatedTester> ack next
<AutomatedTester> jgraham: that is correct
<AutomatedTester> ... I think the issue is the opposite. there are times where we want pointer down and pointer up to happen faster than a tick to count as an gesture properly for "tap"
<AutomatedTester> ack next
<jgraham> q+
<AutomatedTester> gsnedders: this is a question of "how long do you want the event loop to spin for" which means you could wait a time here
<AutomatedTester> ack next
<AutomatedTester> jgraham: this used to work in firefox as "do an action" and then queue up it's events and then we inserted callback to make sure that the events that should happen would fire
<gsnedders> https://github.com//issues/1772 I believe is the issue orkon was referring to about multiple `performActions` calls?
<AutomatedTester> ... [explains scenario about actions with a setTImeout]
<orkon> q+
<AutomatedTester> ... and the previous spec didn't count on how we could interact with html
<AutomatedTester> gsnedders: there is a lot of "implementation defined" items here
<AutomatedTester> q?
<AutomatedTester> ack next
<yezhizhen> This do reminds me of https://github.com/servo/servo/blob/22b7b75ba42474a17ff2cabf492faae181a44e95/components/webdriver_server/actions.rs#L218-L228 in Servo
<AutomatedTester> orkon: I briefly checked chrome and it doesn't do anything around dom. It waits for the ticks to complete and move on which might not be correct.
<AutomatedTester> gsnedders: a lot of the webkit code is async which makes this a lot harder
<AutomatedTester> q?
<gsnedders> s/the webkit code/the UIKit WebKit code/
<gsnedders> (The AppKit WebKit paths are sync, which means this all works correctly on macOS.)
<orkon> present-
<AutomatedTester> RRSAgent: make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/08/12-webdriver-minutes.html AutomatedTester
fyi I've landed new tests for performActions and duration>0 where an implementation needs to dispatch multiple events. Based on the results of the added wdspec tests both Chrome and Safari only dispatch a single event.
The Browser Testing and Tools Working Group just discussed What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"?.
The full IRC log of that discussion
<AutomatedTester> Topic: What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"?
<AutomatedTester> https://github.com//issues/1970
<yezhizhen> scribe+
<RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html gsnedders
<jgraham> RRSAgent, make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html jgraham
<yezhizhen> presetn+
<yezhizhen> Github: https://github.com/w3c/webdriver-bidi/issues/1134
<gsnedders> GitHub: https://github.com//issues/1970
<yezhizhen> gsnedders: Trying to investigate a variety of issue iOS has around perform actions
<yezhizhen> . It became obvious my logic ends up with conclusion: we cannot click
<yezhizhen> There are gestures waiting to see what happens, Zoom? Click? We don't have enough DOM events emitted until the gesture is determined from OS
<jgraham> q+
<yezhizhen> Currently, Safari/iOS, many testdriver driven tests fail, because click is assumed to be done while it is not.
<yezhizhen> (Some thing related to Pointer Events proposal in interop2027
<AutomatedTester> ack next
<yezhizhen> I wonder what Firefox/Chromium way around this currently
<yezhizhen> q?
<yezhizhen> jgraham: From memory(whimboo has more idea around this). Basically, just spinning event loop enough time until everything should have happened. It will break from something more asynchronous than that
<yezhizhen> We end up with a bunch of stuff unspecified, such as batching of events
<yezhizhen> Are this related to other agenda items (dblclick? Sounds very related and very implementation defined)
<yezhizhen> Like gesture recognition, that's even harder.
<AutomatedTester> q?
<whimboo> q+
<AutomatedTester> ack next
<whimboo> In Firefox we wait for each eevnt to be dispatched when we are using the async dispatching. which includes as well the event to be emitted on the page. but this mode it not yet enabled by default for mouse and touch.
<AutomatedTester> s/In Firefox/ whimboo In Firefox/
<yezhizhen> RRSAgent, make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html yezhizhen
<AutomatedTester> q?
<whimboo> and this is for wpt tests only at the moment. We do not have a plan for async events by default in general
<yezhizhen> AutomatedTester: Sam, do you have a way forward that we can update spec accordingly?
<yezhizhen> gsnedders: No. Some problems, frankly a half broken tests in emulator. I guess I should put some tests in a PR as tentative to figure out way forward.
<yezhizhen> sadym: You mean wpt PR?
<yezhizhen> gsnedders: Yeah, tentative ones.
<gsnedders> s/Some problems, frankly a half broken tests in emulator/I had some problems getting Chrome in the Android emulator, I have some half-written tests in WPT which I was trying to use to figure out the status-quo here./
<yezhizhen> jgraham: We can continue with Sasha's item things.
Activity
gsnedders commentedon Aug 12, 2026
Kinda related: #1772
css-meeting-bot commentedon Aug 12, 2026
The Browser Testing and Tools Working Group just discussed
What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps".The full IRC log of that discussion
<AutomatedTester> topic: What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"<AutomatedTester> github: https://github.com//issues/1970
<AutomatedTester> gsnedders: I posted this a few weeks ago around the behaviours of actions on mobile
<AutomatedTester> ... there are a lot cases where waiting for a tick could lead to certain gestures never actually happening
<AutomatedTester> ... this could lead to OS interpretations of gestures not doing what the user wanted .e.g. a tap waiting for something could look like a press and hold while the other item finishes
<AutomatedTester> q?
<jgraham> q+
<AutomatedTester> ack next
<AutomatedTester> jgraham: we have talked about this before, I would need to check what firefox is doing but I think we just inject things into the event loop. The best person for this is whimboo who isnt around at the moment
<AutomatedTester> ... I expect we want to improve the spec here
<AutomatedTester> ... do you have a proposal on how to fix it
<AutomatedTester> gsnedders: not at the moment
<AutomatedTester> ... the longer asnwer is there are times when we want to wait and times we dont and it is hard to decide
<AutomatedTester> ... and this can make WPT fail en masse
<orkon> q+
<AutomatedTester> ... I would like to avoid "wait for any click or events to fire"
<AutomatedTester> ... this is around how gestures are done and none of that is really specified
<AutomatedTester> ack next
<AutomatedTester> RRSAgent, make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/08/12-webdriver-minutes.html AutomatedTester
<jgraham> q+
<gsnedders> q+
<AutomatedTester> orkon: in the past I think we decided to make sure that we didn't do things that lasted more than the `performActions` call
<AutomatedTester> ack next
<AutomatedTester> jgraham: that is correct
<AutomatedTester> ... I think the issue is the opposite. there are times where we want pointer down and pointer up to happen faster than a tick to count as an gesture properly for "tap"
<AutomatedTester> ack next
<jgraham> q+
<AutomatedTester> gsnedders: this is a question of "how long do you want the event loop to spin for" which means you could wait a time here
<AutomatedTester> ack next
<AutomatedTester> jgraham: this used to work in firefox as "do an action" and then queue up it's events and then we inserted callback to make sure that the events that should happen would fire
<gsnedders> https://github.com//issues/1772 I believe is the issue orkon was referring to about multiple `performActions` calls?
<AutomatedTester> ... [explains scenario about actions with a setTImeout]
<orkon> q+
<AutomatedTester> ... and the previous spec didn't count on how we could interact with html
<AutomatedTester> gsnedders: there is a lot of "implementation defined" items here
<AutomatedTester> q?
<AutomatedTester> ack next
<yezhizhen> This do reminds me of https://github.com/servo/servo/blob/22b7b75ba42474a17ff2cabf492faae181a44e95/components/webdriver_server/actions.rs#L218-L228 in Servo
<AutomatedTester> orkon: I briefly checked chrome and it doesn't do anything around dom. It waits for the ticks to complete and move on which might not be correct.
<AutomatedTester> gsnedders: a lot of the webkit code is async which makes this a lot harder
<AutomatedTester> q?
<gsnedders> s/the webkit code/the UIKit WebKit code/
<gsnedders> (The AppKit WebKit paths are sync, which means this all works correctly on macOS.)
<orkon> present-
<AutomatedTester> RRSAgent: make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/08/12-webdriver-minutes.html AutomatedTester
gsnedders commentedon Oct 6, 2026
Again kinda related, from Matrix:
(Tests were added in web-platform-tests/wpt@8eec594)
css-meeting-bot commentedon Oct 30, 2026
The Browser Testing and Tools Working Group just discussed
What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"?.The full IRC log of that discussion
<AutomatedTester> Topic: What counts as "the DOM events generated by the last invocation of the dispatch tick actions steps"?<AutomatedTester> https://github.com//issues/1970
<yezhizhen> scribe+
<RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html gsnedders
<jgraham> RRSAgent, make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html jgraham
<yezhizhen> presetn+
<yezhizhen> Github: https://github.com/w3c/webdriver-bidi/issues/1134
<gsnedders> GitHub: https://github.com//issues/1970
<yezhizhen> gsnedders: Trying to investigate a variety of issue iOS has around perform actions
<yezhizhen> . It became obvious my logic ends up with conclusion: we cannot click
<yezhizhen> There are gestures waiting to see what happens, Zoom? Click? We don't have enough DOM events emitted until the gesture is determined from OS
<jgraham> q+
<yezhizhen> Currently, Safari/iOS, many testdriver driven tests fail, because click is assumed to be done while it is not.
<yezhizhen> (Some thing related to Pointer Events proposal in interop2027
<AutomatedTester> ack next
<yezhizhen> I wonder what Firefox/Chromium way around this currently
<yezhizhen> q?
<yezhizhen> jgraham: From memory(whimboo has more idea around this). Basically, just spinning event loop enough time until everything should have happened. It will break from something more asynchronous than that
<yezhizhen> We end up with a bunch of stuff unspecified, such as batching of events
<yezhizhen> Are this related to other agenda items (dblclick? Sounds very related and very implementation defined)
<yezhizhen> Like gesture recognition, that's even harder.
<AutomatedTester> q?
<whimboo> q+
<AutomatedTester> ack next
<whimboo> In Firefox we wait for each eevnt to be dispatched when we are using the async dispatching. which includes as well the event to be emitted on the page. but this mode it not yet enabled by default for mouse and touch.
<AutomatedTester> s/In Firefox/ whimboo In Firefox/
<yezhizhen> RRSAgent, make minutes
<RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html yezhizhen
<AutomatedTester> q?
<whimboo> and this is for wpt tests only at the moment. We do not have a plan for async events by default in general
<yezhizhen> AutomatedTester: Sam, do you have a way forward that we can update spec accordingly?
<yezhizhen> gsnedders: No. Some problems, frankly a half broken tests in emulator. I guess I should put some tests in a PR as tentative to figure out way forward.
<yezhizhen> sadym: You mean wpt PR?
<yezhizhen> gsnedders: Yeah, tentative ones.
<gsnedders> s/Some problems, frankly a half broken tests in emulator/I had some problems getting Chrome in the Android emulator, I have some half-written tests in WPT which I was trying to use to figure out the status-quo here./
<yezhizhen> jgraham: We can continue with Sasha's item things.