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

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, add a relative length update 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
« 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/PaintPropertyTreeUpdateTests.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
index 726bee4b5afb701d5b63e7099849cc3ce179b80f..4401e5f140a3b696ed9423e4241b498eb3b09ed6 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
@@ -498,4 +498,57 @@ 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());
+}
+
+TEST_P(PaintPropertyTreeUpdateTest, TransformUpdatesOnRelativeLengthChanges) {
+ setBodyInnerHTML(
+ "<style>"
+ " body { margin: 0 }"
+ " #transform {"
+ " transform: translate3d(50%, 50%, 0);"
+ " width: 100px;"
+ " height: 200px;"
+ " }"
+ "</style>"
+ "<div id='transform'></div>");
+
+ auto* transform = document().getElementById("transform");
+ auto* transformObject = transform->layoutObject();
+ EXPECT_EQ(TransformationMatrix().translate3d(50, 100, 0),
+ transformObject->paintProperties()->transform()->matrix());
+
+ transform->setAttribute(HTMLNames::styleAttr, "width: 200px; height: 300px;");
+ document().view()->updateAllLifecyclePhases();
+ EXPECT_EQ(TransformationMatrix().translate3d(100, 150, 0),
+ transformObject->paintProperties()->transform()->matrix());
+}
+
} // namespace blink
« 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