Bug 251925 - [WPE] Compatibility mapping with mouse events use too naive target node detection
Summary: [WPE] Compatibility mapping with mouse events use too naive target node detec...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-08 09:13 PST by Bastian Krause
Modified: 2023-02-08 09:13 PST (History)
3 users (show)

See Also:


Attachments
Demo: Touch compatibility mapping with mouse events trigger on wrong element (1.70 KB, text/html)
2023-02-08 09:13 PST, Bastian Krause
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bastian Krause 2023-02-08 09:13:06 PST
Created attachment 464907 [details]
Demo: Touch compatibility mapping with mouse events trigger on wrong element

WPE sends mouse motion/down/up in PageClientImpl::doneWithTouchEvent() for touches as compatibility mapping with mouse events [1]. Instead of reusing the target node (result of the hit test) from the touch events, completely new synthetic input events are created that rely solely on the X/Y coordinates of the touch event (see TouchGestureController::EventVariant()). Since all of this happens after the touch gesture is done, the new hit test triggered by the synthetic input events can be a different target node (i.e. if the DOM changes under the touch point as a result of the touchstart event). This again can lead to events on wrong elements.

See attachment for a demo.

This also affects the contextmenu handling in https://bugs.webkit.org/show_bug.cgi?id=248076 because it imitates the click handling.


[1] https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events