Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
index c0eaf2464ad1ce073a4a366da2c551bb78b58b94..e8298b6a75c22d627e35bf71ece225baed188a53 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
@@ -1490,6 +1490,12 @@ void PaintLayer::appendSingleFragmentIgnoringPagination(PaintLayerFragments& fra |
fragments.append(fragment); |
} |
+bool PaintLayer::shouldFragmentCompositedBounds(const PaintLayer* compositingLayer) const |
+{ |
+ // Composited layers may not be fragmented. |
+ return enclosingPaginationLayer() && !compositingLayer->enclosingPaginationLayer(); |
+} |
+ |
void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLayer* rootLayer, const LayoutRect& dirtyRect, |
ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayScrollbarClipBehavior, ShouldRespectOverflowClipType respectOverflowClip, const LayoutPoint* offsetFromRoot, |
const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) |
@@ -1500,6 +1506,11 @@ void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLay |
return; |
} |
+ if (!shouldFragmentCompositedBounds(rootLayer)) { |
+ appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFromRoot, subPixelAccumulation); |
+ return; |
+ } |
+ |
// Compute our offset within the enclosing pagination layer. |
LayoutPoint offsetWithinPaginatedLayer; |
convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer); |
@@ -2253,7 +2264,7 @@ LayoutRect PaintLayer::boundingBoxForCompositing(const PaintLayer* ancestorLayer |
if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != ancestorLayer || options == MaybeIncludeTransformForAncestorLayer)) |
result = transform()->mapRect(result); |
- if (enclosingPaginationLayer()) { |
+ if (shouldFragmentCompositedBounds(ancestorLayer)) { |
convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result); |
return result; |
} |