Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp

Issue 2828323003: Stop clipping to visual rect bounds in PLC::CalculateBackgroundClipRect (Closed)
Patch Set: none Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698