Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Scrollbars are not clipped to layer bounds in RenderLayerBacking
https://bugs.webkit.org/show_bug.cgi?id=226823

Reviewed by Simon Fraser.

Source/WebCore:

Mask contents to bounds of overflow controls containers in RenderLayerBacking.

Test: compositing/scrolling/async-overflow-scrolling/overflow-controls-container-clips-scrollbars.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::adjustOverflowControlsPositionRelativeToAncestor):

LayoutTests:

Adjust test expectations due to clipping on overflow controls container.

* compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt:
* compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
* compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt:
* compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment-expected.txt:
* compositing/scrolling/async-overflow-scrolling/overflow-controls-container-clips-scrollbars-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/overflow-controls-container-clips-scrollbars.html: Added.
* compositing/scrolling/async-overflow-scrolling/transform-change-scrollbar-position-expected.txt:
* compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt:
* compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
* compositing/tiling/perspective-on-scroller-tile-coverage-expected.txt:
* platform/mac-wk1/compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt:
* tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage-expected.txt:
* tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage-expected.txt:
* tiled-drawing/scrolling/overflow/overflow-tile-coverage-expected.txt:


Canonical link: https://commits.webkit.org/238825@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Chris Lord committed Jun 15, 2021
1 parent a705747 commit ed791fc
Show file tree
Hide file tree
Showing 27 changed files with 105 additions and 8 deletions.
34 changes: 34 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,37 @@
2021-06-15 Chris Lord <clord@igalia.com>

Scrollbars are not clipped to layer bounds in RenderLayerBacking
https://bugs.webkit.org/show_bug.cgi?id=226823

Reviewed by Simon Fraser.

Adjust test expectations due to clipping on overflow controls container.

* compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt:
* compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
* compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt:
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt:
* compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment-expected.txt:
* compositing/scrolling/async-overflow-scrolling/overflow-controls-container-clips-scrollbars-expected.html: Added.
* compositing/scrolling/async-overflow-scrolling/overflow-controls-container-clips-scrollbars.html: Added.
* compositing/scrolling/async-overflow-scrolling/transform-change-scrollbar-position-expected.txt:
* compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt:
* compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
* compositing/tiling/perspective-on-scroller-tile-coverage-expected.txt:
* platform/mac-wk1/compositing/clipping/border-radius-async-overflow-clipping-layer-expected.txt:
* tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage-expected.txt:
* tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage-expected.txt:
* tiled-drawing/scrolling/overflow/overflow-tile-coverage-expected.txt:

2021-06-15 Alex Christensen <achristensen@webkit.org>

Check for "xn--" in any subdomain when parsing URL hosts
Expand Down
Expand Up @@ -39,6 +39,7 @@ This is the scrolled contents
(GraphicsLayer
(position 44.00 44.00)
(bounds 320.00 200.00)
(clips 1)
(children 1
(GraphicsLayer
(position 305.00 0.00)
Expand Down Expand Up @@ -86,6 +87,7 @@ This is the scrolled contents
(GraphicsLayer
(position 44.00 44.00)
(bounds 320.00 200.00)
(clips 1)
(children 1
(GraphicsLayer
(position 305.00 0.00)
Expand Down
Expand Up @@ -46,6 +46,7 @@
(GraphicsLayer
(position 1.00 1.00)
(bounds 300.00 200.00)
(clips 1)
(children 1
(GraphicsLayer
(position 285.00 0.00)
Expand Down Expand Up @@ -138,6 +139,7 @@
(GraphicsLayer
(position 24.00 106.00)
(bounds 400.00 350.00)
(clips 1)
(children 1
(GraphicsLayer
(position 385.00 0.00)
Expand Down
Expand Up @@ -86,6 +86,7 @@
(GraphicsLayer
(position 10.00 10.00)
(bounds 400.00 219.00)
(clips 1)
(children 1
(GraphicsLayer
(position 0.00 204.00)
Expand Down
Expand Up @@ -55,6 +55,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -55,6 +55,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -56,6 +56,7 @@
(GraphicsLayer
(position 3.00 3.00)
(bounds 210.00 210.00)
(clips 1)
(children 1
(GraphicsLayer
(position 195.00 0.00)
Expand Down Expand Up @@ -113,6 +114,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -25,6 +25,7 @@
(GraphicsLayer
(position 9.00 9.00)
(bounds 300.00 300.00)
(clips 1)
(children 1
(GraphicsLayer
(position 285.00 0.00)
Expand Down
Expand Up @@ -55,6 +55,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -48,6 +48,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -48,6 +48,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -55,6 +55,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -67,6 +67,7 @@
(GraphicsLayer
(position 39.00 39.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -48,6 +48,7 @@
(GraphicsLayer
(position 41.00 33.00)
(bounds 316.00 316.00)
(clips 1)
(children 1
(GraphicsLayer
(position 301.00 0.00)
Expand Down
Expand Up @@ -91,6 +91,7 @@
(children 1
(GraphicsLayer
(bounds 256.00 500.00)
(clips 1)
(backingStoreAttached 1)
(children 3
(GraphicsLayer
Expand Down Expand Up @@ -273,6 +274,7 @@
(children 1
(GraphicsLayer
(bounds 444.00 500.00)
(clips 1)
(backingStoreAttached 1)
(children 3
(GraphicsLayer
Expand Down
@@ -0,0 +1 @@
<!DOCTYPE html>
@@ -0,0 +1,22 @@
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->

<style>
::-webkit-scrollbar {
background: red;
}

#item {
width: 0;
height: 100px;
overflow: auto;
}

#child {
height: 200px;
}
</style>

<div id="item">
<div id="child">
</div>
</div>
Expand Up @@ -31,6 +31,7 @@
(GraphicsLayer
(position 2.00 2.00)
(bounds 520.00 420.00)
(clips 1)
(children 1
(GraphicsLayer
(position 0.00 405.00)
Expand Down
Expand Up @@ -30,6 +30,7 @@ s
(GraphicsLayer
(position 2.00 2.00)
(bounds 300.00 150.00)
(clips 1)
(children 3
(GraphicsLayer
(position 0.00 135.00)
Expand Down
Expand Up @@ -66,6 +66,7 @@
(GraphicsLayer
(position 12.00 12.00)
(bounds 296.00 296.00)
(clips 1)
(children 1
(GraphicsLayer
(position 281.00 0.00)
Expand Down
Expand Up @@ -65,7 +65,7 @@
(GraphicsLayer
(bounds 600.00 500.00)
(visible rect 0.00, 0.00 600.00 x 500.00)
(coverage rect -18.00, -10.00 800.00 x 600.00)
(coverage rect 0.00, 0.00 600.00 x 500.00)
(intersects coverage rect 1)
(contentsScale 1.00)
(children 1
Expand All @@ -74,7 +74,7 @@
(bounds 15.00 500.00)
(drawsContent 1)
(visible rect 0.00, 0.00 15.00 x 500.00)
(coverage rect -603.00, -10.00 800.00 x 600.00)
(coverage rect -585.00, 0.00 600.00 x 500.00)
(intersects coverage rect 1)
(contentsScale 1.00)
)
Expand Down
Expand Up @@ -31,6 +31,7 @@ This is the scrolled contents
(GraphicsLayer
(position 44.00 44.00)
(bounds 320.00 200.00)
(clips 1)
(children 1
(GraphicsLayer
(position 305.00 0.00)
Expand Down Expand Up @@ -64,6 +65,7 @@ This is the scrolled contents
(GraphicsLayer
(position 44.00 44.00)
(bounds 320.00 200.00)
(clips 1)
(children 1
(GraphicsLayer
(position 305.00 0.00)
Expand Down
Expand Up @@ -58,7 +58,7 @@
(position 1.00 1.00)
(bounds 400.00 512.00)
(visible rect 0.00, 0.00 400.00 x 512.00)
(coverage rect -59.00, -51.00 785.00 x 600.00)
(coverage rect 0.00, 0.00 400.00 x 512.00)
(intersects coverage rect 1)
(contentsScale 1.00)
(children 1
Expand All @@ -67,7 +67,7 @@
(bounds 15.00 512.00)
(drawsContent 1)
(visible rect 0.00, 0.00 15.00 x 512.00)
(coverage rect -444.00, -51.00 785.00 x 600.00)
(coverage rect -385.00, 0.00 400.00 x 512.00)
(intersects coverage rect 1)
(contentsScale 1.00)
)
Expand Down
Expand Up @@ -58,7 +58,7 @@
(position 1.00 1.00)
(bounds 400.00 512.00)
(visible rect 0.00, 0.00 400.00 x 512.00)
(coverage rect -59.00, -51.00 785.00 x 600.00)
(coverage rect 0.00, 0.00 400.00 x 512.00)
(intersects coverage rect 1)
(contentsScale 1.00)
(children 1
Expand All @@ -67,7 +67,7 @@
(bounds 15.00 512.00)
(drawsContent 1)
(visible rect 0.00, 0.00 15.00 x 512.00)
(coverage rect -444.00, -51.00 785.00 x 600.00)
(coverage rect -385.00, 0.00 400.00 x 512.00)
(intersects coverage rect 1)
(contentsScale 1.00)
)
Expand Down
Expand Up @@ -56,7 +56,7 @@
(position 1.00 1.00)
(bounds 400.00 512.00)
(visible rect 0.00, 0.00 400.00 x 512.00)
(coverage rect -59.00, -51.00 785.00 x 600.00)
(coverage rect 0.00, 0.00 400.00 x 512.00)
(intersects coverage rect 1)
(contentsScale 1.00)
(children 1
Expand All @@ -65,7 +65,7 @@
(bounds 15.00 512.00)
(drawsContent 1)
(visible rect 0.00, 0.00 15.00 x 512.00)
(coverage rect -444.00, -51.00 785.00 x 600.00)
(coverage rect -385.00, 0.00 400.00 x 512.00)
(intersects coverage rect 1)
(contentsScale 1.00)
)
Expand Down
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2021-06-15 Chris Lord <clord@igalia.com>

Scrollbars are not clipped to layer bounds in RenderLayerBacking
https://bugs.webkit.org/show_bug.cgi?id=226823

Reviewed by Simon Fraser.

Mask contents to bounds of overflow controls containers in RenderLayerBacking.

Test: compositing/scrolling/async-overflow-scrolling/overflow-controls-container-clips-scrollbars.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::adjustOverflowControlsPositionRelativeToAncestor):

2021-06-15 Eric Carlson <eric.carlson@apple.com>

[Mac] CoreMedia WrapperClass does not need alignment fixup
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/rendering/RenderLayerBacking.cpp
Expand Up @@ -1428,6 +1428,7 @@ void RenderLayerBacking::updateGeometry(const RenderLayer* compositedAncestor)

m_overflowControlsContainer->setPosition(snappedBoxInfo.m_snappedRect.location());
m_overflowControlsContainer->setSize(snappedBoxInfo.m_snappedRect.size());
m_overflowControlsContainer->setMasksToBounds(true);
}

if (m_foregroundLayer) {
Expand Down Expand Up @@ -1507,6 +1508,7 @@ void RenderLayerBacking::adjustOverflowControlsPositionRelativeToAncestor(const
SnappedRectInfo snappedBoxInfo = snappedGraphicsLayer(boxOffsetFromGraphicsLayer, overflowControlsRect.size(), deviceScaleFactor());

m_overflowControlsContainer->setPosition(snappedBoxInfo.m_snappedRect.location());
m_overflowControlsContainer->setSize(snappedBoxInfo.m_snappedRect.size());
}

void RenderLayerBacking::setLocationOfScrolledContents(ScrollOffset scrollOffset, ScrollingLayerPositionAction setOrSync)
Expand Down

0 comments on commit ed791fc

Please sign in to comment.