Changeset 242031 in webkit
- Timestamp:
- Feb 24, 2019 10:03:22 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r242019 r242031 1 2019-02-24 Simon Fraser <simon.fraser@apple.com> 2 3 Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree 4 https://bugs.webkit.org/show_bug.cgi?id=194984 5 6 Reviewed by Sam Weinig. 7 8 Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code. 9 10 Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the 11 current layout viewport rect. Instead, set the layout viewport on the root 12 node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling(). 13 14 * page/scrolling/ScrollingTree.cpp: 15 (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling): 16 (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted. 17 * page/scrolling/ScrollingTree.h: 18 * page/scrolling/ScrollingTreeFrameHostingNode.cpp: 19 (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): 20 * page/scrolling/ScrollingTreeFrameHostingNode.h: 21 * page/scrolling/ScrollingTreeFrameScrollingNode.h: 22 * page/scrolling/ScrollingTreeNode.h: 23 * page/scrolling/ScrollingTreeScrollingNode.cpp: 24 (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): 25 * page/scrolling/ScrollingTreeScrollingNode.h: 26 * page/scrolling/cocoa/ScrollingTreeFixedNode.h: 27 * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: 28 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): 29 * page/scrolling/cocoa/ScrollingTreeStickyNode.h: 30 * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: 31 (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): 32 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: 33 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: 34 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: 35 (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): 36 (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): 37 1 38 2019-02-24 Devin Rousso <drousso@apple.com> 2 39 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r241934 r242031 123 123 } 124 124 125 void ScrollingTree::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& fixedPositionRect, double scale) 126 { 127 auto* node = nodeForID(nodeID); 128 if (!is<ScrollingTreeScrollingNode>(node)) 129 return; 130 131 downcast<ScrollingTreeScrollingNode>(*node).updateLayersAfterViewportChange(fixedPositionRect, scale); 125 void ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling(const FloatRect& layoutViewport, double scale) 126 { 127 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree::viewportChangedViaDelegatedScrolling - layoutViewport " << layoutViewport); 128 129 if (m_rootNode) { 130 auto& frameScrollingNode = downcast<ScrollingTreeFrameScrollingNode>(*m_rootNode); 131 frameScrollingNode.setLayoutViewport(layoutViewport); 132 frameScrollingNode.updateLayersAfterViewportChange(layoutViewport, scale); 133 } 132 134 } 133 135 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r241997 r242031 83 83 // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers 84 84 // (but don't cause scroll events to be fired). 85 WEBCORE_EXPORT virtual void viewportChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatRect& fixedPositionRect, double scale);85 WEBCORE_EXPORT virtual void mainFrameViewportChangedViaDelegatedScrolling(const WebCore::FloatRect& layoutViewport, double scale); 86 86 87 87 // Delegated scrolling has scrolled a node. Update layer positions on descendant tree nodes, … … 95 95 96 96 #if PLATFORM(IOS_FAMILY) 97 virtual FloatRect fixedPositionRect() = 0;98 97 virtual void scrollingTreeNodeWillStartPanGesture() { } 99 98 virtual void scrollingTreeNodeWillStartScroll() { } -
trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.cpp
r240787 r242031 58 58 } 59 59 60 void ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)60 void ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 61 61 { 62 62 if (!m_children) … … 64 64 65 65 for (auto& child : *m_children) 66 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);66 child->updateLayersAfterAncestorChange(changedNode, layoutViewport, cumulativeDelta); 67 67 } 68 68 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.h
r240787 r242031 43 43 44 44 void commitStateBeforeChildren(const ScrollingStateNode&) final; 45 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) final;45 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) final; 46 46 47 47 const LayoutRect& parentRelativeScrollableRect() const { return m_parentRelativeScrollableRect; } -
trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h
r241997 r242031 43 43 44 44 // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children. 45 void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /* fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { }45 void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*layoutViewport*/, const FloatSize& /*cumulativeDelta*/) override { } 46 46 47 void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override = 0;47 void updateLayersAfterViewportChange(const FloatRect& layoutViewport, double scale) override = 0; 48 48 void updateLayersAfterDelegatedScroll(const FloatPoint&) override { } 49 49 … … 55 55 FloatRect layoutViewportForScrollPosition(const FloatPoint& visibleContentOrigin, float scale) const; 56 56 57 FloatRect fixedPositionRect() { return FloatRect(lastCommittedScrollPosition(), scrollableAreaSize()); }; 57 FloatRect layoutViewport() const { return m_layoutViewport; }; 58 void setLayoutViewport(const FloatRect& r) { m_layoutViewport = r; }; 58 59 59 60 float frameScaleFactor() const { return m_frameScaleFactor; } … … 65 66 int footerHeight() const { return m_footerHeight; } 66 67 float topContentInset() const { return m_topContentInset; } 67 68 FloatRect layoutViewport() const { return m_layoutViewport; };69 void setLayoutViewport(const FloatRect& r) { m_layoutViewport = r; };70 68 71 69 FloatPoint minLayoutViewportOrigin() const { return m_minLayoutViewportOrigin; } -
trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.h
r241997 r242031 59 59 virtual void commitStateAfterChildren(const ScrollingStateNode&) { } 60 60 61 virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) = 0;61 virtual void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) = 0; 62 62 63 63 ScrollingTreeNode* parent() const { return m_parent; } -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r241997 r242031 114 114 } 115 115 116 void ScrollingTreeScrollingNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)116 void ScrollingTreeScrollingNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 117 117 { 118 118 if (!m_children) … … 120 120 121 121 for (auto& child : *m_children) 122 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);122 child->updateLayersAfterAncestorChange(changedNode, layoutViewport, cumulativeDelta); 123 123 } 124 124 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r241997 r242031 51 51 void commitStateAfterChildren(const ScrollingStateNode&) override; 52 52 53 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;53 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) override; 54 54 55 55 virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&); … … 58 58 void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges); 59 59 60 virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) = 0;60 virtual void updateLayersAfterViewportChange(const FloatRect& layoutViewport, double scale) = 0; 61 61 virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { } 62 62 -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.h
r240963 r242031 48 48 49 49 void commitStateBeforeChildren(const ScrollingStateNode&) override; 50 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;50 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) override; 51 51 52 52 void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeFixedNode.mm
r240963 r242031 71 71 } 72 72 73 void ScrollingTreeFixedNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)73 void ScrollingTreeFixedNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 74 74 { 75 75 using namespace ScrollingTreeFixedNodeInternal; 76 FloatPoint layerPosition = m_constraints.layerPositionForViewportRect( fixedPositionRect);76 FloatPoint layerPosition = m_constraints.layerPositionForViewportRect(layoutViewport); 77 77 78 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeFixedNode " << scrollingNodeID() << " updateLayersAfterAncestorChange: new viewport " << fixedPositionRect << " viewportRectAtLastLayout " << m_constraints.viewportRectAtLastLayout() << " last layer pos " << m_constraints.layerPositionAtLastLayout() << " new offset from top " << (fixedPositionRect.y() - layerPosition.y()));78 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeFixedNode " << scrollingNodeID() << " updateLayersAfterAncestorChange: new viewport " << layoutViewport << " viewportRectAtLastLayout " << m_constraints.viewportRectAtLastLayout() << " last layer pos " << m_constraints.layerPositionAtLastLayout() << " new offset from top " << (layoutViewport.y() - layerPosition.y())); 79 79 80 80 layerPosition -= cumulativeDelta; … … 100 100 101 101 for (auto& child : *m_children) 102 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, newDelta);102 child->updateLayersAfterAncestorChange(changedNode, layoutViewport, newDelta); 103 103 } 104 104 -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h
r240963 r242031 48 48 49 49 void commitStateBeforeChildren(const ScrollingStateNode&) override; 50 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;50 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) override; 51 51 52 52 void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override; -
trunk/Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.mm
r240963 r242031 73 73 } 74 74 75 void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)75 void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 76 76 { 77 77 using namespace ScrollingTreeStickyNodeInternal; … … 83 83 adjustStickyLayer = true; 84 84 } else if (is<ScrollingTreeFrameScrollingNode>(*parent())) { 85 constrainingRect = fixedPositionRect;85 constrainingRect = layoutViewport; 86 86 adjustStickyLayer = true; 87 87 } 88 88 89 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeStickyNode " << scrollingNodeID() << " updateLayersAfterAncestorChange: new viewport " << fixedPositionRect << " constrainingRectAtLastLayout " << m_constraints.constrainingRectAtLastLayout() << " last layer pos " << m_constraints.layerPositionAtLastLayout() << " adjustStickyLayer " << adjustStickyLayer);89 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeStickyNode " << scrollingNodeID() << " updateLayersAfterAncestorChange: new viewport " << layoutViewport << " constrainingRectAtLastLayout " << m_constraints.constrainingRectAtLastLayout() << " last layer pos " << m_constraints.layerPositionAtLastLayout() << " adjustStickyLayer " << adjustStickyLayer); 90 90 91 91 FloatSize deltaForDescendants = cumulativeDelta; … … 106 106 107 107 for (auto& child : *m_children) 108 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, deltaForDescendants);108 child->updateLayersAfterAncestorChange(changedNode, layoutViewport, deltaForDescendants); 109 109 } 110 110 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h
r241984 r242031 57 57 void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges) override; 58 58 59 void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override;59 void updateLayersAfterViewportChange(const FloatRect& layoutViewport, double scale) override; 60 60 61 61 void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h
r241984 r242031 54 54 void updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition) override; 55 55 56 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;56 void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) override; 57 57 58 58 ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm
r241984 r242031 94 94 95 95 96 void ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)96 void ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 97 97 { 98 98 UNUSED_PARAM(changedNode); 99 UNUSED_PARAM( fixedPositionRect);99 UNUSED_PARAM(layoutViewport); 100 100 UNUSED_PARAM(cumulativeDelta); 101 101 } … … 117 117 } 118 118 119 void ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect& fixedPositionRect)119 void ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect& layoutViewport) 120 120 { 121 121 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition " << scrollPosition); … … 126 126 127 127 for (auto& child : *m_children) 128 child->updateLayersAfterAncestorChange(*this, fixedPositionRect, { });128 child->updateLayersAfterAncestorChange(*this, layoutViewport, { }); 129 129 } 130 130 -
trunk/Source/WebKit/ChangeLog
r242014 r242031 1 2019-02-24 Simon Fraser <simon.fraser@apple.com> 2 3 Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree 4 https://bugs.webkit.org/show_bug.cgi?id=194984 5 6 Reviewed by Sam Weinig. 7 8 Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code. 9 10 Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the 11 current layout viewport rect. Instead, set the layout viewport on the root 12 node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling(). 13 14 Add a WK2 Scrolling log channel. 15 16 * Platform/Logging.h: 17 * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: 18 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 19 * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: 20 (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling): 21 * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: 22 * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: 23 (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted. 24 * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: 25 * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: 26 (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const): 27 (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted. 28 * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: 29 * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: 30 (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): 31 (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): 32 (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): 33 * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: 34 * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: 35 (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): 36 * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: 37 * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: 38 (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): 39 (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): 40 * UIProcess/ios/WKContentView.mm: 41 (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): 42 1 43 2019-02-20 Darin Adler <darin@apple.com> 2 44 -
trunk/Source/WebKit/Platform/Logging.h
r239513 r242031 76 76 M(ResourceLoadStatistics) \ 77 77 M(ResourceLoadStatisticsDebug) \ 78 M(Scrolling) \ 78 79 M(Selection) \ 79 80 M(ServiceWorker) \ -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
r241988 r242031 221 221 if (m_webPageProxy.scrollingCoordinatorProxy()->hasFixedOrSticky()) { 222 222 // If we got a new layer for a fixed or sticky node, its position from the WebProcess is probably stale. We need to re-run the "viewport" changed logic to udpate it with our UI-side state. 223 FloatRect customFixedPositionRect = m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(), m_webPageProxy.displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained);224 m_webPageProxy.scrollingCoordinatorProxy()->viewportChangedViaDelegatedScrolling( m_webPageProxy.scrollingCoordinatorProxy()->rootScrollingNodeID(), customFixedPositionRect, m_webPageProxy.displayedContentScale());223 FloatRect layoutViewport = m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(), m_webPageProxy.displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained); 224 m_webPageProxy.scrollingCoordinatorProxy()->viewportChangedViaDelegatedScrolling(layoutViewport, m_webPageProxy.displayedContentScale()); 225 225 } 226 226 #endif -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
r241779 r242031 174 174 } 175 175 176 void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling( ScrollingNodeID nodeID, const FloatRect& fixedPositionRect, double scale)177 { 178 m_scrollingTree-> viewportChangedViaDelegatedScrolling(nodeID, fixedPositionRect, scale);176 void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(const FloatRect& layoutViewport, double scale) 177 { 178 m_scrollingTree->mainFrameViewportChangedViaDelegatedScrolling(layoutViewport, scale); 179 179 } 180 180 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h
r241934 r242031 59 59 60 60 // Called externally when native views move around. 61 void viewportChangedViaDelegatedScrolling( WebCore::ScrollingNodeID, const WebCore::FloatRect& fixedPositionRect, double scale);61 void viewportChangedViaDelegatedScrolling(const WebCore::FloatRect& layoutViewport, double scale); 62 62 63 63 void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical); … … 84 84 85 85 #if PLATFORM(IOS_FAMILY) 86 WebCore::FloatRect cu stomFixedPositionRect() const;86 WebCore::FloatRect currentLayoutViewport() const; 87 87 void scrollingTreeNodeWillStartPanGesture(); 88 88 void scrollingTreeNodeWillStartScroll(); -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
r241997 r242031 79 79 80 80 #if PLATFORM(IOS_FAMILY) 81 WebCore::FloatRect RemoteScrollingTree::fixedPositionRect()82 {83 return m_scrollingCoordinatorProxy.customFixedPositionRect();84 }85 86 81 void RemoteScrollingTree::scrollingTreeNodeWillStartPanGesture() 87 82 { -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h
r240787 r242031 65 65 66 66 #if PLATFORM(IOS_FAMILY) 67 WebCore::FloatRect fixedPositionRect() override;68 67 void scrollingTreeNodeWillStartPanGesture() override; 69 68 void scrollingTreeNodeWillStartScroll() override; -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
r241934 r242031 94 94 } 95 95 96 FloatRect RemoteScrollingCoordinatorProxy::cu stomFixedPositionRect() const96 FloatRect RemoteScrollingCoordinatorProxy::currentLayoutViewport() const 97 97 { 98 98 return m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(), -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h
r241997 r242031 55 55 56 56 void updateLayersAfterDelegatedScroll(const WebCore::FloatPoint& scrollPosition) override; 57 void updateLayersAfterViewportChange(const WebCore::FloatRect& fixedPositionRect, double scale) override;58 void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override;57 void updateLayersAfterViewportChange(const WebCore::FloatRect& layoutViewport, double scale) override; 58 void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& layoutViewport, const WebCore::FloatSize& cumulativeDelta) override; 59 59 60 60 std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate; -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm
r241997 r242031 170 170 171 171 172 FloatRect fixedPositionRect;173 if ( !parent())174 fixedPositionRect = scrollingTree().fixedPositionRect();172 FloatRect layoutViewport; 173 if (isRootNode()) 174 layoutViewport = this->layoutViewport(); 175 175 else 176 fixedPositionRect = FloatRect(scrollPosition, scrollableAreaSize());176 layoutViewport = FloatRect(scrollPosition, scrollableAreaSize()); // FIXME: We'll just use layoutViewport() once we correctly update it after a scroll. 177 177 178 178 for (auto& child : *m_children) 179 child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());179 child->updateLayersAfterAncestorChange(*this, layoutViewport, FloatSize()); 180 180 } 181 181 … … 190 190 } 191 191 192 void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double /*scale*/)192 void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange(const FloatRect& layoutViewport, double /*scale*/) 193 193 { 194 194 // Note: we never currently have a m_counterScrollingLayer (which is used for background-attachment:fixed) on iOS. 195 [m_counterScrollingLayer setPosition: fixedPositionRect.location()];195 [m_counterScrollingLayer setPosition:layoutViewport.location()]; 196 196 197 197 if (!m_children) … … 199 199 200 200 for (auto& child : *m_children) 201 child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());202 } 203 204 void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)201 child->updateLayersAfterAncestorChange(*this, layoutViewport, FloatSize()); 202 } 203 204 void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 205 205 { 206 206 if (m_scrollingNodeDelegate) { 207 m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);207 m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, layoutViewport, cumulativeDelta); 208 208 return; 209 209 } … … 212 212 return; 213 213 214 FloatRect currFrame FixedPositionRect(scrollPosition(), scrollableAreaSize()); // FIXME: use up-to-date layout viewport.214 FloatRect currFrameLayoutViewport(scrollPosition(), scrollableAreaSize()); // FIXME: use layoutViewport() once it's correctly updated. 215 215 for (auto& child : *m_children) 216 child->updateLayersAfterAncestorChange(changedNode, currFrame FixedPositionRect, { });216 child->updateLayersAfterAncestorChange(changedNode, currFrameLayoutViewport, { }); 217 217 } 218 218 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h
r241997 r242031 52 52 void updateLayersAfterDelegatedScroll(const WebCore::FloatPoint& scrollPosition) override; 53 53 54 void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override;54 void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& layoutViewport, const WebCore::FloatSize& cumulativeDelta) override; 55 55 56 56 std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate; -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
r240861 r242031 67 67 } 68 68 69 void ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)69 void ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 70 70 { 71 m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);71 m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, layoutViewport, cumulativeDelta); 72 72 } 73 73 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h
r240875 r242031 62 62 void commitStateBeforeChildren(const WebCore::ScrollingStateScrollingNode&); 63 63 void commitStateAfterChildren(const WebCore::ScrollingStateScrollingNode&); 64 void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta);64 void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& layoutViewport, const WebCore::FloatSize& cumulativeDelta); 65 65 WebCore::FloatPoint scrollPosition() const; 66 66 void setScrollLayerPosition(const WebCore::FloatPoint&); -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm
r241859 r242031 270 270 } 271 271 272 void ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)272 void ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& layoutViewport, const FloatSize& cumulativeDelta) 273 273 { 274 274 if (!scrollingNode().children()) … … 278 278 279 279 for (auto& child : *scrollingNode().children()) 280 child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta + scrollDelta);280 child->updateLayersAfterAncestorChange(changedNode, layoutViewport, cumulativeDelta + scrollDelta); 281 281 } 282 282 … … 306 306 return; 307 307 308 FloatRect fixedPositionRect;308 FloatRect layoutViewport; 309 309 auto* frameNode = scrollingNode().enclosingFrameNodeIncludingSelf(); 310 if (frameNode && frameNode->nodeType() == ScrollingNodeType::Subframe) 311 fixedPositionRect = frameNode->fixedPositionRect(); 312 else 313 fixedPositionRect = scrollingTree().fixedPositionRect(); 314 FloatSize scrollDelta = lastCommittedScrollPosition() - scrollPosition; 310 if (frameNode) 311 layoutViewport = frameNode->layoutViewport(); 312 313 auto scrollDelta = lastCommittedScrollPosition() - scrollPosition; 315 314 316 315 for (auto& child : *scrollingNode().children()) 317 child->updateLayersAfterAncestorChange(scrollingNode(), fixedPositionRect, scrollDelta);316 child->updateLayersAfterAncestorChange(scrollingNode(), layoutViewport, scrollDelta); 318 317 } 319 318 -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r241934 r242031 436 436 _sizeChangedSinceLastVisibleContentRectUpdate = NO; 437 437 438 WebCore::FloatRect fixedPositionRect = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), _page->unobscuredContentRectRespectingInputViewBounds(), _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::Unconstrained);439 scrollingCoordinator->viewportChangedViaDelegatedScrolling( scrollingCoordinator->rootScrollingNodeID(), fixedPositionRect, zoomScale);438 WebCore::FloatRect layoutViewport = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), _page->unobscuredContentRectRespectingInputViewBounds(), _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::Unconstrained); 439 scrollingCoordinator->viewportChangedViaDelegatedScrolling(layoutViewport, zoomScale); 440 440 441 441 drawingArea->updateDebugIndicator(); 442 442 443 [self updateFixedClippingView: fixedPositionRect];443 [self updateFixedClippingView:layoutViewport]; 444 444 445 445 if (wasStableState && !isStableState)
Note: See TracChangeset
for help on using the changeset viewer.