Allow zero in rotateFromVector
Aligns to the spec. Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f7c12c831fb8a6ce0d5ec6b31fcf1f708464deaf
Differential Revision: https://phabricator.services.mozilla.com/D36748
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1392722
gecko-commit: cc6fbf8afb48a0e3e3cc9c2db7a91b5906fb0a8b
gecko-integration-branch: central
gecko-reviewers: bzbarsky
diff --git a/css/geometry/DOMMatrix-003.html b/css/geometry/DOMMatrix-003.html
index 2187f3e..094ae99 100644
--- a/css/geometry/DOMMatrix-003.html
+++ b/css/geometry/DOMMatrix-003.html
@@ -204,6 +204,24 @@
},"test rotateFromVector()");
test(function() {
+ var result = initialDOMMatrix().rotateFromVector(0, 1);
+ var expected = initialDOMMatrix().rotate(90);
+ checkDOMMatrix(result, expected);
+ },"test rotateFromVector() with x being zero");
+
+ test(function() {
+ var result = initialDOMMatrix().rotateFromVector(1, 0);
+ var expected = initialDOMMatrix()
+ checkDOMMatrix(result, expected);
+ },"test rotateFromVector() with y being zero");
+
+ test(function() {
+ var result = initialDOMMatrix().rotateFromVector(0, 0);
+ var expected = initialDOMMatrix()
+ checkDOMMatrix(result, expected);
+ },"test rotateFromVector() with two zeros");
+
+ test(function() {
var result = initialDOMMatrix().rotateAxisAngle(3, 3, 3, 120);
var expected = initialDOMMatrix().multiply(getRotationMatrix(3, 3, 3, 120));
checkDOMMatrix(result, expected);