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

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

Issue 2810503002: Only store previous clip rects for PaintLayers that support subsequences. (Closed)
Patch Set: none Created 3 years, 8 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 08eeaba0fb6e73438cb54db1773155e7a1badc14..34b833947d9badabf4588a8b9401c922092d1b0f 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
@@ -286,6 +286,49 @@ TEST_P(PaintLayerTest, HasNonIsolatedDescendantWithBlendMode) {
EXPECT_TRUE(parent->HasVisibleDescendant());
}
+TEST_P(PaintLayerTest, SubsequenceCachingStackingContexts) {
+ SetBodyInnerHTML(
+ "<div id='parent' style='position:relative'>"
+ " <div id='child1' style='position: relative'>"
+ " <div id='grandchild1' style='position: relative'>"
+ " <div style='position: relative'></div>"
+ " </div>"
+ " </div>"
+ " <div id='child2' style='isolation: isolate'>"
+ " <div style='position: relative'></div>"
+ " </div>"
+ "</div>");
+ PaintLayer* parent = GetPaintLayerByElementId("parent");
+ PaintLayer* child1 = GetPaintLayerByElementId("child1");
+ PaintLayer* child2 = GetPaintLayerByElementId("child2");
+ PaintLayer* grandchild1 = GetPaintLayerByElementId("grandchild1");
+
+ EXPECT_FALSE(parent->SupportsSubsequenceCaching());
+ EXPECT_FALSE(child1->SupportsSubsequenceCaching());
+ EXPECT_TRUE(child2->SupportsSubsequenceCaching());
+ EXPECT_FALSE(grandchild1->SupportsSubsequenceCaching());
+
+ GetDocument()
+ .GetElementById("grandchild1")
+ ->setAttribute(HTMLNames::styleAttr, "isolation: isolate");
+ GetDocument().View()->UpdateAllLifecyclePhases();
+
+ EXPECT_FALSE(parent->SupportsSubsequenceCaching());
+ EXPECT_FALSE(child1->SupportsSubsequenceCaching());
+ EXPECT_TRUE(child2->SupportsSubsequenceCaching());
+ EXPECT_TRUE(grandchild1->SupportsSubsequenceCaching());
+}
+
+TEST_P(PaintLayerTest, SubsequenceCachingSVGRoot) {
+ SetBodyInnerHTML(
+ "<div id='parent' style='position: relative'>"
+ " <svg id='svgroot' style='position: relative'></svg>"
+ "</div>");
+
+ PaintLayer* svgroot = GetPaintLayerByElementId("svgroot");
+ EXPECT_TRUE(svgroot->SupportsSubsequenceCaching());
+}
+
TEST_P(PaintLayerTest, HasDescendantWithClipPath) {
SetBodyInnerHTML(
"<div id='parent' style='position:relative'>"
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698