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

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

Issue 2602453002: Update perspective paint properties on perspective-origin changes (Closed)
Patch Set: Update comment 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 726bee4b5afb701d5b63e7099849cc3ce179b80f..dc2641caa86b4ae67396db6e30c161c9c661d23b 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
@@ -498,4 +498,34 @@ TEST_P(PaintPropertyTreeUpdateTest,
EXPECT_EQ(nullptr, properties->effect());
}
+TEST_P(PaintPropertyTreeUpdateTest, PerspectiveOriginUpdatesOnSizeChanges) {
+ setBodyInnerHTML(
+ "<style>"
+ " body { margin: 0 }"
+ " #perspective {"
+ " position: absolute;"
+ " perspective: 100px;"
+ " width: 100px;"
+ " perspective-origin: 50% 50% 0;"
+ " }"
+ "</style>"
+ "<div id='perspective'>"
+ " <div id='contents'></div>"
+ "</div>");
+
+ auto* perspective = document().getElementById("perspective")->layoutObject();
+ EXPECT_EQ(TransformationMatrix().applyPerspective(100),
+ perspective->paintProperties()->perspective()->matrix());
+ EXPECT_EQ(FloatPoint3D(50, 0, 0),
+ perspective->paintProperties()->perspective()->origin());
+
+ auto* contents = document().getElementById("contents");
+ contents->setAttribute(HTMLNames::styleAttr, "height: 200px;");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(TransformationMatrix().applyPerspective(100),
+ perspective->paintProperties()->perspective()->matrix());
+ EXPECT_EQ(FloatPoint3D(50, 100, 0),
+ perspective->paintProperties()->perspective()->origin());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698