Changeset 246538 in webkit
- Timestamp:
- Jun 18, 2019, 8:16:33 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 29 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/compositing/iframes/scrolling-iframe-expected.txt (modified) (1 diff)
-
LayoutTests/compositing/overflow/textarea-scroll-touch-expected.txt (modified) (4 diffs)
-
LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt (modified) (1 diff)
-
LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt (modified) (1 diff)
-
LayoutTests/compositing/repaint/scroller-with-foreground-layer-repaints-expected.txt (modified) (2 diffs)
-
LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-sierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt (modified) (1 diff)
-
LayoutTests/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt (modified) (1 diff)
-
LayoutTests/tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage-expected.txt (modified) (2 diffs)
-
LayoutTests/tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (modified) (1 diff)
-
Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm (modified) (2 diffs)
-
Source/WebCore/platform/graphics/cocoa/WebCoreCALayerExtras.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/cocoa/WebCoreCALayerExtras.mm (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (14 diffs)
-
Source/WebCore/rendering/RenderLayerCompositor.h (modified) (3 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246536 r246538 1 2019-06-18 Simon Fraser <simon.fraser@apple.com> 2 3 Convert macOS to scroll by changing layer boundsOrigin 4 https://bugs.webkit.org/show_bug.cgi?id=198917 5 6 Reviewed by Antti Koivisto. 7 8 * compositing/iframes/scrolling-iframe-expected.txt: 9 * compositing/overflow/textarea-scroll-touch-expected.txt: 10 * compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: 11 * compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: 12 * compositing/repaint/scroller-with-foreground-layer-repaints-expected.txt: 13 * compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt: 14 * scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt: 15 1 16 2019-06-18 Zan Dobersek <zdobersek@igalia.com> 2 17 -
trunk/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt
r240677 r246538 17 17 (children 1 18 18 (GraphicsLayer 19 (bounds origin 80.00 80.00) 19 20 (anchor 0.00 0.00) 20 21 (bounds 285.00 135.00) 21 22 (children 1 22 23 (GraphicsLayer 23 (position -80.00 -80.00)24 24 (anchor 0.00 0.00) 25 25 (children 1 -
trunk/LayoutTests/compositing/overflow/textarea-scroll-touch-expected.txt
r243347 r246538 17 17 (offsetFromRenderer width=1 height=1) 18 18 (position 1.00 1.00) 19 (bounds origin 0.00 50.00) 19 20 (bounds 189.00 124.00) 20 21 (children 1 … … 22 23 (offsetFromRenderer width=1 height=1) 23 24 (scrollOffset (0,50)) 24 (position 0.00 -50.00)25 25 (anchor 0.00 0.00) 26 26 (bounds 189.00 270.00) … … 40 40 (offsetFromRenderer width=1 height=1) 41 41 (position 1.00 1.00) 42 (bounds origin 0.00 50.00) 42 43 (bounds 189.00 124.00) 43 44 (children 1 … … 45 46 (offsetFromRenderer width=1 height=1) 46 47 (scrollOffset (0,50)) 47 (position 0.00 -50.00)48 48 (anchor 0.00 0.00) 49 49 (bounds 189.00 270.00) -
trunk/LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt
r240677 r246538 18 18 (children 1 19 19 (GraphicsLayer 20 (bounds origin 0.00 100.00) 20 21 (anchor 0.00 0.00) 21 22 (bounds 400.00 300.00) 22 23 (children 1 23 24 (GraphicsLayer 24 (position 0.00 -100.00)25 25 (anchor 0.00 0.00) 26 26 (children 1 -
trunk/LayoutTests/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt
r240677 r246538 18 18 (children 1 19 19 (GraphicsLayer 20 (bounds origin 0.00 100.00) 20 21 (anchor 0.00 0.00) 21 22 (bounds 400.00 300.00) 22 23 (children 1 23 24 (GraphicsLayer 24 (position 0.00 -100.00)25 25 (anchor 0.00 0.00) 26 26 (children 1 -
trunk/LayoutTests/compositing/repaint/scroller-with-foreground-layer-repaints-expected.txt
r246018 r246538 21 21 (offsetFromRenderer width=1 height=1) 22 22 (position 1.00 1.00) 23 (bounds origin 0.00 200.00) 23 24 (bounds 305.00 305.00) 24 25 (children 1 … … 26 27 (offsetFromRenderer width=1 height=1) 27 28 (scrollOffset (0,200)) 28 (position 0.00 -200.00)29 29 (anchor 0.00 0.00) 30 30 (bounds 305.00 1020.00) -
trunk/LayoutTests/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt
r245170 r246538 16 16 (offsetFromRenderer width=2 height=2) 17 17 (position 2.00 2.00) 18 (bounds origin 366.00 0.00) 18 19 (bounds 400.00 204.00) 19 20 (children 1 … … 21 22 (offsetFromRenderer width=2 height=2) 22 23 (scrollOffset (366,0)) 23 (position -366.00 0.00)24 24 (anchor 0.00 0.00) 25 25 (bounds 766.00 204.00) -
trunk/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt
r240916 r246538 17 17 (children 1 18 18 (GraphicsLayer 19 (bounds origin 80.00 80.00) 19 20 (anchor 0.00 0.00) 20 21 (bounds 300.00 150.00) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
r242333 r246538 64 64 (children 1 65 65 (GraphicsLayer 66 (bounds origin 0.00 120.00) 66 67 (anchor 0.00 0.00) 67 68 (bounds 480.00 400.00) -
trunk/LayoutTests/platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt
r240694 r246538 22 22 (children 1 23 23 (GraphicsLayer 24 (bounds origin 0.00 100.00) 24 25 (anchor 0.00 0.00) 25 26 (bounds 400.00 300.00) 26 27 (children 1 27 28 (GraphicsLayer 28 (position 0.00 -100.00)29 29 (anchor 0.00 0.00) 30 30 (children 1 -
trunk/LayoutTests/platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt
r240694 r246538 22 22 (children 1 23 23 (GraphicsLayer 24 (bounds origin 0.00 100.00) 24 25 (anchor 0.00 0.00) 25 26 (bounds 400.00 300.00) 26 27 (children 1 27 28 (GraphicsLayer 28 (position 0.00 -100.00)29 29 (anchor 0.00 0.00) 30 30 (children 1 -
trunk/LayoutTests/platform/mac-sierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt
r238034 r246538 21 21 (children 1 22 22 (GraphicsLayer 23 (bounds origin 0.00 100.00) 23 24 (anchor 0.00 0.00) 24 25 (bounds 400.00 300.00) 25 26 (children 1 26 27 (GraphicsLayer 27 (position 0.00 -100.00)28 28 (children 1 29 29 (GraphicsLayer -
trunk/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt
r240677 r246538 21 21 (children 1 22 22 (GraphicsLayer 23 (bounds origin 0.00 100.00) 23 24 (anchor 0.00 0.00) 24 25 (bounds 400.00 300.00) 25 26 (children 1 26 27 (GraphicsLayer 27 (position 0.00 -100.00)28 28 (anchor 0.00 0.00) 29 29 (children 1 … … 35 35 (bounds 400.00 1016.00) 36 36 (drawsContent 1) 37 (repaint rects 38 (rect 0.00 0.00 400.00 1016.00) 39 (rect 0.00 0.00 400.00 1016.00) 40 (rect 8.00 8.00 384.00 1000.00) 41 (rect 0.00 0.00 400.00 1016.00) 42 ) 37 43 (children 1 38 44 (GraphicsLayer -
trunk/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt
r240677 r246538 21 21 (children 1 22 22 (GraphicsLayer 23 (bounds origin 0.00 100.00) 23 24 (anchor 0.00 0.00) 24 25 (bounds 400.00 300.00) 25 26 (children 1 26 27 (GraphicsLayer 27 (position 0.00 -100.00)28 28 (anchor 0.00 0.00) 29 29 (children 1 -
trunk/LayoutTests/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
r243825 r246538 66 66 (children 1 67 67 (GraphicsLayer 68 (bounds origin 0.00 120.00) 68 69 (anchor 0.00 0.00) 69 70 (bounds 465.00 400.00) 70 71 (children 1 71 72 (GraphicsLayer 72 (position 0.00 -120.00)73 73 (anchor 0.00 0.00) 74 74 (children 1 -
trunk/LayoutTests/tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage-expected.txt
r245837 r246538 31 31 (offsetFromRenderer width=1 height=1) 32 32 (position 1.00 1.00) 33 (bounds origin 0.00 1800.00) 33 34 (bounds 385.00 512.00) 34 (visible rect 0.00, 0.00 385.00 x 512.00)35 (coverage rect 0.00, 0.00 385.00 x 512.00)35 (visible rect 0.00, 1800.00 385.00 x 512.00) 36 (coverage rect 0.00, 1800.00 385.00 x 512.00) 36 37 (intersects coverage rect 1) 37 38 (contentsScale 1.00) … … 40 41 (offsetFromRenderer width=1 height=1) 41 42 (scrollOffset (0,1800)) 42 (position 0.00 -1800.00)43 43 (anchor 0.00 0.00) 44 44 (bounds 385.00 3000.00) -
trunk/LayoutTests/tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage-expected.txt
r245837 r246538 31 31 (offsetFromRenderer width=1 height=1) 32 32 (position 1.00 1.00) 33 (bounds origin 0.00 200.00) 33 34 (bounds 385.00 512.00) 34 (visible rect 0.00, 0.00 385.00 x 512.00)35 (coverage rect 0.00, 0.00 385.00 x 512.00)35 (visible rect 0.00, 200.00 385.00 x 512.00) 36 (coverage rect 0.00, 200.00 385.00 x 512.00) 36 37 (intersects coverage rect 1) 37 38 (contentsScale 1.00) … … 40 41 (offsetFromRenderer width=1 height=1) 41 42 (scrollOffset (0,200)) 42 (position 0.00 -200.00)43 43 (anchor 0.00 0.00) 44 44 (bounds 385.00 3000.00) -
trunk/Source/WebCore/ChangeLog
r246537 r246538 1 2019-06-18 Simon Fraser <simon.fraser@apple.com> 2 3 Convert macOS to scroll by changing layer boundsOrigin 4 https://bugs.webkit.org/show_bug.cgi?id=198917 5 6 Reviewed by Antti Koivisto. 7 8 macOS did frame and overflow scrolling by changing the position of the scrolled 9 contents layer. iOS scrolls by changing the boundsOrigin of the scrollContainer layer 10 (which it has to, to match how UIScrollView works). 11 12 The iOS approach removes the need for an extra layer whose only role is for 13 scroll positioning, so migrate macOS to the same approach. A later patch can remove 14 m_scrolledContentsLayer. 15 16 We can remove RenderLayerCompositor::m_clipLayer since m_scrollContainerLayer has exactly 17 the same role now. 18 19 * page/scrolling/AsyncScrollingCoordinator.cpp: 20 (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition): 21 * page/scrolling/ScrollingCoordinator.cpp: 22 (WebCore::ScrollingCoordinator::insetClipLayerForFrameView): 23 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 24 (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers): 25 * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: 26 (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers): 27 * platform/graphics/cocoa/WebCoreCALayerExtras.h: 28 * platform/graphics/cocoa/WebCoreCALayerExtras.mm: 29 (-[CALayer _web_setLayerBoundsOrigin:]): 30 * rendering/RenderLayerBacking.cpp: 31 (WebCore::RenderLayerBacking::updateGeometry): 32 (WebCore::RenderLayerBacking::setLocationOfScrolledContents): 33 (WebCore::RenderLayerBacking::updateScrollOffset): 34 * rendering/RenderLayerCompositor.cpp: 35 (WebCore::RenderLayerCompositor::~RenderLayerCompositor): 36 (WebCore::RenderLayerCompositor::flushPendingLayerChanges): 37 (WebCore::RenderLayerCompositor::frameViewDidChangeSize): 38 (WebCore::RenderLayerCompositor::updateLayersForScrollPosition): 39 (WebCore::RenderLayerCompositor::updateScrollContainerGeometry): 40 (WebCore::RenderLayerCompositor::frameViewDidScroll): 41 (WebCore::RenderLayerCompositor::updateRootLayerPosition): 42 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 43 (WebCore::RenderLayerCompositor::ensureRootLayer): 44 (WebCore::RenderLayerCompositor::destroyRootLayer): 45 (WebCore::RenderLayerCompositor::updateScrollingNodeLayers): 46 (WebCore::RenderLayerCompositor::updateScrollLayerPosition): Deleted. 47 (WebCore::RenderLayerCompositor::updateScrollLayerClipping): Deleted. 48 * rendering/RenderLayerCompositor.h: 49 1 50 2019-06-18 Philippe Normand <pnormand@igalia.com> 2 51 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r245568 r246538 447 447 void AsyncScrollingCoordinator::reconcileScrollPosition(FrameView& frameView, ScrollingLayerPositionAction scrollingLayerPositionAction) 448 448 { 449 #if PLATFORM(IOS_FAMILY)450 // Doing all scrolling like this (UIScrollView style) would simplify code.451 449 auto* scrollContainerLayer = scrollContainerLayerForFrameView(frameView); 452 450 if (!scrollContainerLayer) 453 451 return; 452 453 // This uses scrollPosition because the root content layer accounts for scrollOrigin (see FrameView::positionForRootContentLayer()). 454 454 if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set) 455 455 scrollContainerLayer->setBoundsOrigin(frameView.scrollPosition()); 456 456 else 457 457 scrollContainerLayer->syncBoundsOrigin(frameView.scrollPosition()); 458 #else459 auto* scrolledContentsLayer = scrolledContentsLayerForFrameView(frameView);460 if (!scrolledContentsLayer)461 return;462 if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)463 scrolledContentsLayer->setPosition(-frameView.scrollPosition());464 else465 scrolledContentsLayer->syncPosition(-frameView.scrollPosition());466 #endif467 458 } 468 459 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r246036 r246538 273 273 { 274 274 if (auto* renderView = frameView.frame().contentRenderer()) 275 return renderView->compositor(). clipLayer();275 return renderView->compositor().scrollContainerLayer(); 276 276 return nullptr; 277 277 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r245543 r246538 200 200 void ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers() 201 201 { 202 scrolledContentsLayer().position = -currentScrollPosition(); 202 // We use scroll position here because the root content layer is offset to account for scrollOrigin (see FrameView::positionForRootContentLayer). 203 [scrollContainerLayer() _web_setLayerBoundsOrigin:currentScrollPosition()]; 203 204 } 204 205 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm
r245771 r246538 32 32 #import "ScrollingStateOverflowScrollingNode.h" 33 33 #import "ScrollingTree.h" 34 #import "WebCoreCALayerExtras.h" 34 35 #import <wtf/text/TextStream.h> 35 36 … … 92 93 { 93 94 auto scrollOffset = ScrollableArea::scrollOffsetFromPosition(currentScrollPosition(), toFloatSize(scrollOrigin())); 94 scrolledContentsLayer().position = -scrollOffset;95 [scrollContainerLayer() _web_setLayerBoundsOrigin:scrollOffset]; 95 96 } 96 97 -
trunk/Source/WebCore/platform/graphics/cocoa/WebCoreCALayerExtras.h
r242669 r246538 29 29 30 30 - (void)web_disableAllActions; 31 - (void)_web_setLayerBoundsOrigin:(CGPoint)origin; 31 32 - (void)_web_setLayerTopLeftPosition:(CGPoint)position; 32 33 + (CALayer *)_web_renderLayerWithContextID:(uint32_t)contextID; -
trunk/Source/WebCore/platform/graphics/cocoa/WebCoreCALayerExtras.mm
r242669 r246538 57 57 } 58 58 59 - (void)_web_setLayerBoundsOrigin:(CGPoint)origin 60 { 61 CGRect bounds = [self bounds]; 62 bounds.origin = origin; 63 [self setBounds:bounds]; 64 } 65 59 66 - (void)_web_setLayerTopLeftPosition:(CGPoint)position 60 67 { -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r246389 r246538 1226 1226 ScrollOffset scrollOffset = m_owningLayer.scrollOffset(); 1227 1227 updateScrollOffset(scrollOffset); 1228 #if PLATFORM(IOS_FAMILY)1229 m_scrolledContentsLayer->setPosition({ }); // FIXME: necessary?1230 #endif1231 1228 1232 1229 FloatSize oldScrollingLayerOffset = m_scrollContainerLayer->offsetFromRenderer(); … … 1307 1304 void RenderLayerBacking::setLocationOfScrolledContents(ScrollOffset scrollOffset, ScrollingLayerPositionAction setOrSync) 1308 1305 { 1309 #if PLATFORM(IOS_FAMILY)1310 1306 if (setOrSync == ScrollingLayerPositionAction::Sync) 1311 1307 m_scrollContainerLayer->syncBoundsOrigin(scrollOffset); 1312 1308 else 1313 1309 m_scrollContainerLayer->setBoundsOrigin(scrollOffset); 1314 #else1315 if (setOrSync == ScrollingLayerPositionAction::Sync)1316 m_scrolledContentsLayer->syncPosition(-scrollOffset);1317 else1318 m_scrolledContentsLayer->setPosition(-scrollOffset);1319 #endif1320 1310 } 1321 1311 … … 1331 1321 m_owningLayer.setRequiresScrollPositionReconciliation(false); 1332 1322 } 1323 1324 ASSERT(m_scrolledContentsLayer->position().isZero()); 1333 1325 } 1334 1326 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r246367 r246538 302 302 GraphicsLayer::unparentAndClear(m_rootContentsLayer); 303 303 304 GraphicsLayer::unparentAndClear(m_clipLayer);305 304 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 306 305 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); … … 522 521 if (layersLogEnabled()) { 523 522 LOG(Layers, "RenderLayerCompositor::flushPendingLayerChanges"); 524 showGraphicsLayerTree(m_ rootContentsLayer.get());523 showGraphicsLayerTree(m_overflowControlsHostLayer.get()); 525 524 } 526 525 #endif … … 1970 1969 1971 1970 if (m_scrolledContentsLayer) { 1972 updateScroll LayerClipping();1971 updateScrollContainerGeometry(); 1973 1972 frameViewDidScroll(); 1974 1973 updateOverflowControlsLayers(); … … 1990 1989 } 1991 1990 1992 void RenderLayerCompositor::update ScrollLayerPosition()1991 void RenderLayerCompositor::updateLayersForScrollPosition() 1993 1992 { 1994 1993 ASSERT(!hasCoordinatedScrolling()); 1995 ASSERT(m_scroll edContentsLayer);1994 ASSERT(m_scrollContainerLayer); 1996 1995 1997 1996 auto& frameView = m_renderView.frameView(); 1998 IntPoint scrollPosition = frameView.scrollPosition(); 1999 2000 m_scrolledContentsLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y())); 1997 // This uses scrollPosition because the root content layer accounts for scrollOrigin (see FrameView::positionForRootContentLayer()). 1998 m_scrollContainerLayer->setBoundsOrigin(frameView.scrollPosition()); 2001 1999 2002 2000 if (auto* fixedBackgroundLayer = fixedRootBackgroundLayer()) … … 2004 2002 } 2005 2003 2006 void RenderLayerCompositor::updateScrollLayerClipping() 2007 { 2008 auto* layerForClipping = this->layerForClipping(); 2009 if (!layerForClipping) 2004 void RenderLayerCompositor::updateScrollContainerGeometry() 2005 { 2006 if (!m_scrollContainerLayer) 2010 2007 return; 2011 2008 2012 layerForClipping->setSize(m_renderView.frameView().sizeForVisibleContent());2013 layerForClipping->setPosition(positionForClipLayer());2009 m_scrollContainerLayer->setSize(m_renderView.frameView().sizeForVisibleContent()); 2010 m_scrollContainerLayer->setPosition(positionForClipLayer()); 2014 2011 } 2015 2012 … … 2036 2033 } 2037 2034 2038 update ScrollLayerPosition();2035 updateLayersForScrollPosition(); 2039 2036 } 2040 2037 … … 2253 2250 m_rootContentsLayer->setSize(m_renderView.frameView().contentsSize()); 2254 2251 m_rootContentsLayer->setPosition(m_renderView.frameView().positionForRootContentLayer()); 2255 m_rootContentsLayer->setAnchorPoint( FloatPoint3D());2256 } 2257 2258 updateScroll LayerClipping();2252 m_rootContentsLayer->setAnchorPoint({ }); 2253 } 2254 2255 updateScrollContainerGeometry(); 2259 2256 2260 2257 #if ENABLE(RUBBER_BANDING) … … 3683 3680 // We want the overhang areas layer to be positioned below the frame contents, 3684 3681 // so insert it below the clip layer. 3685 m_overflowControlsHostLayer->addChildBelow(*m_layerForOverhangAreas, layerForClipping());3682 m_overflowControlsHostLayer->addChildBelow(*m_layerForOverhangAreas, m_scrollContainerLayer.get()); 3686 3683 } 3687 3684 } else … … 3773 3770 IntRect overflowRect = snappedIntRect(m_renderView.layoutOverflowRect()); 3774 3771 m_rootContentsLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.maxY())); 3775 m_rootContentsLayer->setPosition( FloatPoint());3772 m_rootContentsLayer->setPosition({ }); 3776 3773 3777 3774 #if PLATFORM(IOS_FAMILY) … … 3789 3786 if (!m_overflowControlsHostLayer) { 3790 3787 ASSERT(!m_scrolledContentsLayer); 3791 ASSERT(!m_clipLayer);3792 3788 3793 3789 // Create a layer to host the clipping layer and the overflow controls layers. … … 3795 3791 m_overflowControlsHostLayer->setName("overflow controls host"); 3796 3792 3793 m_scrollContainerLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::ScrollContainer); 3794 m_scrollContainerLayer->setName("scroll container"); 3795 m_scrollContainerLayer->setMasksToBounds(true); 3796 m_scrollContainerLayer->setAnchorPoint({ }); 3797 3797 3798 m_scrolledContentsLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::ScrolledContents); 3798 3799 m_scrolledContentsLayer->setName("scrolled contents"); 3799 3800 m_scrolledContentsLayer->setAnchorPoint({ }); 3800 3801 3801 #if PLATFORM(IOS_FAMILY) 3802 if (m_renderView.settings().asyncFrameScrollingEnabled()) { 3803 m_scrollContainerLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::ScrollContainer); 3804 3805 m_scrollContainerLayer->setName("scroll container"); 3806 m_scrollContainerLayer->setMasksToBounds(true); 3807 m_scrollContainerLayer->setAnchorPoint({ }); 3808 3809 m_scrollContainerLayer->addChild(*m_scrolledContentsLayer); 3810 m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer); 3811 } 3812 #endif 3813 if (!m_scrollContainerLayer) { 3814 m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); 3815 m_clipLayer->setName("frame clipping"); 3816 m_clipLayer->setMasksToBounds(true); 3817 m_clipLayer->setAnchorPoint({ }); 3818 3819 m_clipLayer->addChild(*m_scrolledContentsLayer); 3820 m_overflowControlsHostLayer->addChild(*m_clipLayer); 3821 } 3822 3802 m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer); 3803 m_scrollContainerLayer->addChild(*m_scrolledContentsLayer); 3823 3804 m_scrolledContentsLayer->addChild(*m_rootContentsLayer); 3824 3805 3825 updateScroll LayerClipping();3806 updateScrollContainerGeometry(); 3826 3807 updateOverflowControlsLayers(); 3827 3808 … … 3829 3810 scheduleLayerFlush(true); 3830 3811 else 3831 update ScrollLayerPosition();3812 updateLayersForScrollPosition(); 3832 3813 } 3833 3814 } else { 3834 3815 if (m_overflowControlsHostLayer) { 3835 3816 GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer); 3836 GraphicsLayer::unparentAndClear(m_clipLayer);3837 3817 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 3838 3818 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); … … 3881 3861 if (m_overflowControlsHostLayer) { 3882 3862 GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer); 3883 GraphicsLayer::unparentAndClear(m_clipLayer);3884 3863 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 3885 3864 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); … … 4321 4300 scrollingCoordinator.setNodeLayers(nodeID, { nullptr, 4322 4301 scrollContainerLayer(), scrolledContentsLayer(), 4323 fixedRootBackgroundLayer(), clipLayer(), rootContentsLayer(),4302 fixedRootBackgroundLayer(), nullptr, rootContentsLayer(), 4324 4303 frameView.layerForHorizontalScrollbar(), frameView.layerForVerticalScrollbar() }); 4325 4304 } else { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r245950 r246538 247 247 GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); } 248 248 GraphicsLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); } 249 GraphicsLayer* clipLayer() const { return m_clipLayer.get(); }250 249 GraphicsLayer* rootContentsLayer() const { return m_rootContentsLayer.get(); } 251 252 GraphicsLayer* layerForClipping() const { return m_clipLayer ? m_clipLayer.get() : m_scrollContainerLayer.get(); }253 250 254 251 #if ENABLE(RUBBER_BANDING) … … 441 438 void updateOverflowControlsLayers(); 442 439 443 void update ScrollLayerPosition();444 void updateScroll LayerClipping();440 void updateLayersForScrollPosition(); 441 void updateScrollContainerGeometry(); 445 442 446 443 FloatPoint positionForClipLayer() const; … … 575 572 576 573 // Enclosing clipping layer for iframe content 577 RefPtr<GraphicsLayer> m_clipLayer;578 574 RefPtr<GraphicsLayer> m_scrollContainerLayer; 579 575 RefPtr<GraphicsLayer> m_scrolledContentsLayer; -
trunk/Source/WebKit/ChangeLog
r246535 r246538 1 2019-06-18 Simon Fraser <simon.fraser@apple.com> 2 3 Convert macOS to scroll by changing layer boundsOrigin 4 https://bugs.webkit.org/show_bug.cgi?id=198917 5 6 Reviewed by Antti Koivisto. 7 8 Remove unreached and confusing code. 9 10 * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: 11 (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers): 12 1 13 2019-06-18 Dean Jackson <dino@apple.com> 2 14 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm
r243926 r246538 123 123 } 124 124 125 auto scrollPosition = currentScrollPosition(); 126 // FIXME: This is always wrong on iOS. Maybe assert that we always have a delegate. 127 [scrolledContentsLayer() setPosition:-scrollPosition]; 125 // Main frame scrolling is handled by the main UIScrollView. 128 126 } 129 127
Note:
See TracChangeset
for help on using the changeset viewer.