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 99602b8289bc03bb1fdc0aa58eac80b373ff37ae..d045dd9c16a85bd3293ffd74240a7608e4077fae 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
@@ -1728,6 +1728,8 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling( |
const PaintLayer* layer) { |
if (!layer->scrollsOverflow()) |
return false; |
+ if (layer->size().isEmpty()) |
bokan
2017/01/05 14:52:41
It might change behavior to have this above the `i
yigu
2017/01/05 20:20:27
Done.
|
+ return false; |
Node* node = layer->enclosingNode(); |
if (node && node->isElementNode() && |
@@ -1736,6 +1738,8 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling( |
CompositorMutableProperty::kScrollLeft))) |
return true; |
+ bool needsCompositedScrolling = true; |
+ |
// TODO(flackr): Allow integer transforms as long as all of the ancestor |
// transforms are also integer. |
bool backgroundSupportsLCDText = |
@@ -1762,17 +1766,26 @@ bool PaintLayerScrollableArea::computeNeedsCompositedScrolling( |
addStyleRelatedMainThreadScrollingReasons( |
MainThreadScrollingReason::kBackgroundNotOpaqueInRect); |
} |
- return false; |
+ needsCompositedScrolling = false; |
} |
// TODO(schenney) Tests fail if we do not also exclude |
// layer->layoutObject()->style()->hasBorderDecoration() (missing background |
// behind dashed borders). Resolve this case, or not, and update this check |
// with the results. |
- return !(layer->size().isEmpty() || layer->hasDescendantWithClipPath() || |
- layer->hasAncestorWithClipPath() || |
- layer->layoutObject()->style()->hasBorderRadius() || |
- layer->layoutObject()->hasClip()); |
+ if (layer->layoutObject()->style()->hasBorderRadius()) { |
+ addStyleRelatedMainThreadScrollingReasons( |
+ MainThreadScrollingReason::kHasBorderRadius); |
+ needsCompositedScrolling = false; |
+ } |
+ if (layer->layoutObject()->hasClip() || |
+ layer->layoutObject()->hasClipPath() || |
+ layer->hasDescendantWithClipPath() || layer->hasAncestorWithClipPath()) { |
+ addStyleRelatedMainThreadScrollingReasons( |
+ MainThreadScrollingReason::kHasClipRelatedProperty); |
+ needsCompositedScrolling = false; |
+ } |
+ return needsCompositedScrolling; |
} |
void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons( |