Changeset 242333 in webkit
- Timestamp:
- Mar 3, 2019, 4:36:57 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242331 r242333 1 2019-03-02 Simon Fraser <simon.fraser@apple.com> 2 3 Share more code for updating the state of frame scrolling nodes 4 https://bugs.webkit.org/show_bug.cgi?id=195254 5 6 Reviewed by Antti Koivisto. 7 8 New baselines. Overflow nodes get some state from ScrollableAreaParameters now, and 9 frame nodes get the current scroll position (which is good, since they already have 10 the new layout viewport). 11 12 * fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt: 13 * fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt: 14 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt: 15 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt: 16 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt: 17 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt: 18 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt: 19 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt: 20 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt: 21 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt: 22 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt: 23 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt: 24 * scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt: 25 * scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt: 26 * scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt: 27 * scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt: 28 * scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt: 29 * scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt: 30 * tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt: 31 * tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt: 32 * tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt: 33 * tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt: 34 * tiled-drawing/scrolling/fixed/four-bars-expected.txt: 35 * tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt: 36 * tiled-drawing/scrolling/fixed/four-bars.html: 37 * tiled-drawing/scrolling/fixed/nested-fixed-expected.txt: 38 * tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt: 39 * tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt: 40 * tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt: 41 1 42 2019-03-03 Diego Pino Garcia <dpino@igalia.com> 2 43 -
trunk/LayoutTests/fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt
r241934 r242333 162 162 (vertical scroll elasticity 1) 163 163 (horizontal scrollbar mode 0) 164 (vertical scrollbar mode 0)) 164 (vertical scrollbar mode 0) 165 (has enabled vertical scrollbar 1)) 165 166 ) 166 167 (Overflow scrolling node … … 172 173 (vertical scroll elasticity 1) 173 174 (horizontal scrollbar mode 0) 174 (vertical scrollbar mode 0)) 175 (vertical scrollbar mode 0) 176 (has enabled vertical scrollbar 1)) 175 177 ) 176 178 ) -
trunk/LayoutTests/fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt
r241934 r242333 87 87 (vertical scroll elasticity 1) 88 88 (horizontal scrollbar mode 0) 89 (vertical scrollbar mode 0)) 89 (vertical scrollbar mode 0) 90 (has enabled vertical scrollbar 1)) 90 91 ) 91 92 ) -
trunk/LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 40 1000) 3 4 (scrollable area size 785 585) 4 5 (contents size 4016 4042) -
trunk/LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 40 460) 3 4 (scrollable area size 785 585) 4 5 (contents size 4016 4042) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt
r241934 r242333 39 39 (vertical scroll elasticity 1) 40 40 (horizontal scrollbar mode 0) 41 (vertical scrollbar mode 0)) 41 (vertical scrollbar mode 0) 42 (has enabled vertical scrollbar 1)) 42 43 (children 1 43 44 (Sticky node -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt
r241934 r242333 44 44 (vertical scroll elasticity 1) 45 45 (horizontal scrollbar mode 0) 46 (vertical scrollbar mode 0)) 46 (vertical scrollbar mode 0) 47 (has enabled vertical scrollbar 1)) 47 48 (children 1 48 49 (Sticky node -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt
r241934 r242333 44 44 (vertical scroll elasticity 1) 45 45 (horizontal scrollbar mode 0) 46 (vertical scrollbar mode 0)) 46 (vertical scrollbar mode 0) 47 (has enabled vertical scrollbar 1)) 47 48 (children 1 48 49 (Sticky node -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt
r241934 r242333 39 39 (vertical scroll elasticity 1) 40 40 (horizontal scrollbar mode 0) 41 (vertical scrollbar mode 0)) 41 (vertical scrollbar mode 0) 42 (has enabled vertical scrollbar 1)) 42 43 (children 1 43 44 (Sticky node -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
r241934 r242333 19 19 (children 1 20 20 (Frame scrolling node 21 (scroll position 0 120) 21 22 (scrollable area size 480 400) 22 23 (contents size 480 1016) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt
r241934 r242333 25 25 (vertical scroll elasticity 1) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled horizontal scrollbar 1) 29 (has enabled vertical scrollbar 1)) 28 30 (children 1 29 31 (Overflow scrolling node … … 35 37 (vertical scroll elasticity 1) 36 38 (horizontal scrollbar mode 0) 37 (vertical scrollbar mode 0)) 39 (vertical scrollbar mode 0) 40 (has enabled vertical scrollbar 1)) 38 41 ) 39 42 ) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt
r241934 r242333 25 25 (vertical scroll elasticity 1) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled horizontal scrollbar 1) 29 (has enabled vertical scrollbar 1)) 28 30 (children 1 29 31 (Overflow scrolling node … … 35 37 (vertical scroll elasticity 1) 36 38 (horizontal scrollbar mode 0) 37 (vertical scrollbar mode 0)) 39 (vertical scrollbar mode 0) 40 (has enabled vertical scrollbar 1)) 38 41 ) 39 42 ) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt
r241934 r242333 28 28 (vertical scroll elasticity 1) 29 29 (horizontal scrollbar mode 0) 30 (vertical scrollbar mode 0)) 30 (vertical scrollbar mode 0) 31 (has enabled vertical scrollbar 1)) 31 32 ) 32 33 ) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt
r241934 r242333 22 22 (vertical scroll elasticity 1) 23 23 (horizontal scrollbar mode 0) 24 (vertical scrollbar mode 0)) 24 (vertical scrollbar mode 0) 25 (has enabled vertical scrollbar 1)) 25 26 ) 26 27 ) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt
r241934 r242333 25 25 (vertical scroll elasticity 1) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled vertical scrollbar 1)) 28 29 ) 29 30 ) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt
r241934 r242333 25 25 (vertical scroll elasticity 1) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled vertical scrollbar 1)) 28 29 ) 29 30 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt
r241934 r242333 22 22 (parent relative scrollable rect at (9,9) size 405x305) 23 23 (scrollable area parameters 24 (horizontal scroll elasticity 1)25 (vertical scroll elasticity 1)24 (horizontal scroll elasticity 0) 25 (vertical scroll elasticity 0) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled horizontal scrollbar 1) 29 (has enabled vertical scrollbar 1)) 28 30 (children 1 29 31 (Overflow scrolling node … … 32 34 (parent relative scrollable rect at (23,59) size 405x305) 33 35 (scrollable area parameters 34 (horizontal scroll elasticity 1)35 (vertical scroll elasticity 1)36 (horizontal scroll elasticity 0) 37 (vertical scroll elasticity 0) 36 38 (horizontal scrollbar mode 0) 37 (vertical scrollbar mode 0)) 39 (vertical scrollbar mode 0) 40 (has enabled vertical scrollbar 1)) 38 41 ) 39 42 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt
r241934 r242333 22 22 (parent relative scrollable rect at (9,9) size 405x305) 23 23 (scrollable area parameters 24 (horizontal scroll elasticity 1)25 (vertical scroll elasticity 1)24 (horizontal scroll elasticity 0) 25 (vertical scroll elasticity 0) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled horizontal scrollbar 1) 29 (has enabled vertical scrollbar 1)) 28 30 (children 1 29 31 (Overflow scrolling node … … 32 34 (parent relative scrollable rect at (23,59) size 405x305) 33 35 (scrollable area parameters 34 (horizontal scroll elasticity 1)35 (vertical scroll elasticity 1)36 (horizontal scroll elasticity 0) 37 (vertical scroll elasticity 0) 36 38 (horizontal scrollbar mode 0) 37 (vertical scrollbar mode 0)) 39 (vertical scrollbar mode 0) 40 (has enabled vertical scrollbar 1)) 38 41 ) 39 42 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt
r241934 r242333 25 25 (parent relative scrollable rect at (0,0) size 385x285) 26 26 (scrollable area parameters 27 (horizontal scroll elasticity 1)28 (vertical scroll elasticity 1)27 (horizontal scroll elasticity 0) 28 (vertical scroll elasticity 0) 29 29 (horizontal scrollbar mode 0) 30 (vertical scrollbar mode 0)) 30 (vertical scrollbar mode 0) 31 (has enabled vertical scrollbar 1)) 31 32 ) 32 33 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt
r241934 r242333 21 21 (scrollable area parameters 22 22 (horizontal scroll elasticity 1) 23 (vertical scroll elasticity 1)23 (vertical scroll elasticity 0) 24 24 (horizontal scrollbar mode 0) 25 (vertical scrollbar mode 0)) 25 (vertical scrollbar mode 0) 26 (has enabled vertical scrollbar 1)) 26 27 ) 27 28 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt
r241934 r242333 22 22 (parent relative scrollable rect at (70,98) size 425x325) 23 23 (scrollable area parameters 24 (horizontal scroll elasticity 1)25 (vertical scroll elasticity 1)24 (horizontal scroll elasticity 0) 25 (vertical scroll elasticity 0) 26 26 (horizontal scrollbar mode 0) 27 (vertical scrollbar mode 0)) 27 (vertical scrollbar mode 0) 28 (has enabled vertical scrollbar 1)) 28 29 ) 29 30 ) -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt
r241934 r242333 23 23 (parent relative scrollable rect at (70,98) size 425x325) 24 24 (scrollable area parameters 25 (horizontal scroll elasticity 1)26 (vertical scroll elasticity 1)25 (horizontal scroll elasticity 0) 26 (vertical scroll elasticity 0) 27 27 (horizontal scrollbar mode 0) 28 (vertical scrollbar mode 0)) 28 (vertical scrollbar mode 0) 29 (has enabled vertical scrollbar 1)) 29 30 ) 30 31 ) -
trunk/LayoutTests/tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt
r241934 r242333 80 80 81 81 (Frame scrolling node 82 (scroll position 4223 0) 82 83 (scrollable area size 785 585) 83 84 (contents size 5008 5021) … … 101 102 102 103 (Frame scrolling node 104 (scroll position 0 4436) 103 105 (scrollable area size 785 585) 104 106 (contents size 5008 5021) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2710) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2513) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2213) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/four-bars-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2221) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2421) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/four-bars.html
r187905 r242333 3 3 <html> 4 4 <head> 5 <meta name="apple-mobile-web-app-capable" content="yes"> 6 <style type="text/css" media="screen"> 5 <style> 7 6 body { 8 7 height: 2200px; … … 17 16 background-color: rgba(0, 128, 0, 0.8); 18 17 border: 2px solid black; 19 -webkit-box-shadow: 0 0 10px black;18 box-shadow: 0 0 10px black; 20 19 } 21 20 … … 45 44 46 45 </style> 47 <script type="text/javascript" charset="utf-8">46 <script> 48 47 if (window.testRunner) { 49 48 testRunner.waitUntilDone(); -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/nested-fixed-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2213) -
trunk/LayoutTests/tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt
r241934 r242333 1 1 2 2 (Frame scrolling node 3 (scroll position 0 200) 3 4 (scrollable area size 785 600) 4 5 (contents size 785 2513) -
trunk/LayoutTests/tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt
r241934 r242333 2 2 3 3 (Frame scrolling node 4 (scroll position 800 0) 4 5 (scrollable area size 800 585) 5 6 (contents size 2008 585) -
trunk/LayoutTests/tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt
r241934 r242333 6 6 7 7 (Frame scrolling node 8 (scroll position 0 580) 8 9 (scrollable area size 785 600) 9 10 (contents size 785 2908) -
trunk/Source/WebCore/ChangeLog
r242330 r242333 1 2019-03-02 Simon Fraser <simon.fraser@apple.com> 2 3 Share more code for updating the state of frame scrolling nodes 4 https://bugs.webkit.org/show_bug.cgi?id=195254 5 6 Reviewed by Antti Koivisto. 7 8 Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between 9 AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and 10 RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor, 11 ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling 12 state tree. 13 14 We also share code between updating ScrollingStateFrameScrollingNodes and 15 ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea. 16 Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing 17 ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work 18 on macOS. 19 20 * page/scrolling/AsyncScrollingCoordinator.cpp: 21 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): 22 (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode): 23 (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): 24 (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry): 25 (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints): 26 (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted. 27 (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted. 28 * page/scrolling/AsyncScrollingCoordinator.h: 29 * page/scrolling/ScrollingCoordinator.h: 30 (WebCore::ScrollingCoordinator::setRectRelativeToParentNode): 31 (WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry): 32 (WebCore::ScrollingCoordinator::setFrameScrollingNodeState): 33 (WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints): 34 (WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted. 35 (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted. 36 * platform/ScrollView.h: 37 (WebCore::ScrollView::horizontalScrollbarMode const): Deleted. 38 (WebCore::ScrollView::verticalScrollbarMode const): Deleted. 39 * platform/ScrollableArea.cpp: 40 (WebCore::ScrollableArea::reachableTotalContentsSize const): 41 * platform/ScrollableArea.h: 42 (WebCore::ScrollableArea::horizontalScrollbarMode const): 43 (WebCore::ScrollableArea::verticalScrollbarMode const): 44 * rendering/RenderLayer.cpp: 45 (WebCore::RenderLayer::overhangAmount const): 46 (WebCore::RenderLayer::reachableTotalContentsSize const): 47 (WebCore::RenderLayer::scrollableContentsSize const): Deleted. 48 * rendering/RenderLayer.h: 49 * rendering/RenderLayerCompositor.cpp: 50 (WebCore::RenderLayerCompositor::updateCompositingLayers): 51 (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 52 (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole): 53 (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const): 54 (WebCore::RenderLayerCompositor::parentRelativeScrollableRect const): 55 (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole): 56 (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole): 57 (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted. 58 (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted. 59 (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted. 60 * rendering/RenderLayerCompositor.h: 61 1 62 2019-03-02 Darin Adler <darin@apple.com> 2 63 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r241934 r242333 128 128 129 129 setEventTrackingRegionsDirty(); 130 131 #if PLATFORM(COCOA) 130 132 if (!coordinatesScrollingForFrameView(frameView)) 131 133 return; 132 134 133 auto* node = m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID());134 if (!node || !is<ScrollingStateFrameScrollingNode>(*node))135 return;136 137 auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node);138 139 auto* verticalScrollbar = frameView.verticalScrollbar();140 auto* horizontalScrollbar = frameView.horizontalScrollbar();141 frameScrollingNode.setScrollerImpsFromScrollbars(verticalScrollbar, horizontalScrollbar);142 143 frameScrollingNode.setFrameScaleFactor(frameView.frame().frameScaleFactor());144 frameScrollingNode.setHeaderHeight(frameView.headerHeight());145 frameScrollingNode.setFooterHeight(frameView.footerHeight());146 frameScrollingNode.setTopContentInset(frameView.topContentInset());147 148 frameScrollingNode.setLayoutViewport(frameView.layoutViewportRect());149 frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(asyncFrameOrOverflowScrollingEnabled());150 151 frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());152 frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin());153 154 frameScrollingNode.setScrollOrigin(frameView.scrollOrigin());155 frameScrollingNode.setScrollableAreaSize(frameView.visibleContentRect().size());156 frameScrollingNode.setTotalContentsSize(frameView.totalContentsSize());157 frameScrollingNode.setReachableContentsSize(frameView.totalContentsSize());158 frameScrollingNode.setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame());159 frameScrollingNode.setScrollBehaviorForFixedElements(frameView.scrollBehaviorForFixedElements());160 161 #if ENABLE(CSS_SCROLL_SNAP)162 frameView.updateSnapOffsets();163 updateScrollSnapPropertiesWithFrameView(frameView);164 #endif165 166 #if PLATFORM(COCOA)167 135 auto* page = frameView.frame().page(); 168 136 if (page && page->expectsWheelEventTriggers()) { 169 137 LOG(WheelEventTestTriggers, " AsyncScrollingCoordinator::frameViewLayoutUpdated: Expects wheel event test trigger=%d", page->expectsWheelEventTriggers()); 138 139 auto* node = m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()); 140 if (!is<ScrollingStateFrameScrollingNode>(node)) 141 return; 142 143 auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node); 170 144 frameScrollingNode.setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers()); 171 145 } 172 146 #endif 173 174 ScrollableAreaParameters scrollParameters;175 scrollParameters.horizontalScrollElasticity = frameView.horizontalScrollElasticity();176 scrollParameters.verticalScrollElasticity = frameView.verticalScrollElasticity();177 scrollParameters.hasEnabledHorizontalScrollbar = horizontalScrollbar && horizontalScrollbar->enabled();178 scrollParameters.hasEnabledVerticalScrollbar = verticalScrollbar && verticalScrollbar->enabled();179 scrollParameters.horizontalScrollbarMode = frameView.horizontalScrollbarMode();180 scrollParameters.verticalScrollbarMode = frameView.verticalScrollbarMode();181 scrollParameters.useDarkAppearanceForScrollbars = frameView.useDarkAppearanceForScrollbars();182 183 frameScrollingNode.setScrollableAreaParameters(scrollParameters);184 147 } 185 148 … … 615 578 } 616 579 617 void AsyncScrollingCoordinator::set ScrollingNodeGeometry(ScrollingNodeID nodeID, const ScrollingGeometry& scrollingGeometry)580 void AsyncScrollingCoordinator::setRectRelativeToParentNode(ScrollingNodeID nodeID, const LayoutRect& parentRelativeScrollableRect) 618 581 { 619 582 auto* stateNode = m_scrollingStateTree->stateNodeForID(nodeID); … … 622 585 return; 623 586 624 if ( stateNode->nodeType() == ScrollingNodeType::FrameHosting) {587 if (is<ScrollingStateFrameHostingNode>(*stateNode)) { 625 588 auto& frameHostingStateNode = downcast<ScrollingStateFrameHostingNode>(*stateNode); 626 frameHostingStateNode.setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect); 627 return; 628 } 589 frameHostingStateNode.setParentRelativeScrollableRect(parentRelativeScrollableRect); 590 return; 591 } 592 593 if (is<ScrollingStateScrollingNode>(stateNode)) { 594 auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(*stateNode); 595 scrollingStateNode.setParentRelativeScrollableRect(parentRelativeScrollableRect); 596 } 597 } 598 599 void AsyncScrollingCoordinator::setFrameScrollingNodeState(ScrollingNodeID nodeID, const FrameView& frameView) 600 { 601 auto* stateNode = m_scrollingStateTree->stateNodeForID(nodeID); 602 ASSERT(stateNode); 603 if (!is<ScrollingStateFrameScrollingNode>(stateNode)) 604 return; 605 606 auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*stateNode); 607 608 auto* verticalScrollbar = frameView.verticalScrollbar(); 609 auto* horizontalScrollbar = frameView.horizontalScrollbar(); 610 frameScrollingNode.setScrollerImpsFromScrollbars(verticalScrollbar, horizontalScrollbar); 611 612 frameScrollingNode.setFrameScaleFactor(frameView.frame().frameScaleFactor()); 613 frameScrollingNode.setHeaderHeight(frameView.headerHeight()); 614 frameScrollingNode.setFooterHeight(frameView.footerHeight()); 615 frameScrollingNode.setTopContentInset(frameView.topContentInset()); 616 frameScrollingNode.setLayoutViewport(frameView.layoutViewportRect()); 617 frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(asyncFrameOrOverflowScrollingEnabled()); 618 619 frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin()); 620 frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin()); 621 622 frameScrollingNode.setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame()); 623 frameScrollingNode.setScrollBehaviorForFixedElements(frameView.scrollBehaviorForFixedElements()); 624 } 625 626 void AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry(ScrollingNodeID nodeID, ScrollableArea& scrollableArea) 627 { 628 auto* stateNode = m_scrollingStateTree->stateNodeForID(nodeID); 629 ASSERT(stateNode); 630 if (!stateNode) 631 return; 629 632 630 633 auto& scrollingNode = downcast<ScrollingStateScrollingNode>(*stateNode); 631 632 scrollingNode.setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect); 633 scrollingNode.setScrollOrigin(scrollingGeometry.scrollOrigin); 634 scrollingNode.setScrollPosition(scrollingGeometry.scrollPosition); 635 scrollingNode.setTotalContentsSize(scrollingGeometry.contentSize); 636 scrollingNode.setReachableContentsSize(scrollingGeometry.reachableContentSize); 637 scrollingNode.setScrollableAreaSize(scrollingGeometry.scrollableAreaSize); 634 scrollingNode.setScrollOrigin(scrollableArea.scrollOrigin()); 635 scrollingNode.setScrollPosition(scrollableArea.scrollPosition()); 636 scrollingNode.setTotalContentsSize(scrollableArea.totalContentsSize()); 637 scrollingNode.setReachableContentsSize(scrollableArea.reachableTotalContentsSize()); 638 scrollingNode.setScrollableAreaSize(scrollableArea.visibleSize()); 639 640 auto* verticalScrollbar = scrollableArea.verticalScrollbar(); 641 auto* horizontalScrollbar = scrollableArea.horizontalScrollbar(); 642 643 ScrollableAreaParameters scrollParameters; 644 scrollParameters.horizontalScrollElasticity = scrollableArea.horizontalScrollElasticity(); 645 scrollParameters.verticalScrollElasticity = scrollableArea.verticalScrollElasticity(); 646 scrollParameters.hasEnabledHorizontalScrollbar = horizontalScrollbar && horizontalScrollbar->enabled(); 647 scrollParameters.hasEnabledVerticalScrollbar = verticalScrollbar && verticalScrollbar->enabled(); 648 scrollParameters.horizontalScrollbarMode = scrollableArea.horizontalScrollbarMode(); 649 scrollParameters.verticalScrollbarMode = scrollableArea.verticalScrollbarMode(); 650 scrollParameters.useDarkAppearanceForScrollbars = scrollableArea.useDarkAppearanceForScrollbars(); 651 652 scrollingNode.setScrollableAreaParameters(scrollParameters); 638 653 639 654 #if ENABLE(CSS_SCROLL_SNAP) 640 // updateScrollSnapPropertiesWithFrameView() sets these for frame scrolling nodes. FIXME: Why the difference? 641 if (is<ScrollingStateOverflowScrollingNode>(scrollingNode)) { 642 setStateScrollingNodeSnapOffsetsAsFloat(scrollingNode, ScrollEventAxis::Horizontal, &scrollingGeometry.horizontalSnapOffsets, &scrollingGeometry.horizontalSnapOffsetRanges, m_page->deviceScaleFactor()); 643 setStateScrollingNodeSnapOffsetsAsFloat(scrollingNode, ScrollEventAxis::Vertical, &scrollingGeometry.verticalSnapOffsets, &scrollingGeometry.verticalSnapOffsetRanges, m_page->deviceScaleFactor()); 644 scrollingNode.setCurrentHorizontalSnapPointIndex(scrollingGeometry.currentHorizontalSnapPointIndex); 645 scrollingNode.setCurrentVerticalSnapPointIndex(scrollingGeometry.currentVerticalSnapPointIndex); 646 } 655 scrollableArea.updateSnapOffsets(); 656 setStateScrollingNodeSnapOffsetsAsFloat(scrollingNode, ScrollEventAxis::Horizontal, scrollableArea.horizontalSnapOffsets(), scrollableArea.horizontalSnapOffsetRanges(), m_page->deviceScaleFactor()); 657 setStateScrollingNodeSnapOffsetsAsFloat(scrollingNode, ScrollEventAxis::Vertical, scrollableArea.verticalSnapOffsets(), scrollableArea.verticalSnapOffsetRanges(), m_page->deviceScaleFactor()); 658 scrollingNode.setCurrentHorizontalSnapPointIndex(scrollableArea.currentHorizontalSnapPointIndex()); 659 scrollingNode.setCurrentVerticalSnapPointIndex(scrollableArea.currentVerticalSnapPointIndex()); 647 660 #endif 648 661 } 649 662 650 void AsyncScrollingCoordinator::setViewportConstraintedNode Geometry(ScrollingNodeID nodeID, const ViewportConstraints& constraints)663 void AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints(ScrollingNodeID nodeID, const ViewportConstraints& constraints) 651 664 { 652 665 auto* node = m_scrollingStateTree->stateNodeForID(nodeID); -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r241934 r242333 109 109 110 110 WEBCORE_EXPORT void setNodeLayers(ScrollingNodeID, const NodeLayers&) override; 111 WEBCORE_EXPORT void setScrollingNodeGeometry(ScrollingNodeID, const ScrollingGeometry&) override; 112 WEBCORE_EXPORT void setViewportConstraintedNodeGeometry(ScrollingNodeID, const ViewportConstraints&) override; 111 112 WEBCORE_EXPORT void setRectRelativeToParentNode(ScrollingNodeID, const LayoutRect&) override; 113 WEBCORE_EXPORT void setScrollingNodeScrollableAreaGeometry(ScrollingNodeID, ScrollableArea&) override; 114 WEBCORE_EXPORT void setFrameScrollingNodeState(ScrollingNodeID, const FrameView&) override; 115 WEBCORE_EXPORT void setViewportConstraintedNodeConstraints(ScrollingNodeID, const ViewportConstraints&) override; 113 116 114 117 WEBCORE_EXPORT void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool programmaticScroll, ViewportRectStability, ScrollingLayerPositionAction) override; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r240916 r242333 140 140 virtual void setNodeLayers(ScrollingNodeID, const NodeLayers&) { } 141 141 142 struct ScrollingGeometry { 143 LayoutRect parentRelativeScrollableRect; 144 FloatSize scrollableAreaSize; 145 FloatSize contentSize; 146 FloatSize reachableContentSize; // Smaller than contentSize when overflow is hidden on one axis. 147 FloatPoint scrollPosition; 148 IntPoint scrollOrigin; 149 #if ENABLE(CSS_SCROLL_SNAP) 150 Vector<LayoutUnit> horizontalSnapOffsets; 151 Vector<LayoutUnit> verticalSnapOffsets; 152 Vector<ScrollOffsetRange<LayoutUnit>> horizontalSnapOffsetRanges; 153 Vector<ScrollOffsetRange<LayoutUnit>> verticalSnapOffsetRanges; 154 unsigned currentHorizontalSnapPointIndex; 155 unsigned currentVerticalSnapPointIndex; 156 #endif 157 }; 158 159 virtual void setScrollingNodeGeometry(ScrollingNodeID, const ScrollingGeometry&) { } 160 virtual void setViewportConstraintedNodeGeometry(ScrollingNodeID, const ViewportConstraints&) { } 142 virtual void setRectRelativeToParentNode(ScrollingNodeID, const LayoutRect&) { } 143 virtual void setScrollingNodeScrollableAreaGeometry(ScrollingNodeID, ScrollableArea&) { } 144 virtual void setFrameScrollingNodeState(ScrollingNodeID, const FrameView&) { } 145 virtual void setViewportConstraintedNodeConstraints(ScrollingNodeID, const ViewportConstraints&) { } 161 146 162 147 virtual void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect&, ScrollingLayerPositionAction) { } -
trunk/Source/WebCore/platform/ScrollView.h
r240901 r242333 111 111 void setVerticalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(horizontalScrollbarMode(), mode, horizontalScrollbarLock(), lock); }; 112 112 WEBCORE_EXPORT void scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const; 113 ScrollbarMode horizontalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; }114 ScrollbarMode verticalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; }113 ScrollbarMode horizontalScrollbarMode() const final { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; } 114 ScrollbarMode verticalScrollbarMode() const final { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; } 115 115 116 116 void setHorizontalScrollbarLock(bool lock = true) { m_horizontalScrollbarLock = lock; } -
trunk/Source/WebCore/platform/ScrollableArea.cpp
r239689 r242333 670 670 } 671 671 672 IntSize ScrollableArea::reachableTotalContentsSize() const 673 { 674 return totalContentsSize(); 675 } 676 672 677 IntSize ScrollableArea::totalContentsSize() const 673 678 { -
trunk/Source/WebCore/platform/ScrollableArea.h
r240891 r242333 108 108 ScrollElasticity horizontalScrollElasticity() const { return static_cast<ScrollElasticity>(m_horizontalScrollElasticity); } 109 109 110 virtual ScrollbarMode horizontalScrollbarMode() const { return ScrollbarAuto; } 111 virtual ScrollbarMode verticalScrollbarMode() const { return ScrollbarAuto; } 112 110 113 bool inLiveResize() const { return m_inLiveResize; } 111 114 WEBCORE_EXPORT virtual void willStartLiveResize(); … … 254 257 // The totalContentsSize() is equivalent to the contentsSize() plus the header and footer heights. 255 258 WEBCORE_EXPORT IntSize totalContentsSize() const; 259 WEBCORE_EXPORT virtual IntSize reachableTotalContentsSize() const; 256 260 257 261 virtual bool useDarkAppearance() const { return false; } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r242248 r242333 2814 2814 // FIXME: use maximumScrollOffset(), or just move this to ScrollableArea. 2815 2815 ScrollOffset scrollOffset = scrollOffsetFromPosition(scrollPosition()); 2816 auto reachableSize = reachableTotalContentsSize(); 2816 2817 if (scrollOffset.y() < 0) 2817 2818 stretch.setHeight(scrollOffset.y()); 2818 else if ( scrollableContentsSize().height() && scrollOffset.y() > scrollableContentsSize().height() - visibleHeight())2819 stretch.setHeight(scrollOffset.y() - ( scrollableContentsSize().height() - visibleHeight()));2819 else if (reachableSize.height() && scrollOffset.y() > reachableSize.height() - visibleHeight()) 2820 stretch.setHeight(scrollOffset.y() - (reachableSize.height() - visibleHeight())); 2820 2821 2821 2822 if (scrollOffset.x() < 0) 2822 2823 stretch.setWidth(scrollOffset.x()); 2823 else if ( scrollableContentsSize().width() && scrollOffset.x() > scrollableContentsSize().width() - visibleWidth())2824 stretch.setWidth(scrollOffset.x() - ( scrollableContentsSize().width() - visibleWidth()));2824 else if (reachableSize.width() && scrollOffset.x() > reachableSize.width() - visibleWidth()) 2825 stretch.setWidth(scrollOffset.x() - (reachableSize.width() - visibleWidth())); 2825 2826 2826 2827 return stretch; … … 2949 2950 } 2950 2951 2951 IntSize RenderLayer:: scrollableContentsSize() const2952 IntSize RenderLayer::reachableTotalContentsSize() const 2952 2953 { 2953 2954 IntSize contentsSize = this->contentsSize(); -
trunk/Source/WebCore/rendering/RenderLayer.h
r242248 r242333 400 400 IntSize visibleSize() const override; 401 401 IntSize contentsSize() const override; 402 IntSize reachableTotalContentsSize() const override; 402 403 403 404 int scrollWidth() const; … … 420 421 421 422 ScrollOffset scrollOffset() const { return scrollOffsetFromPosition(m_scrollPosition); } 422 IntSize scrollableContentsSize() const;423 423 424 424 void availableContentSizeChanged(AvailableSizeChangeReason) override; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r242308 r242333 701 701 } 702 702 703 if (updateType == CompositingUpdateType::AfterLayout) { 704 // Ensure that post-layout updates push new scroll position and viewport rects onto the root node. 705 rootRenderLayer().setNeedsScrollingTreeUpdate(); 706 } 707 703 708 if (!updateRoot->hasDescendantNeedingCompositingRequirementsTraversal() && !m_compositing) { 704 709 LOG_WITH_STREAM(Compositing, stream << " no compositing work to do"); … … 1172 1177 1173 1178 OptionSet<ScrollingNodeChangeFlags> scrollingNodeChanges = { ScrollingNodeChangeFlags::Layer }; 1174 if (layerNeedsUpdate || layer.needsCompositingGeometryUpdate() || layer.needsScrollingTreeUpdate()) {1179 if (layerNeedsUpdate || layer.needsCompositingGeometryUpdate()) { 1175 1180 layerBacking->updateGeometry(); 1176 1181 scrollingNodeChanges.add(ScrollingNodeChangeFlags::LayerGeometry); 1177 } 1182 } else if (layer.needsScrollingTreeUpdate()) 1183 scrollingNodeChanges.add(ScrollingNodeChangeFlags::LayerGeometry); 1178 1184 1179 1185 if (auto* reflection = layer.reflectionLayer()) { … … 3923 3929 switch (nodeType) { 3924 3930 case ScrollingNodeType::Fixed: 3925 scrollingCoordinator->setViewportConstraintedNode Geometry(newNodeID, computeFixedViewportConstraints(layer));3931 scrollingCoordinator->setViewportConstraintedNodeConstraints(newNodeID, computeFixedViewportConstraints(layer)); 3926 3932 break; 3927 3933 case ScrollingNodeType::Sticky: 3928 scrollingCoordinator->setViewportConstraintedNode Geometry(newNodeID, computeStickyViewportConstraints(layer));3934 scrollingCoordinator->setViewportConstraintedNodeConstraints(newNodeID, computeStickyViewportConstraints(layer)); 3929 3935 break; 3930 3936 case ScrollingNodeType::MainFrame: … … 3939 3945 } 3940 3946 3941 void RenderLayerCompositor::computeFrameScrollingGeometry(ScrollingCoordinator::ScrollingGeometry& scrollingGeometry) const3947 LayoutRect RenderLayerCompositor::rootParentRelativeScrollableRect() const 3942 3948 { 3943 3949 auto& frameView = m_renderView.frameView(); 3944 3950 3945 3951 if (m_renderView.frame().isMainFrame()) 3946 scrollingGeometry.parentRelativeScrollableRect = frameView.frameRect(); 3947 else 3948 scrollingGeometry.parentRelativeScrollableRect = LayoutRect({ }, LayoutSize(frameView.size())); 3949 3950 scrollingGeometry.scrollOrigin = frameView.scrollOrigin(); 3951 scrollingGeometry.scrollableAreaSize = frameView.visibleContentRect().size(); 3952 scrollingGeometry.contentSize = frameView.totalContentsSize(); 3953 scrollingGeometry.reachableContentSize = frameView.totalContentsSize(); 3954 #if ENABLE(CSS_SCROLL_SNAP) 3955 frameView.updateSnapOffsets(); 3956 updateScrollSnapPropertiesWithFrameView(frameView); 3957 #endif 3958 } 3959 3960 void RenderLayerCompositor::computeFrameHostingGeometry(const RenderLayer& layer, const RenderLayer* ancestorLayer, ScrollingCoordinator::ScrollingGeometry& scrollingGeometry) const 3952 return frameView.frameRect(); 3953 3954 return LayoutRect({ }, LayoutSize(frameView.size())); 3955 } 3956 3957 LayoutRect RenderLayerCompositor::parentRelativeScrollableRect(const RenderLayer& layer, const RenderLayer* ancestorLayer) const 3961 3958 { 3962 3959 // FIXME: ancestorLayer needs to be always non-null, so should become a reference. 3963 if (ancestorLayer) { 3964 LayoutRect scrollableRect; 3965 if (is<RenderBox>(layer.renderer())) 3966 scrollableRect = downcast<RenderBox>(layer.renderer()).paddingBoxRect(); 3967 3968 auto offset = layer.convertToLayerCoords(ancestorLayer, scrollableRect.location()); // FIXME: broken for columns. 3969 scrollableRect.setLocation(offset); 3970 scrollingGeometry.parentRelativeScrollableRect = scrollableRect; 3971 } 3972 } 3973 3974 void RenderLayerCompositor::computeOverflowScrollingGeometry(const RenderLayer& layer, const RenderLayer* ancestorLayer, ScrollingCoordinator::ScrollingGeometry& scrollingGeometry) const 3975 { 3976 // FIXME: ancestorLayer needs to be always non-null, so should become a reference. 3977 if (ancestorLayer) { 3978 LayoutRect scrollableRect; 3979 if (is<RenderBox>(layer.renderer())) 3980 scrollableRect = downcast<RenderBox>(layer.renderer()).paddingBoxRect(); 3981 3982 auto offset = layer.convertToLayerCoords(ancestorLayer, scrollableRect.location()); // FIXME: broken for columns. 3983 scrollableRect.setLocation(offset); 3984 scrollingGeometry.parentRelativeScrollableRect = scrollableRect; 3985 } 3986 3987 scrollingGeometry.scrollOrigin = layer.scrollOrigin(); 3988 scrollingGeometry.scrollPosition = layer.scrollPosition(); 3989 scrollingGeometry.scrollableAreaSize = layer.visibleSize(); 3990 scrollingGeometry.contentSize = layer.contentsSize(); 3991 scrollingGeometry.reachableContentSize = layer.scrollableContentsSize(); 3992 #if ENABLE(CSS_SCROLL_SNAP) 3993 if (auto* offsets = layer.horizontalSnapOffsets()) 3994 scrollingGeometry.horizontalSnapOffsets = *offsets; 3995 if (auto* offsets = layer.verticalSnapOffsets()) 3996 scrollingGeometry.verticalSnapOffsets = *offsets; 3997 if (auto* ranges = layer.horizontalSnapOffsetRanges()) 3998 scrollingGeometry.horizontalSnapOffsetRanges = *ranges; 3999 if (auto* ranges = layer.verticalSnapOffsetRanges()) 4000 scrollingGeometry.verticalSnapOffsetRanges = *ranges; 4001 scrollingGeometry.currentHorizontalSnapPointIndex = layer.currentHorizontalSnapPointIndex(); 4002 scrollingGeometry.currentVerticalSnapPointIndex = layer.currentVerticalSnapPointIndex(); 4003 #endif 3960 if (!ancestorLayer) 3961 return LayoutRect({ }, LayoutSize(layer.visibleSize())); 3962 3963 LayoutRect scrollableRect; 3964 if (is<RenderBox>(layer.renderer())) 3965 scrollableRect = downcast<RenderBox>(layer.renderer()).paddingBoxRect(); 3966 3967 auto offset = layer.convertToLayerCoords(ancestorLayer, scrollableRect.location()); // FIXME: broken for columns. 3968 scrollableRect.setLocation(offset); 3969 return scrollableRect; 4004 3970 } 4005 3971 … … 4025 3991 4026 3992 if (changes & ScrollingNodeChangeFlags::LayerGeometry) { 4027 ScrollingCoordinator::ScrollingGeometry scrollingGeometry;4028 computeFrameScrollingGeometry(scrollingGeometry);4029 scrollingCoordinator->set ScrollingNodeGeometry(newNodeID, scrollingGeometry);3993 scrollingCoordinator->setRectRelativeToParentNode(newNodeID, rootParentRelativeScrollableRect()); 3994 scrollingCoordinator->setScrollingNodeScrollableAreaGeometry(newNodeID, frameView); 3995 scrollingCoordinator->setFrameScrollingNodeState(newNodeID, frameView); 4030 3996 } 4031 3997 } else { … … 4041 4007 if (changes & ScrollingNodeChangeFlags::LayerGeometry && treeState.parentNodeID) { 4042 4008 RenderLayer* scrollingAncestorLayer = m_scrollingNodeToLayerMap.get(treeState.parentNodeID.value()); 4043 ScrollingCoordinator::ScrollingGeometry scrollingGeometry; 4044 computeOverflowScrollingGeometry(layer, scrollingAncestorLayer, scrollingGeometry); 4045 scrollingCoordinator->setScrollingNodeGeometry(newNodeID, scrollingGeometry); 4009 scrollingCoordinator->setRectRelativeToParentNode(newNodeID, parentRelativeScrollableRect(layer, scrollingAncestorLayer)); 4010 scrollingCoordinator->setScrollingNodeScrollableAreaGeometry(newNodeID, layer); 4046 4011 } 4047 4012 } … … 4065 4030 if (changes & ScrollingNodeChangeFlags::LayerGeometry && treeState.parentNodeID) { 4066 4031 RenderLayer* scrollingAncestorLayer = m_scrollingNodeToLayerMap.get(treeState.parentNodeID.value()); 4067 ScrollingCoordinator::ScrollingGeometry scrollingGeometry; 4068 computeFrameHostingGeometry(layer, scrollingAncestorLayer, scrollingGeometry); 4069 scrollingCoordinator->setScrollingNodeGeometry(newNodeID, scrollingGeometry); 4032 scrollingCoordinator->setRectRelativeToParentNode(newNodeID, parentRelativeScrollableRect(layer, scrollingAncestorLayer)); 4070 4033 } 4071 4034 … … 4285 4248 bool allowVerticalScrollbar = !scrollbarHasDisplayNone(layer.verticalScrollbar()); 4286 4249 m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer(), 4287 layer. scrollableContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar);4250 layer.reachableTotalContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar); 4288 4251 } 4289 4252 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r240916 r242333 499 499 StickyPositionViewportConstraints computeStickyViewportConstraints(RenderLayer&) const; 500 500 501 void computeFrameScrollingGeometry(ScrollingCoordinator::ScrollingGeometry&) const; 502 void computeFrameHostingGeometry(const RenderLayer&, const RenderLayer* ancestorLayer, ScrollingCoordinator::ScrollingGeometry&) const; 503 void computeOverflowScrollingGeometry(const RenderLayer&, const RenderLayer* ancestorLayer, ScrollingCoordinator::ScrollingGeometry&) const; 501 LayoutRect rootParentRelativeScrollableRect() const; 502 LayoutRect parentRelativeScrollableRect(const RenderLayer&, const RenderLayer* ancestorLayer) const; 504 503 505 504 bool requiresScrollLayer(RootLayerAttachment) const;
Note:
See TracChangeset
for help on using the changeset viewer.