Changeset 285526 in webkit
- Timestamp:
- Nov 9, 2021, 1:06:00 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/Scripts/Preferences/WebPreferencesInternal.yaml (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (modified) (3 diffs)
-
WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (modified) (2 diffs)
-
WebCore/page/scrolling/ScrollingStateNode.h (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTree.cpp (modified) (3 diffs)
-
WebCore/page/scrolling/ScrollingTree.h (modified) (2 diffs)
-
WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTreeScrollingNode.h (modified) (1 diff)
-
WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h (modified) (1 diff)
-
WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (modified) (1 diff)
-
WebCore/platform/ScrollingEffectsController.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r285521 r285526 1 2021-11-09 Tim Horton <timothy_horton@apple.com> 2 3 Add runtime flag for momentum scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=232898 5 <rdar://problem/85211338> 6 7 Reviewed by Simon Fraser. 8 9 * Scripts/Preferences/WebPreferencesInternal.yaml: 10 Add the preference. 11 1 12 2021-11-09 Devin Rousso <drousso@apple.com> 2 13 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml
r285259 r285526 537 537 default: false 538 538 539 MomentumScrollingAnimatorEnabled: 540 type: bool 541 humanReadableName: "Momentum Scrolling Animator" 542 humanReadableDescription: "Drive momentum scrolling via an internal animator instead of using momentum events" 543 defaultValue: 544 WebKitLegacy: 545 "PLATFORM(MAC)": true 546 default: false 547 WebKit: 548 "PLATFORM(MAC)": true 549 default: false 550 WebCore: 551 "PLATFORM(MAC)": true 552 default: false 553 539 554 MouseEventsSimulationEnabled: 540 555 type: bool -
trunk/Source/WebCore/ChangeLog
r285524 r285526 1 2021-11-09 Tim Horton <timothy_horton@apple.com> 2 3 Add runtime flag for momentum scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=232898 5 <rdar://problem/85211338> 6 7 Reviewed by Simon Fraser. 8 9 * page/scrolling/AsyncScrollingCoordinator.cpp: 10 (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): 11 * page/scrolling/ScrollingStateFrameScrollingNode.cpp: 12 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): 13 (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const): 14 (WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled): 15 * page/scrolling/ScrollingStateFrameScrollingNode.h: 16 * page/scrolling/ScrollingStateNode.h: 17 * page/scrolling/ScrollingTree.cpp: 18 (WebCore::ScrollingTree::commitTreeState): 19 * page/scrolling/ScrollingTree.h: 20 (WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const): 21 (WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled): 22 * page/scrolling/ScrollingTreeScrollingNode.cpp: 23 (WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const): 24 * page/scrolling/ScrollingTreeScrollingNode.h: 25 * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: 26 * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: 27 (WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const): 28 * platform/ScrollingEffectsController.h: 29 (WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const): 30 1 31 2021-11-09 Don Olmstead <don.olmstead@sony.com> 2 32 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r285316 r285526 747 747 frameScrollingNode.setScrollingPerformanceTestingEnabled(settings.scrollingPerformanceTestingEnabled()); 748 748 frameScrollingNode.setWheelEventGesturesBecomeNonBlocking(settings.wheelEventGesturesBecomeNonBlocking()); 749 frameScrollingNode.setMomentumScrollingAnimatorEnabled(settings.momentumScrollingAnimatorEnabled()); 749 750 750 751 frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin()); -
trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
r284534 r285526 62 62 , m_wheelEventGesturesBecomeNonBlocking(stateNode.wheelEventGesturesBecomeNonBlocking()) 63 63 , m_scrollingPerformanceTestingEnabled(stateNode.scrollingPerformanceTestingEnabled()) 64 , m_momentumScrollingAnimatorEnabled(stateNode.momentumScrollingAnimatorEnabled()) 64 65 { 65 66 if (hasChangedProperty(Property::RootContentsLayer)) … … 113 114 Property::MaxLayoutViewportOrigin, 114 115 Property::OverrideVisualViewportSize, 116 Property::MomentumScrollingAnimatorEnabled, 115 117 }; 116 118 … … 308 310 m_scrollingPerformanceTestingEnabled = enabled; 309 311 setPropertyChanged(Property::ScrollingPerformanceTestingEnabled); 312 } 313 314 void ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled(bool enabled) 315 { 316 if (enabled == m_momentumScrollingAnimatorEnabled) 317 return; 318 319 m_momentumScrollingAnimatorEnabled = enabled; 320 setPropertyChanged(Property::MomentumScrollingAnimatorEnabled); 310 321 } 311 322 -
trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
r284534 r285526 118 118 WEBCORE_EXPORT void setWheelEventGesturesBecomeNonBlocking(bool); 119 119 120 bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; } 121 WEBCORE_EXPORT void setMomentumScrollingAnimatorEnabled(bool); 122 120 123 void dumpProperties(WTF::TextStream&, OptionSet<ScrollingStateTreeAsTextBehavior>) const override; 121 124 … … 150 153 bool m_wheelEventGesturesBecomeNonBlocking { false }; 151 154 bool m_scrollingPerformanceTestingEnabled { false }; 155 bool m_momentumScrollingAnimatorEnabled { false }; 152 156 }; 153 157 -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r284534 r285526 256 256 VisualViewportIsSmallerThanLayoutViewport = 1LLU << 32, 257 257 AsyncFrameOrOverflowScrollingEnabled = 1LLU << 33, 258 WheelEventGesturesBecomeNonBlocking = 1LLU << 34, 259 ScrollingPerformanceTestingEnabled = 1LLU << 35, 260 LayoutViewport = 1LLU << 36, 261 MinLayoutViewportOrigin = 1LLU << 37, 262 MaxLayoutViewportOrigin = 1LLU << 38, 263 OverrideVisualViewportSize = 1LLU << 39, 258 MomentumScrollingAnimatorEnabled = 1LLU << 34, 259 WheelEventGesturesBecomeNonBlocking = 1LLU << 35, 260 ScrollingPerformanceTestingEnabled = 1LLU << 36, 261 LayoutViewport = 1LLU << 37, 262 MinLayoutViewportOrigin = 1LLU << 38, 263 MaxLayoutViewportOrigin = 1LLU << 39, 264 OverrideVisualViewportSize = 1LLU << 40, 264 265 // ScrollingStatePositionedNode 265 RelatedOverflowScrollingNodes = 1LLU << 4 0,266 LayoutConstraintData = 1LLU << 4 1,266 RelatedOverflowScrollingNodes = 1LLU << 41, 267 LayoutConstraintData = 1LLU << 42, 267 268 // ScrollingStateFixedNode, ScrollingStateStickyNode 268 ViewportConstraints = 1LLU << 4 2,269 ViewportConstraints = 1LLU << 43, 269 270 // ScrollingStateOverflowScrollProxyNode 270 OverflowScrollingNode = 1LLU << 4 3,271 OverflowScrollingNode = 1LLU << 44, 271 272 }; 272 273 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r285094 r285526 280 280 || rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking) 281 281 || rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled) 282 || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))) { 282 || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents) 283 || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled))) { 283 284 Locker locker { m_treeStateLock }; 284 285 … … 300 301 if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents)) 301 302 m_isMonitoringWheelEvents = scrollingStateTree->rootStateNode()->isMonitoringWheelEvents(); 303 304 if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled)) 305 m_momentumScrollingAnimatorEnabled = scrollingStateTree->rootStateNode()->momentumScrollingAnimatorEnabled(); 302 306 } 303 307 … … 321 325 node->willBeDestroyed(); 322 326 } 327 328 if (rootNode && (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled))) 329 RELEASE_LOG(Scrolling, "ScrollingTree momentum scrolling animator enabled: %d", rootNode->momentumScrollingAnimatorEnabled()); 323 330 324 331 didCommitTree(); -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r285094 r285526 101 101 void setScrollingPerformanceTestingEnabled(bool value) { m_scrollingPerformanceTestingEnabled = value; } 102 102 103 bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; } 104 void setMomentumScrollingAnimatorEnabled(bool value) { m_momentumScrollingAnimatorEnabled = value; } 105 103 106 WEBCORE_EXPORT OptionSet<WheelEventProcessingSteps> determineWheelEventProcessing(const PlatformWheelEvent&); 104 107 WEBCORE_EXPORT virtual WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps> = { }); … … 332 335 bool m_asyncFrameOrOverflowScrollingEnabled { false }; 333 336 bool m_wheelEventGesturesBecomeNonBlocking { false }; 337 bool m_momentumScrollingAnimatorEnabled { false }; 334 338 bool m_needsApplyLayerPositionsAfterCommit { false }; 335 339 bool m_inCommitTreeState { false }; -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r285094 r285526 226 226 } 227 227 228 bool ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled() const 229 { 230 return scrollingTree().momentumScrollingAnimatorEnabled(); 231 } 232 228 233 void ScrollingTreeScrollingNode::willStartAnimatedScroll() 229 234 { -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r285357 r285526 133 133 void willStartAnimatedScroll(); 134 134 void didStopAnimatedScroll(); 135 136 bool momentumScrollingAnimatorEnabled() const; 135 137 136 138 void setScrollAnimationInProgress(bool); -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h
r285094 r285526 94 94 void adjustScrollPositionToBoundsIfNecessary() final; 95 95 96 bool momentumScrollingAnimatorEnabled() const final; 97 96 98 bool scrollPositionIsNotRubberbandingEdge(const FloatPoint&) const; 97 99 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm
r285347 r285526 443 443 } 444 444 445 bool ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled() const 446 { 447 return scrollingNode().momentumScrollingAnimatorEnabled(); 448 } 449 445 450 } // namespace WebCore 446 451 -
trunk/Source/WebCore/platform/ScrollingEffectsController.h
r285387 r285526 121 121 virtual ScrollExtents scrollExtents() const = 0; 122 122 virtual bool scrollAnimationEnabled() const { return true; } 123 124 virtual bool momentumScrollingAnimatorEnabled() const { return false; } 123 125 }; 124 126 -
trunk/Source/WebKit/ChangeLog
r285521 r285526 1 2021-11-09 Tim Horton <timothy_horton@apple.com> 2 3 Add runtime flag for momentum scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=232898 5 <rdar://problem/85211338> 6 7 Reviewed by Simon Fraser. 8 9 * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: 10 (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): 11 (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): 12 1 13 2021-11-09 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
r283911 r285526 150 150 WebCore::ScrollingStateNode::Property::VisualViewportIsSmallerThanLayoutViewport, 151 151 WebCore::ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled, 152 WebCore::ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled, 152 153 WebCore::ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking, 153 154 WebCore::ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled, … … 252 253 SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, maxLayoutViewportOrigin) 253 254 SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::OverrideVisualViewportSize, overrideVisualViewportSize) 255 // MomentumScrollingAnimatorEnabled is not relevant for UI-side compositing. 254 256 255 257 if (node.hasChangedProperty(ScrollingStateNode::Property::CounterScrollingLayer)) … … 366 368 SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin) 367 369 SCROLLING_NODE_DECODE(ScrollingStateNode::Property::OverrideVisualViewportSize, std::optional<FloatSize>, setOverrideVisualViewportSize) 370 // MomentumScrollingAnimatorEnabled is not encoded. 368 371 369 372 if (node.hasChangedProperty(ScrollingStateNode::Property::CounterScrollingLayer)) {
Note:
See TracChangeset
for help on using the changeset viewer.