Bug 1397945: Align DOMMatrix scale* operations to the spec r=bzbarsky
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Fri, 28 Jun 2019 15:11:00 +0000
changeset 543566 5084ca5c7896332f3369f7a0bcfa5e04b46c5efc
parent 543565 bce5cc410b16b42881af1b0ad80eb8aa3518677a
child 543567 adc59d50adf815ad6764ff235f833a5ba74291b6
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1397945
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397945: Align DOMMatrix scale* operations to the spec r=bzbarsky Adjusted scale() to receive six arguments, scale3d() to allow zero argument, and scaleNonUniform to support only two arguments. Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e6484802f1961c7fe881b4d1d7f4309ec19110a7 Differential Revision: https://phabricator.services.mozilla.com/D36147
dom/base/DOMMatrix.cpp
dom/base/DOMMatrix.h
dom/base/WebKitCSSMatrix.cpp
dom/base/WebKitCSSMatrix.h
dom/tests/mochitest/general/test_WebKitCSSMatrix.html
dom/webidl/DOMMatrix.webidl
dom/webidl/WebKitCSSMatrix.webidl
testing/web-platform/meta/css/geometry/DOMMatrix-003.html.ini
testing/web-platform/meta/css/geometry/DOMMatrix-newobject.html.ini
testing/web-platform/meta/css/geometry/historical.html.ini
testing/web-platform/meta/css/geometry/interfaces.html.ini
testing/web-platform/meta/css/geometry/interfaces.worker.js.ini
testing/web-platform/tests/css/geometry/DOMMatrix-003.html
--- a/dom/base/DOMMatrix.cpp
+++ b/dom/base/DOMMatrix.cpp
@@ -214,41 +214,39 @@ already_AddRefed<DOMMatrixReadOnly> DOMM
 already_AddRefed<DOMMatrix> DOMMatrixReadOnly::Translate(double aTx, double aTy,
                                                          double aTz) const {
   RefPtr<DOMMatrix> retval = new DOMMatrix(mParent, *this);
   retval->TranslateSelf(aTx, aTy, aTz);
 
   return retval.forget();
 }
 
-already_AddRefed<DOMMatrix> DOMMatrixReadOnly::Scale(double aScale,
-                                                     double aOriginX,
-                                                     double aOriginY) const {
+already_AddRefed<DOMMatrix> DOMMatrixReadOnly::Scale(
+    double aScaleX, const Optional<double>& aScaleY, double aScaleZ,
+    double aOriginX, double aOriginY, double aOriginZ) const {
   RefPtr<DOMMatrix> retval = new DOMMatrix(mParent, *this);
-  retval->ScaleSelf(aScale, aOriginX, aOriginY);
+  retval->ScaleSelf(aScaleX, aScaleY, aScaleZ, aOriginX, aOriginY, aOriginZ);
 
   return retval.forget();
 }
 
 already_AddRefed<DOMMatrix> DOMMatrixReadOnly::Scale3d(double aScale,
                                                        double aOriginX,
                                                        double aOriginY,
                                                        double aOriginZ) const {
   RefPtr<DOMMatrix> retval = new DOMMatrix(mParent, *this);
   retval->Scale3dSelf(aScale, aOriginX, aOriginY, aOriginZ);
 
   return retval.forget();
 }
 
 already_AddRefed<DOMMatrix> DOMMatrixReadOnly::ScaleNonUniform(
-    double aScaleX, double aScaleY, double aScaleZ, double aOriginX,
-    double aOriginY, double aOriginZ) const {
+    double aScaleX, double aScaleY) const {
   RefPtr<DOMMatrix> retval = new DOMMatrix(mParent, *this);
-  retval->ScaleNonUniformSelf(aScaleX, aScaleY, aScaleZ, aOriginX, aOriginY,
-                              aOriginZ);
+  retval->ScaleSelf(aScaleX, Optional<double>(aScaleY), 1, 0, 0, 0);
 
   return retval.forget();
 }
 
 already_AddRefed<DOMMatrix> DOMMatrixReadOnly::Rotate(double aAngle,
                                                       double aOriginX,
                                                       double aOriginY) const {
   RefPtr<DOMMatrix> retval = new DOMMatrix(mParent, *this);
@@ -770,54 +768,55 @@ DOMMatrix* DOMMatrix::TranslateSelf(doub
     mMatrix3D->PreTranslate(aTx, aTy, aTz);
   } else {
     mMatrix2D->PreTranslate(aTx, aTy);
   }
 
   return this;
 }
 
-DOMMatrix* DOMMatrix::ScaleSelf(double aScale, double aOriginX,
-                                double aOriginY) {
-  ScaleNonUniformSelf(aScale, aScale, 1.0, aOriginX, aOriginY, 0);
+DOMMatrix* DOMMatrix::ScaleSelf(double aScaleX, const Optional<double>& aScaleY,
+                                double aScaleZ, double aOriginX,
+                                double aOriginY, double aOriginZ) {
+  const double scaleY = aScaleY.WasPassed() ? aScaleY.Value() : aScaleX;
+
+  TranslateSelf(aOriginX, aOriginY, aOriginZ);
+
+  if (mMatrix3D || aScaleZ != 1.0) {
+    Ensure3DMatrix();
+    gfx::Matrix4x4Double m;
+    m._11 = aScaleX;
+    m._22 = scaleY;
+    m._33 = aScaleZ;
+    *mMatrix3D = m * *mMatrix3D;
+  } else {
+    gfx::MatrixDouble m;
+    m._11 = aScaleX;
+    m._22 = scaleY;
+    *mMatrix2D = m * *mMatrix2D;
+  }
+
+  TranslateSelf(-aOriginX, -aOriginY, -aOriginZ);
 
   return this;
 }
 
 DOMMatrix* DOMMatrix::Scale3dSelf(double aScale, double aOriginX,
                                   double aOriginY, double aOriginZ) {
-  ScaleNonUniformSelf(aScale, aScale, aScale, aOriginX, aOriginY, aOriginZ);
+  ScaleSelf(aScale, Optional<double>(aScale), aScale, aOriginX, aOriginY,
+            aOriginZ);
 
   return this;
 }
 
 DOMMatrix* DOMMatrix::ScaleNonUniformSelf(double aScaleX, double aScaleY,
                                           double aScaleZ, double aOriginX,
                                           double aOriginY, double aOriginZ) {
-  if (aScaleX == 1.0 && aScaleY == 1.0 && aScaleZ == 1.0) {
-    return this;
-  }
-
-  TranslateSelf(aOriginX, aOriginY, aOriginZ);
-
-  if (mMatrix3D || aScaleZ != 1.0 || aOriginZ != 0) {
-    Ensure3DMatrix();
-    gfx::Matrix4x4Double m;
-    m._11 = aScaleX;
-    m._22 = aScaleY;
-    m._33 = aScaleZ;
-    *mMatrix3D = m * *mMatrix3D;
-  } else {
-    gfx::MatrixDouble m;
-    m._11 = aScaleX;
-    m._22 = aScaleY;
-    *mMatrix2D = m * *mMatrix2D;
-  }
-
-  TranslateSelf(-aOriginX, -aOriginY, -aOriginZ);
+  ScaleSelf(aScaleX, Optional<double>(aScaleY), aScaleZ, aOriginX, aOriginY,
+            aOriginZ);
 
   return this;
 }
 
 DOMMatrix* DOMMatrix::RotateFromVectorSelf(double aX, double aY) {
   if (aX == 0.0 || aY == 0.0) {
     return this;
   }
--- a/dom/base/DOMMatrix.h
+++ b/dom/base/DOMMatrix.h
@@ -157,24 +157,25 @@ class DOMMatrixReadOnly : public nsWrapp
   ; // semi-colon here to get clang-format to align properly from here on
 
 #undef Set2DMatrixMember
 #undef Set3DMatrixMember
   // clang-format on
 
   already_AddRefed<DOMMatrix> Translate(double aTx, double aTy,
                                         double aTz = 0) const;
-  already_AddRefed<DOMMatrix> Scale(double aScale, double aOriginX = 0,
-                                    double aOriginY = 0) const;
+  already_AddRefed<DOMMatrix> Scale(double aScaleX,
+                                    const Optional<double>& aScaleY,
+                                    double aScaleZ, double aOriginX,
+                                    double aOriginY, double aOriginZ) const;
   already_AddRefed<DOMMatrix> Scale3d(double aScale, double aOriginX = 0,
                                       double aOriginY = 0,
                                       double aOriginZ = 0) const;
-  already_AddRefed<DOMMatrix> ScaleNonUniform(
-      double aScaleX, double aScaleY = 1.0, double aScaleZ = 1.0,
-      double aOriginX = 0, double aOriginY = 0, double aOriginZ = 0) const;
+  already_AddRefed<DOMMatrix> ScaleNonUniform(double aScaleX,
+                                              double aScaleY) const;
   already_AddRefed<DOMMatrix> Rotate(double aAngle, double aOriginX = 0,
                                      double aOriginY = 0) const;
   already_AddRefed<DOMMatrix> RotateFromVector(double aX, double aY) const;
   already_AddRefed<DOMMatrix> RotateAxisAngle(double aX, double aY, double aZ,
                                               double aAngle) const;
   already_AddRefed<DOMMatrix> SkewX(double aSx) const;
   already_AddRefed<DOMMatrix> SkewY(double aSy) const;
   already_AddRefed<DOMMatrix> Multiply(const DOMMatrixInit& aOther,
@@ -270,17 +271,19 @@ class DOMMatrix : public DOMMatrixReadOn
       JSStructuredCloneReader* aReader);
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
   DOMMatrix* MultiplySelf(const DOMMatrixInit& aOther, ErrorResult& aRv);
   DOMMatrix* PreMultiplySelf(const DOMMatrixInit& aOther, ErrorResult& aRv);
   DOMMatrix* TranslateSelf(double aTx, double aTy, double aTz = 0);
-  DOMMatrix* ScaleSelf(double aScale, double aOriginX = 0, double aOriginY = 0);
+  DOMMatrix* ScaleSelf(double aScaleX, const Optional<double>& aScaleY,
+                       double aScaleZ, double aOriginX, double aOriginY,
+                       double aOriginZ);
   DOMMatrix* Scale3dSelf(double aScale, double aOriginX = 0,
                          double aOriginY = 0, double aOriginZ = 0);
   DOMMatrix* ScaleNonUniformSelf(double aScaleX, double aScaleY = 1,
                                  double aScaleZ = 1, double aOriginX = 0,
                                  double aOriginY = 0, double aOriginZ = 0);
   DOMMatrix* RotateSelf(double aAngle, double aOriginX = 0,
                         double aOriginY = 0);
   DOMMatrix* RotateFromVectorSelf(double aX, double aY);
--- a/dom/base/WebKitCSSMatrix.cpp
+++ b/dom/base/WebKitCSSMatrix.cpp
@@ -91,28 +91,16 @@ already_AddRefed<WebKitCSSMatrix> WebKit
                                                              double aTy,
                                                              double aTz) const {
   RefPtr<WebKitCSSMatrix> retval = new WebKitCSSMatrix(mParent, *this);
   retval->TranslateSelf(aTx, aTy, aTz);
 
   return retval.forget();
 }
 
-already_AddRefed<WebKitCSSMatrix> WebKitCSSMatrix::Scale(
-    double aScaleX, const Optional<double>& aScaleY, double aScaleZ) const {
-  double scaleX = aScaleX;
-  double scaleY = aScaleY.WasPassed() ? aScaleY.Value() : scaleX;
-  double scaleZ = aScaleZ;
-
-  RefPtr<WebKitCSSMatrix> retval = new WebKitCSSMatrix(mParent, *this);
-  retval->ScaleNonUniformSelf(scaleX, scaleY, scaleZ);
-
-  return retval.forget();
-}
-
 already_AddRefed<WebKitCSSMatrix> WebKitCSSMatrix::Rotate(
     double aRotX, const Optional<double>& aRotY,
     const Optional<double>& aRotZ) const {
   double rotX = aRotX;
   double rotY;
   double rotZ;
 
   if (!aRotY.WasPassed() && !aRotZ.WasPassed()) {
--- a/dom/base/WebKitCSSMatrix.h
+++ b/dom/base/WebKitCSSMatrix.h
@@ -37,19 +37,16 @@ class WebKitCSSMatrix final : public DOM
   WebKitCSSMatrix* SetMatrixValue(const nsAString& aTransformList,
                                   ErrorResult& aRv);
 
   already_AddRefed<WebKitCSSMatrix> Multiply(const DOMMatrixInit& aOtherInit,
                                              ErrorResult& aRv) const;
   already_AddRefed<WebKitCSSMatrix> Inverse(ErrorResult& aRv) const;
   already_AddRefed<WebKitCSSMatrix> Translate(double aTx, double aTy,
                                               double aTz) const;
-  already_AddRefed<WebKitCSSMatrix> Scale(double aScaleX,
-                                          const Optional<double>& aScaleY,
-                                          double aScaleZ) const;
   already_AddRefed<WebKitCSSMatrix> Rotate(double aRotX,
                                            const Optional<double>& aRotY,
                                            const Optional<double>& aRotZ) const;
   already_AddRefed<WebKitCSSMatrix> RotateAxisAngle(double aX, double aY,
                                                     double aZ,
                                                     double aAngle) const;
   already_AddRefed<WebKitCSSMatrix> SkewX(double aSx) const;
   already_AddRefed<WebKitCSSMatrix> SkewY(double aSy) const;
--- a/dom/tests/mochitest/general/test_WebKitCSSMatrix.html
+++ b/dom/tests/mochitest/general/test_WebKitCSSMatrix.html
@@ -133,77 +133,77 @@ test(function() {
 }, "Test inverse.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
   var m3 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
 
   var m1r = m1.scale(2);
-  var m2r = m2.scaleNonUniform(2, 2, 1);
+  var m2r = m2.scale(2, 2, 1);
 
   assert_true(RoughCompareMatrix(m1r, m2r), "scale should return the same result as DOMMatrixReadOnly.");
   assert_true(CompareMatrix(m1, m3), "scale should not mutate original matrix.");
 }, "Test scale with 1 argument.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
   var m3 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
 
   var m1r = m1.scale(2, 3);
-  var m2r = m2.scaleNonUniform(2, 3, 1);
+  var m2r = m2.scale(2, 3, 1);
 
   assert_true(RoughCompareMatrix(m1r, m2r), "scale should return the same result as DOMMatrixReadOnly.");
   assert_true(CompareMatrix(m1, m3), "scale should not mutate original matrix.");
 }, "Test scale with 2 arguments.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
   var m3 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
 
   var m1r = m1.scale(2, 3, 4);
-  var m2r = m2.scaleNonUniform(2, 3, 4);
+  var m2r = m2.scale(2, 3, 4);
 
   assert_true(RoughCompareMatrix(m1r, m2r), "scale should return the same result as DOMMatrixReadOnly.");
   assert_true(CompareMatrix(m1, m3), "scale should not mutate original matrix.");
 }, "Test scale with 3 arguments.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
   var m3 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
 
   var m1r = m1.scale(undefined, 3, 4);
-  var m2r = m2.scaleNonUniform(1, 3, 4);
+  var m2r = m2.scale(1, 3, 4);
 
   assert_true(RoughCompareMatrix(m1r, m2r), "scale should return the same result as DOMMatrixReadOnly.");
   assert_true(CompareMatrix(m1, m3), "scale should not mutate original matrix.");
 }, "Test scale with undefined scaleX argument.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
   var m3 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
 
   var m1r = m1.scale(2, undefined, 4);
-  var m2r = m2.scaleNonUniform(2, 2, 4);
+  var m2r = m2.scale(2, 2, 4);
 
   assert_true(RoughCompareMatrix(m1r, m2r), "scale should return the same result as DOMMatrixReadOnly.");
   assert_true(CompareMatrix(m1, m3), "scale should not mutate original matrix.");
 }, "Test scale with undefined scaleY argument.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
   var m3 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
 
   var m1r = m1.scale(2, 3, undefined);
-  var m2r = m2.scaleNonUniform(2, 3, 1);
+  var m2r = m2.scale(2, 3, 1);
 
   assert_true(RoughCompareMatrix(m1r, m2r), "scale should return the same result as DOMMatrixReadOnly.");
   assert_true(CompareMatrix(m1, m3), "scale should not mutate original matrix.");
 }, "Test scale with undefined scaleZ argument.");
 
 test(function() {
   var m1 = new WebKitCSSMatrix("matrix(1,2,3,4,5,6)");
   var m2 = new DOMMatrix("matrix(1,2,3,4,5,6)");
--- a/dom/webidl/DOMMatrix.webidl
+++ b/dom/webidl/DOMMatrix.webidl
@@ -41,29 +41,28 @@ interface DOMMatrixReadOnly {
     readonly attribute unrestricted double m42;
     readonly attribute unrestricted double m43;
     readonly attribute unrestricted double m44;
 
     // Immutable transform methods
     DOMMatrix translate(optional unrestricted double tx = 0,
                         optional unrestricted double ty = 0,
                         optional unrestricted double tz = 0);
-    DOMMatrix scale(unrestricted double scale,
-                    optional unrestricted double originX = 0,
-                    optional unrestricted double originY = 0);
-    DOMMatrix scale3d(unrestricted double scale,
+    [NewObject] DOMMatrix scale(optional unrestricted double scaleX = 1,
+                                optional unrestricted double scaleY,
+                                optional unrestricted double scaleZ = 1,
+                                optional unrestricted double originX = 0,
+                                optional unrestricted double originY = 0,
+                                optional unrestricted double originZ = 0);
+    [NewObject] DOMMatrix scaleNonUniform(optional unrestricted double scaleX = 1,
+                                          optional unrestricted double scaleY = 1);
+    DOMMatrix scale3d(optional unrestricted double scale = 1,
                       optional unrestricted double originX = 0,
                       optional unrestricted double originY = 0,
                       optional unrestricted double originZ = 0);
-    DOMMatrix scaleNonUniform(unrestricted double scaleX,
-                              optional unrestricted double scaleY = 1,
-                              optional unrestricted double scaleZ = 1,
-                              optional unrestricted double originX = 0,
-                              optional unrestricted double originY = 0,
-                              optional unrestricted double originZ = 0);
     DOMMatrix rotate(unrestricted double angle,
                      optional unrestricted double originX = 0,
                      optional unrestricted double originY = 0);
     DOMMatrix rotateFromVector(unrestricted double x,
                                unrestricted double y);
     DOMMatrix rotateAxisAngle(unrestricted double x,
                               unrestricted double y,
                               unrestricted double z,
@@ -123,20 +122,23 @@ interface DOMMatrix : DOMMatrixReadOnly 
     inherit attribute unrestricted double m44;
 
     // Mutable transform methods
     [Throws] DOMMatrix multiplySelf(optional DOMMatrixInit other);
     [Throws] DOMMatrix preMultiplySelf(optional DOMMatrixInit other);
     DOMMatrix translateSelf(optional unrestricted double tx = 0,
                             optional unrestricted double ty = 0,
                             optional unrestricted double tz = 0);
-    DOMMatrix scaleSelf(unrestricted double scale,
+    DOMMatrix scaleSelf(optional unrestricted double scaleX = 1,
+                        optional unrestricted double scaleY,
+                        optional unrestricted double scaleZ = 1,
                         optional unrestricted double originX = 0,
-                        optional unrestricted double originY = 0);
-    DOMMatrix scale3dSelf(unrestricted double scale,
+                        optional unrestricted double originY = 0,
+                        optional unrestricted double originZ = 0);
+    DOMMatrix scale3dSelf(optional unrestricted double scale = 1,
                           optional unrestricted double originX = 0,
                           optional unrestricted double originY = 0,
                           optional unrestricted double originZ = 0);
     DOMMatrix scaleNonUniformSelf(unrestricted double scaleX,
                                   optional unrestricted double scaleY = 1,
                                   optional unrestricted double scaleZ = 1,
                                   optional unrestricted double originX = 0,
                                   optional unrestricted double originY = 0,
--- a/dom/webidl/WebKitCSSMatrix.webidl
+++ b/dom/webidl/WebKitCSSMatrix.webidl
@@ -20,19 +20,16 @@ interface WebKitCSSMatrix : DOMMatrix {
     // Immutable transform methods
     [Throws]
     WebKitCSSMatrix multiply(optional DOMMatrixInit other);
     [Throws]
     WebKitCSSMatrix inverse();
     WebKitCSSMatrix translate(optional unrestricted double tx = 0,
                               optional unrestricted double ty = 0,
                               optional unrestricted double tz = 0);
-    WebKitCSSMatrix scale(optional unrestricted double scaleX = 1,
-                          optional unrestricted double scaleY,
-                          optional unrestricted double scaleZ = 1);
     WebKitCSSMatrix rotate(optional unrestricted double rotX = 0,
                            optional unrestricted double rotY,
                            optional unrestricted double rotZ);
     WebKitCSSMatrix rotateAxisAngle(optional unrestricted double x = 0,
                                     optional unrestricted double y = 0,
                                     optional unrestricted double z = 0,
                                     optional unrestricted double angle = 0);
     WebKitCSSMatrix skewX(optional unrestricted double sx = 0);
--- a/testing/web-platform/meta/css/geometry/DOMMatrix-003.html.ini
+++ b/testing/web-platform/meta/css/geometry/DOMMatrix-003.html.ini
@@ -1,22 +1,3 @@
 [DOMMatrix-003.html]
-  [test scale() without offsets]
-    expected: FAIL
-
-  [test scale() with offsets]
-    expected: FAIL
-
-  [test scale3d()]
-    expected: FAIL
-
   [test rotate()]
-    expected: FAIL
-
-  [test scaleNonUniform()]
-    expected: FAIL
-
-  [test scaleNonUniform() with sx]
-    expected: FAIL
-
-  [test scaleNonUniform() with sx, sy]
-    expected: FAIL
-
+    expected: FAIL
\ No newline at end of file
--- a/testing/web-platform/meta/css/geometry/DOMMatrix-newobject.html.ini
+++ b/testing/web-platform/meta/css/geometry/DOMMatrix-newobject.html.ini
@@ -1,30 +1,18 @@
 [DOMMatrix-newobject.html]
-  [DOMMatrix scale]
-    expected: FAIL
-
-  [DOMMatrix scale3d]
-    expected: FAIL
-
   [DOMMatrix rotate]
     expected: FAIL
 
   [DOMMatrix rotateFromVector]
     expected: FAIL
 
   [DOMMatrix rotateAxisAngle]
     expected: FAIL
 
-  [DOMMatrixReadOnly scale]
-    expected: FAIL
-
-  [DOMMatrixReadOnly scale3d]
-    expected: FAIL
-
   [DOMMatrixReadOnly rotate]
     expected: FAIL
 
   [DOMMatrixReadOnly rotateFromVector]
     expected: FAIL
 
   [DOMMatrixReadOnly rotateAxisAngle]
     expected: FAIL
--- a/testing/web-platform/meta/css/geometry/historical.html.ini
+++ b/testing/web-platform/meta/css/geometry/historical.html.ini
@@ -1,30 +1,18 @@
 [historical.html]
   [DOMMatrix scaleNonUniformSelf must be nuked]
     expected: FAIL
 
-  [DOMMatrixReadOnly scale number of required arguments]
-    expected: FAIL
-
-  [DOMMatrix scaleSelf number of required arguments]
-    expected: FAIL
-
-  [DOMMatrixReadOnly scale3d number of required arguments]
-    expected: FAIL
-
   [DOMMatrixReadOnly rotateFromVector number of required arguments]
     expected: FAIL
 
   [DOMMatrixReadOnly rotateAxisAngle number of required arguments]
     expected: FAIL
 
-  [DOMMatrix scale3dSelf number of required arguments]
-    expected: FAIL
-
   [DOMMatrix rotateFromVectorSelf number of required arguments]
     expected: FAIL
 
   [DOMMatrix rotateAxisAngleSelf number of required arguments]
     expected: FAIL
 
   [DOMPointReadOnly matrixTransform number of required arguments]
     expected: FAIL
--- a/testing/web-platform/meta/css/geometry/interfaces.html.ini
+++ b/testing/web-platform/meta/css/geometry/interfaces.html.ini
@@ -48,25 +48,16 @@
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation fromFloat32Array(Float32Array)]
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation fromFloat64Array(Float64Array)]
     expected: FAIL
 
-  [DOMMatrixReadOnly interface: operation scale(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
-  [DOMMatrixReadOnly interface: operation scaleNonUniform(unrestricted double, unrestricted double)]
-    expected: FAIL
-
-  [DOMMatrixReadOnly interface: operation scale3d(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
   [DOMMatrixReadOnly interface: operation rotate(unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation rotateFromVector(unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation rotateAxisAngle(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
@@ -81,22 +72,16 @@
     expected: FAIL
 
   [DOMMatrix interface: operation fromFloat32Array(Float32Array)]
     expected: FAIL
 
   [DOMMatrix interface: operation fromFloat64Array(Float64Array)]
     expected: FAIL
 
-  [DOMMatrix interface: operation scaleSelf(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
-  [DOMMatrix interface: operation scale3dSelf(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
   [DOMMatrix interface: operation rotateSelf(unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrix interface: operation rotateFromVectorSelf(unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrix interface: operation rotateAxisAngleSelf(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
--- a/testing/web-platform/meta/css/geometry/interfaces.worker.js.ini
+++ b/testing/web-platform/meta/css/geometry/interfaces.worker.js.ini
@@ -42,25 +42,16 @@
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation fromFloat32Array(Float32Array)]
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation fromFloat64Array(Float64Array)]
     expected: FAIL
 
-  [DOMMatrixReadOnly interface: operation scale(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
-  [DOMMatrixReadOnly interface: operation scaleNonUniform(unrestricted double, unrestricted double)]
-    expected: FAIL
-
-  [DOMMatrixReadOnly interface: operation scale3d(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
   [DOMMatrixReadOnly interface: operation rotate(unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation rotateFromVector(unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrixReadOnly interface: operation rotateAxisAngle(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
@@ -72,22 +63,16 @@
     expected: FAIL
 
   [DOMMatrix interface: operation fromFloat32Array(Float32Array)]
     expected: FAIL
 
   [DOMMatrix interface: operation fromFloat64Array(Float64Array)]
     expected: FAIL
 
-  [DOMMatrix interface: operation scaleSelf(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
-  [DOMMatrix interface: operation scale3dSelf(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
-    expected: FAIL
-
   [DOMMatrix interface: operation rotateSelf(unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrix interface: operation rotateFromVectorSelf(unrestricted double, unrestricted double)]
     expected: FAIL
 
   [DOMMatrix interface: operation rotateAxisAngleSelf(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
     expected: FAIL
--- a/testing/web-platform/tests/css/geometry/DOMMatrix-003.html
+++ b/testing/web-platform/tests/css/geometry/DOMMatrix-003.html
@@ -135,16 +135,23 @@
           var expected = initialDOMMatrix()
                           .translate(11, 7, 13)
                           .scale(2, 5, 3)
                           .translate(-11, -7, -13);
           checkDOMMatrix(result, expected);
         },"test scale() with offsets");
 
         test(function() {
+          var result = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6])
+                          .scale(1, 1, 1, 1, 1, 1);
+          var expected = new DOMMatrixReadOnly([1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1]);
+          checkDOMMatrix(result, expected);
+        },"test scale() with identity scale and nonzero originZ");
+
+        test(function() {
           var result = initialDOMMatrix().scaleNonUniform();
           var expected = initialDOMMatrix()
                           .scale(1, 1, 1, 0, 0, 0);
           checkDOMMatrix(result, expected);
         },"test scaleNonUniform()");
 
         test(function() {
           var result = initialDOMMatrix().scaleNonUniform(6);