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

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

Issue 2596623002: Create compositor animations for effect animations in SPv2. (Closed)
Patch Set: Sync to head and add node removal test. 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
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 4e72e74dbf7a350bd3b5d5f934603e8b763333b5..e4d02a09fb03d1594437a12d2cb2584893191284 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -414,30 +414,44 @@ TEST_P(PaintPropertyTreeBuilderTest,
EXPECT_TRUE(properties->transform()->hasDirectCompositingReasons());
}
+namespace {
+
+const char* kSimpleOpacityExampleHTML =
+ "<style>"
+ "div {"
+ " width: 100px;"
+ " height: 100px;"
+ " background-color: red;"
+ " animation-name: example;"
+ " animation-duration: 4s;"
+ "}"
+ "@keyframes example {"
+ " from { opacity: 0.0;}"
+ " to { opacity: 1.0;}"
+ "}"
+ "</style>"
+ "<div id='target'></div>";
+
+} // namespace
+
TEST_P(PaintPropertyTreeBuilderTest,
OpacityAnimationDoesNotCreateTransformNode) {
- setBodyInnerHTML(
- "<style>"
- "div {"
- " width: 100px;"
- " height: 100px;"
- " background-color: red;"
- " animation-name: example;"
- " animation-duration: 4s;"
- "}"
- "@keyframes example {"
- " from { opacity: 0.0;}"
- " to { opacity: 1.0;}"
- "}"
- "</style>"
- "<div id='target'></div>");
-
+ setBodyInnerHTML(kSimpleOpacityExampleHTML);
Element* target = document().getElementById("target");
const ObjectPaintProperties* properties =
target->layoutObject()->paintProperties();
EXPECT_EQ(nullptr, properties->transform());
}
+TEST_P(PaintPropertyTreeBuilderTest,
+ EffectNodeWithActiveAnimationHasDirectCompositingReason) {
+ setBodyInnerHTML(kSimpleOpacityExampleHTML);
+ Element* target = document().getElementById("target");
+ const ObjectPaintProperties* properties =
+ target->layoutObject()->paintProperties();
+ EXPECT_TRUE(properties->effect()->hasDirectCompositingReasons());
+}
+
TEST_P(PaintPropertyTreeBuilderTest, WillChangeTransform) {
setBodyInnerHTML(
"<style> body { margin: 0 } </style>"

Powered by Google App Engine
This is Rietveld 408576698