Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 026e9ce21eee0759e8d061f83bc535ef9690e7ea
https://github.com/WebKit/WebKit/commit/026e9ce21eee0759e8d061f83bc535ef9690e7ea
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointer_boundary_events_after_reappending_last_over_target-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointermove_after_pointerover_target_removed.tentative-expected.txt
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/Element.h
M Source/WebCore/page/EventHandler.cpp
Log Message:
-----------
`pointermove` should not be fired on the parent of a `pointerover` target
that is removed during `pointerover`
https://bugs.webkit.org/show_bug.cgi?id=325903
rdar://188882772
Reviewed by Lily Spiniolas.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
When a `mousemove` is dispatched, `EventHandler::dispatchMouseEvent` first calls
`updateMouseEventTargetNode`, which fires boundary events such as `mouseover`
(and the
corresponding compatibility `pointerover`). If an event listener for
`pointerover` removes
the target node, `EventHandler::nodeWillBeRemoved` records the parent of the
removed node in
`m_mouseMoveTargetOverride`, and the following `mousemove` is retargeted to
that parent so
that `mousemove` is still delivered (see 300522@main).
However, the retargeted `mousemove` also dispatched a compatibility
`pointermove` on the
parent. Other engines suppress the `pointermove` entirely when the preceding
`pointerover`
removed its target, firing only `mousemove`. Match that behavior.
`Element::dispatchMouseEvent` gains a `ShouldDispatchPointerEvent` argument so
that the
retargeted `mousemove` can skip generating the compatibility pointer event
while still
dispatching the mouse event. All existing callers keep the default (dispatch
the pointer
event); only the `m_mouseMoveTargetOverride` path in
`EventHandler::dispatchMouseEvent`
passes `ShouldDispatchPointerEvent::No`.
*
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointer_boundary_events_after_reappending_last_over_target-expected.txt:
Rebaselined
*
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointermove_after_pointerover_target_removed.tentative-expected.txt:
Progression
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
* Source/WebCore/dom/Element.h:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):
Canonical link: https://commits.webkit.org/322451@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications