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

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

Issue 2580713005: [SPInvalidation] Update paint properties on perspective etc. change (Closed)
Patch Set: Unit 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 c5b5f979fe69e30528d669d964492e8869bcf052..dc88f359c564cb8b8c4fb0683f63177d3075a86c 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -306,8 +306,15 @@ TEST_P(PaintPropertyTreeBuilderTest, FrameScrollingTraditional) {
}
TEST_P(PaintPropertyTreeBuilderTest, Perspective) {
- loadTestData("perspective.html");
-
+ setBodyInnerHTML(
+ "<style>"
+ " #perspective { position: absolute; left: 50px; top: 100px;"
+ " width: 400px; height: 300px; perspective: 100px }"
+ " #inner { transform: translateZ(0); width: 100px; height: 200px; }"
+ "</style>"
+ "<div id='perspective'>"
+ " <div id='inner'></div>"
+ "</div>");
Element* perspective = document().getElementById("perspective");
const ObjectPaintProperties* perspectiveProperties =
perspective->layoutObject()->paintProperties();
@@ -331,6 +338,24 @@ TEST_P(PaintPropertyTreeBuilderTest, Perspective) {
innerProperties->paintOffsetTranslation()->parent());
CHECK_EXACT_VISUAL_RECT(LayoutRect(50, 100, 100, 200), inner->layoutObject(),
document().view()->layoutView());
+
+ perspective->setAttribute(HTMLNames::styleAttr, "perspective: 200px");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(TransformationMatrix().applyPerspective(200),
+ perspectiveProperties->perspective()->matrix());
+ EXPECT_EQ(FloatPoint3D(250, 250, 0),
+ perspectiveProperties->perspective()->origin());
+ EXPECT_EQ(framePreTranslation(),
+ perspectiveProperties->perspective()->parent());
+
+ perspective->setAttribute(HTMLNames::styleAttr, "perspective-origin: 5% 20%");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(TransformationMatrix().applyPerspective(100),
+ perspectiveProperties->perspective()->matrix());
+ EXPECT_EQ(FloatPoint3D(70, 160, 0),
+ perspectiveProperties->perspective()->origin());
+ EXPECT_EQ(framePreTranslation(),
+ perspectiveProperties->perspective()->parent());
}
TEST_P(PaintPropertyTreeBuilderTest, Transform) {

Powered by Google App Engine
This is Rietveld 408576698