WebKit Bugzilla
Attachment 362806 Details for
Bug 194968
: Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194968-20190222174845.patch (text/plain), 24.24 KB, created by
Simon Fraser (smfr)
on 2019-02-22 17:48:45 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-02-22 17:48:45 PST
Size:
24.24 KB
patch
obsolete
>Subversion Revision: 241934 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 78d8fb8094a829323f75ad6e061a944260ef372c..9be8fb850ab95f436dad360bc99ccbe436ccb55e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,46 @@ >+2019-02-22 Simon Fraser <simon.fraser@apple.com> >+ >+ Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes >+ https://bugs.webkit.org/show_bug.cgi?id=194968 >+ >+ Reviewed by Antti Koivisto. >+ >+ Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because >+ you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them. >+ >+ ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will >+ reduce that. >+ >+ * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: >+ (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method. >+ * page/scrolling/ScrollingTreeFrameScrollingNode.h: >+ * page/scrolling/ScrollingTreeScrollingNode.cpp: >+ (WebCore::ScrollingTreeScrollingNode::setScrollPosition): >+ (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const): >+ (WebCore::ScrollingTreeScrollingNode::scrollBy): >+ (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted. >+ (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted. >+ * page/scrolling/ScrollingTreeScrollingNode.h: >+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: >+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: >+ (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition): >+ (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing. >+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: >+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: >+ (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): >+ (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): >+ (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): >+ (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted. >+ * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: >+ * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: >+ (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): >+ (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted. >+ * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: >+ (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints): >+ * platform/PlatformWheelEvent.h: >+ (WebCore::PlatformWheelEvent::delta const): >+ * platform/ScrollTypes.h: >+ > 2019-02-21 Simon Fraser <simon.fraser@apple.com> > > Hardcode Visual Viewports on everywhere except iOS WK1 >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp >index 8509c4660b3b09d6a48219876373bb41c3423a21..e2bb597978683409f4788d2c69cd98d77c86ec83 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp >@@ -82,12 +82,6 @@ void ScrollingTreeFrameScrollingNode::commitStateBeforeChildren(const ScrollingS > m_maxLayoutViewportOrigin = state.maxLayoutViewportOrigin(); > } > >-void ScrollingTreeFrameScrollingNode::setScrollPosition(const FloatPoint& scrollPosition) >-{ >- FloatPoint newScrollPosition = scrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); >- setScrollPositionWithoutContentEdgeConstraints(newScrollPosition); >-} >- > FloatRect ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition(const FloatPoint& visibleContentOrigin, float scale) const > { > FloatRect visibleContentRect(visibleContentOrigin, scrollableAreaSize()); >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >index d09f048bebcca01d1c0df1e003c17c3165762593..945da246fddaac506115c8b9cf5ba1d2d6164915 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h >@@ -45,8 +45,6 @@ public: > void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { } > > ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override = 0; >- void setScrollPosition(const FloatPoint&) override; >- void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override = 0; > > void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override = 0; > void updateLayersAfterDelegatedScroll(const FloatPoint&) override { } >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >index f0ef3eaee3bb1ae77cf0a383f8da930e34d4e6a7..6ccb6fdd3e1c1573cdfbc53d49b9237b7330f106 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp >@@ -122,18 +122,21 @@ void ScrollingTreeScrollingNode::updateLayersAfterAncestorChange(const Scrolling > child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta); > } > >-void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosition) >+void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosition, ScrollPositionClamp clamp) > { >- FloatPoint newScrollPosition = scrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); >- setScrollPositionWithoutContentEdgeConstraints(newScrollPosition); >-} >+ FloatPoint newScrollPosition = scrollPosition; >+ if (clamp == ScrollPositionClamp::ToContentEdges) >+ newScrollPosition = clampScrollPosition(scrollPosition); > >-void ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition) >-{ > setScrollLayerPosition(scrollPosition, { }); > scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt); > } > >+FloatPoint ScrollingTreeScrollingNode::clampScrollPosition(const FloatPoint& scrollPosition) const >+{ >+ return scrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); >+} >+ > FloatPoint ScrollingTreeScrollingNode::minimumScrollPosition() const > { > return FloatPoint(); >@@ -153,14 +156,9 @@ bool ScrollingTreeScrollingNode::scrollLimitReached(const PlatformWheelEvent& wh > return newScrollPosition == oldScrollPosition; > } > >-void ScrollingTreeScrollingNode::scrollBy(const FloatSize& delta) >-{ >- setScrollPosition(scrollPosition() + delta); >-} >- >-void ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints(const FloatSize& offset) >+void ScrollingTreeScrollingNode::scrollBy(const FloatSize& delta, ScrollPositionClamp clamp) > { >- setScrollPositionWithoutContentEdgeConstraints(scrollPosition() + offset); >+ setScrollPosition(scrollPosition() + delta, clamp); > } > > LayoutPoint ScrollingTreeScrollingNode::parentToLocalPoint(LayoutPoint point) const >diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >index f754b278523ea9715159ad0bd96c548dd12e5b71..cb1ec97a4877068d6f4c9dec42f737048918e858 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >@@ -53,11 +53,9 @@ public: > WEBCORE_EXPORT void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override; > > virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) = 0; >- WEBCORE_EXPORT virtual void setScrollPosition(const FloatPoint&); >- WEBCORE_EXPORT virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&); >+ WEBCORE_EXPORT virtual void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges); > >- void scrollBy(const FloatSize&); >- void scrollByWithoutContentEdgeConstraints(const FloatSize&); >+ void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges); > > virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) = 0; > virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { } >@@ -88,6 +86,8 @@ protected: > WEBCORE_EXPORT virtual FloatPoint minimumScrollPosition() const; > WEBCORE_EXPORT virtual FloatPoint maximumScrollPosition() const; > >+ FloatPoint clampScrollPosition(const FloatPoint&) const; >+ > virtual void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) = 0; > > FloatPoint lastCommittedScrollPosition() const { return m_lastCommittedScrollPosition; } >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >index 90cfdb14cdae1e859b9dc33704a3a093b912ba32..f2fa2102029eae7cd8405ddf57af862bf2c3e5b7 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h >@@ -49,13 +49,12 @@ protected: > ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > FloatPoint scrollPosition() const override; >- void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; > > void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override; > void updateLayersAfterDelegatedScroll(const FloatPoint&) override; > void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override; > >- void setScrollPosition(const FloatPoint&) override; >+ void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges) override; > void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override; > > FloatPoint minimumScrollPosition() const override; >diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >index f2fb5d71143cc7f2d86c0b3d39c8de21703bd657..9aaaab81cba07218b2e79e38635782732e3ee573 100644 >--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm >@@ -106,13 +106,12 @@ FloatPoint ScrollingTreeFrameScrollingNodeIOS::scrollPosition() const > return -scrolledContentsLayer().position; > } > >-void ScrollingTreeFrameScrollingNodeIOS::setScrollPosition(const FloatPoint& scrollPosition) >+void ScrollingTreeFrameScrollingNodeIOS::setScrollPosition(const FloatPoint& position, ScrollPositionClamp clamp) > { >- ScrollingTreeFrameScrollingNode::setScrollPosition(scrollPosition); >-} >+ auto scrollPosition = position; >+ if (clamp == ScrollPositionClamp::ToContentEdges) >+ scrollPosition = clampScrollPosition(scrollPosition); > >-void ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition) >-{ > if (shouldUpdateScrollLayerPositionSynchronously()) { > m_probableMainThreadScrollPosition = scrollPosition; > scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt, ScrollingLayerPositionAction::Set); >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >index 68d8df3e32157a0635a750d5db39e3529ffcc2f6..610f6db385bca19e07899b94448eacd3733acee4 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >@@ -54,8 +54,7 @@ protected: > ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > FloatPoint scrollPosition() const override; >- void setScrollPosition(const FloatPoint&) override; >- void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; >+ void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges) override; > > void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override; > >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >index c731fd8303ac4a146a40a05dd093ea12892fa796..211ac8d88b76300d1be83e061b8ac042b5ef7ac4 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >@@ -140,6 +140,7 @@ void ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren(const Scrolli > logScrollingMode = true; > } > >+ // FIXME: wrong if we're not the main frame. > if (logScrollingMode && scrollingTree().scrollingPerformanceLoggingEnabled()) > scrollingTree().reportSynchronousScrollingReasonsChanged(MonotonicTime::now(), synchronousScrollingReasons()); > >@@ -202,6 +203,7 @@ ScrollingEventResult ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(const > m_delegate.handleWheelEvent(wheelEvent); > > #if ENABLE(CSS_SCROLL_SNAP) >+ // FIXME: wrong if we're not the main frame. > scrollingTree().setMainFrameIsScrollSnapping(m_delegate.isScrollSnapInProgress()); > if (m_delegate.activeScrollSnapIndexDidChange()) > scrollingTree().setActiveScrollSnapIndices(scrollingNodeID(), m_delegate.activeScrollSnapIndexForAxis(ScrollEventAxis::Horizontal), m_delegate.activeScrollSnapIndexForAxis(ScrollEventAxis::Vertical)); >@@ -221,43 +223,41 @@ FloatPoint ScrollingTreeFrameScrollingNodeMac::scrollPosition() const > return -scrolledContentsLayer().position; > } > >-void ScrollingTreeFrameScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPosition) >+void ScrollingTreeFrameScrollingNodeMac::setScrollPosition(const FloatPoint& position, ScrollPositionClamp clamp) > { >- LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeFrameScrollingNodeMac::setScrollPosition " << scrollPosition << " scrollPosition(): " << this->scrollPosition() << " min: " << minimumScrollPosition() << " max: " << maximumScrollPosition()); >+ LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeFrameScrollingNodeMac::setScrollPosition " << position << " scrollPosition(): " << this->scrollPosition() << " min: " << minimumScrollPosition() << " max: " << maximumScrollPosition()); > > // Scroll deltas can be non-integral with some input devices, so scrollPosition may not be integral. > // FIXME: when we support half-pixel scroll positions on Retina displays, this will need to round to half pixels. >- FloatPoint roundedPosition(roundf(scrollPosition.x()), roundf(scrollPosition.y())); >+ FloatPoint scrollPosition(roundf(position.x()), roundf(position.y())); > >- ScrollingTreeFrameScrollingNode::setScrollPosition(roundedPosition); >+ if (clamp == ScrollPositionClamp::ToContentEdges) >+ scrollPosition = clampScrollPosition(scrollPosition); > >- if (scrollingTree().scrollingPerformanceLoggingEnabled()) { >- unsigned unfilledArea = exposedUnfilledArea(); >- if (unfilledArea || m_lastScrollHadUnfilledPixels) >- scrollingTree().reportExposedUnfilledArea(MonotonicTime::now(), unfilledArea); >- >- m_lastScrollHadUnfilledPixels = unfilledArea; >- } >-} >- >-void ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition) >-{ >+ // FIXME: wrong if we're not the main frame. > updateMainFramePinState(scrollPosition); > >- Optional<FloatPoint> layoutViewportOrigin; // FIXME > FloatPoint visibleContentOrigin = scrollPosition; > FloatRect newLayoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor()); > setLayoutViewport(newLayoutViewport); >- layoutViewportOrigin = newLayoutViewport.location(); >+ auto layoutViewportOrigin = newLayoutViewport.location(); > > if (shouldUpdateScrollLayerPositionSynchronously()) { > m_probableMainThreadScrollPosition = scrollPosition; > scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, layoutViewportOrigin, ScrollingLayerPositionAction::Set); >- return; >+ } else { >+ // This should call the base class once we clean up the layoutViewportOrigin stuff. >+ setScrollLayerPosition(scrollPosition, layoutViewport()); >+ scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, layoutViewportOrigin); > } > >- setScrollLayerPosition(scrollPosition, layoutViewport()); >- scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, layoutViewportOrigin); >+ if (scrollingTree().scrollingPerformanceLoggingEnabled()) { >+ unsigned unfilledArea = exposedUnfilledArea(); >+ if (unfilledArea || m_lastScrollHadUnfilledPixels) >+ scrollingTree().reportExposedUnfilledArea(MonotonicTime::now(), unfilledArea); >+ >+ m_lastScrollHadUnfilledPixels = unfilledArea; >+ } > } > > void ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(const FloatPoint& position, const FloatRect& layoutViewport) >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h >index 0c51d0522b041c74569d2ea06acc847d29ea39dc..80e9877177eaa8dbdc1eddd97ca8a3ea53f2ff4a 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h >@@ -46,8 +46,7 @@ private: > void commitStateAfterChildren(const ScrollingStateNode&) override; > > FloatPoint scrollPosition() const override; >- void setScrollPosition(const FloatPoint&) override; >- void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; >+ void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges) override; > > void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override; > >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >index b99afd7a935869a6984fb4ec4e514ede4357ac0e..b49a32a82c03249440a4b7d799ccbba4750dead3 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >@@ -105,7 +105,7 @@ FloatPoint ScrollingTreeOverflowScrollingNodeMac::scrollPosition() const > return -scrolledContentsLayer().position; > } > >-void ScrollingTreeOverflowScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPosition) >+void ScrollingTreeOverflowScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPosition, ScrollPositionClamp clamp) > { > LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeOverflowScrollingNodeMac::setScrollPosition " << scrollPosition << " from " << this->scrollPosition() << " (min: " << minimumScrollPosition() << " max: " << maximumScrollPosition() << ")"); > >@@ -113,13 +113,7 @@ void ScrollingTreeOverflowScrollingNodeMac::setScrollPosition(const FloatPoint& > // FIXME: when we support half-pixel scroll positions on Retina displays, this will need to round to half pixels. > FloatPoint roundedPosition(roundf(scrollPosition.x()), roundf(scrollPosition.y())); > >- ScrollingTreeOverflowScrollingNode::setScrollPosition(roundedPosition); >-} >- >-void ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition) >-{ >- setScrollLayerPosition(scrollPosition, { }); >- scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, { }); >+ ScrollingTreeOverflowScrollingNode::setScrollPosition(roundedPosition, clamp); > } > > void ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect& fixedPositionRect) >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm >index fd666fd7fa48d4ffb8cba942e2ce39d5807d1bd7..9b6f35882eed0de51a56e0ca58f541b603294bd9 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm >@@ -203,7 +203,7 @@ void ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy(const FloatSize& d > > void ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& offset) > { >- scrollingNode().scrollByWithoutContentEdgeConstraints(offset); >+ scrollingNode().scrollBy(offset, ScrollPositionClamp::None); > } > > void ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer() >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >index a94c98a9408cc73b9e10704403b1cb4fe884f9ea..8f8023ba3550934b447395ac2547c5d8f6057442 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp >@@ -54,14 +54,6 @@ FloatPoint ScrollingTreeFrameScrollingNodeNicosia::scrollPosition() const > return { }; > } > >-void ScrollingTreeFrameScrollingNodeNicosia::setScrollPosition(const FloatPoint&) >-{ >-} >- >-void ScrollingTreeFrameScrollingNodeNicosia::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) >-{ >-} >- > void ScrollingTreeFrameScrollingNodeNicosia::setScrollLayerPosition(const FloatPoint&, const FloatRect&) > { > } >diff --git a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h >index 0cc2816e6c52e16c3184ed38b0c3830d609f0d86..4ba755cc1a4f43356d22f594d89d82b65e7a1753 100644 >--- a/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h >+++ b/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h >@@ -44,8 +44,7 @@ private: > ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; > > FloatPoint scrollPosition() const override; >- void setScrollPosition(const FloatPoint&) override; >- void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override; >+ > void setScrollLayerPosition(const FloatPoint&, const FloatRect&) override; > > void updateLayersAfterViewportChange(const FloatRect&, double) override; >diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h >index 21e97097a3ffbc6956765723b309f05d3f0d14c9..a2f9bc49ca02de1412761482171b49c50ad015fa 100644 >--- a/Source/WebCore/platform/PlatformWheelEvent.h >+++ b/Source/WebCore/platform/PlatformWheelEvent.h >@@ -114,6 +114,7 @@ public: > > float deltaX() const { return m_deltaX; } > float deltaY() const { return m_deltaY; } >+ FloatSize delta() const { return { m_deltaX, m_deltaY}; } > > float wheelTicksX() const { return m_wheelTicksX; } > float wheelTicksY() const { return m_wheelTicksY; } >diff --git a/Source/WebCore/platform/ScrollTypes.h b/Source/WebCore/platform/ScrollTypes.h >index 2b319518fa965175c2c155b022d2f433d2fb1a27..7f452983dabd0ab755dfffc9438be15be2a19990 100644 >--- a/Source/WebCore/platform/ScrollTypes.h >+++ b/Source/WebCore/platform/ScrollTypes.h >@@ -44,6 +44,10 @@ enum ScrollLogicalDirection : uint8_t { > ScrollInlineDirectionForward > }; > >+enum class ScrollPositionClamp : uint8_t { >+ None, >+ ToContentEdges, >+}; > > inline ScrollDirection logicalToPhysical(ScrollLogicalDirection direction, bool isVertical, bool isFlipped) > {
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 194968
:
362791
| 362806