Skip to content

Commit 59b2c3b

Browse files
committed
Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree
https://bugs.webkit.org/show_bug.cgi?id=219241 Reviewed by Tim Horton. Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree via the ScrollingStateFrameScrollingNode, as we do for other settings. Source/WebCore: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): (WebCore::AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const): (WebCore::ScrollingStateFrameScrollingNode::setWheelEventGesturesBecomeNonBlocking): * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): (WebCore::ScrollingTree::wheelEventGesturesBecomeNonBlocking const): (WebCore::ScrollingTree::setWheelEventGesturesBecomeNonBlocking): Source/WebKit: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): Canonical link: https://commits.webkit.org/231865@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent babb868 commit 59b2c3b

10 files changed

Lines changed: 86 additions & 14 deletions

Source/WebCore/ChangeLog

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
2020-11-21 Simon Fraser <simon.fraser@apple.com>
2+
3+
Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree
4+
https://bugs.webkit.org/show_bug.cgi?id=219241
5+
6+
Reviewed by Tim Horton.
7+
8+
Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree
9+
via the ScrollingStateFrameScrollingNode, as we do for other settings.
10+
11+
* page/scrolling/AsyncScrollingCoordinator.cpp:
12+
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
13+
(WebCore::AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking const):
14+
* page/scrolling/AsyncScrollingCoordinator.h:
15+
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
16+
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
17+
(WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
18+
(WebCore::ScrollingStateFrameScrollingNode::setWheelEventGesturesBecomeNonBlocking):
19+
* page/scrolling/ScrollingStateFrameScrollingNode.h:
20+
* page/scrolling/ScrollingStateNode.h:
21+
* page/scrolling/ScrollingTree.cpp:
22+
(WebCore::ScrollingTree::commitTreeState):
23+
(WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): Deleted.
24+
* page/scrolling/ScrollingTree.h:
25+
(WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
26+
(WebCore::ScrollingTree::wheelEventGesturesBecomeNonBlocking const):
27+
(WebCore::ScrollingTree::setWheelEventGesturesBecomeNonBlocking):
28+
129
2020-11-21 Chris Dumez <cdumez@apple.com>
230

331
Unreviewed, reverting r270141.

Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ void AsyncScrollingCoordinator::setFrameScrollingNodeState(ScrollingNodeID nodeI
675675
frameScrollingNode.setTopContentInset(frameView.topContentInset());
676676
frameScrollingNode.setLayoutViewport(frameView.layoutViewportRect());
677677
frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(asyncFrameOrOverflowScrollingEnabled());
678+
frameScrollingNode.setWheelEventGesturesBecomeNonBlocking(wheelEventGesturesBecomeNonBlocking());
678679

679680
frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());
680681
frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin());
@@ -858,6 +859,12 @@ bool AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled() const
858859
return settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled();
859860
}
860861

862+
bool AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking() const
863+
{
864+
auto& settings = m_page->mainFrame().settings();
865+
return settings.wheelEventGesturesBecomeNonBlocking();
866+
}
867+
861868
ScrollingNodeID AsyncScrollingCoordinator::scrollableContainerNodeID(const RenderObject& renderer) const
862869
{
863870
if (auto overflowScrollingNodeID = renderer.view().compositor().asyncScrollableContainerNodeID(renderer))

Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class AsyncScrollingCoordinator : public ScrollingCoordinator {
9797
bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const override { return false; }
9898

9999
bool asyncFrameOrOverflowScrollingEnabled() const;
100+
bool wheelEventGesturesBecomeNonBlocking() const;
100101

101102
WEBCORE_EXPORT ScrollingNodeID scrollableContainerNodeID(const RenderObject&) const override;
102103

Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const Scrolli
5959
, m_fixedElementsLayoutRelativeToFrame(stateNode.fixedElementsLayoutRelativeToFrame())
6060
, m_visualViewportIsSmallerThanLayoutViewport(stateNode.visualViewportIsSmallerThanLayoutViewport())
6161
, m_asyncFrameOrOverflowScrollingEnabled(stateNode.asyncFrameOrOverflowScrollingEnabled())
62+
, m_wheelEventGesturesBecomeNonBlocking(stateNode.wheelEventGesturesBecomeNonBlocking())
6263
{
6364
if (hasChangedProperty(Property::RootContentsLayer))
6465
setRootContentsLayer(stateNode.rootContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
@@ -104,6 +105,7 @@ OptionSet<ScrollingStateNode::Property> ScrollingStateFrameScrollingNode::applic
104105
Property::FixedElementsLayoutRelativeToFrame,
105106
Property::VisualViewportIsSmallerThanLayoutViewport,
106107
Property::AsyncFrameOrOverflowScrollingEnabled,
108+
Property::WheelEventGesturesBecomeNonBlocking,
107109
Property::LayoutViewport,
108110
Property::MinLayoutViewportOrigin,
109111
Property::MaxLayoutViewportOrigin,
@@ -287,6 +289,15 @@ void ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled(b
287289
setPropertyChanged(Property::AsyncFrameOrOverflowScrollingEnabled);
288290
}
289291

292+
void ScrollingStateFrameScrollingNode::setWheelEventGesturesBecomeNonBlocking(bool enabled)
293+
{
294+
if (enabled == m_wheelEventGesturesBecomeNonBlocking)
295+
return;
296+
297+
m_wheelEventGesturesBecomeNonBlocking = enabled;
298+
setPropertyChanged(Property::WheelEventGesturesBecomeNonBlocking);
299+
}
300+
290301
void ScrollingStateFrameScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const
291302
{
292303
ts << "Frame scrolling node";

Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNod
111111
bool asyncFrameOrOverflowScrollingEnabled() const { return m_asyncFrameOrOverflowScrollingEnabled; }
112112
void setAsyncFrameOrOverflowScrollingEnabled(bool);
113113

114+
bool wheelEventGesturesBecomeNonBlocking() const { return m_wheelEventGesturesBecomeNonBlocking; }
115+
WEBCORE_EXPORT void setWheelEventGesturesBecomeNonBlocking(bool);
116+
114117
void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
115118

116119
private:
@@ -141,6 +144,7 @@ class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNod
141144
bool m_fixedElementsLayoutRelativeToFrame { false };
142145
bool m_visualViewportIsSmallerThanLayoutViewport { false };
143146
bool m_asyncFrameOrOverflowScrollingEnabled { false };
147+
bool m_wheelEventGesturesBecomeNonBlocking { false };
144148
};
145149

146150
} // namespace WebCore

Source/WebCore/page/scrolling/ScrollingStateNode.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,18 @@ class ScrollingStateNode : public ThreadSafeRefCounted<ScrollingStateNode> {
258258
FixedElementsLayoutRelativeToFrame = 1LLU << 34,
259259
VisualViewportIsSmallerThanLayoutViewport = 1LLU << 35,
260260
AsyncFrameOrOverflowScrollingEnabled = 1LLU << 36,
261-
LayoutViewport = 1LLU << 37,
262-
MinLayoutViewportOrigin = 1LLU << 38,
263-
MaxLayoutViewportOrigin = 1LLU << 39,
264-
OverrideVisualViewportSize = 1LLU << 40,
261+
WheelEventGesturesBecomeNonBlocking = 1LLU << 37,
262+
LayoutViewport = 1LLU << 38,
263+
MinLayoutViewportOrigin = 1LLU << 39,
264+
MaxLayoutViewportOrigin = 1LLU << 40,
265+
OverrideVisualViewportSize = 1LLU << 41,
265266
// ScrollingStatePositionedNode
266-
RelatedOverflowScrollingNodes = 1LLU << 41,
267-
LayoutConstraintData = 1LLU << 42,
267+
RelatedOverflowScrollingNodes = 1LLU << 42,
268+
LayoutConstraintData = 1LLU << 43,
268269
// ScrollingStateFixedNode, ScrollingStateStickyNode
269-
ViewportConstraints = 1LLU << 43,
270+
ViewportConstraints = 1LLU << 44,
270271
// ScrollingStateOverflowScrollProxyNode
271-
OverflowScrollingNode = 1LLU << 44,
272+
OverflowScrollingNode = 1LLU << 45,
272273
};
273274

274275
bool hasChangedProperties() const { return !m_changedProperties.isEmpty(); }

Source/WebCore/page/scrolling/ScrollingTree.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree>&& scroll
265265
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::EventTrackingRegion)
266266
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrolledContentsLayer)
267267
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled)
268+
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking)
268269
|| rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))) {
269270
LockHolder lock(m_treeStateMutex);
270271

@@ -277,6 +278,9 @@ void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree>&& scroll
277278
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled))
278279
m_asyncFrameOrOverflowScrollingEnabled = scrollingStateTree->rootStateNode()->asyncFrameOrOverflowScrollingEnabled();
279280

281+
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking))
282+
m_wheelEventGesturesBecomeNonBlocking = scrollingStateTree->rootStateNode()->wheelEventGesturesBecomeNonBlocking();
283+
280284
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))
281285
m_isMonitoringWheelEvents = scrollingStateTree->rootStateNode()->isMonitoringWheelEvents();
282286
}
@@ -466,11 +470,6 @@ void ScrollingTree::clearLatchedNode()
466470
m_latchingController.clearLatchedNode();
467471
}
468472

469-
void ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled(bool enabled)
470-
{
471-
m_asyncFrameOrOverflowScrollingEnabled = enabled;
472-
}
473-
474473
FloatPoint ScrollingTree::mainFrameScrollPosition() const
475474
{
476475
ASSERT(m_treeStateMutex.isLocked());

Source/WebCore/page/scrolling/ScrollingTree.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ friend class ScrollingTreeLatchingController;
8989

9090
// This implies that we'll do hit-testing in the scrolling tree.
9191
bool asyncFrameOrOverflowScrollingEnabled() const { return m_asyncFrameOrOverflowScrollingEnabled; }
92-
void setAsyncFrameOrOverflowScrollingEnabled(bool);
92+
void setAsyncFrameOrOverflowScrollingEnabled(bool value) { m_asyncFrameOrOverflowScrollingEnabled = value; }
93+
94+
bool wheelEventGesturesBecomeNonBlocking() const { return m_wheelEventGesturesBecomeNonBlocking; }
95+
void setWheelEventGesturesBecomeNonBlocking(bool value) { m_wheelEventGesturesBecomeNonBlocking = value; }
9396

9497
WEBCORE_EXPORT OptionSet<WheelEventProcessingSteps> determineWheelEventProcessing(const PlatformWheelEvent&);
9598
WEBCORE_EXPORT virtual WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps> = { });
@@ -317,6 +320,7 @@ friend class ScrollingTreeLatchingController;
317320
bool m_isMonitoringWheelEvents { false };
318321
bool m_scrollingPerformanceLoggingEnabled { false };
319322
bool m_asyncFrameOrOverflowScrollingEnabled { false };
323+
bool m_wheelEventGesturesBecomeNonBlocking { false };
320324
bool m_needsApplyLayerPositionsAfterCommit { false };
321325
bool m_inCommitTreeState { false };
322326
};

Source/WebKit/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2020-11-21 Simon Fraser <simon.fraser@apple.com>
2+
3+
Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree
4+
https://bugs.webkit.org/show_bug.cgi?id=219241
5+
6+
Reviewed by Tim Horton.
7+
8+
Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree
9+
via the ScrollingStateFrameScrollingNode, as we do for other settings.
10+
11+
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
12+
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
13+
114
2020-11-21 Simon Fraser <simon.fraser@apple.com>
215

316
Add an Experimental Features for wheel event gestures becoming non-blocking

Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ template<> struct EnumTraits<WebCore::ScrollingStateNode::Property> {
142142
WebCore::ScrollingStateNode::Property::FixedElementsLayoutRelativeToFrame,
143143
WebCore::ScrollingStateNode::Property::VisualViewportIsSmallerThanLayoutViewport,
144144
WebCore::ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled,
145+
WebCore::ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking,
145146
WebCore::ScrollingStateNode::Property::LayoutViewport,
146147
WebCore::ScrollingStateNode::Property::MinLayoutViewportOrigin,
147148
WebCore::ScrollingStateNode::Property::MaxLayoutViewportOrigin,
@@ -241,6 +242,7 @@ void ArgumentCoder<ScrollingStateFrameScrollingNode>::encode(Encoder& encoder, c
241242
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::FixedElementsLayoutRelativeToFrame, fixedElementsLayoutRelativeToFrame)
242243
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::VisualViewportIsSmallerThanLayoutViewport, visualViewportIsSmallerThanLayoutViewport)
243244
// AsyncFrameOrOverflowScrollingEnabled is not relevant for UI-side compositing.
245+
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking, wheelEventGesturesBecomeNonBlocking)
244246
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::LayoutViewport, layoutViewport)
245247
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, minLayoutViewportOrigin)
246248
SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, maxLayoutViewportOrigin)
@@ -357,6 +359,8 @@ bool ArgumentCoder<ScrollingStateFrameScrollingNode>::decode(Decoder& decoder, S
357359
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::TopContentInset, float, setTopContentInset);
358360
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::FixedElementsLayoutRelativeToFrame, bool, setFixedElementsLayoutRelativeToFrame);
359361
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::VisualViewportIsSmallerThanLayoutViewport, bool, setVisualViewportIsSmallerThanLayoutViewport);
362+
// AsyncFrameOrOverflowScrollingEnabled is not encoded.
363+
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking, bool, setWheelEventGesturesBecomeNonBlocking)
360364
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::LayoutViewport, FloatRect, setLayoutViewport)
361365
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, FloatPoint, setMinLayoutViewportOrigin)
362366
SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin)

0 commit comments

Comments
 (0)