Bug 311544
| Summary: | [WPE][GTK] preventDefault() on pointerdown does not suppress gesture-based compatibility mouse events from touch | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | klee |
| Component: | WPE WebKit | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
klee
On WPE (and likely GTK), calling preventDefault() on a pointerdown event does not suppress compatibility mouse events generated from touch input.
After every touch tap, mouse emulation events (pointerId=1, pointerType=mouse) are fired at the same coordinates regardless of whether pointerdown was cancelled.
Per the W3C Pointer Events spec (https://w3c.github.io/pointerevents/#compatibility-mapping-with-mouse-events):
"Authors can prevent the production of certain compatibility mouse events by canceling the pointerdown event."
"Mouse events can only be prevented when the pointer is down. Hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse events prevented."
- Test case:
document.documentElement.addEventListener("pointerdown", (e) => {
e.preventDefault();
}, true);
- How to reproduce:
1. Create a page with a pointerdown handler that calls e.preventDefault()
2. Load it in WPE browser with touch input
3. Tap the screen
- Expected Result:
- pointerdown (touch) fires, app calls preventDefault()
- No compatibility mouse events should follow
- Actual Result:
- pointerdown (touch) fires, app calls preventDefault()
- pointermove/pointerover with pointerId=1, pointerType=***mouse*** fires ~1ms later
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
klee
Pull request: https://github.com/WebKit/WebKit/pull/62097
EWS
Committed 310827@main (45f6219e113d): <https://commits.webkit.org/310827@main>
Reviewed commits have been landed. Closing PR #62097 and removing active labels.