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

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

Issue 2593833002: Constrain transform animation direct compositing reason to transforms. (Closed)
Patch Set: Shift tests. 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 22eb51954dd4b16b8abb28a41037359e5c256f8a..4e72e74dbf7a350bd3b5d5f934603e8b763333b5 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -402,15 +402,40 @@ TEST_P(PaintPropertyTreeBuilderTest,
" 0% { transform: translate(1em, 1em) } "
" 100% { transform: translate(2em, 2em) } "
"} "
+ ".animate { "
+ " animation-name: test; "
+ " animation-duration: 1s "
+ "}"
"</style>"
- "<div id='transform'"
- " style='animation-name: test; animation-duration: 1s'>"
- "</div>");
+ "<div id='target' class='animate'></div>");
+ Element* target = document().getElementById("target");
+ const ObjectPaintProperties* properties =
+ target->layoutObject()->paintProperties();
+ EXPECT_TRUE(properties->transform()->hasDirectCompositingReasons());
+}
- Element* transform = document().getElementById("transform");
- const ObjectPaintProperties* transformProperties =
- transform->layoutObject()->paintProperties();
- EXPECT_TRUE(transformProperties->transform()->hasDirectCompositingReasons());
+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>");
+
+ Element* target = document().getElementById("target");
+ const ObjectPaintProperties* properties =
+ target->layoutObject()->paintProperties();
+ EXPECT_EQ(nullptr, properties->transform());
}
TEST_P(PaintPropertyTreeBuilderTest, WillChangeTransform) {

Powered by Google App Engine
This is Rietveld 408576698