Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Issue 397713004: Overlay scrollbars must respect ancestor clip (Closed)

Created:
6 years, 5 months ago by Ian Vollick
Modified:
6 years, 5 months ago
CC:
abarth-chromium, blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr., rune+blink, zoltan1
Project:
blink
Visibility:
Public.

Description

Overlay scrollbars must respect ancestor clip The current reparenting logic for overlay scrollbars for compositor- driven scrollable areas does not account for ancestor clips. The result is that the scrollbars can escape clips that need to affect them. Consider the following stacking tree. (The '-' characters in the following trees should be ignored. I've only added them so that my indenting doesn't get stripped). + stacking-context - + overflow-hidden-clipper - + overflow-scroller - + fixed-positioned-descendant-of-the-scroller - + relative-positioned-descendant-of-the-scroller Where, in tree order, these are arranged like this + stacking-context - + overflow-hidden-clipper --- + overflow-scroller ----- + fixed-positioned-descendant-of-the-scroller ----- + relative-positioned-descendant-of-the-scroller Since overflow-scroller is clipped by overflow-hidden-clipper, a layer that is not an ancestor in the stacking tree, it gets an ancestor clipping layer. If the overflow controls are parented under overflow-scroller's m_graphicsLayer, everything works fine: the controls inherit the clip from the ancestor clipping layer. Unfortunately, if we are using overlay scrollbars, we can't hang the scrollbars under m_graphicsLayer because they'd stack behind fixed-positioned-descendant-of-the-scroller and relative-positioned-descendant-of-the-scroller. In order to get things stacking correctly, we have to reparent the overflow controls like this: + stacking-context - + overflow-hidden-clipper - + overflow-scroller - + fixed-positioned-descendant-of-the-scroller - + relative-positioned-descendant-of-the-scroller - + <overflow controls for overflow-scroller> If we reparent the controls like this in the graphics layer tree, the overflow controls will no longer be a descendant of the ancestor clipping layer that applies the clip for m_graphicsLayer, unfortunately. In order to get the overflow controls clipped correctly, we need to ensure that they have a clipping layer above them. This CL adds m_overflowControlsClippingLayer for this purpose. BUG=393926 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178980

Patch Set 1 : . #

Total comments: 5

Patch Set 2 : Update overflow host layer with the ancestor clip layer. #

Patch Set 3 : . #

Total comments: 6

Patch Set 4 : . #

Total comments: 1

Patch Set 5 : . #

Total comments: 6

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+176 lines, -73 lines) Patch
A + LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html View 1 2 3 3 chunks +15 lines, -9 lines 0 comments Download
A + LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip-expected.html View 1 2 3 3 chunks +10 lines, -9 lines 0 comments Download
A + LayoutTests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip.html View 1 2 3 2 chunks +23 lines, -10 lines 0 comments Download
A + LayoutTests/compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip-expected.html View 1 2 3 2 chunks +18 lines, -10 lines 0 comments Download
A + LayoutTests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer.html View 1 2 3 2 chunks +12 lines, -9 lines 0 comments Download
A + LayoutTests/compositing/overflow/reparented-unclipped-overlay-scrollbars-with-offset-from-renderer-expected.html View 1 2 3 2 chunks +8 lines, -9 lines 0 comments Download
M Source/core/rendering/compositing/CompositedLayerMapping.h View 1 2 3 4 5 6 chunks +29 lines, -4 lines 0 comments Download
M Source/core/rendering/compositing/CompositedLayerMapping.cpp View 1 2 3 4 5 11 chunks +54 lines, -11 lines 0 comments Download
M Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/compositing/GraphicsLayerUpdater.cpp View 1 2 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 24 (0 generated)
Ian Vollick
6 years, 5 months ago (2014-07-15 20:02:45 UTC) #1
Ian Vollick
On 2014/07/15 20:02:45, Ian Vollick wrote: Please hold off on reviewing this. I'm hoping I ...
6 years, 5 months ago (2014-07-15 20:54:36 UTC) #2
Ian Vollick
On 2014/07/15 20:54:36, Ian Vollick wrote: > On 2014/07/15 20:02:45, Ian Vollick wrote: > > ...
6 years, 5 months ago (2014-07-16 03:57:57 UTC) #3
abarth-chromium
https://codereview.chromium.org/397713004/diff/20001/Source/core/rendering/compositing/CompositedLayerMapping.cpp File Source/core/rendering/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/397713004/diff/20001/Source/core/rendering/compositing/CompositedLayerMapping.cpp#newcode1797 Source/core/rendering/compositing/CompositedLayerMapping.cpp:1797: LayoutRect parentClipRect = m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect(); This call is super expensive. ...
6 years, 5 months ago (2014-07-16 04:12:40 UTC) #4
abarth-chromium
https://codereview.chromium.org/397713004/diff/20001/Source/core/rendering/compositing/CompositedLayerMapping.cpp File Source/core/rendering/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/397713004/diff/20001/Source/core/rendering/compositing/CompositedLayerMapping.cpp#newcode1794 Source/core/rendering/compositing/CompositedLayerMapping.cpp:1794: // inaccurate results (and trips the ASSERTS in RenderLayerClipper). ...
6 years, 5 months ago (2014-07-16 04:13:53 UTC) #5
Ian Vollick
https://codereview.chromium.org/397713004/diff/20001/Source/core/rendering/compositing/CompositedLayerMapping.cpp File Source/core/rendering/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/397713004/diff/20001/Source/core/rendering/compositing/CompositedLayerMapping.cpp#newcode1794 Source/core/rendering/compositing/CompositedLayerMapping.cpp:1794: // inaccurate results (and trips the ASSERTS in RenderLayerClipper). ...
6 years, 5 months ago (2014-07-16 04:21:34 UTC) #6
abarth-chromium
This CL is incorrect. detachLayerForOverflowControls is called by GraphicsLayerTreeBuilder::rebuild, which won't always get called when ...
6 years, 5 months ago (2014-07-16 05:28:13 UTC) #7
Ian Vollick
On 2014/07/16 05:28:13, abarth wrote: > This CL is incorrect. > > detachLayerForOverflowControls is called ...
6 years, 5 months ago (2014-07-16 06:45:40 UTC) #8
Ian Vollick
On 2014/07/16 06:45:40, Ian Vollick wrote: > On 2014/07/16 05:28:13, abarth wrote: > > This ...
6 years, 5 months ago (2014-07-23 20:55:25 UTC) #9
hartmanng
https://codereview.chromium.org/397713004/diff/200001/LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html File LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html (right): https://codereview.chromium.org/397713004/diff/200001/LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html#newcode8 LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html:8: overflow: hidden; nit: this indentation doesn't match the rest ...
6 years, 5 months ago (2014-07-24 15:57:36 UTC) #10
Ian Vollick
https://codereview.chromium.org/397713004/diff/200001/LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html File LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html (right): https://codereview.chromium.org/397713004/diff/200001/LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html#newcode8 LayoutTests/compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html:8: overflow: hidden; On 2014/07/24 15:57:35, hartmanng wrote: > nit: ...
6 years, 5 months ago (2014-07-24 17:39:09 UTC) #11
hartmanng
lgtm, but please wait for Adam to sign off on it
6 years, 5 months ago (2014-07-24 18:28:45 UTC) #12
chrishtr
https://codereview.chromium.org/397713004/diff/240001/Source/core/rendering/compositing/CompositedLayerMapping.h File Source/core/rendering/compositing/CompositedLayerMapping.h (right): https://codereview.chromium.org/397713004/diff/240001/Source/core/rendering/compositing/CompositedLayerMapping.h#newcode399 Source/core/rendering/compositing/CompositedLayerMapping.h:399: // can remain ignorant of the layers above them ...
6 years, 5 months ago (2014-07-24 18:44:57 UTC) #13
Ian Vollick
On 2014/07/24 18:44:57, chrishtr wrote: > https://codereview.chromium.org/397713004/diff/240001/Source/core/rendering/compositing/CompositedLayerMapping.h > File Source/core/rendering/compositing/CompositedLayerMapping.h (right): > > https://codereview.chromium.org/397713004/diff/240001/Source/core/rendering/compositing/CompositedLayerMapping.h#newcode399 > ...
6 years, 5 months ago (2014-07-24 19:09:45 UTC) #14
chrishtr
https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/compositing/CompositedLayerMapping.h File Source/core/rendering/compositing/CompositedLayerMapping.h (right): https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/compositing/CompositedLayerMapping.h#newcode327 Source/core/rendering/compositing/CompositedLayerMapping.h:327: // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow controls may ...
6 years, 5 months ago (2014-07-25 18:00:34 UTC) #15
chrishtr
BTW thank you for the very clear CL description.
6 years, 5 months ago (2014-07-25 18:00:46 UTC) #16
Ian Vollick
https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/compositing/CompositedLayerMapping.h File Source/core/rendering/compositing/CompositedLayerMapping.h (right): https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/compositing/CompositedLayerMapping.h#newcode327 Source/core/rendering/compositing/CompositedLayerMapping.h:327: // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow controls may ...
6 years, 5 months ago (2014-07-25 18:19:51 UTC) #17
chrishtr
lgtm https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/compositing/CompositedLayerMapping.cpp File Source/core/rendering/compositing/CompositedLayerMapping.cpp (right): https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/compositing/CompositedLayerMapping.cpp#newcode1014 Source/core/rendering/compositing/CompositedLayerMapping.cpp:1014: m_overflowControlsClippingLayer->addChild(m_overflowControlsHostLayer.get()); ASSERT(m_overflowControlsHostLayer)
6 years, 5 months ago (2014-07-25 21:04:45 UTC) #18
chrishtr
https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/RenderLayer.h File Source/core/rendering/RenderLayer.h (right): https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/RenderLayer.h#newcode556 Source/core/rendering/RenderLayer.h:556: bool needsToReparentOverflowControls() const; On reflection, this is weird to ...
6 years, 5 months ago (2014-07-25 21:06:16 UTC) #19
Ian Vollick
https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/RenderLayer.h File Source/core/rendering/RenderLayer.h (right): https://codereview.chromium.org/397713004/diff/280001/Source/core/rendering/RenderLayer.h#newcode556 Source/core/rendering/RenderLayer.h:556: bool needsToReparentOverflowControls() const; On 2014/07/25 21:06:15, chrishtr wrote: > ...
6 years, 5 months ago (2014-07-26 01:54:58 UTC) #20
Ian Vollick
The CQ bit was checked by vollick@chromium.org
6 years, 5 months ago (2014-07-26 01:58:02 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/397713004/300001
6 years, 5 months ago (2014-07-26 01:58:29 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 5 months ago (2014-07-26 02:58:17 UTC) #23
commit-bot: I haz the power
6 years, 5 months ago (2014-07-26 05:14:21 UTC) #24
Message was sent while issue was closed.
Change committed as 178980

Powered by Google App Engine
This is Rietveld 408576698