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

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

Issue 2260423002: Implement skew* funtion in DomMatrix & DOMMatrixReadOnly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a typo Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-skew.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-skew.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-skew.html
new file mode 100644
index 0000000000000000000000000000000000000000..ddcb26903166f05612716d9d9ae3b0423869eee7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-skew.html
@@ -0,0 +1,147 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Geometry Interfaces: DOMMatrix skew</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+test(function() {
+ var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
+ matrix2d.skewXSelf();
+ assert_true(matrix2d.is2D);
+ assert_equals(matrix2d.a, 1);
+ assert_equals(matrix2d.b, 2);
+ assert_equals(matrix2d.c, 3);
+ assert_equals(matrix2d.d, 3.1);
+ assert_equals(matrix2d.e, 2);
+ assert_equals(matrix2d.f, 1);
+}, "DOMMatrix skewX() - 2D matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
+ matrix2d.skewXSelf(45);
+ assert_true(matrix2d.is2D);
+ assert_equals(matrix2d.a, 1);
+ assert_equals(matrix2d.b, 2);
+ assert_equals(matrix2d.c, 4);
+ assert_equals(matrix2d.d, 5.1);
+ assert_equals(matrix2d.e, 2);
+ assert_equals(matrix2d.f, 1);
+}, "DOMMatrix skewX(45) - 2D matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]));
+ matrix3d.skewXSelf();
+ assert_false(matrix3d.is2D);
+ assert_equals(matrix3d.m11, 1);
+ assert_equals(matrix3d.m12, 2);
+ assert_equals(matrix3d.m13, 3);
+ assert_equals(matrix3d.m14, 4);
+ assert_equals(matrix3d.m21, 5);
+ assert_equals(matrix3d.m22, 6);
+ assert_equals(matrix3d.m23, 7);
+ assert_equals(matrix3d.m24, 8);
+ assert_equals(matrix3d.m31, 9);
+ assert_equals(matrix3d.m32, 10.1);
+ assert_equals(matrix3d.m33, 11);
+ assert_equals(matrix3d.m34, 12);
+ assert_equals(matrix3d.m41, 13);
+ assert_equals(matrix3d.m42, 14);
+ assert_equals(matrix3d.m43, 15);
+ assert_equals(matrix3d.m44, 16.6);
+}, "DOMMatrix skewX() - 3D matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]));
+ matrix3d.skewXSelf(45);
+ assert_false(matrix3d.is2D);
+ assert_equals(matrix3d.m11, 1);
+ assert_equals(matrix3d.m12, 2);
+ assert_equals(matrix3d.m13, 3);
+ assert_equals(matrix3d.m14, 4);
+ assert_equals(matrix3d.m21, 6);
+ assert_equals(matrix3d.m22, 8);
+ assert_equals(matrix3d.m23, 10);
+ assert_equals(matrix3d.m24, 12);
+ assert_equals(matrix3d.m31, 9);
+ assert_equals(matrix3d.m32, 10.1);
+ assert_equals(matrix3d.m33, 11);
+ assert_equals(matrix3d.m34, 12);
+ assert_equals(matrix3d.m41, 13);
+ assert_equals(matrix3d.m42, 14);
+ assert_equals(matrix3d.m43, 15);
+ assert_equals(matrix3d.m44, 16.6);
+}, "DOMMatrix skewX(45) - 3D matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
+ matrix2d.skewYSelf();
+ assert_true(matrix2d.is2D);
+ assert_equals(matrix2d.a, 1);
+ assert_equals(matrix2d.b, 2);
+ assert_equals(matrix2d.c, 3);
+ assert_equals(matrix2d.d, 3.1);
+ assert_equals(matrix2d.e, 2);
+ assert_equals(matrix2d.f, 1);
+}, "DOMMatrix skewY() - 2D matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([2, 2, 2, 2, 2, 2]));
+ matrix2d.skewYSelf(45);
+ assert_true(matrix2d.is2D);
+ assert_equals(matrix2d.a, 4);
+ assert_equals(matrix2d.b, 4);
+ assert_equals(matrix2d.c, 2);
+ assert_equals(matrix2d.d, 2);
+ assert_equals(matrix2d.e, 2);
+ assert_equals(matrix2d.f, 2);
+}, "DOMMatrix skewY(45) - 2D matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]));
+ matrix3d.skewYSelf();
+ assert_false(matrix3d.is2D);
+ assert_equals(matrix3d.m11, 1);
+ assert_equals(matrix3d.m12, 2);
+ assert_equals(matrix3d.m13, 3);
+ assert_equals(matrix3d.m14, 4);
+ assert_equals(matrix3d.m21, 5);
+ assert_equals(matrix3d.m22, 6);
+ assert_equals(matrix3d.m23, 7);
+ assert_equals(matrix3d.m24, 8);
+ assert_equals(matrix3d.m31, 9);
+ assert_equals(matrix3d.m32, 10.1);
+ assert_equals(matrix3d.m33, 11);
+ assert_equals(matrix3d.m34, 12);
+ assert_equals(matrix3d.m41, 13);
+ assert_equals(matrix3d.m42, 14);
+ assert_equals(matrix3d.m43, 15);
+ assert_equals(matrix3d.m44, 16.6);
+}, "DOMMatrix skewY() - 3D matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]));
+ matrix3d.skewYSelf(45);
+ assert_false(matrix3d.is2D);
+ assert_equals(matrix3d.m11, 2);
+ assert_equals(matrix3d.m12, 2);
+ assert_equals(matrix3d.m13, 2);
+ assert_equals(matrix3d.m14, 2);
+ assert_equals(matrix3d.m21, 1);
+ assert_equals(matrix3d.m22, 1);
+ assert_equals(matrix3d.m23, 1);
+ assert_equals(matrix3d.m24, 1);
+ assert_equals(matrix3d.m31, 1);
+ assert_equals(matrix3d.m32, 1);
+ assert_equals(matrix3d.m33, 1);
+ assert_equals(matrix3d.m34, 1);
+ assert_equals(matrix3d.m41, 1);
+ assert_equals(matrix3d.m42, 1);
+ assert_equals(matrix3d.m43, 1);
+ assert_equals(matrix3d.m44, 1);
+}, "DOMMatrix skewY(45) - 3D matrix");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698