Title: [285375] trunk/Source
Revision
285375
Author
[email protected]
Date
2021-11-06 12:43:54 -0700 (Sat, 06 Nov 2021)

Log Message

WheelEventDeltaFilter::shouldApplyFilteringForEvent can be a static function
https://bugs.webkit.org/show_bug.cgi?id=232786

Reviewed by Wenson Hsieh.
Source/WebCore:

This function just looks at event phase. It can be static.

* page/EventHandler.cpp:
(WebCore::EventHandler::defaultWheelEventHandler):
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::shouldApplyFilteringForEvent):
(WebCore::WheelEventDeltaFilter::shouldApplyFilteringForEvent const): Deleted.
* page/WheelEventDeltaFilter.h:

Source/WebKit:

This function just looks at event phase. It can be static.

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285374 => 285375)


--- trunk/Source/WebCore/ChangeLog	2021-11-06 19:41:20 UTC (rev 285374)
+++ trunk/Source/WebCore/ChangeLog	2021-11-06 19:43:54 UTC (rev 285375)
@@ -1,3 +1,19 @@
+2021-11-06  Simon Fraser  <[email protected]>
+
+        WheelEventDeltaFilter::shouldApplyFilteringForEvent can be a static function
+        https://bugs.webkit.org/show_bug.cgi?id=232786
+
+        Reviewed by Wenson Hsieh.
+
+        This function just looks at event phase. It can be static.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::defaultWheelEventHandler):
+        * page/WheelEventDeltaFilter.cpp:
+        (WebCore::WheelEventDeltaFilter::shouldApplyFilteringForEvent):
+        (WebCore::WheelEventDeltaFilter::shouldApplyFilteringForEvent const): Deleted.
+        * page/WheelEventDeltaFilter.h:
+
 2021-11-06  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] Process all replacement, control and opaque inline items.

Modified: trunk/Source/WebCore/page/EventHandler.cpp (285374 => 285375)


--- trunk/Source/WebCore/page/EventHandler.cpp	2021-11-06 19:41:20 UTC (rev 285374)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2021-11-06 19:43:54 UTC (rev 285375)
@@ -3175,7 +3175,7 @@
         eventHandling.add(EventHandling::DefaultPrevented);
 
     auto* deltaFilter = m_frame.page()->wheelEventDeltaFilter();
-    if (platformEvent && deltaFilter && deltaFilter->shouldApplyFilteringForEvent(*platformEvent)) {
+    if (platformEvent && deltaFilter && WheelEventDeltaFilter::shouldApplyFilteringForEvent(*platformEvent)) {
         filteredPlatformDelta = deltaFilter->filteredDelta();
         filteredVelocity = deltaFilter->filteredVelocity();
     }

Modified: trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp (285374 => 285375)


--- trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp	2021-11-06 19:41:20 UTC (rev 285374)
+++ trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp	2021-11-06 19:43:54 UTC (rev 285375)
@@ -50,7 +50,7 @@
 #endif
 }
 
-bool WheelEventDeltaFilter::shouldApplyFilteringForEvent(const PlatformWheelEvent& event) const
+bool WheelEventDeltaFilter::shouldApplyFilteringForEvent(const PlatformWheelEvent& event)
 {
 #if ENABLE(KINETIC_SCROLLING)
     // Maybe it's a per-platform decision about which event phases get filtered. Ideally we'd filter momentum events too (but that breaks some diagonal scrolling cases).

Modified: trunk/Source/WebCore/page/WheelEventDeltaFilter.h (285374 => 285375)


--- trunk/Source/WebCore/page/WheelEventDeltaFilter.h	2021-11-06 19:41:20 UTC (rev 285374)
+++ trunk/Source/WebCore/page/WheelEventDeltaFilter.h	2021-11-06 19:43:54 UTC (rev 285375)
@@ -42,12 +42,13 @@
 
     WEBCORE_EXPORT virtual void updateFromEvent(const PlatformWheelEvent&) = 0;
 
-    WEBCORE_EXPORT bool shouldApplyFilteringForEvent(const PlatformWheelEvent&) const;
     WEBCORE_EXPORT PlatformWheelEvent eventCopyWithFilteredDeltas(const PlatformWheelEvent&) const;
 
     WEBCORE_EXPORT FloatSize filteredVelocity() const;
     WEBCORE_EXPORT FloatSize filteredDelta() const;
 
+    WEBCORE_EXPORT static bool shouldApplyFilteringForEvent(const PlatformWheelEvent&);
+
 protected:
     FloatSize m_currentFilteredDelta;
     FloatSize m_currentFilteredVelocity;

Modified: trunk/Source/WebKit/ChangeLog (285374 => 285375)


--- trunk/Source/WebKit/ChangeLog	2021-11-06 19:41:20 UTC (rev 285374)
+++ trunk/Source/WebKit/ChangeLog	2021-11-06 19:43:54 UTC (rev 285375)
@@ -1,3 +1,15 @@
+2021-11-06  Simon Fraser  <[email protected]>
+
+        WheelEventDeltaFilter::shouldApplyFilteringForEvent can be a static function
+        https://bugs.webkit.org/show_bug.cgi?id=232786
+
+        Reviewed by Wenson Hsieh.
+        
+        This function just looks at event phase. It can be static.
+
+        * WebProcess/WebPage/EventDispatcher.cpp:
+        (WebKit::EventDispatcher::wheelEvent):
+
 2021-11-05  Simon Fraser  <[email protected]>
 
         Simplify code that makes use of WheelEventDeltaFilter

Modified: trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp (285374 => 285375)


--- trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp	2021-11-06 19:41:20 UTC (rev 285374)
+++ trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp	2021-11-06 19:43:54 UTC (rev 285375)
@@ -104,7 +104,7 @@
         auto platformWheelEvent = platform(wheelEvent);
 #if PLATFORM(COCOA)
         m_recentWheelEventDeltaFilter->updateFromEvent(platformWheelEvent);
-        if (m_recentWheelEventDeltaFilter->shouldApplyFilteringForEvent(platformWheelEvent))
+        if (WheelEventDeltaFilter::shouldApplyFilteringForEvent(platformWheelEvent))
             platformWheelEvent = m_recentWheelEventDeltaFilter->eventCopyWithFilteredDeltas(platformWheelEvent);
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to