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

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

Issue 2428513004: [SPv2] Create effect nodes for CSS filter (Closed)
Patch Set: remove DCHECK(layer) Created 4 years, 2 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/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index bff1b374733f2cd70c5ee32a69a2225c671bd231..b50102f22fbb212c1b9d877fe78e9a6ece926430 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -2860,4 +2860,47 @@ TEST_P(PaintPropertyTreeBuilderTest,
EXPECT_TRUE(
getLayoutObjectByElementId("absolute")->container()->isLayoutBlock());
}
+
+TEST_P(PaintPropertyTreeBuilderTest, SimpleFilter) {
+ setBodyInnerHTML(
+ "<div id='filter' style='filter:opacity(0.5); height:1000px;'>"
+ "</div>");
+ const ObjectPaintProperties* filterProperties =
+ getLayoutObjectByElementId("filter")->paintProperties();
+ EXPECT_TRUE(filterProperties->effect()->parent()->isRoot());
+ EXPECT_EQ(frameScrollTranslation(),
+ filterProperties->effect()->localTransformSpace());
+ EXPECT_EQ(frameContentClip(), filterProperties->effect()->outputClip());
+}
+
+TEST_P(PaintPropertyTreeBuilderTest, FilterReparentClips) {
+ setBodyInnerHTML(
+ "<div id='clip' style='overflow:hidden;'>"
+ " <div id='filter' style='filter:opacity(0.5); height:1000px;'>"
+ " <div id='child' style='position:fixed;'></div>"
+ " </div>"
+ "</div>");
+ const ObjectPaintProperties* clipProperties =
+ getLayoutObjectByElementId("clip")->paintProperties();
+ const ObjectPaintProperties* filterProperties =
+ getLayoutObjectByElementId("filter")->paintProperties();
+ EXPECT_TRUE(filterProperties->effect()->parent()->isRoot());
+ EXPECT_EQ(frameScrollTranslation(),
+ filterProperties->effect()->localTransformSpace());
+ EXPECT_EQ(clipProperties->overflowClip(),
+ filterProperties->effect()->outputClip());
+
+ const ObjectPaintProperties* childProperties =
+ getLayoutObjectByElementId("child")->paintProperties();
+ const PropertyTreeState& childPaintState =
+ childProperties->localBorderBoxProperties()->propertyTreeState;
+ EXPECT_EQ(framePreTranslation(),
+ childProperties->paintOffsetTranslation()->parent());
+ EXPECT_EQ(childProperties->paintOffsetTranslation(),
+ childPaintState.transform());
+ // This will change once we added clip expansion node.
+ EXPECT_EQ(filterProperties->effect()->outputClip(), childPaintState.clip());
+ EXPECT_EQ(filterProperties->effect(), childPaintState.effect());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698