Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 737bafc43518490ea971c421dd5a1884a15c9c14
      
https://github.com/WebKit/WebKit/commit/737bafc43518490ea971c421dd5a1884a15c9c14
  Author: Pascoe <[email protected]>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    A LayoutTests/fast/events/pointerleave-after-ancestor-removal-expected.txt
    A LayoutTests/fast/events/pointerleave-after-ancestor-removal.html
    A LayoutTests/fullscreen/fullscreen-controls-stay-visible-expected.txt
    A LayoutTests/fullscreen/fullscreen-controls-stay-visible.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/page/EventHandler.cpp

  Log Message:
  -----------
  Dispatch boundary events when hovered element is removed from the DOM
https://bugs.webkit.org/show_bug.cgi?id=316229
rdar://177476277

Reviewed by Abrar Rahman Protyasha.

Pointer Events ยง5.1.3 (Firing events using the PointerEvent interface) states
that when the previousTarget is no longer connected, the UA must update it to
the nearest still-connected parent. WebKit was instead nulling
m_lastElementUnderMouse in nodeWillBeRemoved, causing the next mouse event to
skip boundary dispatch entirely.

This left JS-driven hover state stuck on sites like bsky.app where the video
player re-renders controls on fullscreen entry, removing the hovered button
without ever dispatching pointerleave.

The fix retargets m_lastElementUnderMouse to parentElementInComposedTree() of
the removed element when the removal is an ancestor-subtree removal (not the
element itself, which may be re-inserted by appendChild).

Tests: fast/events/pointerleave-after-ancestor-removal.html
       fullscreen/fullscreen-controls-stay-visible.html

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::nodeWillBeRemoved):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to