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

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

Issue 2736463002: [SPv2] Fix property node invalidation for CSS masks (Closed)
Patch Set: Avoid SVGRoot can of worms 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/PaintPropertyTreeBuilder.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/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index 8a8bc4d852afec0bee93159e2780c164e06af018..60a699f2a23db803f78673ff6f6dd353b1536d3b 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -3306,4 +3306,31 @@ TEST_P(PaintPropertyTreeBuilderTest, MaskInline) {
properties2->localBorderBoxProperties()->effect());
}
+TEST_P(PaintPropertyTreeBuilderTest, MaskClipNodeInvalidation) {
+ // This test verifies the clip node generated for mask's implicit clip
+ // is correctly invalidated when a box resizes.
+ setBodyInnerHTML(
+ "<style>"
+ "#mask {"
+ " width: 100px;"
+ " height:100px;"
+ " -webkit-mask:linear-gradient(red,red);"
+ "}"
+ "</style>"
+ "<div id='mask'>"
+ " <div style='width:500px; height:500px; background:green;'></div>"
+ "</div>");
+ const ObjectPaintProperties* properties = paintPropertiesForElement("mask");
+ const ClipPaintPropertyNode* maskClip = properties->maskClip();
+ EXPECT_EQ(FloatRoundedRect(8, 8, 100, 100), maskClip->clipRect());
+
+ Element* mask = document().getElementById("mask");
+ mask->setAttribute(HTMLNames::styleAttr, "height: 200px");
+ document().view()->updateAllLifecyclePhases();
+
+ ASSERT_EQ(properties, paintPropertiesForElement("mask"));
+ ASSERT_EQ(maskClip, properties->maskClip());
+ EXPECT_EQ(FloatRoundedRect(8, 8, 100, 200), maskClip->clipRect());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698