Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 59e1c6227cec2f038d36d6420c893fc17398beb2
      
https://github.com/WebKit/WebKit/commit/59e1c6227cec2f038d36d6420c893fc17398beb2
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2025-11-13 (Thu, 13 Nov 2025)

  Changed paths:
    M Source/WebKit/Shared/ScrollingAccelerationCurve.cpp
    M Source/WebKit/Shared/ScrollingAccelerationCurve.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.h
    M Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp
    M Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h

  Log Message:
  -----------
  Provide a fallback scrolling acceleration curve if curve data is otherwise 
unavailable
https://bugs.webkit.org/show_bug.cgi?id=302436
rdar://164600621

Reviewed by Simon Fraser.

There are some situations where curve data may be unavailable from a
WebWheelEvent instance, for example when WKTR synthesizes a wheel event
stream. In situations like this, we would like to have momentum event
generation for (fake, or otherwise) wheel events.

To facilitate this change, we introduce a hardcoded fallback scrolling
acceleration curve. We also introduce a constexpr constructor for
ScrollingAccelerationCurve.

No change in functionality, so no new tests.

* Source/WebKit/Shared/ScrollingAccelerationCurve.cpp:
(WebKit::ScrollingAccelerationCurve::ScrollingAccelerationCurve): Deleted.

Move the constructor to ScrollingAccelerationCurve.h since it is now
constexpr.

* Source/WebKit/Shared/ScrollingAccelerationCurve.h:
(WebKit::ScrollingAccelerationCurve::ScrollingAccelerationCurve):
(WebKit::ScrollingAccelerationCurve::fallbackCurve):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.mm:
(WebKit::RemoteLayerTreeEventDispatcher::cacheWheelEventScrollingAccelerationCurve):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::cacheWheelEventScrollingAccelerationCurve):
* Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::setScrollingAccelerationCurve):
* Source/WebKit/WebProcess/WebPage/EventDispatcher.h:
* Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp:
(WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve):
* Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h:

Drive-by fix: Pass ScrollingAccelerationCurve as r-value references
instead of creating copies at call boundaries.

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



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

Reply via email to