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 d5748a61a533ed93610300bda459836bfcd96972..60ed111fef4b4ecd4da4ae61e1126d0338941cd8 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
@@ -1736,6 +1736,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 +1764,28 @@ 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->size().isEmpty()) |
bokan
2017/01/05 14:05:48
It's inconsistent that if the size is empty, we'll
yigu
2017/01/05 14:46:51
Done.
|
+ return false; |
+ 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( |