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

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

Issue 2604973002: Move computation of 3D descendants to the descendant-dependent flags walk. (Closed)
Patch Set: none 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10952bab3ae53cfdca33cc675723a82626873dbc..808575bb52fd7126e3acb80ec4d4cd9db0f78e55 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -360,6 +360,7 @@ TEST_P(PaintPropertyTreeBuilderTest, Transform) {
Element* transform = document().getElementById("transform");
const ObjectPaintProperties* transformProperties =
transform->layoutObject()->paintProperties();
+
EXPECT_EQ(TransformationMatrix().translate3d(123, 456, 789),
transformProperties->transform()->matrix());
EXPECT_EQ(FloatPoint3D(200, 150, 0),
@@ -394,6 +395,43 @@ TEST_P(PaintPropertyTreeBuilderTest, Transform) {
transform->layoutObject()->paintProperties()->transform()->matrix());
}
+TEST_P(PaintPropertyTreeBuilderTest, Preserve3D3DTransformedDescendant) {
+ setBodyInnerHTML(
+ "<style> body { margin: 0 } </style>"
+ "<div id='preserve' style='transform-style: preserve-3d'>"
+ "<div id='transform' style='margin-left: 50px; margin-top: 100px;"
+ " width: 400px; height: 300px;"
+ " transform: translate3d(123px, 456px, 789px)'>"
+ "</div>"
+ "</div>");
+
+ Element* preserve = document().getElementById("preserve");
+ const ObjectPaintProperties* preserveProperties =
+ preserve->layoutObject()->paintProperties();
+
+ EXPECT_TRUE(preserveProperties->transform());
+ EXPECT_TRUE(preserveProperties->transform()->hasDirectCompositingReasons());
+}
+
+TEST_P(PaintPropertyTreeBuilderTest, Perspective3DTransformedDescendant) {
+ setBodyInnerHTML(
+ "<style> body { margin: 0 } </style>"
+ "<div id='perspective' style='perspective: 800px;'>"
+ "<div id='transform' style='margin-left: 50px; margin-top: 100px;"
+ " width: 400px; height: 300px;"
+ " transform: translate3d(123px, 456px, 789px)'>"
+ "</div>"
+ "</div>");
+
+ Element* perspective = document().getElementById("perspective");
+ const ObjectPaintProperties* perspectiveProperties =
+ perspective->layoutObject()->paintProperties();
+
+ EXPECT_TRUE(perspectiveProperties->transform());
+ EXPECT_TRUE(
+ perspectiveProperties->transform()->hasDirectCompositingReasons());
+}
+
TEST_P(PaintPropertyTreeBuilderTest,
TransformNodeWithActiveAnimationHasDirectCompositingReason) {
setBodyInnerHTML(
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698