Diff
Modified: trunk/LayoutTests/ChangeLog (240915 => 240916)
--- trunk/LayoutTests/ChangeLog 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/LayoutTests/ChangeLog 2019-02-04 07:49:33 UTC (rev 240916)
@@ -1,3 +1,18 @@
+2019-02-03 Antti Koivisto <[email protected]>
+
+ [iOS] Tiles not created in large scrollable iframes
+ https://bugs.webkit.org/show_bug.cgi?id=193665
+
+ Reviewed by Simon Fraser.
+
+ Test by Frédéric Wang.
+
+ * fast/scrolling/ios/scroll-iframe-expected.html:
+ * fast/scrolling/ios/scroll-iframe.html:
+ * platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt:
+ * platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:
+ * platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
+
2019-02-03 John Wilander <[email protected]>
Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
Modified: trunk/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html (240915 => 240916)
--- trunk/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html 2019-02-04 07:49:33 UTC (rev 240916)
@@ -18,6 +18,7 @@
<div class=testdiv></div>
<div class=testdiv></div>
<div class=testdiv></div>
+ <div class=testdiv></div>
</div>
</body>
</html>
Modified: trunk/LayoutTests/fast/scrolling/ios/scroll-iframe.html (240915 => 240916)
--- trunk/LayoutTests/fast/scrolling/ios/scroll-iframe.html 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/LayoutTests/fast/scrolling/ios/scroll-iframe.html 2019-02-04 07:49:33 UTC (rev 240916)
@@ -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>
Modified: trunk/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt (240915 => 240916)
--- trunk/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt 2019-02-04 07:49:33 UTC (rev 240916)
@@ -20,7 +20,6 @@
(bounds 300.00 150.00)
(children 1
(GraphicsLayer
- (position -80.00 -80.00)
(anchor 0.00 0.00)
(children 1
(GraphicsLayer
Modified: trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt (240915 => 240916)
--- trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt 2019-02-04 07:49:33 UTC (rev 240916)
@@ -44,38 +44,48 @@
(bounds 300.00 150.00)
(backingStoreAttached 1)
(visible rect 0.00, 0.00 300.00 x 150.00)
- (coverage rect -10.00, -10.00 800.00 x 600.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(children 1
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 400.00 300.00)
- (backingStoreAttached 1)
- (visible rect 0.00, 0.00 400.00 x 300.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
- (intersects coverage rect 1)
+ (backingStoreAttached 0)
+ (visible rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 0)
(contentsScale 2.00)
(children 1
(GraphicsLayer
+ (anchor 0.00 0.00)
(bounds 400.00 300.00)
- (drawsContent 1)
(backingStoreAttached 1)
- (visible rect 0.00, 0.00 400.00 x 300.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
+ (visible rect 0.00, 0.00 300.00 x 150.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
(intersects coverage rect 1)
(contentsScale 2.00)
- (tile cache coverage 0, 0 400 x 300)
- (tile size 512 x 512)
- (top left tile 0, 0 tiles grid 1 x 1)
- (in window 1)
(children 1
(GraphicsLayer
- (backingStoreAttached 0)
- (visible rect 0.00, 0.00 0.00 x 0.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
- (intersects coverage rect 0)
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (visible rect 0.00, 0.00 300.00 x 150.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 1)
(contentsScale 2.00)
+ (tile cache coverage 0, 0 400 x 300)
+ (tile size 512 x 512)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (backingStoreAttached 0)
+ (visible rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 0)
+ (contentsScale 2.00)
+ )
+ )
)
)
)
@@ -110,38 +120,48 @@
(bounds 300.00 150.00)
(backingStoreAttached 1)
(visible rect 0.00, 0.00 300.00 x 150.00)
- (coverage rect -318.00, -10.00 800.00 x 600.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(children 1
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 400.00 300.00)
- (backingStoreAttached 1)
- (visible rect 0.00, 0.00 400.00 x 300.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
- (intersects coverage rect 1)
+ (backingStoreAttached 0)
+ (visible rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 0)
(contentsScale 2.00)
(children 1
(GraphicsLayer
+ (anchor 0.00 0.00)
(bounds 400.00 300.00)
- (drawsContent 1)
(backingStoreAttached 1)
- (visible rect 0.00, 0.00 400.00 x 300.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
+ (visible rect 0.00, 0.00 300.00 x 150.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
(intersects coverage rect 1)
(contentsScale 2.00)
- (tile cache coverage 0, 0 400 x 300)
- (tile size 512 x 512)
- (top left tile 0, 0 tiles grid 1 x 1)
- (in window 1)
(children 1
(GraphicsLayer
- (backingStoreAttached 0)
- (visible rect 0.00, 0.00 0.00 x 0.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
- (intersects coverage rect 0)
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (visible rect 0.00, 0.00 300.00 x 150.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 1)
(contentsScale 2.00)
+ (tile cache coverage 0, 0 400 x 300)
+ (tile size 512 x 512)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (backingStoreAttached 0)
+ (visible rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 0)
+ (contentsScale 2.00)
+ )
+ )
)
)
)
@@ -176,38 +196,48 @@
(bounds 300.00 150.00)
(backingStoreAttached 1)
(visible rect 0.00, 0.00 300.00 x 150.00)
- (coverage rect -10.00, -169.00 800.00 x 600.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(children 1
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 400.00 300.00)
- (backingStoreAttached 1)
- (visible rect 0.00, 0.00 400.00 x 300.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
- (intersects coverage rect 1)
+ (backingStoreAttached 0)
+ (visible rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 0)
(contentsScale 2.00)
(children 1
(GraphicsLayer
+ (anchor 0.00 0.00)
(bounds 400.00 300.00)
- (drawsContent 1)
(backingStoreAttached 1)
- (visible rect 0.00, 0.00 400.00 x 300.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
+ (visible rect 0.00, 0.00 300.00 x 150.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
(intersects coverage rect 1)
(contentsScale 2.00)
- (tile cache coverage 0, 0 400 x 300)
- (tile size 512 x 512)
- (top left tile 0, 0 tiles grid 1 x 1)
- (in window 1)
(children 1
(GraphicsLayer
- (backingStoreAttached 0)
- (visible rect 0.00, 0.00 0.00 x 0.00)
- (coverage rect 0.00, 0.00 400.00 x 300.00)
- (intersects coverage rect 0)
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (backingStoreAttached 1)
+ (visible rect 0.00, 0.00 300.00 x 150.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 1)
(contentsScale 2.00)
+ (tile cache coverage 0, 0 400 x 300)
+ (tile size 512 x 512)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (backingStoreAttached 0)
+ (visible rect 0.00, 0.00 0.00 x 0.00)
+ (coverage rect 0.00, 0.00 300.00 x 150.00)
+ (intersects coverage rect 0)
+ (contentsScale 2.00)
+ )
+ )
)
)
)
Modified: trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt (240915 => 240916)
--- trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt 2019-02-04 07:49:33 UTC (rev 240916)
@@ -68,7 +68,6 @@
(bounds 480.00 400.00)
(children 1
(GraphicsLayer
- (position 0.00 -120.00)
(anchor 0.00 0.00)
(children 1
(GraphicsLayer
Modified: trunk/Source/WebCore/ChangeLog (240915 => 240916)
--- trunk/Source/WebCore/ChangeLog 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/ChangeLog 2019-02-04 07:49:33 UTC (rev 240916)
@@ -1,3 +1,53 @@
+2019-02-03 Antti Koivisto <[email protected]>
+
+ [iOS] Tiles not created in large scrollable iframes
+ https://bugs.webkit.org/show_bug.cgi?id=193665
+
+ Reviewed by Simon Fraser.
+
+ We are not syncing scroll position back to the graphics layer tree correctly.
+
+ Test by Frédéric Wang.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+ (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
+ (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
+
+ Factor setting and syncing scrolling layer positions into a function.
+ Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
+
+ (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
+ (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
+ (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
+ (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
+ (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
+ * page/scrolling/ScrollingCoordinator.h:
+ * rendering/RenderLayerCompositor.cpp:
+
+ Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
+ Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
+
+ (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
+ (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
+ (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
+ (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
+ (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
+ (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
+ (WebCore::RenderLayerCompositor::frameViewDidScroll):
+ (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
+ (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
+ (WebCore::RenderLayerCompositor::updateLayerForHeader):
+ (WebCore::RenderLayerCompositor::updateLayerForFooter):
+ (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
+ (WebCore::RenderLayerCompositor::ensureRootLayer):
+ (WebCore::RenderLayerCompositor::destroyRootLayer):
+ (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
+ * rendering/RenderLayerCompositor.h:
+
2019-02-03 Simon Fraser <[email protected]>
Make setNeedsLayout on the root more explicitly about triggering its side-effects
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (240915 => 240916)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2019-02-04 07:49:33 UTC (rev 240916)
@@ -226,7 +226,8 @@
ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
- node->setScrolledContentsLayer(scrollLayerForFrameView(frameView));
+ node->setScrollContainerLayer(scrollContainerLayerForFrameView(frameView));
+ node->setScrolledContentsLayer(scrolledContentsLayerForFrameView(frameView));
node->setRootContentsLayer(rootContentsLayerForFrameView(frameView));
node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
node->setInsetClipLayer(insetClipLayerForFrameView(frameView));
@@ -413,8 +414,7 @@
reconcileViewportConstrainedLayerPositions(scrollingNodeID, LayoutRect(layoutViewportRect.value()), scrollingLayerPositionAction);
}
- auto* scrollLayer = scrollLayerForFrameView(frameView);
- if (!scrollLayer)
+ if (!scrolledContentsLayerForFrameView(frameView))
return;
auto* counterScrollingLayer = counterScrollingLayerForFrameView(frameView);
@@ -438,7 +438,8 @@
FrameView::yPositionForFooterLayer(scrollPosition, topContentInset, frameView.totalContentsSize().height(), frameView.footerHeight()));
if (programmaticScroll || scrollingLayerPositionAction == ScrollingLayerPositionAction::Set) {
- scrollLayer->setPosition(-frameView.scrollPosition());
+ reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Set);
+
if (counterScrollingLayer)
counterScrollingLayer->setPosition(scrollPositionForFixed);
if (insetClipLayer)
@@ -452,7 +453,8 @@
if (footerLayer)
footerLayer->setPosition(positionForFooterLayer);
} else {
- scrollLayer->syncPosition(-frameView.scrollPosition());
+ reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Sync);
+
if (counterScrollingLayer)
counterScrollingLayer->syncPosition(scrollPositionForFixed);
if (insetClipLayer)
@@ -468,6 +470,28 @@
}
}
+void AsyncScrollingCoordinator::reconcileScrollPosition(FrameView& frameView, ScrollingLayerPositionAction scrollingLayerPositionAction)
+{
+#if PLATFORM(IOS_FAMILY)
+ // Doing all scrolling like this (UIScrollView style) would simplify code.
+ auto* scrollContainerLayer = scrollContainerLayerForFrameView(frameView);
+ if (!scrollContainerLayer)
+ return;
+ if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)
+ scrollContainerLayer->setBoundsOrigin(frameView.scrollPosition());
+ else
+ scrollContainerLayer->syncBoundsOrigin(frameView.scrollPosition());
+#else
+ auto* scrolledContentsLayer = scrolledContentsLayerForFrameView(frameView);
+ if (!scrolledContentsLayer)
+ return;
+ if (scrollingLayerPositionAction == ScrollingLayerPositionAction::Set)
+ scrolledContentsLayer->setPosition(-frameView.scrollPosition());
+ else
+ scrolledContentsLayer->syncPosition(-frameView.scrollPosition());
+#endif
+}
+
void AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea& scrollableArea, ScrollbarOrientation orientation)
{
ASSERT(isMainThread());
@@ -480,7 +504,6 @@
scrollingNode.setVerticalScrollbarLayer(scrollableArea.layerForVerticalScrollbar());
else
scrollingNode.setHorizontalScrollbarLayer(scrollableArea.layerForHorizontalScrollbar());
-
}
if (&scrollableArea == m_page->mainFrame().view()) {
@@ -659,17 +682,10 @@
// at this point. So we'll update it before we switch back to main thread scrolling
// in order to avoid layer positioning bugs.
if (reasons)
- updateScrollLayerPosition(frameView);
+ reconcileScrollPosition(frameView, ScrollingLayerPositionAction::Set);
scrollingStateNode->setSynchronousScrollingReasons(reasons);
}
-void AsyncScrollingCoordinator::updateScrollLayerPosition(FrameView& frameView)
-{
- ASSERT(isMainThread());
- if (auto* scrollLayer = scrollLayerForFrameView(frameView))
- scrollLayer->setPosition(-frameView.scrollPosition());
-}
-
bool AsyncScrollingCoordinator::isRubberBandInProgress() const
{
return scrollingTree()->isRubberBandInProgress();
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (240915 => 240916)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2019-02-04 07:49:33 UTC (rev 240916)
@@ -113,6 +113,7 @@
WEBCORE_EXPORT void setViewportConstraintedNodeGeometry(ScrollingNodeID, const ViewportConstraints&) override;
WEBCORE_EXPORT void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool programmaticScroll, ViewportRectStability, ScrollingLayerPositionAction) override;
+ void reconcileScrollPosition(FrameView&, ScrollingLayerPositionAction);
bool isRubberBandInProgress() const override;
void setScrollPinningBehavior(ScrollPinningBehavior) override;
@@ -129,7 +130,6 @@
virtual void scheduleTreeStateCommit() = 0;
void ensureRootStateNodeForFrameView(FrameView&);
- void updateScrollLayerPosition(FrameView&);
void updateScrollPositionAfterAsyncScrollTimerFired();
void setEventTrackingRegionsDirty();
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (240915 => 240916)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2019-02-04 07:49:33 UTC (rev 240916)
@@ -224,13 +224,20 @@
updateSynchronousScrollingReasons(frameView);
}
-GraphicsLayer* ScrollingCoordinator::scrollLayerForFrameView(FrameView& frameView)
+GraphicsLayer* ScrollingCoordinator::scrollContainerLayerForFrameView(FrameView& frameView)
{
if (auto* renderView = frameView.frame().contentRenderer())
- return renderView->compositor().scrollLayer();
+ return renderView->compositor().scrollContainerLayer();
return nullptr;
}
+GraphicsLayer* ScrollingCoordinator::scrolledContentsLayerForFrameView(FrameView& frameView)
+{
+ if (auto* renderView = frameView.frame().contentRenderer())
+ return renderView->compositor().scrolledContentsLayer();
+ return nullptr;
+}
+
GraphicsLayer* ScrollingCoordinator::headerLayerForFrameView(FrameView& frameView)
{
#if ENABLE(RUBBER_BANDING)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (240915 => 240916)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2019-02-04 07:49:33 UTC (rev 240916)
@@ -192,7 +192,8 @@
protected:
explicit ScrollingCoordinator(Page*);
- GraphicsLayer* scrollLayerForFrameView(FrameView&);
+ GraphicsLayer* scrollContainerLayerForFrameView(FrameView&);
+ GraphicsLayer* scrolledContentsLayerForFrameView(FrameView&);
GraphicsLayer* counterScrollingLayerForFrameView(FrameView&);
GraphicsLayer* insetClipLayerForFrameView(FrameView&);
GraphicsLayer* rootContentsLayerForFrameView(FrameView&);
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (240915 => 240916)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-02-04 07:49:33 UTC (rev 240916)
@@ -291,7 +291,7 @@
{
// Take care that the owned GraphicsLayers are deleted first as their destructors may call back here.
m_clipLayer = nullptr;
- m_scrollLayer = nullptr;
+ m_scrolledContentsLayer = nullptr;
ASSERT(m_rootLayerAttachment == RootLayerUnattached);
}
@@ -411,7 +411,7 @@
void RenderLayerCompositor::customPositionForVisibleRectComputation(const GraphicsLayer* graphicsLayer, FloatPoint& position) const
{
- if (graphicsLayer != m_scrollLayer.get())
+ if (graphicsLayer != m_scrolledContentsLayer.get())
return;
FloatPoint scrollPosition = -position;
@@ -453,8 +453,8 @@
#if PLATFORM(IOS_FAMILY)
return frameView.exposedContentRect();
#else
- // Having a m_scrollLayer indicates that we're doing scrolling via GraphicsLayers.
- FloatRect visibleRect = m_scrollLayer ? FloatRect({ }, frameView.sizeForVisibleContent()) : frameView.visibleContentRect();
+ // Having a m_scrolledContentsLayer indicates that we're doing scrolling via GraphicsLayers.
+ FloatRect visibleRect = m_scrolledContentsLayer ? FloatRect({ }, frameView.sizeForVisibleContent()) : frameView.visibleContentRect();
if (frameView.viewExposedRect())
visibleRect.intersect(frameView.viewExposedRect().value());
@@ -549,10 +549,9 @@
if (auto nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling)) {
// FIXME: would be nice to not have to special-case the root.
ScrollingCoordinator::NodeLayers nodeLayers;
- if (layer.isRenderViewLayer()) {
- // FIXME: Reorganize the layers and pass the scrollContainerLayer.
- nodeLayers = { nullptr, nullptr, m_scrollLayer.get(), fixedRootBackgroundLayer(), clipLayer(), m_rootContentsLayer.get() };
- } else
+ if (layer.isRenderViewLayer())
+ nodeLayers = { nullptr, scrollContainerLayer(), scrolledContentsLayer(), fixedRootBackgroundLayer(), clipLayer(), rootContentsLayer() };
+ else
nodeLayers = { layer.backing()->graphicsLayer(), backing->scrollContainerLayer(), backing->scrolledContentsLayer() };
scrollingCoordinator->setNodeLayers(nodeID, nodeLayers);
@@ -1801,7 +1800,7 @@
if (auto* layer = m_renderView.layer())
layer->setNeedsCompositingGeometryUpdate();
- if (m_scrollLayer) {
+ if (m_scrolledContentsLayer) {
updateScrollLayerClipping();
frameViewDidScroll();
updateOverflowControlsLayers();
@@ -1824,12 +1823,13 @@
void RenderLayerCompositor::updateScrollLayerPosition()
{
- ASSERT(m_scrollLayer);
+ ASSERT(!hasCoordinatedScrolling());
+ ASSERT(m_scrolledContentsLayer);
auto& frameView = m_renderView.frameView();
IntPoint scrollPosition = frameView.scrollPosition();
- m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
+ m_scrolledContentsLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
if (auto* fixedBackgroundLayer = fixedRootBackgroundLayer())
fixedBackgroundLayer->setPosition(frameView.scrollPositionForFixedPosition());
@@ -1856,7 +1856,7 @@
void RenderLayerCompositor::frameViewDidScroll()
{
- if (!m_scrollLayer)
+ if (!m_scrolledContentsLayer)
return;
// If there's a scrolling coordinator that manages scrolling for this frame view,
@@ -3124,7 +3124,7 @@
if (!m_layerForTopOverhangArea) {
m_layerForTopOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
m_layerForTopOverhangArea->setName("top overhang");
- m_scrollLayer->addChildBelow(*m_layerForTopOverhangArea, m_rootContentsLayer.get());
+ m_scrolledContentsLayer->addChildBelow(*m_layerForTopOverhangArea, m_rootContentsLayer.get());
}
return m_layerForTopOverhangArea.get();
@@ -3143,7 +3143,7 @@
if (!m_layerForBottomOverhangArea) {
m_layerForBottomOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
m_layerForBottomOverhangArea->setName("bottom overhang");
- m_scrollLayer->addChildBelow(*m_layerForBottomOverhangArea, m_rootContentsLayer.get());
+ m_scrolledContentsLayer->addChildBelow(*m_layerForBottomOverhangArea, m_rootContentsLayer.get());
}
m_layerForBottomOverhangArea->setPosition(FloatPoint(0, m_rootContentsLayer->size().height() + m_renderView.frameView().headerHeight()
@@ -3171,7 +3171,7 @@
if (!m_layerForHeader) {
m_layerForHeader = GraphicsLayer::create(graphicsLayerFactory(), *this);
m_layerForHeader->setName("header");
- m_scrollLayer->addChildAbove(*m_layerForHeader, m_rootContentsLayer.get());
+ m_scrolledContentsLayer->addChildAbove(*m_layerForHeader, m_rootContentsLayer.get());
m_renderView.frameView().addPaintPendingMilestones(DidFirstFlushForHeaderLayer);
}
@@ -3208,7 +3208,7 @@
if (!m_layerForFooter) {
m_layerForFooter = GraphicsLayer::create(graphicsLayerFactory(), *this);
m_layerForFooter->setName("footer");
- m_scrollLayer->addChildAbove(*m_layerForFooter, m_rootContentsLayer.get());
+ m_scrolledContentsLayer->addChildAbove(*m_layerForFooter, m_rootContentsLayer.get());
}
float totalContentHeight = m_rootContentsLayer->size().height() + m_renderView.frameView().headerHeight() + m_renderView.frameView().footerHeight();
@@ -3342,7 +3342,7 @@
m_contentShadowLayer->setAnchorPoint(FloatPoint3D());
m_contentShadowLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::ScrollingShadow);
- m_scrollLayer->addChildBelow(*m_contentShadowLayer, m_rootContentsLayer.get());
+ m_scrolledContentsLayer->addChildBelow(*m_contentShadowLayer, m_rootContentsLayer.get());
}
} else
GraphicsLayer::unparentAndClear(m_contentShadowLayer);
@@ -3433,7 +3433,7 @@
if (requiresScrollLayer(expectedAttachment)) {
if (!m_overflowControlsHostLayer) {
- ASSERT(!m_scrollLayer);
+ ASSERT(!m_scrolledContentsLayer);
ASSERT(!m_clipLayer);
// Create a layer to host the clipping layer and the overflow controls layers.
@@ -3440,29 +3440,33 @@
m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
m_overflowControlsHostLayer->setName("overflow controls host");
- auto scrollLayerType = GraphicsLayer::Type::Normal;
+ m_scrolledContentsLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
+ m_scrolledContentsLayer->setName("scrolled contents layer");
+ m_scrolledContentsLayer->setAnchorPoint({ });
+
#if PLATFORM(IOS_FAMILY)
- if (m_renderView.settings().asyncFrameScrollingEnabled())
- scrollLayerType = GraphicsLayer::Type::Scrolling;
+ if (m_renderView.settings().asyncFrameScrollingEnabled()) {
+ m_scrollContainerLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, GraphicsLayer::Type::Scrolling);
+
+ m_scrollContainerLayer->setName("scroll containers layer");
+ m_scrollContainerLayer->setMasksToBounds(true);
+ m_scrollContainerLayer->setAnchorPoint({ });
+
+ m_scrollContainerLayer->addChild(*m_scrolledContentsLayer);
+ m_overflowControlsHostLayer->addChild(*m_scrollContainerLayer);
+ }
#endif
- m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this, scrollLayerType);
- 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 {
+ if (!m_scrollContainerLayer) {
m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
m_clipLayer->setName("frame clipping");
m_clipLayer->setMasksToBounds(true);
m_clipLayer->setAnchorPoint({ });
- m_clipLayer->addChild(*m_scrollLayer);
+ m_clipLayer->addChild(*m_scrolledContentsLayer);
m_overflowControlsHostLayer->addChild(*m_clipLayer);
}
- m_scrollLayer->addChild(*m_rootContentsLayer);
+ m_scrolledContentsLayer->addChild(*m_rootContentsLayer);
updateScrollLayerClipping();
updateOverflowControlsLayers();
@@ -3476,7 +3480,8 @@
if (m_overflowControlsHostLayer) {
GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer);
GraphicsLayer::unparentAndClear(m_clipLayer);
- GraphicsLayer::unparentAndClear(m_scrollLayer);
+ GraphicsLayer::unparentAndClear(m_scrollContainerLayer);
+ GraphicsLayer::unparentAndClear(m_scrolledContentsLayer);
}
}
@@ -3522,9 +3527,10 @@
if (m_overflowControlsHostLayer) {
GraphicsLayer::unparentAndClear(m_overflowControlsHostLayer);
GraphicsLayer::unparentAndClear(m_clipLayer);
- GraphicsLayer::unparentAndClear(m_scrollLayer);
+ GraphicsLayer::unparentAndClear(m_scrollContainerLayer);
+ GraphicsLayer::unparentAndClear(m_scrolledContentsLayer);
}
- ASSERT(!m_scrollLayer);
+ ASSERT(!m_scrolledContentsLayer);
GraphicsLayer::unparentAndClear(m_rootContentsLayer);
m_layerUpdater = nullptr;
@@ -4013,7 +4019,7 @@
}
if (changes & ScrollingNodeChangeFlags::Layer)
- scrollingCoordinator->setNodeLayers(newNodeID, { nullptr, nullptr, m_scrollLayer.get(), fixedRootBackgroundLayer(), clipLayer(), m_rootContentsLayer.get() });
+ scrollingCoordinator->setNodeLayers(newNodeID, { nullptr, scrollContainerLayer(), scrolledContentsLayer(), fixedRootBackgroundLayer(), clipLayer(), rootContentsLayer() });
if (changes & ScrollingNodeChangeFlags::LayerGeometry) {
ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (240915 => 240916)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2019-02-04 07:49:33 UTC (rev 240916)
@@ -241,11 +241,12 @@
WEBCORE_EXPORT RenderLayer& rootRenderLayer() const;
GraphicsLayer* rootGraphicsLayer() const;
- GraphicsLayer* scrollLayer() const { return m_scrollLayer.get(); }
+ GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); }
+ GraphicsLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
GraphicsLayer* clipLayer() const { return m_clipLayer.get(); }
GraphicsLayer* rootContentsLayer() const { return m_rootContentsLayer.get(); }
- GraphicsLayer* layerForClipping() const { return m_clipLayer ? m_clipLayer.get() : m_scrollLayer.get(); }
+ GraphicsLayer* layerForClipping() const { return m_clipLayer ? m_clipLayer.get() : m_scrollContainerLayer.get(); }
#if ENABLE(RUBBER_BANDING)
GraphicsLayer* headerLayer() const { return m_layerForHeader.get(); }
@@ -564,7 +565,8 @@
// Enclosing clipping layer for iframe content
RefPtr<GraphicsLayer> m_clipLayer;
- RefPtr<GraphicsLayer> m_scrollLayer;
+ RefPtr<GraphicsLayer> m_scrollContainerLayer;
+ RefPtr<GraphicsLayer> m_scrolledContentsLayer;
// Enclosing layer for overflow controls and the clipping layer
RefPtr<GraphicsLayer> m_overflowControlsHostLayer;
Modified: trunk/Source/WebKit/ChangeLog (240915 => 240916)
--- trunk/Source/WebKit/ChangeLog 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebKit/ChangeLog 2019-02-04 07:49:33 UTC (rev 240916)
@@ -1,3 +1,17 @@
+2019-02-03 Antti Koivisto <[email protected]>
+
+ [iOS] Tiles not created in large scrollable iframes
+ https://bugs.webkit.org/show_bug.cgi?id=193665
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
+ (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+ (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
+
+ We now use scrollContainerLayer consistently so remove the special cases.
+
2019-02-03 Fujii Hironori <[email protected]>
[curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm (240915 => 240916)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm 2019-02-04 07:49:33 UTC (rev 240916)
@@ -52,9 +52,8 @@
{
ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(stateNode);
- // FIXME: Should be ScrollContainerLayer.
- if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
- if (scrolledContentsLayer() && [[scrolledContentsLayer() delegate] isKindOfClass:[UIScrollView self]])
+ if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
+ if (scrollContainerLayer())
m_scrollingNodeDelegate = std::make_unique<ScrollingTreeScrollingNodeDelegateIOS>(*this);
else
m_scrollingNodeDelegate = nullptr;
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (240915 => 240916)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm 2019-02-04 07:13:00 UTC (rev 240915)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm 2019-02-04 07:49:33 UTC (rev 240916)
@@ -215,20 +215,8 @@
void ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren(const ScrollingStateScrollingNode& scrollingStateNode)
{
- if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
- RetainPtr<CALayer> layer;
- layer = scrollingStateNode.scrollContainerLayer();
- if ([[layer delegate] isKindOfClass:[UIScrollView self]])
- m_scrollLayer = layer;
- }
-
- // FIMXE: ScrollContainerLayer should always be the UIScrollView layer.
- if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
- RetainPtr<CALayer> layer;
- layer = scrollingStateNode.scrolledContentsLayer();
- if ([[layer delegate] isKindOfClass:[UIScrollView self]])
- m_scrollLayer = layer;
- }
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer))
+ m_scrollLayer = scrollingStateNode.scrollContainerLayer();
}
void ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren(const ScrollingStateScrollingNode& scrollingStateNode)