Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fb2234a1edb84a2bfee94974bda4db434291a246
      
https://github.com/WebKit/WebKit/commit/fb2234a1edb84a2bfee94974bda4db434291a246
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-01-13 (Tue, 13 Jan 2026)

  Changed paths:
    A 
LayoutTests/pointerevents/ios/hover-state-not-updated-on-layout-change-without-mouse-expected.txt
    A 
LayoutTests/pointerevents/ios/hover-state-not-updated-on-layout-change-without-mouse.html
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebCore/page/EventHandler.h
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in

  Log Message:
  -----------
  REGRESSION(300277@main): [iOS] music.apple.com: Hover effect on playlist 
rolls with scrolling
https://bugs.webkit.org/show_bug.cgi?id=304955
rdar://165386975

Reviewed by Wenson Hsieh and Lily Spiniolas.

Scrolling on sites like music.apple.com caused hover states to
inappropriately change as elements moved under the stored "mouse
position" from wheel events. This made it appear as if different items
were being "selected" while scrolling.

The regression was introduced in 300277@main, which added
updateMouseEventTargetAfterLayoutIfNeeded() to fire boundary events when
layout changes cause different elements to be under the pointer. However,
on iOS (or other touch-primary platforms), if we interact on the web
page through touch, this sets m_lastKnownMousePosition because of the
synthetic click codepath. Once set, even though there is no real pointer
to track, we trigger hover semantics (since we hit test over regular web
content).

The fix adds an early return when the last known mouse position is
sourced from touch, rather than a pointing device or wheel event
handling. This preserves correct behavior on iPads with connected
mice or trackpads while preventing inappropriate hover updates on
touch-only devices.

Test: 
pointerevents/ios/hover-state-not-updated-on-layout-change-without-mouse.html

* 
LayoutTests/pointerevents/ios/hover-state-not-updated-on-layout-change-without-mouse-expected.txt:
 Added.
* 
LayoutTests/pointerevents/ios/hover-state-not-updated-on-layout-change-without-mouse.html:
 Added.
* Source/WebCore/page/EventHandler.cpp:
(WebCore::mousePositionSource):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::handleMouseForceEvent):
(WebCore::EventHandler::updateMouseEventTargetAfterLayoutIfNeeded):
(WebCore::EventHandler::handleWheelEventInternal):
(WebCore::EventHandler::setLastKnownMousePosition):
* Source/WebCore/page/EventHandler.h:
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueWheelEventHandling):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setLastKnownMousePosition):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

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



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

Reply via email to