[iOS] Tiles not created in large scrollable iframes
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2019 07:49:33 +0000 (07:49 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2019 07:49:33 +0000 (07:49 +0000)
commitf2ea00e10fe3a260a7bf0747fdd81b04dfe13a52
tree112fc6e7df54e9ef7514d60a8046c23aaf74c10c
parentf81ccae1f7f6ec74d3840ed0ca40c0ca0f64dd47
[iOS] Tiles not created in large scrollable iframes
https://bugs.webkit.org/show_bug.cgi?id=193665

Reviewed by Simon Fraser.

Source/WebCore:

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:

Source/WebKit:

* 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.

LayoutTests:

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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/ios/scroll-iframe-expected.html
LayoutTests/fast/scrolling/ios/scroll-iframe.html
LayoutTests/platform/ios-wk2/compositing/iframes/scrolling-iframe-expected.txt
LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm