Bug 251925

Summary: [WPE] Compatibility mapping with mouse events use too naive target node detection
Product: WebKit Reporter: Bastian Krause <bst>
Component: WPE WebKitAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, cgarcia, zdobersek
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=248076
Attachments:
Description Flags
Demo: Touch compatibility mapping with mouse events trigger on wrong element none

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