WebKit Bugzilla
Attachment 360596 Details for
Bug 193665
: [iOS] Tiles not created in large scrollable iframes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
wip
scroll-container-layer.patch (text/plain), 42.07 KB, created by
Antti Koivisto
on 2019-01-30 10:47:57 PST
(
hide
)
Description:
wip
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-01-30 10:47:57 PST
Size:
42.07 KB
patch
obsolete
>Index: Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >=================================================================== >--- Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (revision 240715) >+++ Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (working copy) >@@ -225,7 +225,7 @@ void AsyncScrollingCoordinator::frameVie > node->setLayer(scrollLayerForFrameView(frameView)); > node->setScrolledContentsLayer(rootContentLayerForFrameView(frameView)); > node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView)); >- node->setInsetClipLayer(insetClipLayerForFrameView(frameView)); >+ node->setScrollContainerLayer(scrollContainerLayerForFrameView(frameView)); > node->setContentShadowLayer(contentShadowLayerForFrameView(frameView)); > node->setHeaderLayer(headerLayerForFrameView(frameView)); > node->setFooterLayer(footerLayerForFrameView(frameView)); >@@ -414,7 +414,7 @@ void AsyncScrollingCoordinator::reconcil > return; > > auto* counterScrollingLayer = counterScrollingLayerForFrameView(frameView); >- auto* insetClipLayer = insetClipLayerForFrameView(frameView); >+ auto* scrollContainerLayer = scrollContainerLayerForFrameView(frameView); > auto* contentShadowLayer = contentShadowLayerForFrameView(frameView); > auto* scrolledContentsLayer = rootContentLayerForFrameView(frameView); > auto* headerLayer = headerLayerForFrameView(frameView); >@@ -424,9 +424,9 @@ void AsyncScrollingCoordinator::reconcil > LayoutPoint scrollPositionForFixed = frameView.scrollPositionForFixedPosition(); > float topContentInset = frameView.topContentInset(); > >- FloatPoint positionForInsetClipLayer; >- if (insetClipLayer) >- positionForInsetClipLayer = FloatPoint(insetClipLayer->position().x(), FrameView::yPositionForInsetClipLayer(scrollPosition, topContentInset)); >+ FloatPoint positionForScrollContainerLayer; >+ if (scrollContainerLayer) >+ positionForScrollContainerLayer = FloatPoint(scrollContainerLayer->position().x(), FrameView::yPositionForInsetClipLayer(scrollPosition, topContentInset)); > FloatPoint positionForContentsLayer = frameView.positionForRootContentLayer(); > > FloatPoint positionForHeaderLayer = FloatPoint(scrollPositionForFixed.x(), FrameView::yPositionForHeaderLayer(scrollPosition, topContentInset)); >@@ -437,8 +437,8 @@ void AsyncScrollingCoordinator::reconcil > scrollLayer->setPosition(-frameView.scrollPosition()); > if (counterScrollingLayer) > counterScrollingLayer->setPosition(scrollPositionForFixed); >- if (insetClipLayer) >- insetClipLayer->setPosition(positionForInsetClipLayer); >+ if (scrollContainerLayer) >+ scrollContainerLayer->setPosition(positionForScrollContainerLayer); > if (contentShadowLayer) > contentShadowLayer->setPosition(positionForContentsLayer); > if (scrolledContentsLayer) >@@ -451,8 +451,8 @@ void AsyncScrollingCoordinator::reconcil > scrollLayer->syncPosition(-frameView.scrollPosition()); > if (counterScrollingLayer) > counterScrollingLayer->syncPosition(scrollPositionForFixed); >- if (insetClipLayer) >- insetClipLayer->syncPosition(positionForInsetClipLayer); >+ if (scrollContainerLayer) >+ scrollContainerLayer->syncPosition(positionForScrollContainerLayer); > if (contentShadowLayer) > contentShadowLayer->syncPosition(positionForContentsLayer); > if (scrolledContentsLayer) >@@ -569,7 +569,7 @@ void AsyncScrollingCoordinator::ensureRo > insertNode(ScrollingNodeType::MainFrame, frameView.scrollLayerID(), 0, 0); > } > >-void AsyncScrollingCoordinator::setNodeLayers(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer) >+void AsyncScrollingCoordinator::setNodeLayers(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* scrollContainerLayer) > { > auto* node = m_scrollingStateTree->stateNodeForID(nodeID); > ASSERT(node); >@@ -584,7 +584,7 @@ void AsyncScrollingCoordinator::setNodeL > > if (is<ScrollingStateFrameScrollingNode>(node)) { > auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node); >- frameScrollingNode.setInsetClipLayer(insetClipLayer); >+ frameScrollingNode.setScrollContainerLayer(scrollContainerLayer); > frameScrollingNode.setCounterScrollingLayer(counterScrollingLayer); > } > } >Index: Source/WebCore/page/scrolling/ScrollingCoordinator.cpp >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (revision 240715) >+++ Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (working copy) >@@ -267,10 +267,10 @@ GraphicsLayer* ScrollingCoordinator::cou > return nullptr; > } > >-GraphicsLayer* ScrollingCoordinator::insetClipLayerForFrameView(FrameView& frameView) >+GraphicsLayer* ScrollingCoordinator::scrollContainerLayerForFrameView(FrameView& frameView) > { > if (auto* renderView = frameView.frame().contentRenderer()) >- return renderView->compositor().clipLayer(); >+ return renderView->compositor().scrollContainerLayer(); > return nullptr; > } > >Index: Source/WebCore/page/scrolling/ScrollingCoordinator.h >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingCoordinator.h (revision 240715) >+++ Source/WebCore/page/scrolling/ScrollingCoordinator.h (working copy) >@@ -129,7 +129,7 @@ public: > virtual ScrollingNodeID parentOfNode(ScrollingNodeID) const { return 0; } > virtual Vector<ScrollingNodeID> childrenOfNode(ScrollingNodeID) const { return { }; } > >- virtual void setNodeLayers(ScrollingNodeID, GraphicsLayer* /*layer*/, GraphicsLayer* /*scrolledContentsLayer*/ = nullptr, GraphicsLayer* /*counterScrollingLayer*/ = nullptr, GraphicsLayer* /*insetClipLayer*/ = nullptr) { } >+ virtual void setNodeLayers(ScrollingNodeID, GraphicsLayer* /*layer*/, GraphicsLayer* /*scrolledContentsLayer*/ = nullptr, GraphicsLayer* /*counterScrollingLayer*/ = nullptr, GraphicsLayer* /*scrollContainerLayer*/ = nullptr) { } > > struct ScrollingGeometry { > LayoutRect parentRelativeScrollableRect; >@@ -188,7 +188,7 @@ protected: > > GraphicsLayer* scrollLayerForFrameView(FrameView&); > GraphicsLayer* counterScrollingLayerForFrameView(FrameView&); >- GraphicsLayer* insetClipLayerForFrameView(FrameView&); >+ GraphicsLayer* scrollContainerLayerForFrameView(FrameView&); > GraphicsLayer* rootContentLayerForFrameView(FrameView&); > GraphicsLayer* contentShadowLayerForFrameView(FrameView&); > GraphicsLayer* headerLayerForFrameView(FrameView&); >Index: Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (revision 240715) >+++ Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (working copy) >@@ -68,9 +68,6 @@ ScrollingStateFrameScrollingNode::Scroll > if (hasChangedProperty(CounterScrollingLayer)) > setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); > >- if (hasChangedProperty(InsetClipLayer)) >- setInsetClipLayer(stateNode.insetClipLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); >- > if (hasChangedProperty(ContentShadowLayer)) > setContentShadowLayer(stateNode.contentShadowLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); > >@@ -101,7 +98,6 @@ void ScrollingStateFrameScrollingNode::s > setPropertyChangedBit(ReasonsForSynchronousScrolling); > setPropertyChangedBit(ScrolledContentsLayer); > setPropertyChangedBit(CounterScrollingLayer); >- setPropertyChangedBit(InsetClipLayer); > setPropertyChangedBit(ContentShadowLayer); > setPropertyChangedBit(HeaderHeight); > setPropertyChangedBit(FooterHeight); >@@ -221,15 +217,6 @@ void ScrollingStateFrameScrollingNode::s > setPropertyChanged(CounterScrollingLayer); > } > >-void ScrollingStateFrameScrollingNode::setInsetClipLayer(const LayerRepresentation& layerRepresentation) >-{ >- if (layerRepresentation == m_insetClipLayer) >- return; >- >- m_insetClipLayer = layerRepresentation; >- setPropertyChanged(InsetClipLayer); >-} >- > void ScrollingStateFrameScrollingNode::setContentShadowLayer(const LayerRepresentation& layerRepresentation) > { > if (layerRepresentation == m_contentShadowLayer) >@@ -308,7 +295,6 @@ void ScrollingStateFrameScrollingNode::d > > if (behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) { > ts.dumpProperty("counter scrolling layer ID", m_counterScrollingLayer.layerID()); >- ts.dumpProperty("inset clip layer ID", m_insetClipLayer.layerID()); > ts.dumpProperty("content shadow layer ID", m_contentShadowLayer.layerID()); > ts.dumpProperty("header layer ID", m_headerLayer.layerID()); > ts.dumpProperty("footer layer ID", m_footerLayer.layerID()); >Index: Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (revision 240715) >+++ Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (working copy) >@@ -51,7 +51,6 @@ public: > ReasonsForSynchronousScrolling, > ScrolledContentsLayer, > CounterScrollingLayer, >- InsetClipLayer, > ContentShadowLayer, > HeaderHeight, > FooterHeight, >@@ -103,13 +102,6 @@ public: > const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; } > WEBCORE_EXPORT void setCounterScrollingLayer(const LayerRepresentation&); > >- // This is a clipping layer that will scroll with the page for all y-delta scroll values between 0 >- // and topContentInset(). Once the y-deltas get beyond the content inset point, this layer no longer >- // needs to move. If the topContentInset() is 0, this layer does not need to move at all. This is >- // only used on the Mac. >- const LayerRepresentation& insetClipLayer() const { return m_insetClipLayer; } >- WEBCORE_EXPORT void setInsetClipLayer(const LayerRepresentation&); >- > const LayerRepresentation& contentShadowLayer() const { return m_contentShadowLayer; } > WEBCORE_EXPORT void setContentShadowLayer(const LayerRepresentation&); > >@@ -148,7 +140,6 @@ private: > void setAllPropertiesChanged() override; > > LayerRepresentation m_counterScrollingLayer; >- LayerRepresentation m_insetClipLayer; > LayerRepresentation m_contentShadowLayer; > LayerRepresentation m_headerLayer; > LayerRepresentation m_footerLayer; >Index: Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (revision 240715) >+++ Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (working copy) >@@ -54,6 +54,9 @@ ScrollingStateScrollingNode::ScrollingSt > , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll()) > , m_expectsWheelEventTestTrigger(stateNode.expectsWheelEventTestTrigger()) > { >+ if (hasChangedProperty(ScrollContainerLayer)) >+ setScrollContainerLayer(stateNode.scrollContainerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); >+ > if (hasChangedProperty(ScrolledContentsLayer)) > setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); > } >@@ -79,6 +82,7 @@ void ScrollingStateScrollingNode::setAll > setPropertyChangedBit(CurrentVerticalSnapOffsetIndex); > #endif > setPropertyChangedBit(ExpectsWheelEventTestTrigger); >+ setPropertyChangedBit(ScrollContainerLayer); > setPropertyChangedBit(ScrolledContentsLayer); > > ScrollingStateNode::setAllPropertiesChanged(); >@@ -219,6 +223,15 @@ void ScrollingStateScrollingNode::setExp > setPropertyChanged(ExpectsWheelEventTestTrigger); > } > >+void ScrollingStateScrollingNode::setScrollContainerLayer(const LayerRepresentation& layerRepresentation) >+{ >+ if (layerRepresentation == m_scrollContainerLayer) >+ return; >+ >+ m_scrollContainerLayer = layerRepresentation; >+ setPropertyChanged(ScrollContainerLayer); >+} >+ > void ScrollingStateScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation) > { > if (layerRepresentation == m_scrolledContentsLayer) >@@ -290,8 +303,12 @@ void ScrollingStateScrollingNode::dumpPr > if (m_expectsWheelEventTestTrigger) > ts.dumpProperty("expects wheel event test trigger", m_expectsWheelEventTestTrigger); > >- if ((behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) && m_scrolledContentsLayer.layerID()) >- ts.dumpProperty("scrolled contents layer", m_scrolledContentsLayer.layerID()); >+ if (behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) { >+ if (m_scrollContainerLayer.layerID()) >+ ts.dumpProperty("scroll container layer ID", m_scrollContainerLayer.layerID()); >+ if (m_scrolledContentsLayer.layerID()) >+ ts.dumpProperty("scrolled contents layer", m_scrolledContentsLayer.layerID()); >+ } > } > > } // namespace WebCore >Index: Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (revision 240715) >+++ Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (working copy) >@@ -56,6 +56,7 @@ public: > CurrentVerticalSnapOffsetIndex, > #endif > ExpectsWheelEventTestTrigger, >+ ScrollContainerLayer, > ScrolledContentsLayer, > NumScrollingStateNodeBits // This must remain at the last position. > }; >@@ -108,6 +109,10 @@ public: > bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; } > WEBCORE_EXPORT void setExpectsWheelEventTestTrigger(bool); > >+ // During scrolling his layer stays put while its child layer (layer() of the node) moves. >+ const LayerRepresentation& scrollContainerLayer() const { return m_scrollContainerLayer; } >+ WEBCORE_EXPORT void setScrollContainerLayer(const LayerRepresentation&); >+ > // This is a layer with the contents that move. > const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; } > WEBCORE_EXPORT void setScrolledContentsLayer(const LayerRepresentation&); >@@ -134,6 +139,7 @@ private: > unsigned m_currentVerticalSnapPointIndex { 0 }; > #endif > ScrollableAreaParameters m_scrollableAreaParameters; >+ LayerRepresentation m_scrollContainerLayer; > LayerRepresentation m_scrolledContentsLayer; > bool m_requestedScrollPositionRepresentsProgrammaticScroll { false }; > bool m_expectsWheelEventTestTrigger { false }; >Index: Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h >=================================================================== >--- Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (revision 240715) >+++ Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (working copy) >@@ -102,7 +102,7 @@ private: > RetainPtr<CALayer> m_scrollLayer; > RetainPtr<CALayer> m_scrolledContentsLayer; > RetainPtr<CALayer> m_counterScrollingLayer; >- RetainPtr<CALayer> m_insetClipLayer; >+ RetainPtr<CALayer> m_scrollContainerLayer; > RetainPtr<CALayer> m_contentShadowLayer; > RetainPtr<CALayer> m_headerLayer; > RetainPtr<CALayer> m_footerLayer; >Index: Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >=================================================================== >--- Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (revision 240715) >+++ Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (working copy) >@@ -111,8 +111,8 @@ void ScrollingTreeFrameScrollingNodeMac: > if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) > m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer(); > >- if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) >- m_insetClipLayer = scrollingStateNode.insetClipLayer(); >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrollContainerLayer)) >+ m_scrollContainerLayer = scrollingStateNode.scrollContainerLayer(); > > if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) > m_contentShadowLayer = scrollingStateNode.contentShadowLayer(); >@@ -439,8 +439,8 @@ void ScrollingTreeFrameScrollingNodeMac: > m_counterScrollingLayer.get().position = fixedPositionRect.location(); > > float topContentInset = this->topContentInset(); >- if (m_insetClipLayer && m_scrolledContentsLayer && topContentInset) { >- m_insetClipLayer.get().position = FloatPoint(m_insetClipLayer.get().position.x, FrameView::yPositionForInsetClipLayer(position, topContentInset)); >+ if (m_scrollContainerLayer && m_scrolledContentsLayer && topContentInset) { >+ m_scrollContainerLayer.get().position = FloatPoint(m_scrollContainerLayer.get().position.x, FrameView::yPositionForInsetClipLayer(position, topContentInset)); > m_scrolledContentsLayer.get().position = FrameView::positionForRootContentLayer(position, scrollOrigin(), topContentInset, headerHeight()); > if (m_contentShadowLayer) > m_contentShadowLayer.get().position = m_scrolledContentsLayer.get().position; >Index: Source/WebCore/rendering/RenderLayerCompositor.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayerCompositor.cpp (revision 240715) >+++ Source/WebCore/rendering/RenderLayerCompositor.cpp (working copy) >@@ -290,7 +290,7 @@ RenderLayerCompositor::RenderLayerCompos > RenderLayerCompositor::~RenderLayerCompositor() > { > // Take care that the owned GraphicsLayers are deleted first as their destructors may call back here. >- m_clipLayer = nullptr; >+ m_scrollContainerLayer = nullptr; > m_scrollLayer = nullptr; > ASSERT(m_rootLayerAttachment == RootLayerUnattached); > } >@@ -549,7 +549,7 @@ void RenderLayerCompositor::didChangePla > if (auto nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling)) { > // FIXME: would be nice to not have to special-case the root. > if (layer.isRenderViewLayer()) >- scrollingCoordinator->setNodeLayers(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer()); >+ scrollingCoordinator->setNodeLayers(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), scrollContainerLayer()); > else > scrollingCoordinator->setNodeLayers(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer()); > } >@@ -1797,7 +1797,7 @@ void RenderLayerCompositor::frameViewDid > layer->setNeedsCompositingGeometryUpdate(); > > if (m_scrollLayer) { >- updateScrollLayerClipping(); >+ updateScrollContainerLayerClipping(); > frameViewDidScroll(); > updateOverflowControlsLayers(); > >@@ -1830,17 +1830,15 @@ void RenderLayerCompositor::updateScroll > fixedBackgroundLayer->setPosition(frameView.scrollPositionForFixedPosition()); > } > >-void RenderLayerCompositor::updateScrollLayerClipping() >+void RenderLayerCompositor::updateScrollContainerLayerClipping() > { >- auto* layerForClipping = this->layerForClipping(); >- if (!layerForClipping) >+ if (!m_scrollContainerLayer) > return; >- >- layerForClipping->setSize(m_renderView.frameView().sizeForVisibleContent()); >- layerForClipping->setPosition(positionForClipLayer()); >+ m_scrollContainerLayer->setSize(m_renderView.frameView().sizeForVisibleContent()); >+ m_scrollContainerLayer->setPosition(positionForScrollContainerLayer()); > } > >-FloatPoint RenderLayerCompositor::positionForClipLayer() const >+FloatPoint RenderLayerCompositor::positionForScrollContainerLayer() const > { > auto& frameView = m_renderView.frameView(); > >@@ -2075,7 +2073,7 @@ void RenderLayerCompositor::updateRootLa > m_rootContentLayer->setAnchorPoint(FloatPoint3D()); > } > >- updateScrollLayerClipping(); >+ updateScrollContainerLayerClipping(); > > #if ENABLE(RUBBER_BANDING) > if (m_contentShadowLayer && m_rootContentLayer) { >@@ -3323,7 +3321,7 @@ void RenderLayerCompositor::updateOverfl > > // We want the overhang areas layer to be positioned below the frame contents, > // so insert it below the clip layer. >- m_overflowControlsHostLayer->addChildBelow(*m_layerForOverhangAreas, layerForClipping()); >+ m_overflowControlsHostLayer->addChildBelow(*m_layerForOverhangAreas, m_scrollContainerLayer.get()); > } > } else > GraphicsLayer::unparentAndClear(m_layerForOverhangAreas); >@@ -3429,37 +3427,31 @@ void RenderLayerCompositor::ensureRootLa > if (requiresScrollLayer(expectedAttachment)) { > if (!m_overflowControlsHostLayer) { > ASSERT(!m_scrollLayer); >- ASSERT(!m_clipLayer); >+ ASSERT(!m_scrollContainerLayer); > > // Create a layer to host the clipping layer and the overflow controls layers. > m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); > m_overflowControlsHostLayer->setName("overflow controls host"); > >- auto scrollLayerType = GraphicsLayer::Type::Normal; >-#if PLATFORM(IOS_FAMILY) >- if (m_renderView.settings().asyncFrameScrollingEnabled()) >- scrollLayerType = GraphicsLayer::Type::Scrolling; >-#endif >- m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, scrollLayerType); >+ m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); > m_scrollLayer->setName("frame scrolling"); > m_scrollLayer->setAnchorPoint({ }); > >- if (scrollLayerType == GraphicsLayer::Type::Scrolling) { >- // Scroll layer clips so there is no need for a separate clipping layer. >- m_overflowControlsHostLayer->addChild(*m_scrollLayer); >- } else { >- m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); >- m_clipLayer->setName("frame clipping"); >- m_clipLayer->setMasksToBounds(true); >- m_clipLayer->setAnchorPoint({ }); >- >- m_clipLayer->addChild(*m_scrollLayer); >- m_overflowControlsHostLayer->addChild(*m_clipLayer); >- } >+ auto scrollContainerLayerType = GraphicsLayer::Type::Normal; >+#if PLATFORM(IOS_FAMILY) >+ if (m_renderView.settings().asyncFrameScrollingEnabled()) >+ scrollContainerLayerType = GraphicsLayer::Type::Scrolling; >+#endif >+ m_scrollContainerLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, scrollContainerLayerType); >+ m_scrollContainerLayer->setName("frame scrolling container"); >+ m_scrollContainerLayer->setMasksToBounds(true); >+ m_scrollContainerLayer->setAnchorPoint({ }); > >+ m_scrollContainerLayer->addChild(*m_scrollLayer); >+ m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer); > m_scrollLayer->addChild(*m_rootContentLayer); > >- updateScrollLayerClipping(); >+ updateScrollContainerLayerClipping(); > updateOverflowControlsLayers(); > > if (hasCoordinatedScrolling()) >@@ -3470,7 +3462,7 @@ void RenderLayerCompositor::ensureRootLa > } else { > if (m_overflowControlsHostLayer) { > GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer); >- GraphicsLayer::unparentAndClear(m_clipLayer); >+ GraphicsLayer::unparentAndClear(m_scrollContainerLayer); > GraphicsLayer::unparentAndClear(m_scrollLayer); > } > } >@@ -3516,7 +3508,7 @@ void RenderLayerCompositor::destroyRootL > > if (m_overflowControlsHostLayer) { > GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer); >- GraphicsLayer::unparentAndClear(m_clipLayer); >+ GraphicsLayer::unparentAndClear(m_scrollContainerLayer); > GraphicsLayer::unparentAndClear(m_scrollLayer); > } > ASSERT(!m_scrollLayer); >@@ -4001,7 +3993,7 @@ ScrollingNodeID RenderLayerCompositor::u > } > > if (changes & ScrollingNodeChangeFlags::Layer) >- scrollingCoordinator->setNodeLayers(newNodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer()); >+ scrollingCoordinator->setNodeLayers(newNodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), scrollContainerLayer()); > > if (changes & ScrollingNodeChangeFlags::LayerGeometry) { > ScrollingCoordinator::ScrollingGeometry scrollingGeometry; >Index: Source/WebCore/rendering/RenderLayerCompositor.h >=================================================================== >--- Source/WebCore/rendering/RenderLayerCompositor.h (revision 240715) >+++ Source/WebCore/rendering/RenderLayerCompositor.h (working copy) >@@ -242,11 +242,9 @@ public: > GraphicsLayer* rootGraphicsLayer() const; > > GraphicsLayer* scrollLayer() const { return m_scrollLayer.get(); } >- GraphicsLayer* clipLayer() const { return m_clipLayer.get(); } >+ GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); } > GraphicsLayer* rootContentLayer() const { return m_rootContentLayer.get(); } > >- GraphicsLayer* layerForClipping() const { return m_clipLayer ? m_clipLayer.get() : m_scrollLayer.get(); } >- > #if ENABLE(RUBBER_BANDING) > GraphicsLayer* headerLayer() const { return m_layerForHeader.get(); } > GraphicsLayer* footerLayer() const { return m_layerForFooter.get(); } >@@ -434,9 +432,9 @@ private: > void updateOverflowControlsLayers(); > > void updateScrollLayerPosition(); >- void updateScrollLayerClipping(); >+ void updateScrollContainerLayerClipping(); > >- FloatPoint positionForClipLayer() const; >+ FloatPoint positionForScrollContainerLayer() const; > > void notifyIFramesOfCompositingChange(); > >@@ -562,8 +560,9 @@ private: > > RootLayerAttachment m_rootLayerAttachment { RootLayerUnattached }; > >- // Enclosing clipping layer for iframe content >- RefPtr<GraphicsLayer> m_clipLayer; >+ // Layer that moves and clips its content layer. >+ RefPtr<GraphicsLayer> m_scrollContainerLayer; >+ // Layer that moves during scrolling. > RefPtr<GraphicsLayer> m_scrollLayer; > > // Enclosing layer for overflow controls and the clipping layer >Index: Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp >=================================================================== >--- Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (revision 240715) >+++ Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (working copy) >@@ -141,6 +141,9 @@ void ArgumentCoder<ScrollingStateScrolli > SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPosition) > SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll) > >+ if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) >+ encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrollContainerLayer()); >+ > if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) > encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()); > } >@@ -165,9 +168,6 @@ void ArgumentCoder<ScrollingStateFrameSc > if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) > encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer()); > >- if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) >- encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer()); >- > if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) > encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer()); > >@@ -237,6 +237,13 @@ bool ArgumentCoder<ScrollingStateScrolli > node.setRequestedScrollPosition(scrollPosition, representsProgrammaticScroll); > } > >+ if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) { >+ GraphicsLayer::PlatformLayerID layerID; >+ if (!decoder.decode(layerID)) >+ return false; >+ node.setScrollContainerLayer(layerID); >+ } >+ > if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) { > GraphicsLayer::PlatformLayerID layerID; > if (!decoder.decode(layerID)) >@@ -273,13 +280,6 @@ bool ArgumentCoder<ScrollingStateFrameSc > node.setCounterScrollingLayer(layerID); > } > >- if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) { >- GraphicsLayer::PlatformLayerID layerID; >- if (!decoder.decode(layerID)) >- return false; >- node.setInsetClipLayer(layerID); >- } >- > if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) { > GraphicsLayer::PlatformLayerID layerID; > if (!decoder.decode(layerID)) >@@ -513,6 +513,9 @@ static void dump(TextStream& ts, const S > ts.dumpProperty("requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll()); > } > >+ if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) >+ ts.dumpProperty("scroll-container-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrollContainerLayer())); >+ > if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) > ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer())); > } >@@ -566,9 +569,6 @@ static void dump(TextStream& ts, const S > if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor)) > ts.dumpProperty("frame-scale-factor", node.frameScaleFactor()); > >- if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) >- ts.dumpProperty("clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer())); >- > if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) > ts.dumpProperty("content-shadow-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer())); > >Index: Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (revision 240715) >+++ Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (working copy) >@@ -106,15 +106,15 @@ void RemoteScrollingCoordinatorProxy::co > case ScrollingNodeType::MainFrame: > case ScrollingNodeType::Subframe: { > ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode); >- >+ > if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) > scrollingStateNode.setScrolledContentsLayer(layerTreeHost.layerForID(scrollingStateNode.scrolledContentsLayer())); > > if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) > scrollingStateNode.setCounterScrollingLayer(layerTreeHost.layerForID(scrollingStateNode.counterScrollingLayer())); > >- if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) >- scrollingStateNode.setInsetClipLayer(layerTreeHost.layerForID(scrollingStateNode.insetClipLayer())); >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrollContainerLayer)) >+ scrollingStateNode.setScrollContainerLayer(layerTreeHost.layerForID(scrollingStateNode.scrollContainerLayer())); > > if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) > scrollingStateNode.setContentShadowLayer(layerTreeHost.layerForID(scrollingStateNode.contentShadowLayer())); >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm (revision 240715) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm (working copy) >@@ -64,13 +64,13 @@ void RemoteScrollingCoordinatorProxy::co > case ScrollingNodeType::MainFrame: > case ScrollingNodeType::Subframe: { > ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode); >- >+ >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) >+ scrollingStateNode.setScrollContainerLayer(layerTreeHost.layerForID(scrollingStateNode.scrollContainerLayer())); >+ > if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer)) > scrollingStateNode.setLayer(layerTreeHost.layerForID(scrollingStateNode.layer())); > >- if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) >- scrollingStateNode.setScrolledContentsLayer(layerTreeHost.layerForID(scrollingStateNode.scrolledContentsLayer())); >- > if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) > scrollingStateNode.setCounterScrollingLayer(layerTreeHost.layerForID(scrollingStateNode.counterScrollingLayer())); > >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h (revision 240715) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h (working copy) >@@ -51,6 +51,7 @@ private: > void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override; > > std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate; >+ RetainPtr<CALayer> m_scrollContainerLayer; > }; > > } // namespace WebKit >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm (revision 240715) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm (working copy) >@@ -50,10 +50,14 @@ ScrollingTreeFrameScrollingNodeRemoteIOS > > void ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren(const ScrollingStateNode& stateNode) > { >- ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(stateNode); >+ auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode); > >- if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) { >- if (scrollLayer() && [[scrollLayer() delegate] isKindOfClass:[UIScrollView self]]) >+ ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(scrollingStateNode); >+ >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrollContainerLayer)) { >+ m_scrollContainerLayer = scrollingStateNode.scrollContainerLayer(); >+ >+ if (m_scrollContainerLayer && [[m_scrollContainerLayer delegate] isKindOfClass:[UIScrollView self]]) > m_scrollingNodeDelegate = std::make_unique<ScrollingTreeScrollingNodeDelegateIOS>(*this); > else > m_scrollingNodeDelegate = nullptr; >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (revision 240715) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (working copy) >@@ -71,7 +71,6 @@ public: > > private: > RetainPtr<CALayer> m_scrollLayer; >- RetainPtr<CALayer> m_scrolledContentsLayer; > RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate; > bool m_updatingFromStateNode { false }; > }; >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (revision 240715) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (working copy) >@@ -194,17 +194,26 @@ void ScrollingTreeScrollingNodeDelegateI > > void ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren(const ScrollingStateScrollingNode& scrollingStateNode) > { >- if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer)) >- m_scrollLayer = scrollingStateNode.layer(); >- >- if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) >- m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer(); >+ // FIMXE: Use ScrollContainerLayer for overflow scrolling too. >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) { >+ RetainPtr<CALayer> layer; >+ layer = scrollingStateNode.layer(); >+ if ([[layer delegate] isKindOfClass:[UIScrollView self]]) >+ m_scrollLayer = layer; >+ } >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) { >+ RetainPtr<CALayer> layer; >+ layer = scrollingStateNode.scrollContainerLayer(); >+ if ([[layer delegate] isKindOfClass:[UIScrollView self]]) >+ m_scrollLayer = layer; >+ } > } > > void ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren(const ScrollingStateScrollingNode& scrollingStateNode) > { > SetForScope<bool> updatingChange(m_updatingFromStateNode, true); > if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer) >+ || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer) > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ReachableContentsSize) > || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition) >@@ -213,7 +222,8 @@ void ScrollingTreeScrollingNodeDelegateI > UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate]; > ASSERT([scrollView isKindOfClass:[UIScrollView self]]); > >- if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)) { >+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer) >+ || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) { > if (!m_scrollViewDelegate) > m_scrollViewDelegate = adoptNS([[WKScrollingNodeScrollViewDelegate alloc] initWithScrollingTreeNodeDelegate:this]); > >Index: LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html >=================================================================== >--- LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html (revision 240715) >+++ LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html (working copy) >@@ -18,6 +18,7 @@ > <div class=testdiv></div> > <div class=testdiv></div> > <div class=testdiv></div> >+ <div class=testdiv></div> > </div> > </body> > </html> >Index: LayoutTests/fast/scrolling/ios/scroll-iframe.html >=================================================================== >--- LayoutTests/fast/scrolling/ios/scroll-iframe.html (revision 240715) >+++ LayoutTests/fast/scrolling/ios/scroll-iframe.html (working copy) >@@ -24,18 +24,24 @@ > var c = centerOf("maxScrollX"); > await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y); > await liftUpAtPoint(c.x - 150, c.y); >+ > c = centerOf("maxScrollY"); > await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 150); > await liftUpAtPoint(c.x, c.y - 150); >+ > c = centerOf("maxScrollXY"); > await touchAndDragFromPointToPoint(c.x, c.y, c.x - 150, c.y - 150); > await liftUpAtPoint(c.x - 150, c.y - 150); > >+ c = centerOf("largeContent"); >+ await touchAndDragFromPointToPoint(c.x, c.y, c.x, c.y - 2000); >+ await liftUpAtPoint(c.x, c.y - 2000); >+ > // Wait for scrolling to stabilize and for scrollbars to disappear. > setTimeout(() => {testRunner.notifyDone(); }, 2000); > } > >- var frameToLoadCount = 3; >+ var frameToLoadCount = 4; > function newFrameLoaded() { > frameToLoadCount--; > if (frameToLoadCount == 0) >@@ -70,6 +76,15 @@ > <div style='left: 100px; top: 100px; position: absolute; width: 100px; height: 100px; background: green;'></div> > </body>" onload="newFrameLoaded()"> > </iframe> >+ <iframe id="largeContent" scrolling="yes" srcdoc=" >+ <body style='margin: 0;'> >+ <div style='width: 100px; height: 500px; background: red;'></div> >+ <div style='width: 100px; height: 500px; background: blue;'></div> >+ <div style='width: 100px; height: 500px; background: red;'></div> >+ <div style='width: 100px; height: 500px; background: blue;'></div> >+ <div style='width: 100px; height: 500px; background: green;'></div> >+ </body>" onload="newFrameLoaded()"> >+ </iframe> > </div> > </body> > </html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193665
:
359724
|
359729
|
359730
|
360596
|
360604
|
361002
|
361006
|
361010
|
361020
|
361040