Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4771a54c1936e9729dc7a20fca5c27894698347c
      
https://github.com/WebKit/WebKit/commit/4771a54c1936e9729dc7a20fca5c27894698347c
  Author: Pascoe <[email protected]>
  Date:   2026-04-24 (Fri, 24 Apr 2026)

  Changed paths:
    A LayoutTests/fullscreen/fullscreen-clears-hover-on-overlay-expected.txt
    A LayoutTests/fullscreen/fullscreen-clears-hover-on-overlay.html
    M Source/WebCore/dom/DocumentFullscreen.cpp
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/page/EventHandler.h

  Log Message:
  -----------
  Dispatch mouse boundary events when entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=309586
rdar://157694866

Reviewed by Aditya Keerthi.

After entering fullscreen, Chrome and Firefox dispatch pointer/mouse
boundary events for elements that were under the cursor. Safari does not,
causing JS-driven hover state to stick when sites use pointerenter/
pointerleave on a full-coverage overlay (position:absolute inset:0) to
manage hover styling — after fullscreen the overlay fills the screen, the
cursor stays inside it, and pointerleave never fires. Reduced test case
is attached to the radar.

scheduleMouseEventTargetUpdateAfterLayout does not help here: it
re-hit-tests and only fires events when the target element changes, but
the overlay is still under the cursor after fullscreen.

Add dispatchMouseBoundaryEventsAfterFullscreenChange() which dispatches
mouseout to a null target in didEnterFullscreen(), walking the ancestor
chain to fire mouseleave/pointerleave on every element. Clear the saved
mouse position so timer-based updates don't re-establish stale hover.

Not specified — the Fullscreen spec says nothing about hover or boundary
events. This aligns with Chrome and Firefox behavior.

I have verified the layout test fails without the fix, and passes with it.

* Source/WebCore/dom/DocumentFullscreen.cpp:
(WebCore::DocumentFullscreen::didEnterFullscreen):
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseBoundaryEventsAfterFullscreenChange):
* Source/WebCore/page/EventHandler.h:
* LayoutTests/fullscreen/fullscreen-clears-hover-on-overlay-expected.txt:
* LayoutTests/fullscreen/fullscreen-clears-hover-on-overlay.html:

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



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

Reply via email to