Skip to content
Permalink
Browse files
Overlay with -webkit-overflow-scrolling:touch doesn't become scrollab…
…le after added text makes it taller

https://bugs.webkit.org/show_bug.cgi?id=158342

Patch by Frederic Wang <fwang@igalia.com> on 2018-11-06
Reviewed by Simon Fraser.

Source/WebCore:

Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it
scrollable. However, the RenderLayerBacking's scrolling layer is not properly created
when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess
receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the
associated update. In debug mode this hits an ASSERT and in release mode the overflow node
remains unscrollable from the user's point of view. This patch fixes this issue by ensuring
the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus.

Test: fast/scrolling/ios/update-scroll-coordinated-status.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration()
to ensure the scrolling layer is present and indicate whether a rebuild is necessary.

LayoutTests:

Add a test to ensure the change of scrolling status is reflected in the layer and scrolling
trees. This test should also ASSERT in debug mode without the associated code change.

* fast/scrolling/ios/update-scroll-coordinated-status-expected.txt: Added.
* fast/scrolling/ios/update-scroll-coordinated-status.html: Added.

Canonical link: https://commits.webkit.org/206098@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fred-wang committed Nov 6, 2018
1 parent fee2f12 commit 96f99f3e27bd47ed33271a6ee0d005d1ac0d0bf5
Showing 5 changed files with 204 additions and 0 deletions.
@@ -1,3 +1,16 @@
2018-11-06 Frederic Wang <fwang@igalia.com>

Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342

Reviewed by Simon Fraser.

Add a test to ensure the change of scrolling status is reflected in the layer and scrolling
trees. This test should also ASSERT in debug mode without the associated code change.

* fast/scrolling/ios/update-scroll-coordinated-status-expected.txt: Added.
* fast/scrolling/ios/update-scroll-coordinated-status.html: Added.

2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com>

[iOS] Swatch appears squished and off-center in inputs of type color
@@ -0,0 +1,108 @@
(GraphicsLayer
(anchor 0.00 0.00)
(bounds 800.00 600.00)
(visible rect 0.00, 0.00 800.00 x 600.00)
(coverage rect 0.00, 0.00 800.00 x 600.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(visible rect 0.00, 0.00 800.00 x 600.00)
(coverage rect 0.00, 0.00 800.00 x 600.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(tile cache coverage 0, 0 800 x 600)
(tile size 800 x 600)
(top left tile 0, 0 tiles grid 1 x 1)
(in window 1)
(children 2
(GraphicsLayer
(position 13.00 18.00)
(bounds 210.00 210.00)
(drawsContent 1)
(visible rect 0.00, 0.00 210.00 x 210.00)
(coverage rect -13.00, -18.00 800.00 x 600.00)
(intersects coverage rect 1)
(contentsScale 2.00)
)
(GraphicsLayer
(position 255.00 18.00)
(bounds 210.00 210.00)
(drawsContent 1)
(visible rect 0.00, 0.00 210.00 x 210.00)
(coverage rect -255.00, -18.00 800.00 x 600.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(children 1
(GraphicsLayer
(offsetFromRenderer width=-5 height=-5)
(position 5.00 5.00)
(bounds 200.00 200.00)
(visible rect 0.00, 0.00 200.00 x 200.00)
(coverage rect 0.00, 0.00 200.00 x 200.00)
(intersects coverage rect 1)
(contentsScale 2.00)
(children 1
(GraphicsLayer
(offsetFromRenderer width=5 height=5)
(bounds 200.00 400.00)
(drawsContent 1)
(visible rect 0.00, 0.00 200.00 x 200.00)
(coverage rect 0.00, 0.00 200.00 x 200.00)
(intersects coverage rect 1)
(contentsScale 2.00)
)
)
)
)
)
)
)
)
)



(Frame scrolling node
(scrollable area size 800 600)
(contents size 800 600)
(scrollable area parameters
(horizontal scroll elasticity 1)
(vertical scroll elasticity 1)
(horizontal scrollbar mode 0)
(vertical scrollbar mode 0))
(visual viewport enabled 1)
(layout viewport at (0,0) size 800x600)
(min layout viewport origin (0,0))
(max layout viewport origin (0,0))
(behavior for fixed 0)
(children 2
(Fixed node
(anchor edges: AnchorEdgeLeft AnchorEdgeTop)
(viewport rect at last layout at (0,0) size 800x600)
(layer position at last layout (13,18))
(children 0
)
)
(Fixed node
(anchor edges: AnchorEdgeLeft AnchorEdgeTop)
(viewport rect at last layout at (0,0) size 800x600)
(layer position at last layout (255,18))
(children 1
(Overflow scrolling node
(scrollable area size 200 200)
(contents size 200 400)
(scrollable area parameters
(horizontal scroll elasticity 1)
(vertical scroll elasticity 1)
(horizontal scrollbar mode 0)
(vertical scrollbar mode 0))
)
)
)
)
)


@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<title>Update scroll coordinated status</title>
<style>
.scrollable {
position: fixed;
width: 200px;
height: 200px;
overflow: auto;
-webkit-overflow-scrolling: touch;
border: 5px solid orange;
margin: 5px;
}
.scrollable-content {
width: 100px;
height: 100px;
background: linear-gradient(135deg, yellow, cyan);
}
.overflowing {
height: 400px;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function doTest()
{
requestAnimationFrame(() => {
document.querySelectorAll('.scrollable-content').forEach((div) => {
div.classList.toggle('overflowing');
});
if (window.testRunner && window.internals) {
requestAnimationFrame(() => {
document.getElementById('layerTree').innerText = internals.layerTreeAsText(document,
internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES) + "\n\n" +
internals.scrollingStateTreeAsText() + "\n";
testRunner.notifyDone();
});
}
});
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div class="scrollable">
<div class="scrollable-content overflowing">
</div>
</div>
<div class="scrollable" style="left: 250px">
<div class="scrollable-content">
</div>
</div>
<pre id="layerTree"></pre>
</body>
</html>
@@ -1,3 +1,24 @@
2018-11-06 Frederic Wang <fwang@igalia.com>

Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342

Reviewed by Simon Fraser.

Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it
scrollable. However, the RenderLayerBacking's scrolling layer is not properly created
when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess
receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the
associated update. In debug mode this hits an ASSERT and in release mode the overflow node
remains unscrollable from the user's point of view. This patch fixes this issue by ensuring
the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus.

Test: fast/scrolling/ios/update-scroll-coordinated-status.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration()
to ensure the scrolling layer is present and indicate whether a rebuild is necessary.

2018-11-05 Zan Dobersek <zdobersek@igalia.com>

Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
@@ -3544,6 +3544,9 @@ void RenderLayerCompositor::updateScrollCoordinatedStatus(RenderLayer& layer, Op
if (layer.isComposited())
layer.backing()->setIsScrollCoordinatedWithViewportConstrainedRole(coordinationRoles.contains(ViewportConstrained));

if (layer.backing() && layer.backing()->updateConfiguration())
setCompositingLayersNeedRebuild();

if (coordinationRoles && canCoordinateScrollingForLayer(layer)) {
if (m_scrollCoordinatedLayers.add(&layer).isNewEntry)
m_subframeScrollLayersNeedReattach = true;

0 comments on commit 96f99f3

Please sign in to comment.