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

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

Issue 2781863005: Account for filter bounds for backgroundRect during PaintLayer painting (Closed)
Patch Set: none Created 3 years, 9 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 b868c3ca60069e9a3632b9fa4d4961be5b4cc3c6..75a9e89124f2e2f87705942d9e79fbf448869b10 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
@@ -482,4 +482,32 @@ TEST_P(PaintLayerClipperTest, CSSClip) {
EXPECT_EQ(LayoutRect(0, 0, 50, 100), foregroundRect.rect());
}
+TEST_P(PaintLayerClipperTest, Filter) {
+ setBodyInnerHTML(
+ "<style>"
+ " * { margin: 0 }"
+ " #target { "
+ " filter: drop-shadow(0 3px 4px #333); overflow: hidden;"
+ " width: 100px; height: 200px;"
+ " }"
+ "</style>"
+ "<div id='target'></div>");
+
+ PaintLayer* target =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer();
+ ClipRectsContext context(target, UncachedClipRects);
+ PaintLayer::GeometryMapperOption option = PaintLayer::DoNotUseGeometryMapper;
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ option = PaintLayer::UseGeometryMapper;
+ LayoutRect infiniteRect(LayoutRect::infiniteIntRect());
+ LayoutRect layerBounds(infiniteRect);
+ ClipRect backgroundRect(infiniteRect);
+ ClipRect foregroundRect(infiniteRect);
+ target->clipper(option).calculateRects(context, infiniteRect, layerBounds,
+ backgroundRect, foregroundRect);
+
+ EXPECT_EQ(LayoutRect(-12, -9, 124, 224), backgroundRect.rect());
+ EXPECT_EQ(LayoutRect(0, 0, 100, 200), foregroundRect.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