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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp

Issue 1427843009: Fix crash about mask layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Real fix of the issue in Patch Set 2 Created 5 years, 1 month 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/layout/compositing/CompositedLayerMapping.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/layout/compositing/CompositedLayerMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
index 34b8fa8e4556bd872886353c19df4007630248cc..0490a8a6afbb8ad3ba708df11d3531821a2dae77 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -208,6 +208,39 @@ TEST_F(CompositedLayerMappingTest, ClippedBigLayer)
EXPECT_TRUE(checkRectsEqual(IntRect(0, 0, 4001, 4001), computeInterestRect(paintLayer->graphicsLayerBacking(), paintLayer->layoutObject())));
}
+TEST_F(CompositedLayerMappingTest, ClippingMaskLayer)
+{
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+ return;
+
+ const AtomicString styleWithoutClipping = "backface-visibility: hidden; width: 200px; height: 200px";
+ const AtomicString styleWithBorderRadius = styleWithoutClipping + "; border-radius: 10px";
+ const AtomicString styleWithClipPath = styleWithoutClipping + "; -webkit-clip-path: inset(10px)";
+
+ setBodyInnerHTML("<video id='video' src='x' style='" + styleWithoutClipping + "'></video>");
+
+ document().view()->updateAllLifecyclePhases();
+ Element* videoElement = document().getElementById("video");
+ GraphicsLayer* graphicsLayer = toLayoutBoxModelObject(videoElement->layoutObject())->layer()->graphicsLayerBacking();
+ EXPECT_FALSE(graphicsLayer->maskLayer());
+ EXPECT_FALSE(graphicsLayer->contentsClippingMaskLayer());
+
+ videoElement->setAttribute(HTMLNames::styleAttr, styleWithBorderRadius);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_FALSE(graphicsLayer->maskLayer());
+ EXPECT_TRUE(graphicsLayer->contentsClippingMaskLayer());
+
+ videoElement->setAttribute(HTMLNames::styleAttr, styleWithClipPath);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_TRUE(graphicsLayer->maskLayer());
+ EXPECT_FALSE(graphicsLayer->contentsClippingMaskLayer());
+
+ videoElement->setAttribute(HTMLNames::styleAttr, styleWithoutClipping);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_FALSE(graphicsLayer->maskLayer());
+ EXPECT_FALSE(graphicsLayer->contentsClippingMaskLayer());
+}
+
TEST_F(CompositedLayerMappingTest, InterestRectChangedEnoughToRepaintEmpty)
{
IntSize layerSize(1000, 1000);
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698