Index: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp |
index 62cd610bfde2b7775e4d80846817e5d5a0884b54..1ca0792fc653084faf2994791a8a483945197c8c 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp |
@@ -512,4 +512,33 @@ TEST_P(PaintLayerClipperTest, Filter) { |
EXPECT_EQ(LayoutRect(0, 0, 100, 200), foreground_rect.Rect()); |
} |
+TEST_P(PaintLayerClipperTest, CalculateBackgroundClipRectRoot) { |
+ SetBodyInnerHTML( |
+ "<style>" |
+ " * { margin: 0 }" |
+ " #target { " |
+ " position: relative; " |
+ " overflow: hidden;" |
+ " width: 100px; height: 200px;" |
+ " }" |
+ "</style>" |
+ "<div id='target'></div>"); |
+ |
+ PaintLayer* target = |
+ ToLayoutBoxModelObject(GetLayoutObjectByElementId("target"))->Layer(); |
+ ClipRectsContext context(target, kUncachedClipRects); |
+ PaintLayer::GeometryMapperOption option = PaintLayer::kDoNotUseGeometryMapper; |
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
+ option = PaintLayer::kUseGeometryMapper; |
+ ClipRect output; |
+ |
+ target->Clipper(option).CalculateBackgroundClipRect(context, output); |
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
+ EXPECT_EQ(LayoutRect(FloatRect(LayoutRect::InfiniteIntRect())), |
+ output.Rect()); |
+ } else { |
+ EXPECT_EQ(LayoutRect(LayoutRect::InfiniteIntRect()), output.Rect()); |
+ } |
+} |
+ |
} // namespace blink |