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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html

Issue 2758153002: calc() should not take Relative unit in transform-function of setMatrixValue() (Closed)
Patch Set: add test case Created 3 years, 9 months 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 | « no previous file | third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html
index b4f837ab6c40e8ecec1662fd473acb23ec555e3c..283d6a077e8091da868476722d618eb62d006248 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-setMatrixValue.html
@@ -215,21 +215,18 @@ test(() => {
assert_matrix_almost_equals(actualMatrix2, expectedMatrix);
}, "DOMMatrix setMatrix(multiple value)");
-// TODO(hs1217.lee) : calc() function take only absolute unit. should be pass this test.
-// but calc() function is not supported not yet.
-// refer to hasRelativeLengths() in TransformBuilder.cpp
-// test(() => {
-// var actualMatrix1 = new DOMMatrix(matrix2d);
-// var actualMatrix2 = new DOMMatrix(matrix3d);
-// var expectedMatrix = new DOMMatrix();
-// actualMatrix1.setMatrixValue("translateX(calc(10px + 1px))");
-// assert_true(actualMatrix1.is2D);
-// actualMatrix2.setMatrixValue("translateX(calc(10px + 1px))");
-// assert_true(actualMatrix2.is2D);
-// expectedMatrix.translateSelf(11, 0)
-// assert_matrix_almost_equals(actualMatrix1, expectedMatrix);
-// assert_matrix_almost_equals(actualMatrix2, expectedMatrix);
-// }, "DOMMatrix setMatrix(multiple value)");
+test(() => {
+ var actualMatrix1 = new DOMMatrix(matrix2d);
+ var actualMatrix2 = new DOMMatrix(matrix3d);
+ var expectedMatrix = new DOMMatrix();
+ actualMatrix1.setMatrixValue("translateX(calc(10px + 1px))");
+ assert_true(actualMatrix1.is2D);
+ actualMatrix2.setMatrixValue("translateX(calc(10px + 1px))");
+ assert_true(actualMatrix2.is2D);
+ expectedMatrix.translateSelf(11, 0)
+ assert_matrix_almost_equals(actualMatrix1, expectedMatrix);
+ assert_matrix_almost_equals(actualMatrix2, expectedMatrix);
+}, "DOMMatrix setMatrix() with calc function");
test(() => {
@@ -284,6 +281,14 @@ test(() => {
actualMatrix.setMatrixValue("translateX(calc(10px + 1em))");
}, "using relative units should throw a SyntaxError");
+ assert_throws(new SyntaxError(), () => {
+ actualMatrix.setMatrixValue("translateX(calc(10px + 1%))");
+ }, "using relative units should throw a SyntaxError");
+
+ assert_throws(new SyntaxError(), () => {
+ actualMatrix.setMatrixValue("translateX(calc(10vw + 1%))");
+ }, "using relative units should throw a SyntaxError");
+
//actualMatrix should be not changed.
assert_true(actualMatrix.is2D);
assert_matrix_almost_equals(actualMatrix, expectedMatrix);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/TransformBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698