Skip to content

Commit

Permalink
Add DOMMatrix.prototype.scaleNonUniform
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Jul 2, 2019
1 parent f4ff9e2 commit ebdb106
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 32 deletions.
11 changes: 11 additions & 0 deletions components/script/dom/dommatrixreadonly.rs
Expand Up @@ -571,6 +571,17 @@ impl DOMMatrixReadOnlyMethods for DOMMatrixReadOnly {
.ScaleSelf(scaleX, scaleY, scaleZ, originX, originY, originZ)
}

fn ScaleNonUniform(&self, scaleX: f64, scaleY: f64) -> DomRoot<DOMMatrix> {
DOMMatrix::from_readonly(&self.global(), self).ScaleSelf(
scaleX,
Some(scaleY),
1.0,
0.0,
0.0,
0.0,
)
}

// https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-scale3d
fn Scale3d(&self, scale: f64, originX: f64, originY: f64, originZ: f64) -> DomRoot<DOMMatrix> {
DOMMatrix::from_readonly(&self.global(), self).Scale3dSelf(scale, originX, originY, originZ)
Expand Down
2 changes: 2 additions & 0 deletions components/script/dom/webidls/DOMMatrixReadOnly.webidl
Expand Up @@ -56,6 +56,8 @@ interface DOMMatrixReadOnly {
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,
Expand Down
4 changes: 0 additions & 4 deletions tests/wpt/metadata/css/geometry/DOMMatrix-002.html.ini

This file was deleted.

10 changes: 0 additions & 10 deletions tests/wpt/metadata/css/geometry/DOMMatrix-003.html.ini
Expand Up @@ -5,13 +5,3 @@

[test rotateAxisAngle() ]
expected: FAIL

[test scaleNonUniform() with sx]
expected: FAIL

[test scaleNonUniform() with sx, sy]
expected: FAIL

[test scaleNonUniform()]
expected: FAIL

9 changes: 0 additions & 9 deletions tests/wpt/metadata/css/geometry/interfaces.html.ini
Expand Up @@ -375,15 +375,6 @@
[Geometry APIs interface IDL tests]
expected: FAIL
[DOMMatrixReadOnly interface: calling scaleNonUniform(unrestricted double, unrestricted double) on new DOMMatrixReadOnly() with too few arguments must throw TypeError]
expected: FAIL
[DOMMatrixReadOnly interface: new DOMMatrixReadOnly() must inherit property "scaleNonUniform(unrestricted double, unrestricted double)" with the proper type]
expected: FAIL
[DOMMatrixReadOnly interface: operation scaleNonUniform(unrestricted double, unrestricted double)]
expected: FAIL
[DOMPointReadOnly interface: default toJSON operation on new DOMPoint()]
expected: FAIL
Expand Down
9 changes: 0 additions & 9 deletions tests/wpt/metadata/css/geometry/interfaces.worker.js.ini
Expand Up @@ -98,15 +98,6 @@
[interfaces]
expected: FAIL

[DOMMatrixReadOnly interface: calling scaleNonUniform(unrestricted double, unrestricted double) on new DOMMatrixReadOnly() with too few arguments must throw TypeError]
expected: FAIL

[DOMMatrixReadOnly interface: new DOMMatrixReadOnly() must inherit property "scaleNonUniform(unrestricted double, unrestricted double)" with the proper type]
expected: FAIL

[DOMMatrixReadOnly interface: operation scaleNonUniform(unrestricted double, unrestricted double)]
expected: FAIL

[DOMPointReadOnly interface: default toJSON operation on new DOMPoint()]
expected: FAIL

Expand Down

0 comments on commit ebdb106

Please sign in to comment.