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

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

Issue 2545683002: Move all descendant-dependent flags into the same tree walk. (Closed)
Patch Set: none Created 4 years 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 f06dd39a3603f2865d2cf3113733169bad58f0d2..4e967a7c2a78746a4a97cc0c770f556b83ab0282 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
@@ -112,4 +112,69 @@ TEST_F(PaintLayerTest, NonCompositedScrollingNeedsRepaint) {
document().view()->updateAllLifecyclePhases();
}
+TEST_F(PaintLayerTest, HasNonIsolatedDescendantWithBlendMode) {
+ setBodyInnerHTML(
+ "<div id='stacking-grandparent' style='isolation: isolate'>"
+ " <div id='stacking-parent' style='isolation: isolate'>"
+ " <div id='non-stacking-parent' style='position:relative'>"
+ " <div id='blend-mode' style='mix-blend-mode: overlay'>"
+ " </div>"
+ " </div>"
+ " </div>"
+ "</div>");
+ PaintLayer* stackingGrandparent =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("stacking-grandparent"))
+ ->layer();
+ PaintLayer* stackingParent =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("stacking-parent"))
+ ->layer();
+ PaintLayer* parent =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("non-stacking-parent"))
+ ->layer();
+
+ EXPECT_TRUE(parent->hasNonIsolatedDescendantWithBlendMode());
+ EXPECT_TRUE(stackingParent->hasNonIsolatedDescendantWithBlendMode());
+ EXPECT_FALSE(stackingGrandparent->hasNonIsolatedDescendantWithBlendMode());
+
+ EXPECT_FALSE(parent->hasDescendantWithClipPath());
+ EXPECT_TRUE(parent->hasVisibleDescendant());
+}
+
+TEST_F(PaintLayerTest, HasDescendantWithClipPath) {
+ setBodyInnerHTML(
+ "<div id='parent' style='position:relative'>"
+ " <div id='clip-path' style='clip-path: circle(50px at 0 100px)'>"
+ " </div>"
+ "</div>");
+ PaintLayer* parent =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("parent"))->layer();
+ PaintLayer* clipPath =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("clip-path"))->layer();
+
+ EXPECT_TRUE(parent->hasDescendantWithClipPath());
+ EXPECT_FALSE(clipPath->hasDescendantWithClipPath());
+
+ EXPECT_FALSE(parent->hasNonIsolatedDescendantWithBlendMode());
+ EXPECT_TRUE(parent->hasVisibleDescendant());
+}
+
+TEST_F(PaintLayerTest, HasVisibleDescendant) {
+ enableCompositing();
+ setBodyInnerHTML(
+ "<div id='invisible' style='position:relative'>"
+ " <div id='visible' style='visibility: visible; position: relative'>"
+ " </div>"
+ "</div>");
+ PaintLayer* invisible =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("invisible"))->layer();
+ PaintLayer* visible =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("visible"))->layer();
+
+ EXPECT_TRUE(invisible->hasVisibleDescendant());
+ EXPECT_FALSE(visible->hasVisibleDescendant());
+
+ EXPECT_FALSE(invisible->hasNonIsolatedDescendantWithBlendMode());
+ EXPECT_FALSE(invisible->hasDescendantWithClipPath());
+}
+
} // namespace blink
« 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