Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Interop: major browsers fire click/auxclick events differently for chorded buttons #530

Open
mustaqahmed opened this issue Nov 28, 2024 · 4 comments
Labels

Comments

@mustaqahmed
Copy link
Member

mustaqahmed commented Nov 28, 2024

Click-like events from chorded buttons differ significantly between major browsers.

Repro: https://codepen.io/mustaqahmed/full/QwLwdpq

  • Chrome fires a single click-like event, only for the first button release (click for L-release, auxclick for M-release).
  • Firefox fires two click-like events, one per button release (click for L-release, auxclick for M-release).
  • Safari fires a single click event (and never an auxclick), only for the first button release.

I know this has been discussed in #93 where we concluded that this belongs to the UIEvent spec. Things have shifted quite a bit since then: click and auxclick are now PointerEvents, and as per this years TPAC we (PEWG) should be owning this spec.

@skobes-chromium
Copy link

FYI, it looks like Safari 18.2 Beta will support auxclick (MDN, Release Notes)

@flackr
Copy link
Contributor

flackr commented Dec 4, 2024

While it's not particularly common on the web to have multi-button interactions, there are many games where it is expected that there is a stateful click-like action for each release. E.g. holding left mouse button to continue to drag while right clicking drops some amount of the held item held.

@mustaqahmed
Copy link
Member Author

One important point is that any click-like event fired before the very last button-up action has no corresponding pointerup event. This is because any button-change between the very first button-down and the very last button-up becomes a pointermove event (even though it still fires a mousedown or mouseup event), as per Sec 4.1.1.1.

So the spec needs to clarify that a click does not always have a pointerdown/up pair, regardless of which path we take for this issue (whether we fire a click-like event for the first button-release or for every button release).

aarongable pushed a commit to chromium/chromium that referenced this issue Dec 12, 2024
This CL adds a WPT for click-like events from chorded buttons, which
is currently being discussed in PEWG as an Interop problem:
  w3c/pointerevents#530

The CL also fixes a behind-a-flag crack in Chromium.  The crack
prevented firing of click-like events with the chorded buttons when
ClickToCapturedPointer is enabled.  This is because the call to
`DispatchMouseClickIfNeeded` is wrongly skipped in this case since
the `pointer_event->type()` is `kPointermove` not `kPointerup`.

Bug: 40851596
Change-Id: I11606ed8f709f08aaa2d8aba3ebaeb07f26bbc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6059955
Reviewed-by: Robert Flack <flackr@chromium.org>
Auto-Submit: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395404}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Dec 12, 2024
This CL adds a WPT for click-like events from chorded buttons, which
is currently being discussed in PEWG as an Interop problem:
  w3c/pointerevents#530

The CL also fixes a behind-a-flag crack in Chromium.  The crack
prevented firing of click-like events with the chorded buttons when
ClickToCapturedPointer is enabled.  This is because the call to
`DispatchMouseClickIfNeeded` is wrongly skipped in this case since
the `pointer_event->type()` is `kPointermove` not `kPointerup`.

Bug: 40851596
Change-Id: I11606ed8f709f08aaa2d8aba3ebaeb07f26bbc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6059955
Reviewed-by: Robert Flack <flackr@chromium.org>
Auto-Submit: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395404}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Dec 12, 2024
This CL adds a WPT for click-like events from chorded buttons, which
is currently being discussed in PEWG as an Interop problem:
  w3c/pointerevents#530

The CL also fixes a behind-a-flag crack in Chromium.  The crack
prevented firing of click-like events with the chorded buttons when
ClickToCapturedPointer is enabled.  This is because the call to
`DispatchMouseClickIfNeeded` is wrongly skipped in this case since
the `pointer_event->type()` is `kPointermove` not `kPointerup`.

Bug: 40851596
Change-Id: I11606ed8f709f08aaa2d8aba3ebaeb07f26bbc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6059955
Reviewed-by: Robert Flack <flackr@chromium.org>
Auto-Submit: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395404}
@mustaqahmed
Copy link
Member Author

We just landed a tentative WPT: pointerevent_click_on_chorded_mouse_button.tentative.html

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Dec 16, 2024
… with chorded buttons., a=testonly

Automatic update from web-platform-tests
[Interop] WPT and fix for click dispatch with chorded buttons.

This CL adds a WPT for click-like events from chorded buttons, which
is currently being discussed in PEWG as an Interop problem:
  w3c/pointerevents#530

The CL also fixes a behind-a-flag crack in Chromium.  The crack
prevented firing of click-like events with the chorded buttons when
ClickToCapturedPointer is enabled.  This is because the call to
`DispatchMouseClickIfNeeded` is wrongly skipped in this case since
the `pointer_event->type()` is `kPointermove` not `kPointerup`.

Bug: 40851596
Change-Id: I11606ed8f709f08aaa2d8aba3ebaeb07f26bbc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6059955
Reviewed-by: Robert Flack <flackr@chromium.org>
Auto-Submit: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395404}

--

wpt-commits: fae8dd06efde90fd0b43ca757b6e691e7bbe55fa
wpt-pr: 49656
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue Dec 19, 2024
… with chorded buttons., a=testonly

Automatic update from web-platform-tests
[Interop] WPT and fix for click dispatch with chorded buttons.

This CL adds a WPT for click-like events from chorded buttons, which
is currently being discussed in PEWG as an Interop problem:
  w3c/pointerevents#530

The CL also fixes a behind-a-flag crack in Chromium.  The crack
prevented firing of click-like events with the chorded buttons when
ClickToCapturedPointer is enabled.  This is because the call to
`DispatchMouseClickIfNeeded` is wrongly skipped in this case since
the `pointer_event->type()` is `kPointermove` not `kPointerup`.

Bug: 40851596
Change-Id: I11606ed8f709f08aaa2d8aba3ebaeb07f26bbc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6059955
Reviewed-by: Robert Flack <flackr@chromium.org>
Auto-Submit: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395404}

--

wpt-commits: fae8dd06efde90fd0b43ca757b6e691e7bbe55fa
wpt-pr: 49656
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants