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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.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/PaintPropertyTreeUpdateTests.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
index ba68026e7d176fafac752a41b441f7e4ec28877e..5357d802da7a6dfaa1ded4719812039820773592 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
@@ -466,4 +466,34 @@ TEST_P(PaintPropertyTreeUpdateTest,
EXPECT_EQ(nullptr, properties->transform());
}
+TEST_P(PaintPropertyTreeUpdateTest,
+ EffectNodeWithAnimationLosesNodeWhenAnimationRemoved) {
+ setBodyInnerHTML(
+ "<style>"
+ "div {"
+ " width: 100px;"
+ " height: 100px;"
+ " background-color: red;"
+ "} "
+ ".animate {"
+ " animation-name: test;"
+ " animation-duration: 4s;"
+ "}"
+ "@keyframes test {"
+ " from { opacity: 0.0;}"
+ " to { opacity: 1.0;}"
+ "}"
+ "</style>"
+ "<div id='target' class='animate'></div>");
+ Element* target = document().getElementById("target");
+ const ObjectPaintProperties* properties =
+ target->layoutObject()->paintProperties();
+ EXPECT_TRUE(properties->effect()->hasDirectCompositingReasons());
+
+ // Removing the animation should remove the effect node.
+ target->removeAttribute(HTMLNames::classAttr);
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(nullptr, properties->effect());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698