Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1651c7a400657b0b7d885fe0fb07d9bf869eafa0
      
https://github.com/WebKit/WebKit/commit/1651c7a400657b0b7d885fe0fb07d9bf869eafa0
  Author: Lily Spiniolas <[email protected]>
  Date:   2025-09-25 (Thu, 25 Sep 2025)

  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 
LayoutTests/imported/w3c/web-platform-tests/uievents/mouse/mousemove_after_mouseover_target_removed-expected.txt
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/page/EventHandler.h

  Log Message:
  -----------
  `mousemove` is not fired on parent of `mouseover` targets that are removed at 
`mouseover`
https://bugs.webkit.org/show_bug.cgi?id=299398
rdar://161203639

Reviewed by Abrar Rahman Protyasha.

`EventHandler::dispatchMouseEvent` calls `updateMouseEventTargetNode` which 
fires
boundary events such as `mouseover` when necessary. If a page has event 
listeners which
delete the target node when `mouseover` fires for the target node, we will 
still attempt
to dispatch a `mousemove` event to the disconnected node.

To fix this, `EventHandler::nodeWillBeRemoved` now stores the ancestor of the 
node to be
removed if the node is the current element underneath the mouse. Then, in
`EventHandler::dispatchMouseEvent`, if the override is set and the event type 
is `mousemove`,
we dispatch the event to override element instead (the parent of the removed 
element).

Tested by 
imported/w3c/web-platform-tests/pointerevents/mousemove_after_mouseover_target_removed.html

* 
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_pointer_boundary_events_after_reappending_last_over_target-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointermove_after_pointerover_target_removed.tentative-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/uievents/mouse/mousemove_after_mouseover_target_removed-expected.txt:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::nodeWillBeRemoved):
(WebCore::EventHandler::updateMouseEventTargetAfterLayoutIfNeeded):
(WebCore::EventHandler::dispatchMouseEvent):
* Source/WebCore/page/EventHandler.h:

Canonical link: https://commits.webkit.org/300522@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to