Reland "Implement correct z-order of overlay scrollbars"
This reverts commit a0d2f696348eddcd758fd1d67d99f1a93b31fd3e.
Fix crbug.com/980086 by calling MarkAncestorChainForFlagsUpdate() from
DirtyStackingContextZOrderLists() to ensure z-order lists are updated in
UpdateDescendantDependentFlags() when scrollbar existence changes.
Original change's description:
> Revert "Implement correct z-order of overlay scrollbars"
>
> This reverts commit 128c75781f5ead66e1a16eea79ccfe4010f0807a.
>
> Reason for revert: crbug.com/980086
>
> Original change's description:
> > Implement correct z-order of overlay scrollbars
> >
> > Previously we implemented z-ordering of composited overlay scrollbars
> > in GraphicsLayerTreeBuilder which reparents overlay scrollbar
> > GraphicsLayers of scrollers with higher z-order scrollable contents.
> > The overlay scrollbar GraphicsLayers are inserted into the
> > GraphicsLayer of the stacking context above all scrolling contents
> > GraphicsLayers, to ensure the overlay scrollbars to be above any
> > scrolling contents.
> >
> > However, the logic doesn't work for all overlay scrollbars in
> > CompositeAfterPaint and non-composited scrollbars in
> > pre-CompositedAfterPaint because these scrollbars are not controlled
> > by GraphicsLayerTreeBuilder.
> >
> > This CL let PaintLayerStackingNode also manage z-order of overlay
> > scrollbars. If any scroller with overlay scrollbars has any stacked
> > contents that have higher z-order than the scroller, the overlay
> > scrollbars will be inserted after the highest z-order scrolling
> > contents in the z-order list.
> >
> > Also add a paint phase for overlay scrollbars. This is not strictly
> > necessary for now because all scrollers with overlay scrollbars are
> > self-painting. However, this allows us in the future to let scrollers
> > not self-painting to achieve perfect painting order.
> >
> > Bug: 918155
> > Change-Id: Iccae1cbcde8de46158267e45bab2a13a027db3ec
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1461536
> > Commit-Queue: Xianzhu Wang <[email protected]>
> > Reviewed-by: Chris Harrelson <[email protected]>
> > Cr-Commit-Position: refs/heads/master@{#672748}
>
> [email protected],[email protected]
>
> Bug: 918155, 980086
> Change-Id: Icccb9ec7af7ef424306afade0c80015e4c5c5c6f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1684022
> Reviewed-by: Xianzhu Wang <[email protected]>
> Commit-Queue: Xianzhu Wang <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#674526}
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 918155, 980086
Change-Id: I5f001477512de5ebbaa7a4fe62c1ef1bb76e442a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1691331
Reviewed-by: Chris Harrelson <[email protected]>
Commit-Queue: Xianzhu Wang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#675683}
diff --git a/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html b/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html
new file mode 100644
index 0000000..9a9eba03
--- /dev/null
+++ b/third_party/blink/web_tests/scrollbars/nested-scroll-overlay-scrollbar.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<div style="width: 200px; height: 200px; overflow: scroll">
+ <!-- The intermediate div doesn't have layout overflow. -->
+ <div style="height: 210px; overflow: scroll">
+ <div style="background: green; width: 300px; height: 100px"></div>
+ </div>
+</div>
+<script>
+if (window.internals) {
+ internals.runtimeFlags.overlayScrollbarsEnabled = true;
+ internals.settings.setMockScrollbarsEnabled(true);
+}
+</script>