- Revision
- 242670
- Author
- [email protected]
- Date
- 2019-03-08 18:35:57 -0800 (Fri, 08 Mar 2019)
Log Message
Make it clearer which data is protected by the two locks in ScrollingTree
https://bugs.webkit.org/show_bug.cgi?id=195501
Reviewed by Tim Horton.
Gather ScrollingTree member variables into two structs, and name the struct
members and the locks to make it clear which data is protected by each lock.
We only need to protect data read by multiple threads; these are the scrolling
thread, the event handling thread (which runs ThreadedScrollingTree::tryToHandleWheelEvent()),
and the main thread, which pokes various bits of pin/rubber-banding state.
Ideally the main thread would always push data to the scrolling thread via a commit,
but that's not what happens now.
Suspiciously, ScrollingTree::shouldHandleWheelEventSynchronously() uses the root node,
so should probably hold a lock shared with the scrolling thread (webkit.org/b/195502).
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
(WebCore::ScrollingTree::setMainFrameScrollPosition):
(WebCore::ScrollingTree::eventTrackingTypeForPoint):
(WebCore::ScrollingTree::isRubberBandInProgress):
(WebCore::ScrollingTree::setMainFrameIsRubberBanding):
(WebCore::ScrollingTree::isScrollSnapInProgress):
(WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
(WebCore::ScrollingTree::setMainFramePinState):
(WebCore::ScrollingTree::setCanRubberBandState):
(WebCore::ScrollingTree::setScrollPinningBehavior):
(WebCore::ScrollingTree::scrollPinningBehavior):
(WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
(WebCore::ScrollingTree::latchedNode):
(WebCore::ScrollingTree::setLatchedNode):
(WebCore::ScrollingTree::clearLatchedNode):
(WebCore::ScrollingTree::scrollingTreeAsText):
(WebCore::ScrollingTree::touchActionDataAtPoint const):
(WebCore::ScrollingTree::mainFrameScrollPosition): Deleted.
(WebCore::ScrollingTree::mainFrameLayoutViewport): Deleted.
(WebCore::ScrollingTree::rubberBandsAtLeft): Deleted.
(WebCore::ScrollingTree::rubberBandsAtRight): Deleted.
(WebCore::ScrollingTree::rubberBandsAtBottom): Deleted.
(WebCore::ScrollingTree::rubberBandsAtTop): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::hasLatchedNode const):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::isZero const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (242669 => 242670)
--- trunk/Source/WebCore/ChangeLog 2019-03-09 02:35:54 UTC (rev 242669)
+++ trunk/Source/WebCore/ChangeLog 2019-03-09 02:35:57 UTC (rev 242670)
@@ -1,5 +1,57 @@
2019-03-08 Simon Fraser <[email protected]>
+ Make it clearer which data is protected by the two locks in ScrollingTree
+ https://bugs.webkit.org/show_bug.cgi?id=195501
+
+ Reviewed by Tim Horton.
+
+ Gather ScrollingTree member variables into two structs, and name the struct
+ members and the locks to make it clear which data is protected by each lock.
+
+ We only need to protect data read by multiple threads; these are the scrolling
+ thread, the event handling thread (which runs ThreadedScrollingTree::tryToHandleWheelEvent()),
+ and the main thread, which pokes various bits of pin/rubber-banding state.
+ Ideally the main thread would always push data to the scrolling thread via a commit,
+ but that's not what happens now.
+
+ Suspiciously, ScrollingTree::shouldHandleWheelEventSynchronously() uses the root node,
+ so should probably hold a lock shared with the scrolling thread (webkit.org/b/195502).
+
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
+ (WebCore::ScrollingTree::commitTreeState):
+ (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
+ (WebCore::ScrollingTree::setMainFrameScrollPosition):
+ (WebCore::ScrollingTree::eventTrackingTypeForPoint):
+ (WebCore::ScrollingTree::isRubberBandInProgress):
+ (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
+ (WebCore::ScrollingTree::isScrollSnapInProgress):
+ (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
+ (WebCore::ScrollingTree::setMainFramePinState):
+ (WebCore::ScrollingTree::setCanRubberBandState):
+ (WebCore::ScrollingTree::setScrollPinningBehavior):
+ (WebCore::ScrollingTree::scrollPinningBehavior):
+ (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
+ (WebCore::ScrollingTree::latchedNode):
+ (WebCore::ScrollingTree::setLatchedNode):
+ (WebCore::ScrollingTree::clearLatchedNode):
+ (WebCore::ScrollingTree::scrollingTreeAsText):
+ (WebCore::ScrollingTree::touchActionDataAtPoint const):
+ (WebCore::ScrollingTree::mainFrameScrollPosition): Deleted.
+ (WebCore::ScrollingTree::mainFrameLayoutViewport): Deleted.
+ (WebCore::ScrollingTree::rubberBandsAtLeft): Deleted.
+ (WebCore::ScrollingTree::rubberBandsAtRight): Deleted.
+ (WebCore::ScrollingTree::rubberBandsAtBottom): Deleted.
+ (WebCore::ScrollingTree::rubberBandsAtTop): Deleted.
+ * page/scrolling/ScrollingTree.h:
+ (WebCore::ScrollingTree::hasLatchedNode const):
+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
+ * platform/graphics/FloatPoint.h:
+ (WebCore::FloatPoint::isZero const):
+
+2019-03-08 Simon Fraser <[email protected]>
+
Share some code that sets CALayer positions
https://bugs.webkit.org/show_bug.cgi?id=195485
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (242669 => 242670)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2019-03-09 02:35:54 UTC (rev 242669)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2019-03-09 02:35:57 UTC (rev 242670)
@@ -49,7 +49,7 @@
bool ScrollingTree::shouldHandleWheelEventSynchronously(const PlatformWheelEvent& wheelEvent)
{
// This method is invoked by the event handling thread
- LockHolder lock(m_mutex);
+ LockHolder lock(m_treeStateMutex);
bool shouldSetLatch = wheelEvent.shouldConsiderLatching();
@@ -57,19 +57,19 @@
return false;
if (shouldSetLatch)
- m_latchedNodeID = 0;
+ m_treeState.latchedNodeID = 0;
- if (!m_eventTrackingRegions.isEmpty() && m_rootNode) {
+ if (!m_treeState.eventTrackingRegions.isEmpty() && m_rootNode) {
auto& frameScrollingNode = downcast<ScrollingTreeFrameScrollingNode>(*m_rootNode);
FloatPoint position = wheelEvent.position();
- position.move(frameScrollingNode.viewToContentsOffset(m_mainFrameScrollPosition));
+ position.move(frameScrollingNode.viewToContentsOffset(m_treeState.mainFrameScrollPosition));
const EventNames& names = eventNames();
IntPoint roundedPosition = roundedIntPoint(position);
// Event regions are affected by page scale, so no need to map through scale.
- bool isSynchronousDispatchRegion = m_eventTrackingRegions.trackingTypeForPoint(names.wheelEvent, roundedPosition) == TrackingType::Synchronous
- || m_eventTrackingRegions.trackingTypeForPoint(names.mousewheelEvent, roundedPosition) == TrackingType::Synchronous;
+ bool isSynchronousDispatchRegion = m_treeState.eventTrackingRegions.trackingTypeForPoint(names.wheelEvent, roundedPosition) == TrackingType::Synchronous
+ || m_treeState.eventTrackingRegions.trackingTypeForPoint(names.mousewheelEvent, roundedPosition) == TrackingType::Synchronous;
LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree::shouldHandleWheelEventSynchronously: wheelEvent at " << wheelEvent.position() << " mapped to content point " << position << ", in non-fast region " << isSynchronousDispatchRegion);
if (isSynchronousDispatchRegion)
@@ -150,13 +150,13 @@
|| rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::EventTrackingRegion)
|| rootNode->hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)
|| rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::AsyncFrameOrOverflowScrollingEnabled))) {
- LockHolder lock(m_mutex);
+ LockHolder lock(m_treeStateMutex);
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
- m_mainFrameScrollPosition = FloatPoint();
+ m_treeState.mainFrameScrollPosition = { };
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::EventTrackingRegion))
- m_eventTrackingRegions = scrollingStateTree->rootStateNode()->eventTrackingRegions();
+ m_treeState.eventTrackingRegions = scrollingStateTree->rootStateNode()->eventTrackingRegions();
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::AsyncFrameOrOverflowScrollingEnabled))
m_asyncFrameOrOverflowScrollingEnabled = scrollingStateTree->rootStateNode()->asyncFrameOrOverflowScrollingEnabled();
@@ -176,7 +176,7 @@
updateTreeFromStateNode(rootNode, orphanNodes, unvisitedNodes);
for (auto nodeID : unvisitedNodes) {
- if (nodeID == m_latchedNodeID)
+ if (nodeID == m_treeState.latchedNodeID)
clearLatchedNode();
LOG(Scrolling, "ScrollingTree::commitTreeState - removing unvisited node %" PRIu64, nodeID);
@@ -287,124 +287,78 @@
void ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled(bool enabled)
{
- LockHolder lock(m_mutex);
m_asyncFrameOrOverflowScrollingEnabled = enabled;
}
-void ScrollingTree::setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom)
-{
- LockHolder locker(m_swipeStateMutex);
-
- m_mainFramePinnedToTheLeft = pinnedToTheLeft;
- m_mainFramePinnedToTheRight = pinnedToTheRight;
- m_mainFramePinnedToTheTop = pinnedToTheTop;
- m_mainFramePinnedToTheBottom = pinnedToTheBottom;
-}
-
-FloatPoint ScrollingTree::mainFrameScrollPosition()
-{
- LockHolder lock(m_mutex);
- return m_mainFrameScrollPosition;
-}
-
-FloatRect ScrollingTree::mainFrameLayoutViewport()
-{
- if (!m_rootNode)
- return { };
-
- auto& frameScrollingNode = downcast<ScrollingTreeFrameScrollingNode>(*m_rootNode);
- return frameScrollingNode.layoutViewport();
-}
-
void ScrollingTree::setMainFrameScrollPosition(FloatPoint position)
{
- LockHolder lock(m_mutex);
- m_mainFrameScrollPosition = position;
+ LockHolder lock(m_treeStateMutex);
+ m_treeState.mainFrameScrollPosition = position;
}
TrackingType ScrollingTree::eventTrackingTypeForPoint(const AtomicString& eventName, IntPoint p)
{
- LockHolder lock(m_mutex);
-
- return m_eventTrackingRegions.trackingTypeForPoint(eventName, p);
+ LockHolder lock(m_treeStateMutex);
+ return m_treeState.eventTrackingRegions.trackingTypeForPoint(eventName, p);
}
+// Can be called from the main thread.
bool ScrollingTree::isRubberBandInProgress()
{
- LockHolder lock(m_mutex);
-
- return m_mainFrameIsRubberBanding;
+ LockHolder lock(m_treeStateMutex);
+ return m_treeState.mainFrameIsRubberBanding;
}
void ScrollingTree::setMainFrameIsRubberBanding(bool isRubberBanding)
{
- LockHolder locker(m_mutex);
-
- m_mainFrameIsRubberBanding = isRubberBanding;
+ LockHolder locker(m_treeStateMutex);
+ m_treeState.mainFrameIsRubberBanding = isRubberBanding;
}
+// Can be called from the main thread.
bool ScrollingTree::isScrollSnapInProgress()
{
- LockHolder lock(m_mutex);
-
- return m_mainFrameIsScrollSnapping;
+ LockHolder lock(m_treeStateMutex);
+ return m_treeState.mainFrameIsScrollSnapping;
}
void ScrollingTree::setMainFrameIsScrollSnapping(bool isScrollSnapping)
{
- LockHolder locker(m_mutex);
-
- m_mainFrameIsScrollSnapping = isScrollSnapping;
+ LockHolder locker(m_treeStateMutex);
+ m_treeState.mainFrameIsScrollSnapping = isScrollSnapping;
}
-void ScrollingTree::setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
+void ScrollingTree::setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom)
{
LockHolder locker(m_swipeStateMutex);
- m_rubberBandsAtLeft = canRubberBandAtLeft;
- m_rubberBandsAtRight = canRubberBandAtRight;
- m_rubberBandsAtTop = canRubberBandAtTop;
- m_rubberBandsAtBottom = canRubberBandAtBottom;
+ m_swipeState.mainFramePinnedToTheLeft = pinnedToTheLeft;
+ m_swipeState.mainFramePinnedToTheRight = pinnedToTheRight;
+ m_swipeState.mainFramePinnedToTheTop = pinnedToTheTop;
+ m_swipeState.mainFramePinnedToTheBottom = pinnedToTheBottom;
}
-bool ScrollingTree::rubberBandsAtLeft()
+void ScrollingTree::setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
{
- LockHolder lock(m_swipeStateMutex);
+ LockHolder locker(m_swipeStateMutex);
- return m_rubberBandsAtLeft;
+ m_swipeState.rubberBandsAtLeft = canRubberBandAtLeft;
+ m_swipeState.rubberBandsAtRight = canRubberBandAtRight;
+ m_swipeState.rubberBandsAtTop = canRubberBandAtTop;
+ m_swipeState.rubberBandsAtBottom = canRubberBandAtBottom;
}
-bool ScrollingTree::rubberBandsAtRight()
-{
- LockHolder lock(m_swipeStateMutex);
-
- return m_rubberBandsAtRight;
-}
-
-bool ScrollingTree::rubberBandsAtBottom()
-{
- LockHolder lock(m_swipeStateMutex);
-
- return m_rubberBandsAtBottom;
-}
-
-bool ScrollingTree::rubberBandsAtTop()
-{
- LockHolder lock(m_swipeStateMutex);
-
- return m_rubberBandsAtTop;
-}
-
bool ScrollingTree::isHandlingProgrammaticScroll()
{
return m_isHandlingProgrammaticScroll;
}
+// Can be called from the main thread.
void ScrollingTree::setScrollPinningBehavior(ScrollPinningBehavior pinning)
{
LockHolder locker(m_swipeStateMutex);
- m_scrollPinningBehavior = pinning;
+ m_swipeState.scrollPinningBehavior = pinning;
}
ScrollPinningBehavior ScrollingTree::scrollPinningBehavior()
@@ -411,7 +365,7 @@
{
LockHolder lock(m_swipeStateMutex);
- return m_scrollPinningBehavior;
+ return m_swipeState.scrollPinningBehavior;
}
bool ScrollingTree::willWheelEventStartSwipeGesture(const PlatformWheelEvent& wheelEvent)
@@ -421,13 +375,13 @@
LockHolder lock(m_swipeStateMutex);
- if (wheelEvent.deltaX() > 0 && m_mainFramePinnedToTheLeft && !m_rubberBandsAtLeft)
+ if (wheelEvent.deltaX() > 0 && m_swipeState.mainFramePinnedToTheLeft && !m_swipeState.rubberBandsAtLeft)
return true;
- if (wheelEvent.deltaX() < 0 && m_mainFramePinnedToTheRight && !m_rubberBandsAtRight)
+ if (wheelEvent.deltaX() < 0 && m_swipeState.mainFramePinnedToTheRight && !m_swipeState.rubberBandsAtRight)
return true;
- if (wheelEvent.deltaY() > 0 && m_mainFramePinnedToTheTop && !m_rubberBandsAtTop)
+ if (wheelEvent.deltaY() > 0 && m_swipeState.mainFramePinnedToTheTop && !m_swipeState.rubberBandsAtTop)
return true;
- if (wheelEvent.deltaY() < 0 && m_mainFramePinnedToTheBottom && !m_rubberBandsAtBottom)
+ if (wheelEvent.deltaY() < 0 && m_swipeState.mainFramePinnedToTheBottom && !m_swipeState.rubberBandsAtBottom)
return true;
return false;
@@ -445,20 +399,20 @@
ScrollingNodeID ScrollingTree::latchedNode()
{
- LockHolder locker(m_mutex);
- return m_latchedNodeID;
+ LockHolder locker(m_treeStateMutex);
+ return m_treeState.latchedNodeID;
}
void ScrollingTree::setLatchedNode(ScrollingNodeID node)
{
- LockHolder locker(m_mutex);
- m_latchedNodeID = node;
+ LockHolder locker(m_treeStateMutex);
+ m_treeState.latchedNodeID = node;
}
void ScrollingTree::clearLatchedNode()
{
- LockHolder locker(m_mutex);
- m_latchedNodeID = 0;
+ LockHolder locker(m_treeStateMutex);
+ m_treeState.latchedNodeID = 0;
}
String ScrollingTree::scrollingTreeAsText()
@@ -467,19 +421,18 @@
TextStream::GroupScope scope(ts);
ts << "scrolling tree";
-
- if (m_latchedNodeID)
- ts.dumpProperty("latched node", m_latchedNodeID);
- if (m_mainFrameScrollPosition != IntPoint())
- ts.dumpProperty("main frame scroll position", m_mainFrameScrollPosition);
+ LockHolder locker(m_treeStateMutex);
+
+ if (m_treeState.latchedNodeID)
+ ts.dumpProperty("latched node", m_treeState.latchedNodeID);
+
+ if (!m_treeState.mainFrameScrollPosition.isZero())
+ ts.dumpProperty("main frame scroll position", m_treeState.mainFrameScrollPosition);
- {
- LockHolder lock(m_mutex);
- if (m_rootNode) {
- TextStream::GroupScope scope(ts);
- m_rootNode->dump(ts, ScrollingStateTreeAsTextBehaviorIncludeLayerPositions);
- }
+ if (m_rootNode) {
+ TextStream::GroupScope scope(ts);
+ m_rootNode->dump(ts, ScrollingStateTreeAsTextBehaviorIncludeLayerPositions);
}
return ts.release();
@@ -489,12 +442,12 @@
Optional<TouchActionData> ScrollingTree::touchActionDataAtPoint(IntPoint p) const
{
// FIXME: This does not handle the case where there are multiple regions matching this point.
- for (auto& touchActionData : m_eventTrackingRegions.touchActionData) {
+ for (auto& touchActionData : m_treeState.eventTrackingRegions.touchActionData) {
if (touchActionData.region.contains(p))
return touchActionData;
}
- return WTF::nullopt;
+ return { };
}
#endif
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (242669 => 242670)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2019-03-09 02:35:54 UTC (rev 242669)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2019-03-09 02:35:57 UTC (rev 242670)
@@ -69,8 +69,6 @@
virtual void invalidate() { }
WEBCORE_EXPORT virtual void commitTreeState(std::unique_ptr<ScrollingStateTree>);
- void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom);
-
virtual Ref<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) = 0;
// Called after a scrolling tree node has handled a scroll and updated its layers.
@@ -89,9 +87,6 @@
virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { }
virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { }
- FloatPoint mainFrameScrollPosition();
- WEBCORE_EXPORT virtual FloatRect mainFrameLayoutViewport();
-
#if PLATFORM(IOS_FAMILY)
virtual void scrollingTreeNodeWillStartPanGesture() { }
virtual void scrollingTreeNodeWillStartScroll() { }
@@ -114,13 +109,11 @@
WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0;
#endif
+ void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom);
+
// Can be called from any thread. Will update what edges allow rubber-banding.
WEBCORE_EXPORT void setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom);
- bool rubberBandsAtLeft();
- bool rubberBandsAtRight();
- bool rubberBandsAtTop();
- bool rubberBandsAtBottom();
bool isHandlingProgrammaticScroll();
void setScrollPinningBehavior(ScrollPinningBehavior);
@@ -137,7 +130,7 @@
void setLatchedNode(ScrollingNodeID);
void clearLatchedNode();
- bool hasLatchedNode() const { return m_latchedNodeID; }
+ bool hasLatchedNode() const { return m_treeState.latchedNodeID; }
void setOrClearLatchedNode(const PlatformWheelEvent&, ScrollingNodeID);
bool hasFixedOrSticky() const { return !!m_fixedOrStickyNodeCount; }
@@ -168,26 +161,33 @@
using ScrollingTreeNodeMap = HashMap<ScrollingNodeID, ScrollingTreeNode*>;
ScrollingTreeNodeMap m_nodeMap;
- Lock m_mutex;
- EventTrackingRegions m_eventTrackingRegions;
- FloatPoint m_mainFrameScrollPosition;
+ struct TreeState {
+ ScrollingNodeID latchedNodeID { 0 };
+ EventTrackingRegions eventTrackingRegions;
+ FloatPoint mainFrameScrollPosition;
+ bool mainFrameIsRubberBanding { false };
+ bool mainFrameIsScrollSnapping { false };
+ };
+
+ Lock m_treeStateMutex;
+ TreeState m_treeState;
+ struct SwipeState {
+ ScrollPinningBehavior scrollPinningBehavior { DoNotPin };
+ bool rubberBandsAtLeft { true };
+ bool rubberBandsAtRight { true };
+ bool rubberBandsAtTop { true };
+ bool rubberBandsAtBottom { true };
+ bool mainFramePinnedToTheLeft { true };
+ bool mainFramePinnedToTheRight { true };
+ bool mainFramePinnedToTheTop { true };
+ bool mainFramePinnedToTheBottom { true };
+ };
+
Lock m_swipeStateMutex;
- ScrollPinningBehavior m_scrollPinningBehavior { DoNotPin };
- ScrollingNodeID m_latchedNodeID { 0 };
+ SwipeState m_swipeState;
unsigned m_fixedOrStickyNodeCount { 0 };
-
- bool m_rubberBandsAtLeft { true };
- bool m_rubberBandsAtRight { true };
- bool m_rubberBandsAtTop { true };
- bool m_rubberBandsAtBottom { true };
- bool m_mainFramePinnedToTheLeft { true };
- bool m_mainFramePinnedToTheRight { true };
- bool m_mainFramePinnedToTheTop { true };
- bool m_mainFramePinnedToTheBottom { true };
- bool m_mainFrameIsRubberBanding { false };
- bool m_mainFrameIsScrollSnapping { false };
bool m_scrollingPerformanceLoggingEnabled { false };
bool m_isHandlingProgrammaticScroll { false };
bool m_asyncFrameOrOverflowScrollingEnabled { false };
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (242669 => 242670)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2019-03-09 02:35:54 UTC (rev 242669)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2019-03-09 02:35:57 UTC (rev 242670)
@@ -178,6 +178,7 @@
else if (scrollPosition.x() > maximumScrollPosition().x())
stretch.setWidth(scrollPosition.x() - maximumScrollPosition().x());
+ // FIXME: calling this function should not have these side-effects.
if (scrollingNode().isRootNode()) {
if (stretch.isZero())
scrollingTree().setMainFrameIsRubberBanding(false);
Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.h (242669 => 242670)
--- trunk/Source/WebCore/platform/graphics/FloatPoint.h 2019-03-09 02:35:54 UTC (rev 242669)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.h 2019-03-09 02:35:57 UTC (rev 242670)
@@ -70,6 +70,7 @@
explicit FloatPoint(const FloatSize& size) : m_x(size.width()), m_y(size.height()) { }
static FloatPoint zero() { return FloatPoint(); }
+ bool isZero() const { return !m_x && !m_y; }
WEBCORE_EXPORT static FloatPoint narrowPrecision(double x, double y);