Changeset 246612 in webkit
- Timestamp:
- Jun 19, 2019 2:47:07 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246611 r246612 20 20 21 21 * platform/gtk/TestExpectations: 22 23 2019-06-19 Simon Fraser <simon.fraser@apple.com> 24 25 Revert parts of r246538 so that frame scrolling is reverted to using layer positions. 26 Overflow scroll will still scroll by changing boundsOrigin. 27 28 The bug was caused by confusion about insetClipLayer and scrollContainerLayer; macOS 29 positions the clip layer using FrameView::yPositionForInsetClipLayer(), so it's not just 30 a simple scroll container, and this change broke positioning for fixed position layers. 31 32 * compositing/iframes/scrolling-iframe-expected.txt: 33 * compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: 34 * compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: 35 * platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt: 36 * platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt: 37 * platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: 38 * platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: 39 * platform/mac-sierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: 40 * platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt: 41 * platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt: 42 * scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt: 22 43 23 44 2019-06-19 Russell Epstein <russell_e@apple.com> -
trunk/LayoutTests/compositing/iframes/scrolling-iframe-expected.txt
r246538 r246612 17 17 (children 1 18 18 (GraphicsLayer 19 (bounds origin 80.00 80.00)20 19 (anchor 0.00 0.00) 21 20 (bounds 285.00 135.00) 22 21 (children 1 23 22 (GraphicsLayer 23 (position -80.00 -80.00) 24 24 (anchor 0.00 0.00) 25 25 (children 1 -
trunk/LayoutTests/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt
r246538 r246612 18 18 (children 1 19 19 (GraphicsLayer 20 (bounds origin 0.00 100.00)21 20 (anchor 0.00 0.00) 22 21 (bounds 400.00 300.00) 23 22 (children 1 24 23 (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
r246538 r246612 18 18 (children 1 19 19 (GraphicsLayer 20 (bounds origin 0.00 100.00)21 20 (anchor 0.00 0.00) 22 21 (bounds 400.00 300.00) 23 22 (children 1 24 23 (GraphicsLayer 24 (position 0.00 -100.00) 25 25 (anchor 0.00 0.00) 26 26 (children 1 -
trunk/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt
r246538 r246612 17 17 (children 1 18 18 (GraphicsLayer 19 (bounds origin 80.00 80.00)20 19 (anchor 0.00 0.00) 21 20 (bounds 300.00 150.00) -
trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
r246538 r246612 64 64 (children 1 65 65 (GraphicsLayer 66 (bounds origin 0.00 120.00)67 66 (anchor 0.00 0.00) 68 67 (bounds 480.00 400.00) -
trunk/LayoutTests/platform/mac-highsierra-wk1/compositing/repaint/iframes/compositing-iframe-scroll-repaint-expected.txt
r246538 r246612 22 22 (children 1 23 23 (GraphicsLayer 24 (bounds origin 0.00 100.00)25 24 (anchor 0.00 0.00) 26 25 (bounds 400.00 300.00) 27 26 (children 1 28 27 (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
r246538 r246612 22 22 (children 1 23 23 (GraphicsLayer 24 (bounds origin 0.00 100.00)25 24 (anchor 0.00 0.00) 26 25 (bounds 400.00 300.00) 27 26 (children 1 28 27 (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
r246538 r246612 21 21 (children 1 22 22 (GraphicsLayer 23 (bounds origin 0.00 100.00)24 23 (anchor 0.00 0.00) 25 24 (bounds 400.00 300.00) 26 25 (children 1 27 26 (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
r246538 r246612 21 21 (children 1 22 22 (GraphicsLayer 23 (bounds origin 0.00 100.00)24 23 (anchor 0.00 0.00) 25 24 (bounds 400.00 300.00) 26 25 (children 1 27 26 (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 rects38 (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 )43 37 (children 1 44 38 (GraphicsLayer -
trunk/LayoutTests/platform/mac-wk1/compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint-expected.txt
r246538 r246612 21 21 (children 1 22 22 (GraphicsLayer 23 (bounds origin 0.00 100.00)24 23 (anchor 0.00 0.00) 25 24 (bounds 400.00 300.00) 26 25 (children 1 27 26 (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
r246538 r246612 66 66 (children 1 67 67 (GraphicsLayer 68 (bounds origin 0.00 120.00)69 68 (anchor 0.00 0.00) 70 69 (bounds 465.00 400.00) 71 70 (children 1 72 71 (GraphicsLayer 72 (position 0.00 -120.00) 73 73 (anchor 0.00 0.00) 74 74 (children 1 -
trunk/Source/WebCore/ChangeLog
r246611 r246612 41 41 (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer): 42 42 (WebCore::computeRotatedWidthAndHeight): Deleted. 43 44 2019-06-19 Simon Fraser <simon.fraser@apple.com> 45 46 REGRESSION (246538): Newyorker.com header scrolls on page 47 48 Revert parts of r246538 so that frame scrolling is reverted to using layer positions. 49 Overflow scroll will still scroll by changing boundsOrigin. 50 51 The bug was caused by confusion about insetClipLayer and scrollContainerLayer; macOS 52 positions the clip layer using FrameView::yPositionForInsetClipLayer(), so it's not just 53 a simple scroll container, and this change broke positioning for fixed position layers. 54 55 * page/scrolling/AsyncScrollingCoordinator.cpp: 56 (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition): 57 * page/scrolling/ScrollingCoordinator.cpp: 58 (WebCore::ScrollingCoordinator::insetClipLayerForFrameView): 59 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 60 (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers): 61 * rendering/RenderLayerCompositor.cpp: 62 (WebCore::RenderLayerCompositor::~RenderLayerCompositor): 63 (WebCore::RenderLayerCompositor::frameViewDidChangeSize): 64 (WebCore::RenderLayerCompositor::updateScrollLayerPosition): 65 (WebCore::RenderLayerCompositor::updateScrollLayerClipping): 66 (WebCore::RenderLayerCompositor::frameViewDidScroll): 67 (WebCore::RenderLayerCompositor::updateRootLayerPosition): 68 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 69 (WebCore::RenderLayerCompositor::ensureRootLayer): 70 (WebCore::RenderLayerCompositor::destroyRootLayer): 71 (WebCore::RenderLayerCompositor::updateScrollingNodeLayers): 72 (WebCore::RenderLayerCompositor::updateLayersForScrollPosition): Deleted. 73 (WebCore::RenderLayerCompositor::updateScrollContainerGeometry): Deleted. 74 * rendering/RenderLayerCompositor.h: 43 75 44 76 2019-06-19 Adrian Perez de Castro <aperez@igalia.com> -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r246538 r246612 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. 449 451 auto* scrollContainerLayer = scrollContainerLayerForFrameView(frameView); 450 452 if (!scrollContainerLayer) 451 453 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 #else 459 // This uses scrollPosition because the root content layer accounts for scrollOrigin (see FrameView::positionForRootContentLayer()). 460 auto* scrolledContentsLayer = scrolledContentsLayerForFrameView(frameView); 461 if (!scrolledContentsLayer) 462 return; 463 if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set) 464 scrolledContentsLayer->setPosition(-frameView.scrollPosition()); 465 else 466 scrolledContentsLayer->syncPosition(-frameView.scrollPosition()); 467 #endif 458 468 } 459 469 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r246538 r246612 273 273 { 274 274 if (auto* renderView = frameView.frame().contentRenderer()) 275 return renderView->compositor(). scrollContainerLayer();275 return renderView->compositor().clipLayer(); 276 276 return nullptr; 277 277 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r246538 r246612 201 201 { 202 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 scrolledContentsLayer().position = -currentScrollPosition(); 204 204 } 205 205 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r246538 r246612 302 302 GraphicsLayer::unparentAndClear(m_rootContentsLayer); 303 303 304 GraphicsLayer::unparentAndClear(m_clipLayer); 304 305 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 305 306 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); … … 1969 1970 1970 1971 if (m_scrolledContentsLayer) { 1971 updateScroll ContainerGeometry();1972 updateScrollLayerClipping(); 1972 1973 frameViewDidScroll(); 1973 1974 updateOverflowControlsLayers(); … … 1989 1990 } 1990 1991 1991 void RenderLayerCompositor::update LayersForScrollPosition()1992 void RenderLayerCompositor::updateScrollLayerPosition() 1992 1993 { 1993 1994 ASSERT(!hasCoordinatedScrolling()); 1994 ASSERT(m_scroll ContainerLayer);1995 ASSERT(m_scrolledContentsLayer); 1995 1996 1996 1997 auto& frameView = m_renderView.frameView(); 1997 // This uses scrollPosition because the root content layer accounts for scrollOrigin (see FrameView::positionForRootContentLayer()). 1998 m_scrollContainerLayer->setBoundsOrigin(frameView.scrollPosition()); 1998 IntPoint scrollPosition = frameView.scrollPosition(); 1999 2000 // We use scroll position here because the root content layer is offset to account for scrollOrigin (see FrameView::positionForRootContentLayer). 2001 m_scrolledContentsLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y())); 1999 2002 2000 2003 if (auto* fixedBackgroundLayer = fixedRootBackgroundLayer()) … … 2002 2005 } 2003 2006 2004 void RenderLayerCompositor::updateScrollContainerGeometry() 2005 { 2006 if (!m_scrollContainerLayer) 2007 void RenderLayerCompositor::updateScrollLayerClipping() 2008 { 2009 auto* layerForClipping = this->layerForClipping(); 2010 if (!layerForClipping) 2007 2011 return; 2008 2012 2009 m_scrollContainerLayer->setSize(m_renderView.frameView().sizeForVisibleContent());2010 m_scrollContainerLayer->setPosition(positionForClipLayer());2013 layerForClipping->setSize(m_renderView.frameView().sizeForVisibleContent()); 2014 layerForClipping->setPosition(positionForClipLayer()); 2011 2015 } 2012 2016 … … 2033 2037 } 2034 2038 2035 update LayersForScrollPosition();2039 updateScrollLayerPosition(); 2036 2040 } 2037 2041 … … 2250 2254 m_rootContentsLayer->setSize(m_renderView.frameView().contentsSize()); 2251 2255 m_rootContentsLayer->setPosition(m_renderView.frameView().positionForRootContentLayer()); 2252 m_rootContentsLayer->setAnchorPoint( { });2253 } 2254 2255 updateScroll ContainerGeometry();2256 m_rootContentsLayer->setAnchorPoint(FloatPoint3D()); 2257 } 2258 2259 updateScrollLayerClipping(); 2256 2260 2257 2261 #if ENABLE(RUBBER_BANDING) … … 3680 3684 // We want the overhang areas layer to be positioned below the frame contents, 3681 3685 // so insert it below the clip layer. 3682 m_overflowControlsHostLayer->addChildBelow(*m_layerForOverhangAreas, m_scrollContainerLayer.get());3686 m_overflowControlsHostLayer->addChildBelow(*m_layerForOverhangAreas, layerForClipping()); 3683 3687 } 3684 3688 } else … … 3770 3774 IntRect overflowRect = snappedIntRect(m_renderView.layoutOverflowRect()); 3771 3775 m_rootContentsLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.maxY())); 3772 m_rootContentsLayer->setPosition( { });3776 m_rootContentsLayer->setPosition(FloatPoint()); 3773 3777 3774 3778 #if PLATFORM(IOS_FAMILY) … … 3786 3790 if (!m_overflowControlsHostLayer) { 3787 3791 ASSERT(!m_scrolledContentsLayer); 3792 ASSERT(!m_clipLayer); 3788 3793 3789 3794 // Create a layer to host the clipping layer and the overflow controls layers. … … 3791 3796 m_overflowControlsHostLayer->setName("overflow controls host"); 3792 3797 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 3798 3798 m_scrolledContentsLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::ScrolledContents); 3799 3799 m_scrolledContentsLayer->setName("scrolled contents"); 3800 3800 m_scrolledContentsLayer->setAnchorPoint({ }); 3801 3801 3802 m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer); 3803 m_scrollContainerLayer->addChild(*m_scrolledContentsLayer); 3802 #if PLATFORM(IOS_FAMILY) 3803 if (m_renderView.settings().asyncFrameScrollingEnabled()) { 3804 m_scrollContainerLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::ScrollContainer); 3805 3806 m_scrollContainerLayer->setName("scroll container"); 3807 m_scrollContainerLayer->setMasksToBounds(true); 3808 m_scrollContainerLayer->setAnchorPoint({ }); 3809 3810 m_scrollContainerLayer->addChild(*m_scrolledContentsLayer); 3811 m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer); 3812 } 3813 #endif 3814 // FIXME: m_scrollContainerLayer and m_clipLayer have similar roles here, but m_clipLayer has some special positioning to 3815 // account for clipping and top content inset (see FrameView::yPositionForInsetClipLayer()). 3816 if (!m_scrollContainerLayer) { 3817 m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); 3818 m_clipLayer->setName("frame clipping"); 3819 m_clipLayer->setMasksToBounds(true); 3820 m_clipLayer->setAnchorPoint({ }); 3821 3822 m_clipLayer->addChild(*m_scrolledContentsLayer); 3823 m_overflowControlsHostLayer->addChild(*m_clipLayer); 3824 } 3825 3804 3826 m_scrolledContentsLayer->addChild(*m_rootContentsLayer); 3805 3827 3806 updateScroll ContainerGeometry();3828 updateScrollLayerClipping(); 3807 3829 updateOverflowControlsLayers(); 3808 3830 … … 3810 3832 scheduleLayerFlush(true); 3811 3833 else 3812 update LayersForScrollPosition();3834 updateScrollLayerPosition(); 3813 3835 } 3814 3836 } else { 3815 3837 if (m_overflowControlsHostLayer) { 3816 3838 GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer); 3839 GraphicsLayer::unparentAndClear(m_clipLayer); 3817 3840 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 3818 3841 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); … … 3861 3884 if (m_overflowControlsHostLayer) { 3862 3885 GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer); 3886 GraphicsLayer::unparentAndClear(m_clipLayer); 3863 3887 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 3864 3888 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); … … 4300 4324 scrollingCoordinator.setNodeLayers(nodeID, { nullptr, 4301 4325 scrollContainerLayer(), scrolledContentsLayer(), 4302 fixedRootBackgroundLayer(), nullptr, rootContentsLayer(),4326 fixedRootBackgroundLayer(), clipLayer(), rootContentsLayer(), 4303 4327 frameView.layerForHorizontalScrollbar(), frameView.layerForVerticalScrollbar() }); 4304 4328 } else { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r246538 r246612 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(); } 249 250 GraphicsLayer* rootContentsLayer() const { return m_rootContentsLayer.get(); } 251 252 GraphicsLayer* layerForClipping() const { return m_clipLayer ? m_clipLayer.get() : m_scrollContainerLayer.get(); } 250 253 251 254 #if ENABLE(RUBBER_BANDING) … … 438 441 void updateOverflowControlsLayers(); 439 442 440 void update LayersForScrollPosition();441 void updateScroll ContainerGeometry();443 void updateScrollLayerPosition(); 444 void updateScrollLayerClipping(); 442 445 443 446 FloatPoint positionForClipLayer() const; … … 572 575 573 576 // Enclosing clipping layer for iframe content 577 RefPtr<GraphicsLayer> m_clipLayer; 574 578 RefPtr<GraphicsLayer> m_scrollContainerLayer; 575 579 RefPtr<GraphicsLayer> m_scrolledContentsLayer;
Note: See TracChangeset
for help on using the changeset viewer.