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

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

Issue 2640053004: Fix compositingContainer for stacked inlines. (Closed)
Patch Set: none Created 3 years, 11 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/PaintLayer.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/PaintLayerTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
index 8bd2a7bd687307f915d1d077a831997588a2b1da..b792155b6a323f60acb9d739f8748732e51a3287 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
@@ -501,7 +501,8 @@ TEST_P(PaintLayerTest, CompositingContainerFloat) {
" will-change: transform'>"
" <div id='containingBlock' style='position: relative; z-index: 0'>"
" <div style='backface-visibility: hidden'></div>"
- " <span style='clip-path: polygon(0px 15px, 0px 54px, 100px 0px)'>"
+ " <span id='span'"
+ " style='clip-path: polygon(0px 15px, 0px 54px, 100px 0px)'>"
" <div id='target' style='float: right; position: relative'></div>"
" </span>"
" </div>"
@@ -509,6 +510,41 @@ TEST_P(PaintLayerTest, CompositingContainerFloat) {
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, CompositingContainerFloatingIframe) {
+ 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)'>"
+ " <iframe srcdoc='foo' id='target' style='float: right'></iframe>"
+ " </span>"
+ " </div>"
+ "</div>");
+
+ PaintLayer* target =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer();
+
+ // A non-positioned iframe still gets a PaintLayer because PaintLayers are
+ // forced for all LayoutPart objects. However, such PaintLayers are not
+ // stacked.
PaintLayer* containingBlock =
toLayoutBoxModelObject(getLayoutObjectByElementId("containingBlock"))
->layer();
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698