Skip to content

Clarify how the double click tracking should work in the actions #1772

Open

Description

@lutien

At the moment, the spec doesn't specify how the double (or triple click, etc.) tracking should work in the actions. For example, it's not clear, if it should be possible to simulate a double click event by sending two separate commands with individual clicks.

Activity

  1. css-meeting-bot commented on Feb 12, 2025

    @css-meeting-bot
    Member

    The Browser Testing and Tools Working Group just discussed Clarify how the double (triple) click tracking should work in the actions.

    The full IRC log of that discussion <AutomatedTester> topic: Clarify how the double (triple) click tracking should work in the actions
    <AutomatedTester> github: https://github.com//issues/1772
    <AutomatedTester> whimboo: this is another issue for actions. I have been checking different frameworks
    <AutomatedTester> ... and they do things different ways for solving this e.g. in same chain or different chains
    <jgraham> q+
    <jimevans> q+
    <AutomatedTester> ... so we should solve this to only allow in chain or not especially since separate chains could be tricky to see what people mean
    <AutomatedTester> ack next
    <sadym> q+
    <simons> q+
    <jimevans> q-
    <AutomatedTester> jgraham: do we know what existing implementations are doing here? if I were building this this myself it would be in the same chain especially around network latency
    <orkon> q+
    <AutomatedTester> ... I am happy for state to be cancelled at the end of the chain but that might require client changes and that would be problematic
    <AutomatedTester> ack next
    <AutomatedTester> sadym: there is a potential if the user wants to do 2 single clicks. THey will have to wait a certain time accoridng to the OS
    <AutomatedTester> ... so we need to be aware of how that plays out
    <AutomatedTester> q?
    <AutomatedTester> ack next
    <AutomatedTester> simons: I think most clients would do the right thing here in a single chain. I quite like jgraham's suggestion here of cancelling state at the end of the chain
    <AutomatedTester> ack next
    <jgraham> (I should say I don't know how easy that is to implement)
    <jgraham> q+
    <AutomatedTester> orkon: how would we specify this behaviour in the spec? Do we want to improve how events are specified?
    <AutomatedTester> ack next
    <orkon> q+
    <whimboo> q+
    <AutomatedTester> jgraham: from the spec point of view. It is quite reasonable for the event must not have the double click attr have it set unless it's part of the action chain and the previous item was a pointer down?
    <AutomatedTester> q?
    <AutomatedTester> ack next
    <AutomatedTester> orkon: I think the complexity is from there being a new event not just another click
    <AutomatedTester> ... and it can be challenging for the event to be doing the right order
    <AutomatedTester> ... if we don't have a "it must not have" we are making our own rules here
    <AutomatedTester> q?
    <AutomatedTester> ack next
    <AutomatedTester> whimboo: one more comment to jgraham is that it's not only related to the time but it's also about the location of the mouse. E.g. a click, move 1 px, click won't be seen as double click even if it takes the same time as click, click
    <AutomatedTester> q?
    <AutomatedTester> consensus: we are going to have double clicks in a single chain and clear state at the end of the chain. Also need to check if this might break clients
  2. whimboo commented on Apr 14, 2025

    @whimboo
    Contributor

    The consensus of the W3C meeting as minuted in the last comment was:

    consensus: we are going to have double clicks in a single chain and clear state at the end of the chain. Also need to check if this might break clients

  3. OrKoN commented on Aug 29, 2025

    @OrKoN
    Contributor

    I think one use case that we did not discuss is:

    1. Trigger mousedown.
    2. Evaluate a script to check the element is correctly reacting to mousedown.
    3. Trigger mouseup.
    4. Assert that the click is dispatched on the element.

    I think this would not be possible right now because mousedown and mouseup are required to be in the same action chain?

    P.S. I cannot recall if we discussed it so bringing it up just in case. I think we discussed double clicks and triple clicks specifically but I wonder if single clicks across action chains would also be affected?

  4. whimboo commented on Aug 29, 2025

    @whimboo
    Contributor

    If we clear the input state at the end of the action chain as mentioned in the meeting notes we would certainly release the mouse button before the evaluate script will run. It also means the click will be emitted before the evaluation, which might not be expected.

    It might be good to get some wpt tests added to see which of these scenarios might not work so that we may have to change our decision.

  5. OrKoN commented on Aug 29, 2025

    @OrKoN
    Contributor

    I think that might be fine to release dbl clicks and triple clicks in the end of the chain but it sounds like doing the same for other events might be breaking and unexpected. Would it also apply to key down events? That would basically mean that there is no way to only trigger a mouse down/key down event in isolation? That would probably be fine but since you also cannot inspect the state in between actions, how can one test that the site responds correctly to mousedown/keydown?

  6. deleted a comment from css-meeting-bot on Jan 14, 2026
  7. css-meeting-bot commented on Jan 14, 2026

    @css-meeting-bot
    Member

    The Browser Testing and Tools Working Group just discussed Multiple click events (e.g. double/triple click).

    The full IRC log of that discussion <tidoust> Topic: Multiple click events (e.g. double/triple click)
    <jgraham> github: https://github.com//issues/1772
    <tidoust> Sacha: The point which wasn't addressed yet is that some clients will still want to genere double cllicks or triple clicks with different action chains, maybe because they need to run some script in between.
    <jgraham> q+
    <jgraham> ack next
    <tidoust> jgraham: The way it works at the moment is that it's left at the implementation to define what double-click or triple-click means.
    <tidoust> ... Gecko more or less uses a timer and if the events happen within that timer, they get counted as double clicks and so on.
    <tidoust> ... Relying on internal timers is a bit difficult because it makes things undeterministic.
    <tidoust> ... If you split across action chains, latency comes into play as well.
    <tidoust> ... It has also seemed logical to me that things needed to be within the same action chain to be counted together.
    <tidoust> ... However, some use cases involve starting a click, running an event handler, and then continuing with the rest of the click.
    <orkon> q+
    <tidoust> ... One option is to have a specific clickCount property.
    <tidoust> ... We could have some sort of sequence identifier to relate actions together.
    <tidoust> ... to increment clickCount when actions are part of the same sequence.
    <shs> q+
    <tidoust> ... But then the question is whether the timer still runs in that case. E.g., if the same sequence is used 30s apart?
    <jgraham> ack next
    <shs> q-
    <tidoust> orkon: I think if we're doing double click based on the action chain, that's fine. After an action chain is dispatched, you released all the actions, says the proposal.
    <jgraham> q+
    <tidoust> ... If the event chain causes things to be released, would scenarios that involve checking on mouseup following mousedown still work?
    <jgraham> ack next
    <tidoust> jgraham: I don't think it makes sense to release all the events at the end of the action chain.
    <gsnedders> q+ to ask about devices without mouse input
    <orkon> q+
    <tidoust> ... I think they should just not be able to merge as part of a single click if they're not part of the same action chain.
    <sasha> q+
    <tidoust> ... Something may come from how Playwright handles it.
    <jgraham> ack next
    <Zakim> gsnedders, you wanted to ask about devices without mouse input
    <orkon> q-
    <tidoust> s/Sacha/Sasha/
    <tidoust> gsnedders: Wondering about what it means for devices without mouse input types
    <jgraham> ack next
    <orkon> q+
    <tidoust> ... Maybe the answer is simple.
    <tidoust> sasha: I just wanted to address Alex comment about resetting the chain. What Hendrik meant was for the double-click only. Related to our implementation. By the end of the action, we would not expect a double-click coming. That would not be for all events.
    <tidoust> ... For Playwright, for them they want to generate a double click with two clicks using two different actions. They use clickCount in CDP for that. They don't necessarily do anything in between these two chains.
    <jgraham> q+
    <tidoust> ... Sequences are more flexible. They open the question on how to validate that they still make sense.
    <jgraham> ack next
    <tidoust> orkon: Making it possible to double click with two clicks is probably not a good idea, we used to have it in Puppeteer. Splitting things across chains is also not super consistent.
    <tidoust> ... You can one mousedown in one chain with script evaluation. And then mouseup and click in another action chain.
    <tidoust> ... It's not timer based in that case.
    <jgraham> ack next
    <sasha> q+
    <tidoust> ... There's some inconsistency although we can perhaps live with it.
    <tidoust> jgraham: For devices without mouse input, unsupported operation seems a good answer. Double tap is still doable there.
    <tidoust> ... Sequence ids are more flexible, but there is still the question of the timer.
    <shs> q+
    <tidoust> ... Timer seems not ideal but it wouldn't be ideal to drop it as well. If there's no timer, should there be something to cancel the sequence?
    <tidoust> ... Should a set of pointer actions cancel the sequence?
    <jgraham> ack next
    <tidoust> sasha: I wanted to comment on what Alex was saying on consistency
    <shs> q-
    <tidoust> ... The whole issue started with trying to understand how it works for different browsers and specify something.
    <tidoust> ... Nothing specifies it in the current spec.
    <tidoust> ... The main point is to specify something that is consistent across browsers that would allow clients to simulate double or triple clicks consistently.
    <shs> q+
    <tidoust> ... If implementations are different but the specification still allows that, that seems fine.
    <jgraham> ack next
    <tidoust> shs: It seems like the only way to do that reliably is to have all actions in the same action chain. Otherwise, not only will you hit timer issues, but also you may end up with timing issues with the underlying system.
    <tidoust> ... These cannot be spec-ced out cleanly.
    <tidoust> ... It may be that we want to be able to add as part of a single action chain. We mentioned scroll into view.
    <jgraham> q+
    <tidoust> ... Related to operations that we may want to do as part of an action chain.
    <jgraham> ack next
    <tidoust> jgraham: The simplest approach is to say that by default mulitple click events that happen as part of the same actions chain increase the click count unless something causes delay as part of the actions.
    <tidoust> ... That's the least that I know how to specify. It covers the simple cases, and then we can work increasingly from there.
    <tidoust> ... My concern is incompatible changes.
    <tidoust> ... For the time being, people may rely on timers to trigger double or triple clicks, and that would break.
    <tidoust> ... But then the alternative would be to say that the timer is implementation-defined, which does not seem a good thing either.
    <sasha> q+
    <jgraham> ack next
    <jgraham> q+
    <tidoust> sasha: If we would find some kind of different solutions to simulate double clicks consistently, implementations could converge to them over time and we would have a transition path.
    <jgraham> ack next
    <orkon> q+
    <tidoust> jgraham: It would be possible to opt-in in a couple of ways.
    <tidoust> ... You could add a property on specific events. But I guess that we would things to work like this in general.
    <tidoust> ... Opting in for deterministic behavior seems doable in any case.
    <jgraham> You could also opt in on a performActions call
    <jgraham> ack next
    <tidoust> orkon: Just to confirm that we still want mousedown and mouseup as part of different action chains to trigger a single click.
    <jgraham> q+
    <tidoust> ... I imagine scenarios where you have mousedown in an actions chain, then mouseup, mousedown, mouseup in the next one.
    <jgraham> ack next
    <tidoust> ... Should that trigger a double click or not?
    <tidoust> jgraham: I guess click isn't on a timer at the momen. At least, I don't think Gecko has a timer.
    <tidoust> s/momen/moment
    <tidoust> ... If there is no timer, it seems easier to say that it can persist across action chains.
    <tidoust> ... But I actually do not know.
    <AutomatedTester> q?
    <sasha> q+
    <AutomatedTester> ack next
    <tidoust> sasha: To summarize, that's how I imagined it, that we would keep the current behavior but would add a more deterministic way to also do double and triple clicks.
    <tidoust> jgraham: I'm not immediately seeing what part of the DOM API to attach timestamps to.
    <tidoust> ... Is long press reflected in the DOM API somehow? Do you have to implement it by hand?
    <tidoust> orkon: I think it's a timer you can measure by yourself.
    <tidoust> jgraham: That seems ok. We don't have to care if we don't have to measure time by ourselves.
    <tidoust> ... If you try and do mousedown, mouseup, mousedown, mouseup split in different action chains, it probably doesn't trigger a double click.
    <tidoust> gsnedders: There were some tests on Pointer Events along those lines.
    <tidoust> jgraham: We should look at that.
    <gsnedders> s/on Pointer Events/in the Interop Pointer Events focus area/
    <tidoust> ... Sometimes, I've been wondering whether they were doing silly things or whether we were misusing the TestDriver API.
  8. lutien commented on Oct 13, 2026

    @lutien
    MemberAuthor

    So I think we came to an agreement that generally click sequences in the different action chains shouldn't generate a double/triple click to avoid flakiness. But we know that some clients still want to have a way to do that. CDP uses clickCount for this purpose, but as we discussed the last time, it opens many questions about how it should be handled in case clickCount is wrong in some way (e.g., there is only one action chain with clickCount=2). The alternative proposal was to introduce something like sequenceId to indicate that different pointer action chains are part of the same click sequence. That would allow browsers to still make the final decision about setting the right clickCount.
    Some questions to discuss here if the proposal sounds good:

    • How the input.releaseActions should behave? (Probably reset the count for the sequence)
    • What if there was a pointerMove action as a part of the same sequence? (Most likely should reset the double/triple click sequence.)
    • Should we still have some reasonable timeout so that after 3 hours we cannot continue the same sequence?
  9. css-meeting-bot commented on Oct 30, 2026

    @css-meeting-bot
    Member

    The Browser Testing and Tools Working Group just discussed double/triple clicks in action chains.

    The full IRC log of that discussion <AutomatedTester> topic: double/triple clicks in action chains
    <AutomatedTester> github: https://github.com//issues/1772
    <yezhizhen> Github: https://github.com//issues/1772
    <yezhizhen> jgraham: A special case of previous discussion.
    <yezhizhen> double/triple click is impl defined. If you send specific action sequence, as long as Pointer Events fit the heuristics of the particular engine, you will get the corresponding events. Not guaranteed.
    <yezhizhen> Some clients want to send click, run scripts, then send click again, which hope to be counted as dblclick. That is not reliable!
    <yezhizhen> We try to model something closer to user input.
    <yezhizhen> Not clear in many ways to standardize this. So many combinations with intermediate event states unclear in different browsers.
    <yezhizhen> Also release action. Should we just clear states?
    <yezhizhen> q?
    <jgraham> q+ gesndders
    <AutomatedTester> ack next
    <yezhizhen> gsnedders: On macOS, WebKit has no logic about whether something dblclicked or not.
    <yezhizhen> This is handled by AppleKit(?)
    <jgraham> s/AppleKit(?)/AppKit/
    <yezhizhen> It is handled by platform. We could expose platform capability.
    <AutomatedTester> q?
    <jgraham> q+
    <yezhizhen> AutomatedTester: How WebKit speak to AppKit about common click/dblclick?
    <yezhizhen> gsnedders: Action goes directly into AppKit. There's nothing in WebKit related(not sure).
    <hbenl> q+
    <yezhizhen> We run WebKit stuff, wait for notification such as mousemove etc. and triggers rest of this.
    <AutomatedTester> ack next
    <jdescottes> q+
    <yezhizhen> Kinda fuzzy. I could be run.
    <RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html gsnedders
    <yezhizhen> jgraham: Leave heuristics to the platform, the only possible solution to handle Pinch Zoom etc is a pity.
    <yezhizhen> Might be the best we can do. Make it harder to write cross-platform tests.
    <yezhizhen> Question is use case: how do we handle the fact people want to run scripts in the middle of action change.
    <hbenl> q-
    <yezhizhen> Similar to screenshot discussed morning: do we continue with same state, or reset state?
    <jdescottes> q-
    <yezhizhen> Obvious thing: Make script execution part of action.
    <hbenl> q+
    <gsnedders> q+
    <yezhizhen> Can still be wrong to distinguish between action chain. Anything mixed in between?
    <AutomatedTester> q?
    <AutomatedTester> ack next
    <yezhizhen> hbenl: Context here: reason this came up is PlayWright. Not so much about script between actions. It's designed protocol independently, not allowed to say "dblclick". Only allowed to say click, click.
    <yezhizhen> AutomatedTester: Client side ask for dblclick. But you only get click, click.
    <yezhizhen> hbenl: They need change internal API.
    <sadym> q+
    <AutomatedTester> q+
    <AutomatedTester> ack next
    <yezhizhen> ack next
    <jgraham> q++ sadym
    <jgraham> q-+
    <yezhizhen> gsnedder: That's really helpful!
    <AutomatedTester> ack sadym
    <gsnedders> s/snedder: That's really helpful!/gsnedders: I think jgraham's suggestion to put script execution as part of the action sequence is a good option, because it makes it explicit and part of the same command./
    <yezhizhen> sadym: Back to GitHub issue again. Small move, big move, different outcomes.
    <yezhizhen> Regarding dblclick, in chomedriver: we keep state, calculate amount of clicks and reset based on mousemove.
    <yezhizhen> Emulate dbl/triple click based on that.
    <AutomatedTester> ack next
    <sadym> s/based on mousemove/based on mousemove and input.releaseActions/
    <yezhizhen> AutomatedTester: Question for Holger. Most concern is internal API for Playwright. Curious Selenium/Webdriver version.
    <yezhizhen> hbenl: Pretty sure it could. But not a trivial change to their internal API.
    <gsnedders> q+ to ask whether we just want to pass a flag to perform actions to not wait for events
    <yezhizhen> AutomatedTester: How to ensure to support a project while not breaking another object
    <yezhizhen> s/object/project
    <jgraham> q+
    <AutomatedTester> ack next
    <Zakim> gsnedders, you wanted to ask whether we just want to pass a flag to perform actions to not wait for events
    <yezhizhen> gsnedder: Minimal spec change: to update flag to perform actions, make it not wait dbl event.
    <yezhizhen> Then would be possible clicks in multiple actions without timeout. Not sure.
    <yezhizhen> hbenl: Would work for Playwright. First click, pass a flag: there's more coming.
    <yezhizhen> gsnedder: There's challenge for Playwright.
    <sadym> q+
    <yezhizhen> hbenl: Sounds small change to Playwright. I can accept that.
    <yezhizhen> gsnedder: Dblclick is simple. Something about perform scroll.
    <yezhizhen> jgraham: My PoV, don't reset click count between action chains would be enough.
    <AutomatedTester> ack next
    <yezhizhen> Might need some heuristics to figure out. Playwright architecture not well set up is not strong argument. If we do have people want to run script between clicks.
    <yezhizhen> Maybe Holger, we can have specific vendor flag in Playwright.
    <AutomatedTester> ack next
    <jgraham> s/Playwright/gecko/
    <jimevans> q+
    <AutomatedTester> ack next
    <yezhizhen> sadym: Wonder how Playwright works with cdp in terms of click/dblclick dynamic. Does anyone know?
    <jgraham> RRSAgent, make minutes
    <gsnedders> Oh, we do actually have custom code for automation sessions for macOS in WebKit, rather than relying on AppKit in that case.
    <RRSAgent> I have made the request to generate https://www.w3.org/2026/10/30-webdriver-minutes.html jgraham
    <gsnedders> s/gsnedder:/gsnedders:/g
    <yezhizhen> jimevans: All user interaction code is done through script(preload-script), which I remember sometimes ago.
    <yezhizhen> All UI manipulation code is done through script.
    <AutomatedTester> q?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions