Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Issue 381840 Promote scrolling layers to composited layers on low-DPI screens when possible
Starred by 22 users Project Member Reported by nduca@chromium.org, Jun 6 2014 Back to list
Status: Fixed
Owner:
Closed: Dec 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug


Sign in to add a comment
Putting overscroll:auto on a div to get it scrolling is easy. But, on platforms that use LCD text AND that have devicePixelRatio=1, we have to invalidate on scroll. This bites people all the time.

There are lots of theoretical ways to make this better using fancier rasterization strategies. But, the reality is that this is not going to happen any time soon for Chrome.  I think we need to just concede defeat and make this a clear choice for developers: do you want fast scrolling or lcd text? Take your pick, you shall not get both.


The current way to fix this is to force the moving element and its children into a layer, which causes it to lose LCD
.fastscroll,
.fastscroll > * {
  -webkit-transform: translateZ(0)
}

But, whats the will-change variant on this?

I gather you can could wrap this in a media query too so it only applies on dpr=1.

Lets undo this magic and explain things.
 
Comment 1 by nduca@chromium.org, Jun 6 2014
Blockedon: chromium:381826
Right now we still slightly invalidate even when we use the fastscroll trick on lowdpi. We should fix that as part of this outer effort. Marking '826 as blocking.
Nat reminded me offline about the font-smooth property. Perhaps we could use font-smooth: none as a hint that we can ignore LCD text and promote the scrolling layers?
Comment 3 by nduca@chromium.org, Jun 6 2014
Labels: -SlowBecauseOfRepaintStorms SlowBecauseOfSpec
Comment 4 by ajuma@chromium.org, Jun 6 2014
We could also use will-change:scroll-position as such a hint.
Comment 5 by alokp@chromium.org, Jun 6 2014
I was under the impression that we had decided that performance trumps LCD and if we need to promote something to layer for performance reasons, we should just do it and not worry about losing LCD. Is this not true?

Could developers put a solid background color on the div if they cared about lcd?
Comment 6 Deleted
Project Member Comment 7 by sheriffbot@chromium.org, Mar 22 2016
Labels: Hotlist-Recharge-Cold
This issue has been available for more than 365 days, and should be re-evaluated. Hotlist-Recharge-Cold label is added for tracking. Please re-triage this issue.

For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Assigned
schenney is going to try the approach hinted at in comment 5: promote if the background is opaque.
Owner: schenney@chromium.org
I've added the check for opaque background color and it does give us composited scrolling for content that meets the other requirements. The change is in https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp&l=1411 where I add

&& !layer->layoutObject()->style()->visitedDependentColor(CSSPropertyBackgroundColor).hasAlpha()

as a condition and remove the check for preferCompositingToLCDTextEnabled().

The only thing that concerns me is this comment in https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp&l=245

            // FIXME: it should also be possible to promote if the layer can
            // still use LCD text when promoted, but detecting when the
            // compositor can do this is tricky. Currently, the layer must be
            // both opaque and may only have an integer translation as its
            // transform. Both opacity and screen space transform are inherited
            // properties, so this cannot be determined from local information.

Is the screen space transform thing an issue? vollick@ added the comment.
Also, not sure if fixed-position elements will display correctly.
Comment 12 by ajuma@chromium.org, Mar 22 2016
Cc: weiliangc@chromium.org
It's true that only layers with the property that every ancestor transform is only a scale or integer translation can get LCD text. The compositor does snap non-integer scroll offsets to integers, so it's fractional values in Layer::position and Layer::transform that are a problem. That said, in those cases the text is likely not going to be aligned with screen space pixels regardless of how we promote (unless its position within the layer happens to cancel out the layer's fractional position), so it's probably going to look bad either way.
Lots of test failures that I need to process to figure out what's wrong versus what's just different. Lots looks wrong.
Working through the tests, so far everything is behaving properly, despite ending up with only 1 layer in the layer tree. I'll put up the patch and get some trybot results so people can look at it and tell me if that's an expected change or a test artifact or whatever.

I'm also changing a lot of the tests involving scrollers to have a gradient on the scrolling element, which allows manual testing (because you can see the scroll, unlike with a solid background color).

Which raises another optimization. We could also composite if we can tell that a background image is opaque, as is the case for, say, a gradient with opaque colors.

Which raises another problem: some CSS compositing and blending modes might break the "opaque background color means opaque background" invariant. Honestly I don't think that's likely to hit many sites.
Regarding c#12: Where is that "only integral transformations have LCD" requirement enforced? I'm not seeing it in the code I'm looking at.

vollick@, this is the bug we were talking about in the stand-up.
OK, so the main thing to be sure of is that we do consider the layer to be opaque if the background color is opaque, which I think is the case based on looking at test output.

Turns out I had a bug in my first attempt, so retrying now with something I've somewhat verified behaves as expected.
OK, fewer failures now but some stacking order bugs.
Comment 19 by pdr@chromium.org, Mar 23 2016
Cc: pdr@chromium.org
Summary: Promote scrolling layers to composited layers on low-DPI screens when possible (was: Its crazy hard for developers to make performant overscroll divs)
Issue 597678 has been merged into this issue.
Components: Blink>Scroll
Labels: Hotlist-ThreadedRendering
Status: Started
WIP patch: https://codereview.chromium.org/1826013002/
Cc: skobes@chromium.org rbyers@chromium.org pinkerton@chromium.org chrishtr@chromium.org rsch...@chromium.org flackr@chromium.org dsinclair@chromium.org ccameron@chromium.org danakj@chromium.org erikc...@chromium.org pawli...@chromium.org durga.behera@chromium.org jdduke@chromium.org andreip@chromium.org darrensmith@chromium.org
Issue 410832 has been merged into this issue.
Labels: DevRel-Facebook
This is important for a good experience on Facebook.  They currently rely on a wheel handler today to fix the scrolling of sub-layers (like the chat mole) to not chain to the document.  They get a better UX by moving the main content to an overflow:scroll div, but would then loose sub-pixel AA.
Cc: piman@chromium.org fsam...@chromium.org enne@chromium.org rjkroege@chromium.org
Interesting, that is exactly input latching that we've noticed safari now does and we think may make input event routing much cheaper (after the first event).
A few tests have significant failures with the existing patch:
fast/clip/014.html - We're not clipping scrollbars like we should (or were)
fast/forms/select/listbox-selection-2.html - Probably OK, but not sure
fast/overflow/overflow-float-stacking.html - Real error, need to check if we fail always with composited scrolling
fast/overflow/overflow-stacking.html - Real error, need to check if we fail always with composited scrolling
fast/overflow/overflow-with-local-background-attachment.html - Border very incorrectly rendered

Some of these might be just local failures. Running a try job to verify.

Cc: -erikc...@chromium.org
Re #26: agree it would be good to test vanilla ToT with --enable-prefer-compositing-to-lcd-text and see if those tests also fail.
FYI with the patch from #22 on Linux I see the promoted opaque scrolling layer on http://output.jsbin.com/sutafa not getting subpixel text anti-aliasing.
I wonder if we need to modify solid-color background painting to use m_scrollingContentsLayer.  (Something similar is also needed for root layer scrolling in issue 568847.)

</wildguess>
Labels: -Hotlist-Recharge-Cold -Hotlist-ThreadedRendering
All of the significant failures listed in #26 also fail with --enable-prefer-compositing-to-lcd-text, and the latter causes lots more failures because it promotes everything, not just opaque backgrounds.

In Debug builds there are lots of asserts related to self painting layers that need to be addressed also.

On linux Layout tests I am seeing a few text painting differences, like fast/forms/select-popup/popup-menu-appearance-long.html from https://storage.googleapis.com/chromium-layout-test-archives/linux_chromium_rel_ng/235495/layout-test-results/results.html

I'll follow up offline about how to test that we actually get sub-pixel anti-aliasing.
And furthermore, the 5 significant failures (really just 2 classes of failures) also fail on Mac Chrome, so it's not specific to using background color as a compositing reason. Maybe we turn off the feature in layout tests or something?

So I think there are 2 outstanding issues preventing landing this: Fix all the debug crashes I'm seeing, and make sure we are actually getting lcd text with a solid background color.
Comment 33 by alokp@chromium.org, May 31 2016
Cc: -alokp@chromium.org
Blockedon: 617265
Blockedon: 568847
I have a hacky WIP patch uploaded which fixes the LCD text issues. There are several changes required though so I'll probably split it up into pieces and add appropriate tests.
https://codereview.chromium.org/2068723002
Blocking: 626196
Blocking: 437306
Project Member Comment 39 by bugdroid1@chromium.org, Aug 4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0f3f2e7a62356e4c1a44b769e46be984366ecad

commit a0f3f2e7a62356e4c1a44b769e46be984366ecad
Author: schenney <schenney@chromium.org>
Date: Thu Aug 04 15:29:02 2016

Modify LayoutTests to prep for compositing solid background scollers

Tests of scrolling behavior should allow some visual mechanism for
detecting the scroll position. Some tests have been updated to make this
so.

Other tests require that a scrolling layer not be composited. Upcoming
changes will cause solid background color scrolling content to be
composited on all displays, so such tests must be modified slightly to
prevent the scrolling layer from promotion (by making the background
partially transparent).

And one test is explicitly testing the preferCompositingToLCDText flag,
so we should rename it and adjust the background so that the test
continues to test what it claims.

R=flackr
BUG= 381840 

Review-Url: https://codereview.chromium.org/2196363002
Cr-Commit-Position: refs/heads/master@{#409791}

[delete] https://crrev.com/563a4d1a4a02714746f0782cafea9c5ad247c4ae/third_party/WebKit/LayoutTests/compositing/change-compositing-settings.html
[add] https://crrev.com/a0f3f2e7a62356e4c1a44b769e46be984366ecad/third_party/WebKit/LayoutTests/compositing/change-preferCompositingToLCDText-setting.html
[modify] https://crrev.com/a0f3f2e7a62356e4c1a44b769e46be984366ecad/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-nonscrollable-body-mismatch-containers.html
[modify] https://crrev.com/a0f3f2e7a62356e4c1a44b769e46be984366ecad/third_party/WebKit/LayoutTests/compositing/overflow/clear-scroll-parent.html
[modify] https://crrev.com/a0f3f2e7a62356e4c1a44b769e46be984366ecad/third_party/WebKit/LayoutTests/fast/borders/overflow-hidden-border-radius-force-backing-store-expected.txt
[modify] https://crrev.com/a0f3f2e7a62356e4c1a44b769e46be984366ecad/third_party/WebKit/LayoutTests/fast/borders/overflow-hidden-border-radius-force-backing-store.html
[modify] https://crrev.com/a0f3f2e7a62356e4c1a44b769e46be984366ecad/third_party/WebKit/Source/web/tests/data/composited_selection_bounds_editable.html

Labels: -SlowBecauseOfLayers Hotlist-ThreadedRendering
This is on the threaded rendering hotlist since the issue impacts how often we scroll on the compositor thread.

The SlowBecauseOfLayers label is inappropriate since the problem here is not the overhead due to creating/maintaining composited layers.
Project Member Comment 41 by bugdroid1@chromium.org, Aug 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f

commit 9a2cdc8d96d94c736eb5547a7c8c541e58e5759f
Author: flackr <flackr@chromium.org>
Date: Tue Aug 09 20:30:12 2016

Paint local background colors onto foreground layer.

This patch adds support for drawing backgrounds into the scrolling content
layer. This allows us to render text with sub-pixel anti-aliasing when an
opaque background color is used meaning that we can now promote in these
cases, and correctly supports content-box clips on locally attached
backgrounds (see overflow-scroll-with-local-background.html test).

BUG= 381840 
TEST=compositing/overflow/overflow-scroll-with-local-background.html,compositing/overflow/overflow-scroll-with-transparent-background.html,compositing/overflow/overflow-scroll-with-opaque-background.html

Review-Url: https://codereview.chromium.org/2196583002
Cr-Commit-Position: refs/heads/master@{#410797}

[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child-expected.html
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-and-child.html
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-expected.html
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background.html
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background-expected.txt
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-transparent-background-expected.txt
[add] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-transparent-background.html
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/paint/BoxPainter.cpp
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/paint/BoxPainter.h
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/paint/TableRowPainter.cpp
[modify] https://crrev.com/9a2cdc8d96d94c736eb5547a7c8c541e58e5759f/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp

Project Member Comment 42 by bugdroid1@chromium.org, Aug 10
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a0abcf517e027c793782d057982d992ae0ea4612

commit a0abcf517e027c793782d057982d992ae0ea4612
Author: schenney <schenney@chromium.org>
Date: Wed Aug 10 14:42:40 2016

Enable compositing for opaque scrolling content on low DPI screens

If an overflow scroll element has an opaque background color we
will consider it for promotion to a composited layer, regardless
of the LCD text vs compositing reference. A runtime flag must be
enabled on the command line to test and use this feature. It will
be removed after we verify stability and fix related bugs.

R=flackr, chrishtr
BUG= 381840 

Review-Url: https://codereview.chromium.org/1826013002
Cr-Commit-Position: refs/heads/master@{#411037}

[modify] https://crrev.com/a0abcf517e027c793782d057982d992ae0ea4612/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/a0abcf517e027c793782d057982d992ae0ea4612/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/a0abcf517e027c793782d057982d992ae0ea4612/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
[add] https://crrev.com/a0abcf517e027c793782d057982d992ae0ea4612/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
[add] https://crrev.com/a0abcf517e027c793782d057982d992ae0ea4612/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.h
[modify] https://crrev.com/a0abcf517e027c793782d057982d992ae0ea4612/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in

Great to see this landing. Could we also make this optimisation for background images with background-attachment:local?

We could also do it if the element has a horizontal gradient & the element is only vertically scrollable. Although I don't know if that's common enough to make it worth detecting.
To the first case, yes. I have a work in progress patch to do exactly this and it fixes a longstanding compositing bug: issue 568847.

As for the second - we can weigh the work against how common it is.
Brilliant, thanks!
Project Member Comment 46 by bugdroid1@chromium.org, Aug 26
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05ee9971df08ffd2e57af7e6258a2b3efab9b539

commit 05ee9971df08ffd2e57af7e6258a2b3efab9b539
Author: flackr <flackr@chromium.org>
Date: Fri Aug 26 20:26:03 2016

Paint local attachment backgrounds into composited scrolling contents layer

This change detects when we can paint the background onto the scrolling contents layer. This will unblock promoting scrollers with supported backgrounds on low DPI devices as we can now maintain subpixel antialiased text.

BUG= 381840 ,568847
TEST=compositing/overflow/overflow-scroll-with-local-image-background.html, LayoutBoxTest.BackgroundRect, CompositedLayerMappingTest.ShouldPaintBackgroundOntoScrollingContentsLayer
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2068723002
Cr-Commit-Position: refs/heads/master@{#414795}

[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/layer-creation/overlap-transformed-layer-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/layer-creation/overlap-transformed-layer-with-transform-body-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background-expected.html
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-background.html
[add] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-image-background-expected.html
[add] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-local-image-background.html
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/compositing/squashing/squashing-inside-perspective-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/css3/blending/mix-blend-mode-composited-reason-children-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/fast/borders/overflow-hidden-border-radius-force-backing-store-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/fast/repaint/background-resize-height-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/fast/repaint/fixed-element-repaint-after-compositing-update-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/paint/invalidation/invalidate-descendants-when-receiving-paint-layer-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/platform/android/css3/blending/mix-blend-mode-composited-layers-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/platform/linux/fast/repaint/fixed-element-repaint-after-compositing-update-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/platform/mac/css3/blending/mix-blend-mode-composited-layers-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/LayoutTests/platform/win/css3/blending/mix-blend-mode-composited-layers-expected.txt
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/layout/LayoutBox.cpp
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/layout/LayoutBox.h
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/layout/LayoutBoxTest.cpp
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/style/ComputedStyle.h
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
[modify] https://crrev.com/05ee9971df08ffd2e57af7e6258a2b3efab9b539/third_party/WebKit/Source/core/style/FillLayer.cpp

Project Member Comment 47 by bugdroid1@chromium.org, Sep 1
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3a79cf9764213b54bf9e5a0be2198f029a3540c8

commit 3a79cf9764213b54bf9e5a0be2198f029a3540c8
Author: flackr <flackr@chromium.org>
Date: Thu Sep 01 16:49:51 2016

Paint solid color backgrounds which are equivalent to locally attached into scrolling contents layer

If we have a solid color background whose bounds / visible rect is equivalent to the padding-box we can treat it as locally attached and paint it into the scrolling contents layer. This enables composited scrolling with sub-pixel text anti-aliasing.

BUG= 381840 
TEST=CompositedLayerMappingTest.ShouldPaintBackgroundOntoScrollingContentsLayer
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2264663002
Cr-Commit-Position: refs/heads/master@{#415973}

[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/compositing/overflow/scroll-parent-absolute-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/paint/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac-mac10.9/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/paint/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/paint/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/layout/LayoutTheme.h
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8/third_party/WebKit/Source/core/style/ComputedStyle.h

Project Member Comment 48 by bugdroid1@chromium.org, Sep 2
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e78566fb8a8085644b7e5ed7ab6430e7a1074ced

commit e78566fb8a8085644b7e5ed7ab6430e7a1074ced
Author: magjed <magjed@chromium.org>
Date: Fri Sep 02 09:47:17 2016

Revert of Paint solid color backgrounds which are equivalent to locally attached into scrolling contents layer (patchset #9 id:160001 of https://codereview.chromium.org/2264663002/ )

Reason for revert:
This CL breaks paint/selection/selection-within-composited-scroller.html on WebKit Win7 (dbg).
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7%20(dbg)

01:07:46.923 1952 worker/0 paint/selection/selection-within-composited-scroller.html crashed, (stderr lines):
01:07:46.923 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=0 y=1170 47ffffff vs ffd3d3d3
01:07:46.923 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=1 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=2 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=3 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=4 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=5 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=6 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=7 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=8 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:drawingdisplayitem.cpp(100)] x=9 y=1170 47ffffff vs ffd3d3d3
01:07:46.924 1952   [2516:5320:0902/010745:4409539:ERROR:paintcontroller.cpp(621)] "" under-invalidation: display item changed
01:07:46.924 1952   [2516:5320:0902/010745:4409555:ERROR:paintcontroller.cpp(623)] New display item: "{client: \"35B71898 Scrolling Contents Layer\", type: \"DrawingBoxDecorationBackground\", rect: [0.000000,0.000000 200.000000x1620.000000]}"
01:07:46.924 1952   [2516:5320:0902/010745:4409555:ERROR:paintcontroller.cpp(624)] Old display item: "{client: \"35B71898 Scrolling Contents Layer\", type: \"DrawingBoxDecorationBackground\", rect: [0.000000,0.000000 200.000000x1620.000000]}"
01:07:46.924 1952   [2516:5320:0902/010745:4409555:ERROR:paintcontroller.cpp(628)] See http://crbug.com/619103.
...
01:07:46.924 1952   [2516:5320:0902/010745:4409555:FATAL:paintcontroller.cpp(674)] Check failed: false.
01:07:46.924 1952   Backtrace:
01:07:46.924 1952   	base::debug::StackTrace::StackTrace [0x01F0ADC7+23]
01:07:46.924 1952   	logging::LogMessage::~LogMessage [0x01F5844B+59]
01:07:46.925 1952   	blink::PaintController::checkUnderInvalidation [0x0AE6ACB7+839]
01:07:46.925 1952   	blink::PaintController::processNewItem [0x0AE6F1D6+1558]
01:07:46.925 1952   	blink::PaintController::createAndAppend<blink::DrawingDisplayItem,blink::DisplayItemClient const &,enum blink::DisplayItem::Type const &,WTF::PassRefPtr<SkPicture>,bool &> [0x0AE566C2+114]
01:07:46.925 1952   	blink::DrawingRecorder::~DrawingRecorder [0x0AE56B2E+302]
01:07:46.925 1952   	blink::BoxPainter::paintBoxDecorationBackgroundWithRect [0x1578E899+1001]
01:07:46.925 1952   	blink::BoxPainter::paintBoxDecorationBackground [0x1578E49E+334]
01:07:46.925 1952   	blink::LayoutBox::paintBoxDecorationBackground [0x15927EC4+36]
01:07:46.925 1952   	blink::BlockPainter::paintObject [0x1577E854+116]
01:07:46.925 1952   	blink::LayoutBlock::paintObject [0x158F27D4+36]
01:07:46.925 1952   	blink::BlockPainter::paint [0x1577E329+233]
01:07:46.925 1952   	blink::LayoutBlock::paint [0x158F2774+36]
01:07:46.925 1952   	blink::PaintLayerPainter::paintFragmentWithPhase [0x157D17A2+658]
01:07:46.925 1952   	blink::PaintLayerPainter::paintBackgroundForFragments [0x157D09B2+130]
01:07:46.925 1952   	blink::PaintLayerPainter::paintLayerContents [0x157D2550+2976]
01:07:46.925 1952   	blink::CompositedLayerMapping::doPaintTask [0x15A04F13+579]
01:07:46.925 1952   	blink::CompositedLayerMapping::paintContents [0x15A06224+996]
01:07:46.925 1952   	blink::GraphicsLayer::paintWithoutCommit [0x0ACDD0F3+499]
01:07:46.925 1952   	blink::GraphicsLayer::paint [0x0ACDCC3C+44]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F746+38]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaintRecursively [0x1552F7F6+214]
01:07:46.925 1952   	blink::FrameView::synchronizedPaint [0x1552F689+601]
01:07:46.925 1952   	blink::FrameView::updateLifecyclePhasesInternal [0x15530B8A+1306]
01:07:46.925 1952   	blink::FrameView::updateAllLifecyclePhases [0x155301D6+38]
01:07:46.925 1952   	blink::Internals::layerTreeAsText [0x00534AA2+146]
01:07:46.926 1952   	blink::Iterable<unsigned int,int>::keysForBinding [0x00568FE6+1814]
01:07:46.926 1952   	blink::Iterable<unsigned int,int>::keysForBinding [0x0056904C+1916]
01:07:46.926 1952   	v8::internal::FunctionCallbackArguments::Call [0x093DFE93+179]
01:07:46.926 1952   	v8::internal::Isolate::typed_array_prototype [0x09475B48+1800]
01:07:46.926 1952   	v8::internal::Builtin_HandleApiCallAsFunction [0x09476828+552]
01:07:46.926 1952   	v8::internal::Builtin_HandleApiCall [0x09476505+165]

Original issue's description:
> Paint solid color backgrounds which are equivalent to locally attached into scrolling contents layer
>
> If we have a solid color background whose bounds / visible rect is equivalent to the padding-box we can treat it as locally attached and paint it into the scrolling contents layer. This enables composited scrolling with sub-pixel text anti-aliasing.
>
> BUG= 381840 
> TEST=CompositedLayerMappingTest.ShouldPaintBackgroundOntoScrollingContentsLayer
> CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
>
> Committed: https://crrev.com/3a79cf9764213b54bf9e5a0be2198f029a3540c8
> Cr-Commit-Position: refs/heads/master@{#415973}

TBR=chrishtr@chromium.org,flackr@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 381840 

Review-Url: https://codereview.chromium.org/2308503002
Cr-Commit-Position: refs/heads/master@{#416226}

[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/compositing/overflow/scroll-parent-absolute-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/paint/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac-mac10.9/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/paint/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/paint/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/layout/LayoutTheme.h
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/e78566fb8a8085644b7e5ed7ab6430e7a1074ced/third_party/WebKit/Source/core/style/ComputedStyle.h

Project Member Comment 49 by bugdroid1@chromium.org, Sep 6
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a879db6c440ffd9c296b1a3f272458212eac48b5

commit a879db6c440ffd9c296b1a3f272458212eac48b5
Author: schenney <schenney@chromium.org>
Date: Tue Sep 06 15:04:32 2016

Remove unnecessary checks in PaintLayer::backgroundIsKnownToBeOpaqueInRect

The PaintLayer::backgroundIsKnownToBeOpaque method is currently
only called by GraphicsLayers on their owning paint layer, or
by the recursive child call. The former is by definition
always called on a self painting layer, while the latter
already has a test to prevent consideration of layers that
do not paint into the backing in question. Hence we can
remove the check for self painting layer status.

Also convert a test for dirty stacking order lists to a
DCHECK, because the test never fires on any layout test.

These checks cause chicken-and-egg problems when the method
is called by the layer itself in order to identify compositing
reasons. In such cases we are not concerned with self layer
status; we are in fact trying to determine that status.

R=chrishtr@chromium.org
BUG= 381840 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2297873002
Cr-Commit-Position: refs/heads/master@{#416628}

[modify] https://crrev.com/a879db6c440ffd9c296b1a3f272458212eac48b5/third_party/WebKit/Source/core/paint/PaintLayer.cpp

Project Member Comment 50 by bugdroid1@chromium.org, Sep 6
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1551e13becc18ed64e3a67070f9679542adec01f

commit 1551e13becc18ed64e3a67070f9679542adec01f
Author: lushnikov <lushnikov@chromium.org>
Date: Tue Sep 06 23:52:49 2016

Revert of Remove unnecessary checks in PaintLayer::backgroundIsKnownToBeOpaqueInRect (patchset #3 id:140001 of https://codereview.chromium.org/2297873002/ )

Reason for revert:
This makes Win Tests builder to hit the DCHECK, e.g.:

https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/52416

Original issue's description:
> Remove unnecessary checks in PaintLayer::backgroundIsKnownToBeOpaqueInRect
>
> The PaintLayer::backgroundIsKnownToBeOpaque method is currently
> only called by GraphicsLayers on their owning paint layer, or
> by the recursive child call. The former is by definition
> always called on a self painting layer, while the latter
> already has a test to prevent consideration of layers that
> do not paint into the backing in question. Hence we can
> remove the check for self painting layer status.
>
> Also convert a test for dirty stacking order lists to a
> DCHECK, because the test never fires on any layout test.
>
> These checks cause chicken-and-egg problems when the method
> is called by the layer itself in order to identify compositing
> reasons. In such cases we are not concerned with self layer
> status; we are in fact trying to determine that status.
>
> R=chrishtr@chromium.org
> BUG= 381840 
> CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
>
> Committed: https://crrev.com/a879db6c440ffd9c296b1a3f272458212eac48b5
> Cr-Commit-Position: refs/heads/master@{#416628}

TBR=chrishtr@chromium.org,schenney@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 381840 

Review-Url: https://codereview.chromium.org/2315693003
Cr-Commit-Position: refs/heads/master@{#416779}

[modify] https://crrev.com/1551e13becc18ed64e3a67070f9679542adec01f/third_party/WebKit/Source/core/paint/PaintLayer.cpp

Project Member Comment 51 by bugdroid1@chromium.org, Sep 7
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5a28ce539ba64f44324c9ce311b91ffc851d6ffd

commit 5a28ce539ba64f44324c9ce311b91ffc851d6ffd
Author: schenney <schenney@chromium.org>
Date: Wed Sep 07 18:27:34 2016

Remove unnecessary checks in PaintLayer::backgroundIsKnownToBeOpaqueInRect

The PaintLayer::backgroundIsKnownToBeOpaque method is currently
only called by GraphicsLayers on their owning paint layer, or
by the recursive child call. The former is by definition
always called on a self painting layer, while the latter
already has a test to prevent consideration of layers that
do not paint into the backing in question. Hence we can
remove the check for self painting layer status.

These checks cause chicken-and-egg problems when the method
is called by the layer itself in order to identify compositing
reasons. In such cases we are not concerned with self layer
status; we are in fact trying to determine that status.

This is a relanding of issue 2297873002 at patchset 140001
(http://crrev.com/2297873002#ps140001) without the DCHECK that was in the that patch.

R=chrishtr@chromium.org
BUG= 381840 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2320713002
Cr-Commit-Position: refs/heads/master@{#417002}

[modify] https://crrev.com/5a28ce539ba64f44324c9ce311b91ffc851d6ffd/third_party/WebKit/Source/core/paint/PaintLayer.cpp

Project Member Comment 52 by bugdroid1@chromium.org, Sep 9
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1

commit 87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1
Author: schenney <schenney@chromium.org>
Date: Fri Sep 09 22:46:47 2016

Fix Compositing of Opaque Scrolling Layers and Add Tests

Move the CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer
method to PaintLayer to use it for detecting composited
scrolling. The method only uses data from PaintLayer, so there's
no reason to have it elsewhere.

Switch the check in PaintLayerScrollableArea for compositing scrollers on low-dpi
devices to use the method.

Fix the check in CompositingReasonsFinder to detect opaque background scrollers
as a reason

Remove the unnecessary check for self painting layer in
PaintLayer::backgroundIsKnownToBeOpaqueInRect.
The code is always called from a self painting layer's GraphicsLayer, or it's
called by the recursive call checking childrens' opaqueness. The former case means
the layer is always self painting, while the latter seems incorrect - one should
not exclude, not include, child self painting layers.

Add tests for promotion and demotion of scrolling layers as they switch between
opaque and transparent backgrounds.

R=flackr@chromium.org, chrishtr@chromium.org
BUG= 381840 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2259493004
Cr-Commit-Position: refs/heads/master@{#417743}

[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.txt
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent.html
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.txt
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque.html
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background-will-change-expected.txt
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background-will-change.html
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
[add] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/paint/PaintLayer.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/paint/PaintLayer.h
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.h
[modify] https://crrev.com/87b0099aa31169f8c7a40b4f93b4a1e86ddf53a1/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in

Project Member Comment 53 by bugdroid1@chromium.org, Sep 11
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/77e72c03da749413cecee992ba27636fdd6bbfe1

commit 77e72c03da749413cecee992ba27636fdd6bbfe1
Author: flackr <flackr@chromium.org>
Date: Sun Sep 11 12:03:12 2016

Reland Paint solid color backgrounds which are equivalent to locally attached into scrolling contents layer (patchset #9 id:160001 of https://codereview.chromium.org/2264663002/ )

If we have a solid color background whose bounds / visible rect is equivalent to the padding-box we can treat it as locally attached and paint it into the scrolling contents layer. This enables composited scrolling with sub-pixel text anti-aliasing.

TBR=chrishtr
BUG= 381840 
TEST=CompositedLayerMappingTest.ShouldPaintBackgroundOntoScrollingContentsLayer
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2302743004
Cr-Commit-Position: refs/heads/master@{#417858}

[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/compositing/overflow/scroll-parent-absolute-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac-mac10.9/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-after-removing-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/selection-gaps-toggling-with-scrolling-contents-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/textarea-scroll-touch-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-expected.txt
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/Source/core/paint/PaintLayer.cpp
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/77e72c03da749413cecee992ba27636fdd6bbfe1/third_party/WebKit/Source/core/style/ComputedStyle.h

Project Member Comment 54 by bugdroid1@chromium.org, Sep 15
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f86fdaf9407f907eb9f5f81c4213ba4662c6947

commit 6f86fdaf9407f907eb9f5f81c4213ba4662c6947
Author: schenney <schenney@chromium.org>
Date: Thu Sep 15 14:17:43 2016

Move some paint-related tests to NeverFixTests

The moved tests are always expected to fail due to stack-space issues
or incompatible test flags. Also update the comment as to what belongs
in NeverFixTests.

Two tests that were in NeverFixTests are just Slow now, so re-enable them.

R=dpranke@chromium.org
BUG= 381840 ,601669, 646528 

Review-Url: https://codereview.chromium.org/2334893002
Cr-Commit-Position: refs/heads/master@{#418862}

[modify] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/NeverFixTests
[modify] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/SlowTests
[modify] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/StaleTestExpectations
[modify] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-expected.txt
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/compositing/lots-of-img-layers-with-opacity-expected.txt
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/android/compositing/lots-of-img-layers-expected.png
[rename] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/android/compositing/lots-of-img-layers-expected.txt
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/android/compositing/lots-of-img-layers-with-opacity-expected.png
[rename] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/android/compositing/lots-of-img-layers-with-opacity-expected.txt
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/linux/compositing/lots-of-img-layers-expected.png
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/linux/compositing/lots-of-img-layers-with-opacity-expected.png
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/mac/compositing/lots-of-img-layers-expected.png
[delete] https://crrev.com/81f6ee03502186923da48690101f66441ffe14d6/third_party/WebKit/LayoutTests/platform/mac/compositing/lots-of-img-layers-expected.txt
[add] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/mac/compositing/lots-of-img-layers-with-opacity-expected.png
[delete] https://crrev.com/81f6ee03502186923da48690101f66441ffe14d6/third_party/WebKit/LayoutTests/platform/mac/compositing/lots-of-img-layers-with-opacity-expected.txt
[modify] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/win/compositing/lots-of-img-layers-expected.png
[modify] https://crrev.com/6f86fdaf9407f907eb9f5f81c4213ba4662c6947/third_party/WebKit/LayoutTests/platform/win/compositing/lots-of-img-layers-with-opacity-expected.png

Blockedon: 593097
Blockedon: 649051
Project Member Comment 57 by bugdroid1@chromium.org, Sep 22
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7081b331ccd1903e0b3cc539d8decccb0a09863d

commit 7081b331ccd1903e0b3cc539d8decccb0a09863d
Author: schenney <schenney@chromium.org>
Date: Thu Sep 22 22:09:27 2016

Fix assertions related to floats and z-order lists when compositing opaque scrollers

The codepath for compositing opaque scrollers, enabled by
--enable-blink-feature="CompositeOpaqueScrollbars", was triggering two asserts.

One assertion was due to querying stacking order lists when those lists were
dirty. The assertion is fixed by updating the stacking order lists if needed
before the query, only if we actually need to look at the list.

The other assertion was a side-effect of an earlier change to remove a
different assertion, https://codereview.chromium.org/2191953002. The code
in question is attempting to update the shouldPaint flag of a FloatingObject
when that object has had a change in selfPaintingLayer status. But because
selfPaintingLayer status has already been updated, and the query for
FloatingObject::shouldPaint() checks the current selfPaintingLayer status,
we have no way of finding out if a floating object with a selfpaintingLayer
was previously shouldPaint. We were requiring that shouldPaint return
true so that we could set it false and return, but instead we were falling
out of the loop and hitting an ASSERT_NOT_REACHED.

The fix is to not check the previous status and just set shouldPaint to false
for all FloatingObject where the object has a selfPaintingLayer, and not assert
not reached as now we might exit the loop. We are no longer returning as soon
as we update the shouldPaint to false because we can no longer be sure that
we are actually changing the value of shouldPaint.

The lack of assertions allows 2 webkit_unit_tests to pass without crashing,
and prevents crashes in a slew of LayoutTests. Of note,
fast/overflow/overflow-float-stacking.html no longer crashes, but does fail
analogously to fast/overflow/overflow-stacking.html. In
https://codereview.chromium.org/1826013002 we had decided to live with that
failure as it is a manifestation of the fundamental compositing bug that
users on high DPI devices have always seen.

R=wangxianzhu@chromium.org,flackr@chromium.org
BUG= 593097 , 381840 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2365673002
Cr-Commit-Position: refs/heads/master@{#420477}

[modify] https://crrev.com/7081b331ccd1903e0b3cc539d8decccb0a09863d/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
[modify] https://crrev.com/7081b331ccd1903e0b3cc539d8decccb0a09863d/third_party/WebKit/Source/core/paint/PaintLayer.cpp

Project Member Comment 58 by bugdroid1@chromium.org, Sep 22
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7081b331ccd1903e0b3cc539d8decccb0a09863d

commit 7081b331ccd1903e0b3cc539d8decccb0a09863d
Author: schenney <schenney@chromium.org>
Date: Thu Sep 22 22:09:27 2016

Fix assertions related to floats and z-order lists when compositing opaque scrollers

The codepath for compositing opaque scrollers, enabled by
--enable-blink-feature="CompositeOpaqueScrollbars", was triggering two asserts.

One assertion was due to querying stacking order lists when those lists were
dirty. The assertion is fixed by updating the stacking order lists if needed
before the query, only if we actually need to look at the list.

The other assertion was a side-effect of an earlier change to remove a
different assertion, https://codereview.chromium.org/2191953002. The code
in question is attempting to update the shouldPaint flag of a FloatingObject
when that object has had a change in selfPaintingLayer status. But because
selfPaintingLayer status has already been updated, and the query for
FloatingObject::shouldPaint() checks the current selfPaintingLayer status,
we have no way of finding out if a floating object with a selfpaintingLayer
was previously shouldPaint. We were requiring that shouldPaint return
true so that we could set it false and return, but instead we were falling
out of the loop and hitting an ASSERT_NOT_REACHED.

The fix is to not check the previous status and just set shouldPaint to false
for all FloatingObject where the object has a selfPaintingLayer, and not assert
not reached as now we might exit the loop. We are no longer returning as soon
as we update the shouldPaint to false because we can no longer be sure that
we are actually changing the value of shouldPaint.

The lack of assertions allows 2 webkit_unit_tests to pass without crashing,
and prevents crashes in a slew of LayoutTests. Of note,
fast/overflow/overflow-float-stacking.html no longer crashes, but does fail
analogously to fast/overflow/overflow-stacking.html. In
https://codereview.chromium.org/1826013002 we had decided to live with that
failure as it is a manifestation of the fundamental compositing bug that
users on high DPI devices have always seen.

R=wangxianzhu@chromium.org,flackr@chromium.org
BUG= 593097 , 381840 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2365673002
Cr-Commit-Position: refs/heads/master@{#420477}

[modify] https://crrev.com/7081b331ccd1903e0b3cc539d8decccb0a09863d/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
[modify] https://crrev.com/7081b331ccd1903e0b3cc539d8decccb0a09863d/third_party/WebKit/Source/core/paint/PaintLayer.cpp

Blocking: 307091
Status: Fixed
This has landed and there are no known bugs at this time.
Sign in to add a comment