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

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

Issue 2787203002: Fix GraphicsLayerUpdater::UpdateContext::compositingContainer() for corner cases (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
index 3341e981fd596ea4b88693315bfe66f40a99fd81..7b0f5bb6c7afcbb9ffabb023ebd933a2b349ded1 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
@@ -516,7 +516,7 @@ TEST_P(PaintLayerTest, PaintInvalidationOnCompositedScroll) {
EXPECT_EQ(LayoutRect(0, 30, 50, 5), content->visualRect());
}
-TEST_P(PaintLayerTest, CompositingContainerFloat) {
+TEST_P(PaintLayerTest, CompositingContainerFloatUnderInline) {
enableCompositing();
setBodyInnerHTML(
"<div id='compositedContainer' style='position: relative;"
@@ -547,6 +547,39 @@ TEST_P(PaintLayerTest, CompositingContainerFloat) {
}
}
+TEST_P(PaintLayerTest, CompositingContainerUnderFloatUnderInline) {
Xianzhu 2017/03/30 22:23:12 This test also passes without any real code change
+ enableCompositing();
+ setBodyInnerHTML(
+ "<div id='compositedContainer' style='position: relative;"
+ " will-change: transform'>"
+ " <div id='containingBlock' style='position: relative; z-index: 0'>"
+ " <div style='backface-visibility: hidden'></div>"
+ " <span id='span'"
+ " style='clip-path: polygon(0px 15px, 0px 54px, 100px 0px)'>"
+ " <div style='float: right'>"
+ " <div id='target' style='position: relative'></div>"
+ " </div>"
+ " </span>"
+ " </div>"
+ "</div>");
+
+ PaintLayer* target =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer();
+ PaintLayer* span =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer();
+ EXPECT_EQ(span, target->compositingContainer());
+ PaintLayer* compositedContainer =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("compositedContainer"))
+ ->layer();
+
+ // enclosingLayerWithCompositedLayerMapping is not needed or applicable to
+ // SPv2.
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ EXPECT_EQ(compositedContainer,
+ target->enclosingLayerWithCompositedLayerMapping(ExcludeSelf));
+ }
+}
+
TEST_P(PaintLayerTest, FloatLayerAndAbsoluteUnderInlineLayer) {
setBodyInnerHTML(
"<div id='container' style='position: absolute; top: 20px; left: 20px'>"

Powered by Google App Engine
This is Rietveld 408576698