Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| index cb5500a93959ed72957af3adadf0b1c9d534d3bc..9f44412cbe23d36e07160bef6283872b60cecfa2 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| @@ -1494,13 +1494,24 @@ static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode |
| if (node && node->isElementNode() && (toElement(node)->compositorMutableProperties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::kScrollLeft))) |
| return true; |
| - if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor()->preferCompositingToLCDTextEnabled()) |
| + // TODO(schenney) The color test alone is inadequate. When https://codereview.chromium.org/2196583002 lands |
| + // we should use PaintLayer::shouldPaintBackgroundOntoForeground() because we will not still get |
| + // LCD text unless the conditions there are met. It also unifies logic for scrolling compositing |
| + // decisions. |
| + bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() |
| + && !layer->layoutObject()->style()->visitedDependentColor(CSSPropertyBackgroundColor).hasAlpha(); |
| + if (mode == PaintLayerScrollableArea::ConsiderLCDText |
| + && !layer->compositor()->preferCompositingToLCDTextEnabled() |
| + && !backgroundSupportsLCDText) |
| return false; |
| - return !layer->size().isEmpty() |
| - && !layer->hasDescendantWithClipPath() |
| - && !layer->hasAncestorWithClipPath() |
| - && !layer->layoutObject()->style()->hasBorderRadius(); |
| + // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject()->isFloating() (asserts) and |
|
chrishtr
2016/08/04 16:35:44
isFloating should have been fixed by https://coder
Stephen Chennney
2016/08/04 17:35:25
Yep. Forgot you fixed that.
|
| + // layer->layoutObject()->style()->hasBorderDecoration() (missing background behind dashed borders). |
| + // Resolve these cases, or not, and update this check with the results. |
| + return !(layer->size().isEmpty() |
| + || layer->hasDescendantWithClipPath() |
| + || layer->hasAncestorWithClipPath() |
| + || layer->layoutObject()->style()->hasBorderRadius()); |
| } |
| void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) |