Diff
Modified: branches/safari-612-branch/Source/WTF/ChangeLog (286691 => 286692)
--- branches/safari-612-branch/Source/WTF/ChangeLog 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WTF/ChangeLog 2021-12-08 20:23:38 UTC (rev 286692)
@@ -1,3 +1,55 @@
+2021-12-03 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r285526. rdar://problem/85928816
+
+ Add runtime flag for momentum scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=232898
+ <rdar://problem/85211338>
+
+ Reviewed by Simon Fraser.
+
+ * Scripts/Preferences/WebPreferencesInternal.yaml:
+ Add the preference.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+ (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+ (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
+ (WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingStateNode.h:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::commitTreeState):
+ * page/scrolling/ScrollingTree.h:
+ (WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const):
+ (WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const):
+ * page/scrolling/ScrollingTreeScrollingNode.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const):
+ * platform/ScrollingEffectsController.h:
+ (WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const):
+
+ * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-11-09 Tim Horton <timothy_hor...@apple.com>
+
+ Add runtime flag for momentum scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=232898
+ <rdar://problem/85211338>
+
+ Reviewed by Simon Fraser.
+
+ * Scripts/Preferences/WebPreferencesInternal.yaml:
+ Add the preference.
+
2021-12-01 Alan Coon <alanc...@apple.com>
Cherry-pick r286346. rdar://problem/85928816
Modified: branches/safari-612-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (286691 => 286692)
--- branches/safari-612-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml 2021-12-08 20:23:38 UTC (rev 286692)
@@ -536,6 +536,21 @@
WebCore:
default: false
+MomentumScrollingAnimatorEnabled:
+ type: bool
+ humanReadableName: "Momentum Scrolling Animator"
+ humanReadableDescription: "Drive momentum scrolling via an internal animator instead of using momentum events"
+ defaultValue:
+ WebKitLegacy:
+ "PLATFORM(MAC)": true
+ default: false
+ WebKit:
+ "PLATFORM(MAC)": true
+ default: false
+ WebCore:
+ "PLATFORM(MAC)": true
+ default: false
+
MouseEventsSimulationEnabled:
type: bool
humanReadableName: "Mouse events simulation"
Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/ChangeLog 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog 2021-12-08 20:23:38 UTC (rev 286692)
@@ -1,3 +1,74 @@
+2021-12-03 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r285526. rdar://problem/85928816
+
+ Add runtime flag for momentum scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=232898
+ <rdar://problem/85211338>
+
+ Reviewed by Simon Fraser.
+
+ * Scripts/Preferences/WebPreferencesInternal.yaml:
+ Add the preference.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+ (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+ (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
+ (WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingStateNode.h:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::commitTreeState):
+ * page/scrolling/ScrollingTree.h:
+ (WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const):
+ (WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const):
+ * page/scrolling/ScrollingTreeScrollingNode.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const):
+ * platform/ScrollingEffectsController.h:
+ (WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const):
+
+ * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-11-09 Tim Horton <timothy_hor...@apple.com>
+
+ Add runtime flag for momentum scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=232898
+ <rdar://problem/85211338>
+
+ Reviewed by Simon Fraser.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+ (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+ (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
+ (WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingStateNode.h:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::commitTreeState):
+ * page/scrolling/ScrollingTree.h:
+ (WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const):
+ (WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const):
+ * page/scrolling/ScrollingTreeScrollingNode.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const):
+ * platform/ScrollingEffectsController.h:
+ (WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const):
+
2021-12-03 Russell Epstein <repst...@apple.com>
Cherry-pick r286481. rdar://problem/85928816
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2021-12-08 20:23:38 UTC (rev 286692)
@@ -651,6 +651,7 @@
frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled());
frameScrollingNode.setScrollingPerformanceTestingEnabled(settings.scrollingPerformanceTestingEnabled());
frameScrollingNode.setWheelEventGesturesBecomeNonBlocking(settings.wheelEventGesturesBecomeNonBlocking());
+ frameScrollingNode.setMomentumScrollingAnimatorEnabled(settings.momentumScrollingAnimatorEnabled());
frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());
frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin());
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp 2021-12-08 20:23:38 UTC (rev 286692)
@@ -61,6 +61,7 @@
, m_asyncFrameOrOverflowScrollingEnabled(stateNode.asyncFrameOrOverflowScrollingEnabled())
, m_wheelEventGesturesBecomeNonBlocking(stateNode.wheelEventGesturesBecomeNonBlocking())
, m_scrollingPerformanceTestingEnabled(stateNode.scrollingPerformanceTestingEnabled())
+ , m_momentumScrollingAnimatorEnabled(stateNode.momentumScrollingAnimatorEnabled())
{
if (hasChangedProperty(Property::RootContentsLayer))
setRootContentsLayer(stateNode.rootContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
@@ -112,6 +113,7 @@
Property::MinLayoutViewportOrigin,
Property::MaxLayoutViewportOrigin,
Property::OverrideVisualViewportSize,
+ Property::MomentumScrollingAnimatorEnabled,
};
auto properties = ScrollingStateScrollingNode::applicableProperties();
@@ -309,6 +311,15 @@
setPropertyChanged(Property::ScrollingPerformanceTestingEnabled);
}
+void ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled(bool enabled)
+{
+ if (enabled == m_momentumScrollingAnimatorEnabled)
+ return;
+
+ m_momentumScrollingAnimatorEnabled = enabled;
+ setPropertyChanged(Property::MomentumScrollingAnimatorEnabled);
+}
+
void ScrollingStateFrameScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const
{
ts << "Frame scrolling node";
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h 2021-12-08 20:23:38 UTC (rev 286692)
@@ -117,6 +117,9 @@
bool wheelEventGesturesBecomeNonBlocking() const { return m_wheelEventGesturesBecomeNonBlocking; }
WEBCORE_EXPORT void setWheelEventGesturesBecomeNonBlocking(bool);
+ bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; }
+ WEBCORE_EXPORT void setMomentumScrollingAnimatorEnabled(bool);
+
void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
private:
@@ -149,6 +152,7 @@
bool m_asyncFrameOrOverflowScrollingEnabled { false };
bool m_wheelEventGesturesBecomeNonBlocking { false };
bool m_scrollingPerformanceTestingEnabled { false };
+ bool m_momentumScrollingAnimatorEnabled { false };
};
} // namespace WebCore
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateNode.h (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateNode.h 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingStateNode.h 2021-12-08 20:23:38 UTC (rev 286692)
@@ -255,19 +255,20 @@
FixedElementsLayoutRelativeToFrame = 1LLU << 31,
VisualViewportIsSmallerThanLayoutViewport = 1LLU << 32,
AsyncFrameOrOverflowScrollingEnabled = 1LLU << 33,
- WheelEventGesturesBecomeNonBlocking = 1LLU << 34,
- ScrollingPerformanceTestingEnabled = 1LLU << 35,
- LayoutViewport = 1LLU << 36,
- MinLayoutViewportOrigin = 1LLU << 37,
- MaxLayoutViewportOrigin = 1LLU << 38,
- OverrideVisualViewportSize = 1LLU << 39,
+ MomentumScrollingAnimatorEnabled = 1LLU << 34,
+ WheelEventGesturesBecomeNonBlocking = 1LLU << 35,
+ ScrollingPerformanceTestingEnabled = 1LLU << 36,
+ LayoutViewport = 1LLU << 37,
+ MinLayoutViewportOrigin = 1LLU << 38,
+ MaxLayoutViewportOrigin = 1LLU << 39,
+ OverrideVisualViewportSize = 1LLU << 40,
// ScrollingStatePositionedNode
- RelatedOverflowScrollingNodes = 1LLU << 40,
- LayoutConstraintData = 1LLU << 41,
+ RelatedOverflowScrollingNodes = 1LLU << 41,
+ LayoutConstraintData = 1LLU << 42,
// ScrollingStateFixedNode, ScrollingStateStickyNode
- ViewportConstraints = 1LLU << 42,
+ ViewportConstraints = 1LLU << 43,
// ScrollingStateOverflowScrollProxyNode
- OverflowScrollingNode = 1LLU << 43,
+ OverflowScrollingNode = 1LLU << 44,
};
bool hasChangedProperties() const { return !m_changedProperties.isEmpty(); }
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp 2021-12-08 20:23:38 UTC (rev 286692)
@@ -279,7 +279,8 @@
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled)
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking)
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled)
- || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))) {
+ || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents)
+ || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled))) {
Locker locker { m_treeStateLock };
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrolledContentsLayer))
@@ -299,6 +300,9 @@
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))
m_isMonitoringWheelEvents = scrollingStateTree->rootStateNode()->isMonitoringWheelEvents();
+
+ if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled))
+ m_momentumScrollingAnimatorEnabled = scrollingStateTree->rootStateNode()->momentumScrollingAnimatorEnabled();
}
m_overflowRelatedNodesMap.clear();
@@ -321,6 +325,10 @@
node->willBeDestroyed();
}
+ if (rootNode && (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled)))
+ RELEASE_LOG(Scrolling, "ScrollingTree momentum scrolling animator enabled: %d", rootNode->momentumScrollingAnimatorEnabled());
+
+
LOG_WITH_STREAM(ScrollingTree, stream << "committed ScrollingTree" << scrollingTreeAsText(ScrollingStateTreeAsTextBehaviorDebug));
}
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTree.h (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTree.h 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTree.h 2021-12-08 20:23:38 UTC (rev 286692)
@@ -100,6 +100,9 @@
bool scrollingPerformanceTestingEnabled() const { return m_scrollingPerformanceTestingEnabled; }
void setScrollingPerformanceTestingEnabled(bool value) { m_scrollingPerformanceTestingEnabled = value; }
+ bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; }
+ void setMomentumScrollingAnimatorEnabled(bool value) { m_momentumScrollingAnimatorEnabled = value; }
+
WEBCORE_EXPORT OptionSet<WheelEventProcessingSteps> determineWheelEventProcessing(const PlatformWheelEvent&);
WEBCORE_EXPORT virtual WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps> = { });
@@ -335,6 +338,7 @@
bool m_scrollingPerformanceTestingEnabled { false };
bool m_asyncFrameOrOverflowScrollingEnabled { false };
bool m_wheelEventGesturesBecomeNonBlocking { false };
+ bool m_momentumScrollingAnimatorEnabled { false };
bool m_needsApplyLayerPositionsAfterCommit { false };
bool m_inCommitTreeState { false };
};
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp 2021-12-08 20:23:38 UTC (rev 286692)
@@ -227,6 +227,11 @@
scrollingTree().setNodeScrollSnapInProgress(scrollingNodeID(), isSnapping);
}
+bool ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled() const
+{
+ return scrollingTree().momentumScrollingAnimatorEnabled();
+}
+
FloatPoint ScrollingTreeScrollingNode::adjustedScrollPosition(const FloatPoint& scrollPosition, ScrollClamping clamping) const
{
if (clamping == ScrollClamping::Clamped)
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h 2021-12-08 20:23:38 UTC (rev 286692)
@@ -120,7 +120,8 @@
virtual void willDoProgrammaticScroll(const FloatPoint&) { }
virtual FloatPoint adjustedScrollPosition(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped) const;
-
+ bool momentumScrollingAnimatorEnabled() const;
+
virtual void currentScrollPositionChanged(ScrollType, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync);
virtual void updateViewportForCurrentScrollPosition(std::optional<FloatRect> = { }) { }
virtual bool scrollPositionAndLayoutViewportMatch(const FloatPoint& position, std::optional<FloatRect> overrideLayoutViewport);
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h 2021-12-08 20:23:38 UTC (rev 286692)
@@ -89,6 +89,8 @@
void rubberBandingStateChanged(bool) final;
void adjustScrollPositionToBoundsIfNecessary() final;
+ bool momentumScrollingAnimatorEnabled() const final;
+
bool scrollPositionIsNotRubberbandingEdge(const FloatPoint&) const;
void scrollControllerAnimationTimerFired();
Modified: branches/safari-612-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2021-12-08 20:23:38 UTC (rev 286692)
@@ -478,6 +478,11 @@
}
}
+bool ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled() const
+{
+ return scrollingNode().momentumScrollingAnimatorEnabled();
+}
+
} // namespace WebCore
#endif // PLATFORM(MAC) && ENABLE(ASYNC_SCROLLING)
Modified: branches/safari-612-branch/Source/WebCore/platform/ScrollController.h (286691 => 286692)
--- branches/safari-612-branch/Source/WebCore/platform/ScrollController.h 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebCore/platform/ScrollController.h 2021-12-08 20:23:38 UTC (rev 286692)
@@ -113,6 +113,8 @@
virtual float pageScaleFactor() const = 0;
virtual LayoutSize scrollExtent() const = 0;
virtual FloatSize viewportSize() const = 0;
+
+ virtual bool momentumScrollingAnimatorEnabled() const { return false; }
};
class ScrollController {
Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (286691 => 286692)
--- branches/safari-612-branch/Source/WebKit/ChangeLog 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog 2021-12-08 20:23:38 UTC (rev 286692)
@@ -1,3 +1,56 @@
+2021-12-03 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r285526. rdar://problem/85928816
+
+ Add runtime flag for momentum scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=232898
+ <rdar://problem/85211338>
+
+ Reviewed by Simon Fraser.
+
+ * Scripts/Preferences/WebPreferencesInternal.yaml:
+ Add the preference.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+ (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+ (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
+ (WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingStateNode.h:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::commitTreeState):
+ * page/scrolling/ScrollingTree.h:
+ (WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const):
+ (WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled):
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const):
+ * page/scrolling/ScrollingTreeScrollingNode.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const):
+ * platform/ScrollingEffectsController.h:
+ (WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const):
+
+ * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-11-09 Tim Horton <timothy_hor...@apple.com>
+
+ Add runtime flag for momentum scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=232898
+ <rdar://problem/85211338>
+
+ Reviewed by Simon Fraser.
+
+ * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+
2021-12-03 Russell Epstein <repst...@apple.com>
Cherry-pick r286483. rdar://problem/85928816
Modified: branches/safari-612-branch/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (286691 => 286692)
--- branches/safari-612-branch/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp 2021-12-08 20:23:32 UTC (rev 286691)
+++ branches/safari-612-branch/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp 2021-12-08 20:23:38 UTC (rev 286692)
@@ -149,6 +149,7 @@
WebCore::ScrollingStateNode::Property::FixedElementsLayoutRelativeToFrame,
WebCore::ScrollingStateNode::Property::VisualViewportIsSmallerThanLayoutViewport,
WebCore::ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled,
+ WebCore::ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled,
WebCore::ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking,
WebCore::ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled,
WebCore::ScrollingStateNode::Property::LayoutViewport,
@@ -251,6 +252,7 @@
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, minLayoutViewportOrigin)
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, maxLayoutViewportOrigin)
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::OverrideVisualViewportSize, overrideVisualViewportSize)
+ // MomentumScrollingAnimatorEnabled is not relevant for UI-side compositing.
if (node.hasChangedProperty(ScrollingStateNode::Property::CounterScrollingLayer))
encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
@@ -365,6 +367,7 @@
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, FloatPoint, setMinLayoutViewportOrigin)
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin)
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::OverrideVisualViewportSize, std::optional<FloatSize>, setOverrideVisualViewportSize)
+ // MomentumScrollingAnimatorEnabled is not encoded.
if (node.hasChangedProperty(ScrollingStateNode::Property::CounterScrollingLayer)) {
GraphicsLayer::PlatformLayerID layerID;