Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e502098485b1b7d14391b6ad8ae28dc2407e8397
      
https://github.com/WebKit/WebKit/commit/e502098485b1b7d14391b6ad8ae28dc2407e8397
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Tools/TestWebKitAPI/Helpers/cocoa/JavaScriptTypes.swift
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift

  Log Message:
  -----------
  [AppKit Gestures] Hover state can move away from the pointer during pan 
gesture driven scrolling
https://bugs.webkit.org/show_bug.cgi?id=323481
rdar://186098436

Reviewed by Richard Robinson, Pascoe, and Wenson Hsieh.

A wheel event carries a "last known mouse" position because, for a
physical scroll wheel or trackpad, that position is the pointer's, and
is used to drive cursor updates, hover state, boundary events, etc. This
does not hold for wheel events synthesized from gestures, though. In
that case, we want to skip writing the last known mouse position when
the input source is not user-driven. Note that we apply this mitigation
in two places depending on whether the web content has wheel event
listeners.

The dissonance described above became easier to hit after 300277@main
added updateMouseEventTargetAfterLayoutIfNeeded(), which samples the
same position on a timer for as long as layout keeps changing, but the
general symptom _is_ long-standing behavior (courtesy of the "fake mouse
move event dispatch" path).

To facilitate testing, we add the boundary event types to DOMEventType
so tests can observe them.

Test:
- AppKitGesturesTests.Basic/scrollEndingOnHoverTargetDoesNotActivateIt
- AppKitGesturesTests.Basic/scrollBeginningOnHoverTargetDoesNotActivateIt
- AppKitGesturesTests.Basic/scrollDoesNotMoveHoverWhileCursorRests

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::shouldUpdateAutoscroll):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleWheelEvent):
* Tools/TestWebKitAPI/Helpers/cocoa/JavaScriptTypes.swift:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift:

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



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

Reply via email to