WebKit Bugzilla
Attachment 360668 Details for
Bug 172917
: [Mac] Implement basic hit testing in the scrolling tree
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-172917-20190130184227.patch (text/plain), 63.06 KB, created by
Simon Fraser (smfr)
on 2019-01-30 18:42:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-01-30 18:42:28 PST
Size:
63.06 KB
patch
obsolete
>Subversion Revision: 240713 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fa6bd328897655d2c8ddeebebe22e7986e4112ce..c068d6749a8aaa3578de9eeb4c0e92f1ec223c2b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,78 @@ >+2019-01-30 Simon Fraser <simon.fraser@apple.com> >+ >+ [Mac] Implement basic hit testing in the scrolling tree >+ https://bugs.webkit.org/show_bug.cgi?id=172917 >+ <rdar://problem/34215516> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch >+ by Frédéric Wang. >+ >+ First we pipe the "async scrolling enabled" setting through to the ScrollingTree via >+ the root node (like the other settings; weird, but that's how it's done). For now, >+ we hit test in the scrolling tree if either async overflow or frame scrolling are enabled >+ (it's hard to deal with one without the other). >+ >+ Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing. >+ Two helper functions exist to simplify coordinate conversion: parentToLocalPoint() >+ and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes >+ hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need >+ to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions >+ to do these point mappings. >+ >+ handleWheelEvent() is changed to return a ScrollingEventResult. >+ >+ No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the >+ scrolling tree, rather than doing eventSender stuff everywhere. >+ >+ * page/scrolling/AsyncScrollingCoordinator.cpp: >+ (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): >+ (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const): >+ * page/scrolling/AsyncScrollingCoordinator.h: >+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp: >+ (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): >+ (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): >+ (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled): >+ * page/scrolling/ScrollingStateFrameScrollingNode.h: >+ * page/scrolling/ScrollingTree.cpp: >+ (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): >+ (WebCore::ScrollingTree::handleWheelEvent): >+ (WebCore::ScrollingTree::commitTreeState): >+ (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): >+ * page/scrolling/ScrollingTree.h: >+ (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const): >+ * page/scrolling/ScrollingTreeFrameHostingNode.cpp: >+ (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const): >+ * page/scrolling/ScrollingTreeFrameHostingNode.h: >+ * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: >+ (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const): >+ (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const): >+ * page/scrolling/ScrollingTreeFrameScrollingNode.h: >+ * page/scrolling/ScrollingTreeNode.cpp: >+ (WebCore::ScrollingTreeNode::scrollingNodeForPoint const): >+ * page/scrolling/ScrollingTreeNode.h: >+ (WebCore::ScrollingTreeNode::children const): >+ (WebCore::ScrollingTreeNode::parentToLocalPoint const): >+ (WebCore::ScrollingTreeNode::localToContentsPoint const): >+ * page/scrolling/ScrollingTreeScrollingNode.cpp: >+ (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const): >+ (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const): >+ (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const): >+ (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const): >+ * page/scrolling/ScrollingTreeScrollingNode.h: >+ * page/scrolling/ThreadedScrollingTree.cpp: >+ (WebCore::ThreadedScrollingTree::handleWheelEvent): >+ * page/scrolling/ThreadedScrollingTree.h: >+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: >+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: >+ (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent): >+ * page/scrolling/ios/ScrollingTreeIOS.h: >+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: >+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: >+ (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): >+ * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: >+ > 2019-01-30 Simon Fraser <simon.fraser@apple.com> > > Add some basic geometry information to the scrolling tree >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 11d679ebbcab423c02e3f231904033eabe96c9a0..43e98540e3ea6c7d49731013246bf81c4e234438 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2019-01-30 Simon Fraser <simon.fraser@apple.com> >+ >+ [Mac] Implement basic hit testing in the scrolling tree >+ https://bugs.webkit.org/show_bug.cgi?id=172917 >+ <rdar://problem/34215516> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp. >+ >+ * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: >+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): >+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: >+ * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: >+ * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: >+ (WebKit::ScrollerPairMac::handleWheelEvent): >+ (WebKit::ScrollerPairMac::handleMouseEvent): >+ * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: >+ (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent): >+ (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent): >+ * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: >+ > 2019-01-30 Simon Fraser <simon.fraser@apple.com> > > Add some basic geometry information to the scrolling tree >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index b6bbaf3a7590b76605e3121f158330429b9a5789..d5c8897fe12ce6a4c81c75944870548fac1e9e83 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -5011,7 +5011,7 @@ bool FrameView::wheelEvent(const PlatformWheelEvent& wheelEvent) > if (Page* page = frame().page()) { > if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { > if (scrollingCoordinator->coordinatesScrollingForFrameView(*this)) >- return scrollingCoordinator->handleWheelEvent(*this, wheelEvent); >+ return scrollingCoordinator->handleWheelEvent(*this, wheelEvent) != ScrollingEventResult::DidNotHandleEvent; > } > } > #endif >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index f7d809da1c4f19129582ea14fae9a87076b00bbd..ee127d11cd4d8a91352319f6d1b3d63d872ebcc4 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >@@ -130,30 +130,34 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView) > if (!coordinatesScrollingForFrameView(frameView)) > return; > >- auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID())); >- if (!node) >+ auto* node = m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()); >+ if (!node || !is<ScrollingStateFrameScrollingNode>(*node)) > return; > >+ auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node); >+ > auto* verticalScrollbar = frameView.verticalScrollbar(); > auto* horizontalScrollbar = frameView.horizontalScrollbar(); >- node->setScrollerImpsFromScrollbars(verticalScrollbar, horizontalScrollbar); >- >- node->setFrameScaleFactor(frameView.frame().frameScaleFactor()); >- node->setHeaderHeight(frameView.headerHeight()); >- node->setFooterHeight(frameView.footerHeight()); >- node->setTopContentInset(frameView.topContentInset()); >- >- node->setVisualViewportEnabled(visualViewportEnabled()); >- node->setLayoutViewport(frameView.layoutViewportRect()); >- node->setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin()); >- node->setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin()); >- >- node->setScrollOrigin(frameView.scrollOrigin()); >- node->setScrollableAreaSize(frameView.visibleContentRect().size()); >- node->setTotalContentsSize(frameView.totalContentsSize()); >- node->setReachableContentsSize(frameView.totalContentsSize()); >- node->setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame()); >- node->setScrollBehaviorForFixedElements(frameView.scrollBehaviorForFixedElements()); >+ frameScrollingNode.setScrollerImpsFromScrollbars(verticalScrollbar, horizontalScrollbar); >+ >+ frameScrollingNode.setFrameScaleFactor(frameView.frame().frameScaleFactor()); >+ frameScrollingNode.setHeaderHeight(frameView.headerHeight()); >+ frameScrollingNode.setFooterHeight(frameView.footerHeight()); >+ frameScrollingNode.setTopContentInset(frameView.topContentInset()); >+ >+ frameScrollingNode.setVisualViewportEnabled(visualViewportEnabled()); >+ frameScrollingNode.setLayoutViewport(frameView.layoutViewportRect()); >+ frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(asyncFrameOrOverflowScrollingEnabled()); >+ >+ frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin()); >+ frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin()); >+ >+ frameScrollingNode.setScrollOrigin(frameView.scrollOrigin()); >+ frameScrollingNode.setScrollableAreaSize(frameView.visibleContentRect().size()); >+ frameScrollingNode.setTotalContentsSize(frameView.totalContentsSize()); >+ frameScrollingNode.setReachableContentsSize(frameView.totalContentsSize()); >+ frameScrollingNode.setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame()); >+ frameScrollingNode.setScrollBehaviorForFixedElements(frameView.scrollBehaviorForFixedElements()); > > #if ENABLE(CSS_SCROLL_SNAP) > frameView.updateSnapOffsets(); >@@ -164,7 +168,7 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView) > auto* page = frameView.frame().page(); > if (page && page->expectsWheelEventTriggers()) { > LOG(WheelEventTestTriggers, " AsyncScrollingCoordinator::frameViewLayoutUpdated: Expects wheel event test trigger=%d", page->expectsWheelEventTriggers()); >- node->setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers()); >+ frameScrollingNode.setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers()); > } > #endif > >@@ -177,7 +181,7 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView) > scrollParameters.verticalScrollbarMode = frameView.verticalScrollbarMode(); > scrollParameters.useDarkAppearanceForScrollbars = frameView.useDarkAppearanceForScrollbars(); > >- node->setScrollableAreaParameters(scrollParameters); >+ frameScrollingNode.setScrollableAreaParameters(scrollParameters); > } > > void AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView(const FrameView& frameView) >@@ -679,6 +683,12 @@ bool AsyncScrollingCoordinator::visualViewportEnabled() const > return m_page->mainFrame().settings().visualViewportEnabled(); > } > >+bool AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled() const >+{ >+ auto& settings = m_page->mainFrame().settings(); >+ return settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled(); >+} >+ > String AsyncScrollingCoordinator::scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior behavior) const > { > if (m_scrollingStateTree->rootStateNode()) { >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >index cc23da8f0be8926a1443ae15394042cf27abed34..345a374b4a6ca60fe3cc857be0b5e0713ccaa1bc 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >@@ -90,6 +90,7 @@ private: > bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const override { return false; } > > bool visualViewportEnabled() const; >+ bool asyncFrameOrOverflowScrollingEnabled() const; > > WEBCORE_EXPORT void frameViewLayoutUpdated(FrameView&) override; > WEBCORE_EXPORT void frameViewRootLayerDidChange(FrameView&) override; >diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >index 53322f666160c12f45acaadc90408fe03c5fe8e2..02cbb27391935a3614001183c01d167c6926ead8 100644 >--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >@@ -111,7 +111,7 @@ public: > // These virtual functions are currently unique to the threaded scrolling architecture. > virtual void commitTreeStateIfNeeded() { } > virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; } >- virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return true; } >+ virtual ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return ScrollingEventResult::DidNotHandleEvent; } > > // Create an unparented node. > virtual ScrollingNodeID createNode(ScrollingNodeType, ScrollingNodeID newNodeID) { return newNodeID; } >diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h b/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h >index 137ebd2ffcc9c8fe400c0cec67d6016967914b15..5d6e2009b0aa95dfdf0366b9c1369ae0655f5b87 100644 >--- a/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h >+++ b/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h >@@ -80,6 +80,12 @@ struct ScrollableAreaParameters { > } > }; > >+enum class ScrollingEventResult { >+ DidNotHandleEvent, >+ DidHandleEvent, >+ SendToMainThread >+}; >+ > enum class ViewportRectStability { > Stable, > Unstable, >diff --git a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp >index 76b1d0f56c48c9024f7992ef2f14f079ccddf36c..66cd7ecef88bff7ee19dbe7c5351e06619ff9668 100644 >--- a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp >@@ -64,6 +64,7 @@ ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const Scrolli > , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll()) > , m_fixedElementsLayoutRelativeToFrame(stateNode.fixedElementsLayoutRelativeToFrame()) > , m_visualViewportEnabled(stateNode.visualViewportEnabled()) >+ , m_asyncFrameOrOverflowScrollingEnabled(stateNode.asyncFrameOrOverflowScrollingEnabled()) > { > if (hasChangedProperty(CounterScrollingLayer)) > setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); >@@ -114,6 +115,7 @@ void ScrollingStateFrameScrollingNode::setAllPropertiesChanged() > setPropertyChangedBit(TopContentInset); > setPropertyChangedBit(FixedElementsLayoutRelativeToFrame); > setPropertyChangedBit(VisualViewportEnabled); >+ setPropertyChangedBit(AsyncFrameOrOverflowScrollingEnabled); > setPropertyChangedBit(LayoutViewport); > setPropertyChangedBit(MinLayoutViewportOrigin); > setPropertyChangedBit(MaxLayoutViewportOrigin); >@@ -294,6 +296,15 @@ void ScrollingStateFrameScrollingNode::setVisualViewportEnabled(bool visualViewp > setPropertyChanged(VisualViewportEnabled); > } > >+void ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled(bool enabled) >+{ >+ if (enabled == m_asyncFrameOrOverflowScrollingEnabled) >+ return; >+ >+ m_asyncFrameOrOverflowScrollingEnabled = enabled; >+ setPropertyChanged(AsyncFrameOrOverflowScrollingEnabled); >+} >+ > #if !PLATFORM(MAC) > void ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars(Scrollbar*, Scrollbar*) > { >diff --git a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h >index 7b5970a5443efdfecb0ec35cad0e33d905868edb..f5d8646ef407707684be7a4dbcbe95e7bf4151d8 100644 >--- a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h >@@ -64,6 +64,7 @@ public: > TopContentInset, > FixedElementsLayoutRelativeToFrame, > VisualViewportEnabled, >+ AsyncFrameOrOverflowScrollingEnabled, > LayoutViewport, > MinLayoutViewportOrigin, > MaxLayoutViewportOrigin, >@@ -127,12 +128,16 @@ public: > const LayerRepresentation& horizontalScrollbarLayer() const { return m_horizontalScrollbarLayer; } > WEBCORE_EXPORT void setHorizontalScrollbarLayer(const LayerRepresentation&); > >+ // These are more like Settings, and should probably move to the Scrolling{State}Tree itself. > bool fixedElementsLayoutRelativeToFrame() const { return m_fixedElementsLayoutRelativeToFrame; } > WEBCORE_EXPORT void setFixedElementsLayoutRelativeToFrame(bool); > > bool visualViewportEnabled() const { return m_visualViewportEnabled; }; > WEBCORE_EXPORT void setVisualViewportEnabled(bool); > >+ bool asyncFrameOrOverflowScrollingEnabled() const { return m_asyncFrameOrOverflowScrollingEnabled; } >+ void setAsyncFrameOrOverflowScrollingEnabled(bool); >+ > #if PLATFORM(MAC) > NSScrollerImp *verticalScrollerImp() const { return m_verticalScrollerImp.get(); } > NSScrollerImp *horizontalScrollerImp() const { return m_horizontalScrollerImp.get(); } >@@ -176,6 +181,7 @@ private: > bool m_requestedScrollPositionRepresentsProgrammaticScroll { false }; > bool m_fixedElementsLayoutRelativeToFrame { false }; > bool m_visualViewportEnabled { false }; >+ bool m_asyncFrameOrOverflowScrollingEnabled { false }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.cpp b/Source/WebCore/page/scrolling/ScrollingTree.cpp >index 7fb27f0327f3c68c65dadd23ae21f831d9406b28..27907010a53263c2a0024d1104564a9f3be0a402 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTree.cpp >@@ -65,6 +65,8 @@ bool ScrollingTree::shouldHandleWheelEventSynchronously(const PlatformWheelEvent > > 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; > LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree::shouldHandleWheelEventSynchronously: wheelEvent at " << wheelEvent.position() << " mapped to content point " << position << ", in non-fast region " << isSynchronousDispatchRegion); >@@ -83,10 +85,41 @@ void ScrollingTree::setOrClearLatchedNode(const PlatformWheelEvent& wheelEvent, > clearLatchedNode(); > } > >-void ScrollingTree::handleWheelEvent(const PlatformWheelEvent& wheelEvent) >+ScrollingEventResult ScrollingTree::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > { >- if (m_rootNode) >- downcast<ScrollingTreeScrollingNode>(*m_rootNode).handleWheelEvent(wheelEvent); >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree " << this << " handleWheelEvent (async scrolling enabled: " << asyncFrameOrOverflowScrollingEnabled() << ")"); >+ >+ if (!asyncFrameOrOverflowScrollingEnabled()) { >+ if (m_rootNode) >+ downcast<ScrollingTreeScrollingNode>(*m_rootNode).handleWheelEvent(wheelEvent); >+ return ScrollingEventResult::DidNotHandleEvent; >+ } >+ >+ if (hasLatchedNode()) { >+ auto* node = nodeForID(latchedNode()); >+ if (is<ScrollingTreeScrollingNode>(node)) >+ return downcast<ScrollingTreeScrollingNode>(*node).handleWheelEvent(wheelEvent); >+ } >+ >+ if (m_rootNode) { >+ auto& frameScrollingNode = downcast<ScrollingTreeFrameScrollingNode>(*m_rootNode); >+ >+ FloatPoint position = wheelEvent.position(); >+ ScrollingTreeNode* node = frameScrollingNode.scrollingNodeForPoint(LayoutPoint(position)); >+ >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree::handleWheelEvent found node " << (node ? node->scrollingNodeID() : 0) << " for point " << position << "\n"); >+ >+ while (node) { >+ if (is<ScrollingTreeScrollingNode>(*node)) { >+ auto& scrollingNode = downcast<ScrollingTreeScrollingNode>(*node); >+ // FIXME: this needs to consult latching logic. >+ if (scrollingNode.handleWheelEvent(wheelEvent) == ScrollingEventResult::DidHandleEvent) >+ return ScrollingEventResult::DidHandleEvent; >+ } >+ node = node->parent(); >+ } >+ } >+ return ScrollingEventResult::DidNotHandleEvent; > } > > void ScrollingTree::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& fixedPositionRect, double scale) >@@ -115,14 +148,15 @@ void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> scrollin > { > bool rootStateNodeChanged = scrollingStateTree->hasNewRootStateNode(); > >- LOG(Scrolling, "\nScrollingTree::commitTreeState"); >+ LOG(Scrolling, "\nScrollingTree %p commitTreeState", this); > > auto* rootNode = scrollingStateTree->rootStateNode(); > if (rootNode > && (rootStateNodeChanged > || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::EventTrackingRegion) > || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer) >- || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::VisualViewportEnabled))) { >+ || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::VisualViewportEnabled) >+ || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::AsyncFrameOrOverflowScrollingEnabled))) { > LockHolder lock(m_mutex); > > if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) >@@ -133,6 +167,9 @@ void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> scrollin > > if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::VisualViewportEnabled)) > m_visualViewportEnabled = scrollingStateTree->rootStateNode()->visualViewportEnabled(); >+ >+ if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::AsyncFrameOrOverflowScrollingEnabled)) >+ m_asyncFrameOrOverflowScrollingEnabled = scrollingStateTree->rootStateNode()->asyncFrameOrOverflowScrollingEnabled(); > } > > bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false; >@@ -223,6 +260,12 @@ ScrollingTreeNode* ScrollingTree::nodeForID(ScrollingNodeID nodeID) const > return m_nodeMap.get(nodeID); > } > >+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); >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h >index ec3dd6e0766537b53ac3a475e968b11697eca77f..d9378532ddc619ea72a5a2a3fa22cd84c832b0ca 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ScrollingTree.h >@@ -50,19 +50,17 @@ public: > WEBCORE_EXPORT ScrollingTree(); > WEBCORE_EXPORT virtual ~ScrollingTree(); > >- enum EventResult { >- DidNotHandleEvent, >- DidHandleEvent, >- SendToMainThread >- }; >- > virtual bool isThreadedScrollingTree() const { return false; } > virtual bool isRemoteScrollingTree() const { return false; } > virtual bool isScrollingTreeIOS() const { return false; } > > bool visualViewportEnabled() const { return m_visualViewportEnabled; } > >- virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) = 0; >+ // This implies that we'll do hit-testing in the scrolling tree. >+ bool asyncFrameOrOverflowScrollingEnabled() const { return m_asyncFrameOrOverflowScrollingEnabled; } >+ void setAsyncFrameOrOverflowScrollingEnabled(bool); >+ >+ virtual ScrollingEventResult tryToHandleWheelEvent(const PlatformWheelEvent&) = 0; > WEBCORE_EXPORT bool shouldHandleWheelEventSynchronously(const PlatformWheelEvent&); > > void setMainFrameIsRubberBanding(bool); >@@ -160,7 +158,7 @@ protected: > void setMainFrameScrollPosition(FloatPoint); > void setVisualViewportEnabled(bool b) { m_visualViewportEnabled = b; } > >- WEBCORE_EXPORT virtual void handleWheelEvent(const PlatformWheelEvent&); >+ WEBCORE_EXPORT virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&); > > private: > using OrphanScrollingNodeMap = HashMap<ScrollingNodeID, RefPtr<ScrollingTreeNode>>; >@@ -196,6 +194,7 @@ private: > bool m_scrollingPerformanceLoggingEnabled { false }; > bool m_isHandlingProgrammaticScroll { false }; > bool m_visualViewportEnabled { false }; >+ bool m_asyncFrameOrOverflowScrollingEnabled { false }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.cpp >index 24ad08fdb767d6ed35a7e9eedbe61c58b9601143..e1607e7700b757124526531dd190cf44bfbacf5e 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.cpp >@@ -66,6 +66,11 @@ void ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange(const Scroll > child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta); > } > >+LayoutPoint ScrollingTreeFrameHostingNode::parentToLocalPoint(LayoutPoint point) const >+{ >+ return point - toLayoutSize(parentRelativeScrollableRect().location()); >+} >+ > void ScrollingTreeFrameHostingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const > { > ts << "frame hosting node"; >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.h >index 5c3b7974358012e2045639797f11d7f8022efe3d..ddf7adc61c405e7398635d43e6505d0994ceb7c5 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.h >@@ -46,6 +46,8 @@ private: > > const LayoutRect& parentRelativeScrollableRect() const { return m_parentRelativeScrollableRect; } > >+ LayoutPoint parentToLocalPoint(LayoutPoint) const final; >+ > WEBCORE_EXPORT void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; > > LayoutRect m_parentRelativeScrollableRect; >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp >index f15a559d6e7114292a8ffc6976246d9c89024c8a..d0a9fb531e268909916b6a1c860d36fb64bf50ad 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp >@@ -126,6 +126,17 @@ FloatSize ScrollingTreeFrameScrollingNode::viewToContentsOffset(const FloatPoint > return toFloatSize(scrollPosition) - FloatSize(0, headerHeight() + topContentInset()); > } > >+LayoutPoint ScrollingTreeFrameScrollingNode::parentToLocalPoint(LayoutPoint point) const >+{ >+ return point - LayoutSize(0, headerHeight() + topContentInset()); >+} >+ >+LayoutPoint ScrollingTreeFrameScrollingNode::localToContentsPoint(LayoutPoint point) const >+{ >+ auto scrolledPoint = point + LayoutPoint(scrollPosition()); >+ return scrolledPoint.scaled(1 / frameScaleFactor()); >+} >+ > void ScrollingTreeFrameScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const > { > ts << "frame scrolling node"; >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >index 7b08a675e2c29640dc1add92d8d3132b7ea80656..18c913f7b40d7c3b68dcf3f0a173f8a98ee5a9a0 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >@@ -44,7 +44,7 @@ public: > // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children. > void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { } > >- void handleWheelEvent(const PlatformWheelEvent&) override = 0; >+ ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override = 0; > void setScrollPosition(const FloatPoint&) override; > void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override = 0; > >@@ -80,6 +80,9 @@ protected: > ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; } > > private: >+ WEBCORE_EXPORT LayoutPoint parentToLocalPoint(LayoutPoint) const final; >+ WEBCORE_EXPORT LayoutPoint localToContentsPoint(LayoutPoint) const final; >+ > WEBCORE_EXPORT void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; > > FloatRect m_layoutViewport; >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp >index 0503cdb26caf7a20d1d1e10d22f6588503b54213..5855d5ea5588161f2ee4cc3bee9bf38e9beca3b3 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp >@@ -98,6 +98,21 @@ void ScrollingTreeNode::dump(TextStream& ts, ScrollingStateTreeAsTextBehavior be > } > } > >+ScrollingTreeScrollingNode* ScrollingTreeNode::scrollingNodeForPoint(LayoutPoint parentPoint) const >+{ >+ LayoutPoint localPoint = parentToLocalPoint(parentPoint); >+ LayoutPoint contentsPoint = localToContentsPoint(localPoint); >+ >+ if (children()) { >+ for (auto iterator = children()->rbegin(), end = children()->rend(); iterator != end; iterator++) { >+ if (auto node = (**iterator).scrollingNodeForPoint(contentsPoint)) >+ return node; >+ } >+ } >+ >+ return nullptr; >+} >+ > } // namespace WebCore > > #endif // ENABLE(ASYNC_SCROLLING) >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeNode.h b/Source/WebCore/page/scrolling/ScrollingTreeNode.h >index 2ae1a361f8197ad78ccf26d15a9c944b3d624060..b5096ab7880dd1b3d0fb63988c194aba5b195515 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeNode.h >@@ -40,6 +40,7 @@ namespace WebCore { > class ScrollingStateFixedNode; > class ScrollingStateScrollingNode; > class ScrollingTreeFrameScrollingNode; >+class ScrollingTreeScrollingNode; > > class ScrollingTreeNode : public RefCounted<ScrollingTreeNode> { > public: >@@ -64,6 +65,7 @@ public: > void setParent(ScrollingTreeNode* parent) { m_parent = parent; } > > Vector<RefPtr<ScrollingTreeNode>>* children() { return m_children.get(); } >+ const Vector<RefPtr<ScrollingTreeNode>>* children() const { return m_children.get(); } > > void appendChild(Ref<ScrollingTreeNode>&&); > void removeChild(ScrollingTreeNode&); >@@ -72,6 +74,10 @@ public: > > WEBCORE_EXPORT void dump(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const; > >+ virtual LayoutPoint parentToLocalPoint(LayoutPoint point) const { return point; } >+ virtual LayoutPoint localToContentsPoint(LayoutPoint point) const { return point; } >+ virtual ScrollingTreeScrollingNode* scrollingNodeForPoint(LayoutPoint) const; >+ > protected: > ScrollingTreeNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); > ScrollingTree& scrollingTree() const { return m_scrollingTree; } >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >index 6b56b1fe6c6bd9fb0320da74785e1cd345521b0f..dcc96f1cb62517931119f9f0f63778068512a6f4 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >@@ -28,6 +28,7 @@ > > #if ENABLE(ASYNC_SCROLLING) > >+#include "Logging.h" > #include "ScrollingStateScrollingNode.h" > #include "ScrollingStateTree.h" > #include "ScrollingTree.h" >@@ -133,6 +134,35 @@ FloatPoint ScrollingTreeScrollingNode::maximumScrollPosition() const > return FloatPoint(contentSizePoint - scrollableAreaSize()).expandedTo(FloatPoint()); > } > >+bool ScrollingTreeScrollingNode::scrollLimitReached(const PlatformWheelEvent& wheelEvent) const >+{ >+ FloatPoint oldScrollPosition = scrollPosition(); >+ FloatPoint newScrollPosition = oldScrollPosition + FloatSize(wheelEvent.deltaX(), -wheelEvent.deltaY()); >+ newScrollPosition = newScrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); >+ return newScrollPosition == oldScrollPosition; >+} >+ >+LayoutPoint ScrollingTreeScrollingNode::parentToLocalPoint(LayoutPoint point) const >+{ >+ return point - toLayoutSize(parentRelativeScrollableRect().location()); >+} >+ >+LayoutPoint ScrollingTreeScrollingNode::localToContentsPoint(LayoutPoint point) const >+{ >+ return point + LayoutPoint(scrollPosition()); >+} >+ >+ScrollingTreeScrollingNode* ScrollingTreeScrollingNode::scrollingNodeForPoint(LayoutPoint parentPoint) const >+{ >+ if (auto* node = ScrollingTreeNode::scrollingNodeForPoint(parentPoint)) >+ return node; >+ >+ if (parentRelativeScrollableRect().contains(parentPoint)) >+ return const_cast<ScrollingTreeScrollingNode*>(this); >+ >+ return nullptr; >+} >+ > void ScrollingTreeScrollingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const > { > ScrollingTreeNode::dumpProperties(ts, behavior); >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >index 70bd81d006d6e78f1b0de7aaf9312dbbc4011f37..f652b2d261e637188c69bd13f4471192e9baa573 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >@@ -55,7 +55,7 @@ public: > > WEBCORE_EXPORT void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override; > >- virtual void handleWheelEvent(const PlatformWheelEvent&) = 0; >+ virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) = 0; > WEBCORE_EXPORT virtual void setScrollPosition(const FloatPoint&); > WEBCORE_EXPORT virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&); > >@@ -79,6 +79,9 @@ public: > > bool useDarkAppearanceForScrollbars() const { return m_scrollableAreaParameters.useDarkAppearanceForScrollbars; } > >+ bool scrollLimitReached(const PlatformWheelEvent&) const; >+ WEBCORE_EXPORT ScrollingTreeScrollingNode* scrollingNodeForPoint(LayoutPoint) const override; >+ > protected: > ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID); > >@@ -106,6 +109,9 @@ protected: > > bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; } > >+ WEBCORE_EXPORT LayoutPoint parentToLocalPoint(LayoutPoint) const override; >+ WEBCORE_EXPORT LayoutPoint localToContentsPoint(LayoutPoint) const override; >+ > WEBCORE_EXPORT void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; > > private: >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >index 06b319609ea99223f00e11a9a81c1c64afa24c3c..127b95fc406c96d1ce040667b85870211bbe69ac 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp >@@ -48,26 +48,26 @@ ThreadedScrollingTree::~ThreadedScrollingTree() > ASSERT(!m_scrollingCoordinator); > } > >-ScrollingTree::EventResult ThreadedScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent& wheelEvent) >+ScrollingEventResult ThreadedScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent& wheelEvent) > { > if (shouldHandleWheelEventSynchronously(wheelEvent)) >- return SendToMainThread; >+ return ScrollingEventResult::SendToMainThread; > > if (willWheelEventStartSwipeGesture(wheelEvent)) >- return DidNotHandleEvent; >+ return ScrollingEventResult::DidNotHandleEvent; > > RefPtr<ThreadedScrollingTree> protectedThis(this); > ScrollingThread::dispatch([protectedThis, wheelEvent] { > protectedThis->handleWheelEvent(wheelEvent); > }); > >- return DidHandleEvent; >+ return ScrollingEventResult::DidHandleEvent; > } > >-void ThreadedScrollingTree::handleWheelEvent(const PlatformWheelEvent& wheelEvent) >+ScrollingEventResult ThreadedScrollingTree::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > { > ASSERT(ScrollingThread::isCurrentThread()); >- ScrollingTree::handleWheelEvent(wheelEvent); >+ return ScrollingTree::handleWheelEvent(wheelEvent); > } > > void ThreadedScrollingTree::invalidate() >diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >index 402c2d92b2a2e8520b6d71c53d4e5ab368772188..e506ddd05b973a3db1aa68a372f71ecb06364e8a 100644 >--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h >@@ -45,12 +45,12 @@ public: > > void commitTreeState(std::unique_ptr<ScrollingStateTree>) override; > >- void handleWheelEvent(const PlatformWheelEvent&) override; >+ ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > // Can be called from any thread. Will try to handle the wheel event on the scrolling thread. > // Returns true if the wheel event can be handled on the scrolling thread and false if the > // event must be sent again to the WebCore event handler. >- EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) override; >+ ScrollingEventResult tryToHandleWheelEvent(const PlatformWheelEvent&) override; > > void invalidate() override; > >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h >index 595304c6ab5010159d0dba0a6095de61eae1f312..9cf639ecbd4e07589cb9a28bcf7d9b2b4f896fe0 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h >+++ b/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h >@@ -47,7 +47,7 @@ public: > void commitTreeStateIfNeeded() override; > > // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not. >- bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override { return false; } >+ ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) override { return ScrollingEventResult::DidNotHandleEvent; } > > private: > void scheduleTreeStateCommit() override; >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >index 56a4790747d6035c0e934a26d7f4cd9951500f7b..8a61a0f1c0063ddd59943f1593a6db36763d4541 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >@@ -46,7 +46,7 @@ protected: > void commitStateBeforeChildren(const ScrollingStateNode&) override; > void commitStateAfterChildren(const ScrollingStateNode&) override; > >- void handleWheelEvent(const PlatformWheelEvent&) override { } >+ ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > FloatPoint scrollPosition() const override; > void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >index 24debd0bed7bce81e3d39f885c95a7a3968244f1..a4146a2a63610605e8b2fd3d52a758bdab4d3bdd 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >@@ -96,6 +96,11 @@ void ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren(const Scrollin > setScrollPosition(scrollingStateNode.requestedScrollPosition()); > } > >+ScrollingEventResult ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent(const PlatformWheelEvent&) >+{ >+ return ScrollingEventResult::DidNotHandleEvent; >+} >+ > FloatPoint ScrollingTreeFrameScrollingNodeIOS::scrollPosition() const > { > if (shouldUpdateScrollLayerPositionSynchronously()) >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h >index fcc7ee2071301fb01d81153df391056d1ac119c4..e9035d0a22c904e8008d73c920e130d7696e9b8e 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h >@@ -45,8 +45,8 @@ private: > bool isScrollingTreeIOS() const final { return true; } > > // No wheel events on iOS >- void handleWheelEvent(const PlatformWheelEvent&) final { } >- EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) final { return DidNotHandleEvent; } >+ ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) final { return ScrollingEventResult::DidNotHandleEvent; } >+ ScrollingEventResult tryToHandleWheelEvent(const PlatformWheelEvent&) final { return ScrollingEventResult::DidNotHandleEvent; } > > void invalidate() final; > >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h >index abf0d79911fd1233785b7c190d68ff487eea330c..893969b6a683b6f4b3fef405da1224a9282d139f 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h >@@ -47,7 +47,7 @@ public: > void commitTreeStateIfNeeded() override; > > // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not. >- bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override; >+ ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) override; > > private: > void scheduleTreeStateCommit() override; >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm >index 572e427b161039bd2a3356af884a339e9d73d9a3..d157ceb963143f878e81bbaa502474d0737c7ddd 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm >@@ -82,19 +82,19 @@ void ScrollingCoordinatorMac::commitTreeStateIfNeeded() > m_scrollingStateTreeCommitterTimer.stop(); > } > >-bool ScrollingCoordinatorMac::handleWheelEvent(FrameView&, const PlatformWheelEvent& wheelEvent) >+ScrollingEventResult ScrollingCoordinatorMac::handleWheelEvent(FrameView&, const PlatformWheelEvent& wheelEvent) > { > ASSERT(isMainThread()); > ASSERT(m_page); > > if (scrollingTree()->willWheelEventStartSwipeGesture(wheelEvent)) >- return false; >+ return ScrollingEventResult::DidNotHandleEvent; > > RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree()); > ScrollingThread::dispatch([threadedScrollingTree, wheelEvent] { > threadedScrollingTree->handleWheelEvent(wheelEvent); > }); >- return true; >+ return ScrollingEventResult::DidHandleEvent; > } > > void ScrollingCoordinatorMac::scheduleTreeStateCommit() >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >index 5faf3fb5c44f81d4eb4de1976d52ac9663cef0da..178f1af644aad371c37d3df3a45d2b4b9c9532ad 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >@@ -51,7 +51,7 @@ protected: > void commitStateBeforeChildren(const ScrollingStateNode&) override; > void commitStateAfterChildren(const ScrollingStateNode&) override; > >- void handleWheelEvent(const PlatformWheelEvent&) override; >+ ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > // ScrollController member functions. > bool allowsHorizontalStretching(const PlatformWheelEvent&) override; >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >index 06cb84975716abfa7c23e3dd1153255c27bc5668..0b3cbdb15a51df737c55342fec7c39446321e551 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >@@ -184,10 +184,13 @@ void ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren(const Scrollin > updateMainFramePinState(scrollPosition()); > } > >-void ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent) >+ScrollingEventResult ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > { > if (!canHaveScrollbars()) >- return; >+ return ScrollingEventResult::DidNotHandleEvent; >+ >+ if (scrollLimitReached(wheelEvent)) >+ return ScrollingEventResult::DidNotHandleEvent; > > if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseBegan) { > [m_verticalScrollerImp setUsePresentationValue:YES]; >@@ -215,6 +218,9 @@ void ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(const PlatformWheelEve > #endif > scrollingTree().setOrClearLatchedNode(wheelEvent, scrollingNodeID()); > scrollingTree().handleWheelEventPhase(wheelEvent.phase()); >+ >+ // FIXME: This needs to return whether the event was handled. >+ return ScrollingEventResult::DidHandleEvent; > } > > // FIXME: We should find a way to share some of the code from newGestureIsStarting(), isAlreadyPinnedInDirectionOfGesture(), >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h >index f1eedbedef3db06259ad16c5f707e5d2b3538962..ce397b9926ba6e77df0ab0de584f9a0b624edca1 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h >@@ -51,7 +51,7 @@ private: > > void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override; > >- void handleWheelEvent(const WebCore::PlatformWheelEvent&) override { } >+ ScrollingEventResult handleWheelEvent(const WebCore::PlatformWheelEvent&) override { return ScrollingEventResult::DidNotHandleEvent; } > }; > > } // namespace WebKit >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >index 68eaa980107bbdd0a57fbe0f059ea84e26baa5eb..0d343ab64085a1eba90fb3da15265336e4006fd4 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp >@@ -67,9 +67,9 @@ void ScrollingCoordinatorNicosia::commitTreeStateIfNeeded() > m_scrollingStateTreeCommitterTimer.stop(); > } > >-bool ScrollingCoordinatorNicosia::handleWheelEvent(FrameView&, const PlatformWheelEvent&) >+ScrollingEventResult ScrollingCoordinatorNicosia::handleWheelEvent(FrameView&, const PlatformWheelEvent&) > { >- return false; >+ return ScrollingEventResult::DidNotHandleEvent; > } > > void ScrollingCoordinatorNicosia::scheduleTreeStateCommit() >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h b/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h >index 71cc9fa5240c6aa70b897097b9b4cf83fff5cbd9..237d7c2e924cfa5c21b39ccec78e875a34a37256 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.h >@@ -44,7 +44,7 @@ public: > > void commitTreeStateIfNeeded() override; > >- bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override; >+ ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) override; > > private: > void scheduleTreeStateCommit() override; >diff --git a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp b/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp >index 0d01f33c1c8284eaeba57f67f9cae10a41f56905..8b38a42ecd36d1bdc9afd830fb40aa14d5eb9fe4 100644 >--- a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp >+++ b/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp >@@ -158,6 +158,7 @@ void ArgumentCoder<ScrollingStateFrameScrollingNode>::encode(Encoder& encoder, c > SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::TopContentInset, topContentInset) > SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FixedElementsLayoutRelativeToFrame, fixedElementsLayoutRelativeToFrame) > SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::VisualViewportEnabled, visualViewportEnabled) >+ // AsyncFrameOrOverflowScrollingEnabled is not relevant for UI-side compositing. > SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::LayoutViewport, layoutViewport) > SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::MinLayoutViewportOrigin, minLayoutViewportOrigin) > SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin, maxLayoutViewportOrigin) >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >index f964fc981ed314cab7eb44ef83cd369287fae34c..9752e9544398d9016312a581bf9a4d1620adcc60 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >@@ -151,8 +151,8 @@ void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& > > bool RemoteScrollingCoordinatorProxy::handleWheelEvent(const PlatformWheelEvent& event) > { >- ScrollingTree::EventResult result = m_scrollingTree->tryToHandleWheelEvent(event); >- return result == ScrollingTree::DidHandleEvent; // FIXME: handle other values. >+ ScrollingEventResult result = m_scrollingTree->tryToHandleWheelEvent(event); >+ return result == ScrollingEventResult::DidHandleEvent; // FIXME: handle other values. > } > > void RemoteScrollingCoordinatorProxy::handleMouseEvent(const WebCore::PlatformMouseEvent& event) >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >index 26d970930ab46b7f2e95b626721838fadc2c6f38..f30e25ca112918babab686a051112be7758c7161 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp >@@ -59,16 +59,16 @@ RemoteScrollingTree::~RemoteScrollingTree() > { > } > >-ScrollingTree::EventResult RemoteScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent& wheelEvent) >+ScrollingEventResult RemoteScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent& wheelEvent) > { > if (shouldHandleWheelEventSynchronously(wheelEvent)) >- return SendToMainThread; >+ return ScrollingEventResult::SendToMainThread; > > if (willWheelEventStartSwipeGesture(wheelEvent)) >- return DidNotHandleEvent; >+ return ScrollingEventResult::DidNotHandleEvent; > > handleWheelEvent(wheelEvent); >- return DidHandleEvent; >+ return ScrollingEventResult::DidHandleEvent; > } > > #if PLATFORM(MAC) >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h >index 685b4f5118764a647cc1a0ea21c81d3fa16f2dd9..a5f46521fcec84f1b10a1c04b6e408e02e508bf7 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h >@@ -45,7 +45,7 @@ public: > virtual ~RemoteScrollingTree(); > > bool isRemoteScrollingTree() const override { return true; } >- EventResult tryToHandleWheelEvent(const WebCore::PlatformWheelEvent&) override; >+ WebCore::ScrollingEventResult tryToHandleWheelEvent(const WebCore::PlatformWheelEvent&) override; > > void handleMouseEvent(const WebCore::PlatformMouseEvent&); > >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h >index 842a9877a74d51e90689d0114ac470ca0fbad16f..bfbeb08614eb458518804c7351ddc49cc42a797b 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h >@@ -53,7 +53,7 @@ private: > > void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override; > >- void handleWheelEvent(const WebCore::PlatformWheelEvent&) override { } >+ WebCore::ScrollingEventResult handleWheelEvent(const WebCore::PlatformWheelEvent&) override { return ScrollingEventResult::DidNotHandleEvent; } > > std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate; > }; >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h >index f0725a02a2817c458c9819167b6a25ef2050856c..b310b108d2072d0a6e24c9579e35b3d35292abda 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h >@@ -52,8 +52,8 @@ public: > ScrollerMac& verticalScroller() { return m_verticalScroller; } > ScrollerMac& horizontalScroller() { return m_horizontalScroller; } > >- void handleWheelEvent(const WebCore::PlatformWheelEvent&); >- void handleMouseEvent(const WebCore::PlatformMouseEvent&); >+ bool handleWheelEvent(const WebCore::PlatformWheelEvent&); >+ bool handleMouseEvent(const WebCore::PlatformMouseEvent&); > > void updateValues(); > >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm >index 9b9f678905332aae654837eb0a5182e1239ba9fe..c226fc595a40940666a78a4d16be072819487e71 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm >@@ -141,7 +141,7 @@ ScrollerPairMac::~ScrollerPairMac() > [m_scrollerImpPair setDelegate:nil]; > } > >-void ScrollerPairMac::handleWheelEvent(const WebCore::PlatformWheelEvent& event) >+bool ScrollerPairMac::handleWheelEvent(const WebCore::PlatformWheelEvent& event) > { > switch (event.phase()) { > case WebCore::PlatformWheelEventPhaseBegan: >@@ -158,15 +158,19 @@ void ScrollerPairMac::handleWheelEvent(const WebCore::PlatformWheelEvent& event) > default: > break; > } >+ // FIXME: this needs to return whether the event was handled. >+ return true; > } > >-void ScrollerPairMac::handleMouseEvent(const WebCore::PlatformMouseEvent& event) >+bool ScrollerPairMac::handleMouseEvent(const WebCore::PlatformMouseEvent& event) > { > if (event.type() != WebCore::PlatformEvent::MouseMoved) >- return; >+ return false; > > m_lastKnownMousePosition = event.position(); > [m_scrollerImpPair mouseMovedInContentArea]; >+ // FIXME: this needs to return whether the event was handled. >+ return true; > } > > void ScrollerPairMac::updateValues() >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp >index 90866dc4093f1b89b11814186d1f0e4d205262b3..80e8eef8c73a1f5bb34a848fd6816bb040ed7d5f 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp >@@ -32,9 +32,10 @@ > #include "ScrollerPairMac.h" > > namespace WebKit { >+using namespace WebCore; > >-ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac(WebCore::ScrollingTree& tree, WebCore::ScrollingNodeType nodeType, WebCore::ScrollingNodeID nodeID) >- : WebCore::ScrollingTreeFrameScrollingNodeMac(tree, nodeType, nodeID) >+ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac(ScrollingTree& tree, ScrollingNodeType nodeType, ScrollingNodeID nodeID) >+ : ScrollingTreeFrameScrollingNodeMac(tree, nodeType, nodeID) > , m_scrollerPair(std::make_unique<ScrollerPairMac>(*this)) > { > } >@@ -43,42 +44,42 @@ ScrollingTreeFrameScrollingNodeRemoteMac::~ScrollingTreeFrameScrollingNodeRemote > { > } > >-Ref<ScrollingTreeFrameScrollingNodeRemoteMac> ScrollingTreeFrameScrollingNodeRemoteMac::create(WebCore::ScrollingTree& tree, WebCore::ScrollingNodeType nodeType, WebCore::ScrollingNodeID nodeID) >+Ref<ScrollingTreeFrameScrollingNodeRemoteMac> ScrollingTreeFrameScrollingNodeRemoteMac::create(ScrollingTree& tree, ScrollingNodeType nodeType, ScrollingNodeID nodeID) > { > return adoptRef(*new ScrollingTreeFrameScrollingNodeRemoteMac(tree, nodeType, nodeID)); > } > >-void ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren(const WebCore::ScrollingStateNode& stateNode) >+void ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren(const ScrollingStateNode& stateNode) > { >- WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren(stateNode); >- const auto& scrollingStateNode = downcast<WebCore::ScrollingStateFrameScrollingNode>(stateNode); >+ ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren(stateNode); >+ const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode); > >- if (scrollingStateNode.hasChangedProperty(WebCore::ScrollingStateFrameScrollingNode::VerticalScrollbarLayer)) >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::VerticalScrollbarLayer)) > m_scrollerPair->verticalScroller().setHostLayer(scrollingStateNode.verticalScrollbarLayer()); > >- if (scrollingStateNode.hasChangedProperty(WebCore::ScrollingStateFrameScrollingNode::HorizontalScrollbarLayer)) >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HorizontalScrollbarLayer)) > m_scrollerPair->horizontalScroller().setHostLayer(scrollingStateNode.horizontalScrollbarLayer()); > > m_scrollerPair->updateValues(); > } > >-void ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition(const WebCore::FloatPoint& position, const WebCore::FloatRect& layoutViewport) >+void ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition(const FloatPoint& position, const FloatRect& layoutViewport) > { > ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(position, layoutViewport); > > m_scrollerPair->updateValues(); > } > >-void ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent(const WebCore::PlatformWheelEvent& wheelEvent) >+ScrollingEventResult ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent) > { > ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(wheelEvent); > >- m_scrollerPair->handleWheelEvent(wheelEvent); >+ return m_scrollerPair->handleWheelEvent(wheelEvent) ? ScrollingEventResult::DidHandleEvent : ScrollingEventResult::DidNotHandleEvent; > } > >-void ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent(const WebCore::PlatformMouseEvent& mouseEvent) >+bool ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent(const PlatformMouseEvent& mouseEvent) > { >- m_scrollerPair->handleMouseEvent(mouseEvent); >+ return m_scrollerPair->handleMouseEvent(mouseEvent); > } > > } >diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h >index f2c32b53c7cc5ea35720fbc903181497ec102746..3c368474d590c3d8f1ca1fb13ee0dbc9fad2be6d 100644 >--- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h >+++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h >@@ -38,13 +38,13 @@ public: > WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNodeRemoteMac> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeType, WebCore::ScrollingNodeID); > virtual ~ScrollingTreeFrameScrollingNodeRemoteMac(); > >- void handleMouseEvent(const WebCore::PlatformMouseEvent&); >+ bool handleMouseEvent(const WebCore::PlatformMouseEvent&); > > private: > ScrollingTreeFrameScrollingNodeRemoteMac(WebCore::ScrollingTree&, WebCore::ScrollingNodeType, WebCore::ScrollingNodeID); > > void commitStateBeforeChildren(const WebCore::ScrollingStateNode&) override; >- void handleWheelEvent(const WebCore::PlatformWheelEvent&) override; >+ WebCore::ScrollingEventResult handleWheelEvent(const WebCore::PlatformWheelEvent&) override; > void setScrollLayerPosition(const WebCore::FloatPoint& position, const WebCore::FloatRect& layoutViewport) override; > > std::unique_ptr<ScrollerPairMac> m_scrollerPair; >diff --git a/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp b/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp >index 76c482675de8944fd992959618369e72e67e7404..691830b593c67ad33d77a0e68c547a631c5ab6d7 100644 >--- a/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp >+++ b/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp >@@ -122,10 +122,10 @@ void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEven > if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan) > scrollingTree->setCanRubberBandState(canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom); > >- ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent); >+ ScrollingEventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent); > >- if (result == ScrollingTree::DidHandleEvent || result == ScrollingTree::DidNotHandleEvent) { >- sendDidReceiveEvent(pageID, wheelEvent, result == ScrollingTree::DidHandleEvent); >+ if (result == ScrollingEventResult::DidHandleEvent || result == ScrollingEventResult::DidNotHandleEvent) { >+ sendDidReceiveEvent(pageID, wheelEvent, result == ScrollingEventResult::DidHandleEvent); > return; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 172917
:
312007
|
312321
|
320274
|
320548
|
320627
|
320631
|
320652
|
320752
|
320919
|
355486
|
355637
|
355639
|
355640
|
355641
|
355642
|
355986
|
356005
|
356149
|
356503
|
358490
|
358491
|
358703
|
360651
|
360657
|
360668
|
360677
|
360689
|
360691