Update CSS tests to revision 5366390418de396cdf7c9d45fbaedbed81dc4a61

This commit is contained in:
Ms2ger 2016-03-07 17:30:48 +01:00
parent dedae5e459
commit 3a73a2452e
333 changed files with 2454 additions and 1418 deletions

View file

@ -25,8 +25,8 @@
m12: 0, m22: 2, m32: 0, m42: 10,
m13: 0, m23: 0, m33: 1, m43: 0,
m14: 0, m24: 0, m34: 0, m44: 1,
is2D: true,
isIdentity: true
is2D: false,
isIdentity: false
};
test(function() {
@ -41,7 +41,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0);
checkDOMMatrix(new DOMMatrix(float32Array), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(float32Array), scaleTranslate2D, false);
},'testConstructor2');
test(function() {
var float32Array = new Float32Array(2.0, 0.0, 0.0, 2.0, 10.0, 10.0);
@ -53,7 +53,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0]);
checkDOMMatrix(new DOMMatrix(float64Array), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(float64Array), scaleTranslate2D, false);
},'testConstructor4');
test(function() {
var float64Array = new Float64Array(2.0, 0.0, 0.0, 2.0, 10.0, 10.0);
@ -65,7 +65,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0];
checkDOMMatrix(new DOMMatrix(sequence), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(sequence), scaleTranslate2D, false);
},'testConstructor6');
test(function() {
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0, 10.0];
@ -134,11 +134,14 @@
assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(string); });
},'testConstructorIllegal1');
test(function() {
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0, 10.0];
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0];
assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(sequence); });
},'testConstructorIllegal2');
function checkDOMMatrix(m, exp) {
function checkDOMMatrix(m, exp, is2D) {
if (is2D === undefined) {
is2D = exp.is2D;
}
assert_equals(m.m11, exp.m11, "Expected value for m11 is " + exp.m11);
assert_equals(m.m12, exp.m12, "Expected value for m12 is " + exp.m12);
assert_equals(m.m13, exp.m13, "Expected value for m13 is " + exp.m13);
@ -155,7 +158,7 @@
assert_equals(m.m42, exp.m42, "Expected value for m42 is " + exp.m42);
assert_equals(m.m43, exp.m43, "Expected value for m43 is " + exp.m43);
assert_equals(m.m44, exp.m44, "Expected value for m44 is " + exp.m44);
assert_equals(m.is2D, exp.is2D, "Expected value for is2D is " + exp.is2D);
assert_equals(m.is2D, is2D, "Expected value for is2D is " + is2D);
assert_equals(m.isIdentity, exp.isIdentity, "Expected value for isIdentity is " + exp.isIdentity);
}

View file

@ -0,0 +1,126 @@
<!DOCTYPE html>
<html><head>
<title>Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object</title>
<link href="mailto:peter.hall@algomi.com" rel="author" title="Peter Hall">
<link href="https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly" rel="help">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<p>Test DOMMatrixReadOnly methods do not mutate the object</p>
<div id="log"></div>
<script>
function initialMatrix(){
return DOMMatrixReadOnly.fromMatrix(
{
m11:1, m12:-0.5, m13: 0.5, m14:0,
m21:0.5, m22:2, m23: -0.5, m24:0,
m31:0, m32:0, m33: 1, m34:0,
m41:0, m42:0, m43: 0, m44:1,
is2D: false
}
);
}
test(function() {
var matrix = initialMatrix();
matrix.translate(1,5,3);
checkDOMMatrix(matrix, initialMatrix());
},"test translate() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.scale(1,5,3,0,1,3);
checkDOMMatrix(matrix, initialMatrix());
},"test scale() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.scale3d(3,2,1,1);
checkDOMMatrix(matrix, initialMatrix());
},"test scale3d() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotate(Math.PI, Math.PI/2, Math.PI/6);
checkDOMMatrix(matrix, initialMatrix());
},"test rotate() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotateFromVector(10,-4);
checkDOMMatrix(matrix, initialMatrix());
},"test rotateFromVector() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotateAxisAngle(3,4,5, Math.PI/6);
checkDOMMatrix(matrix, initialMatrix());
},"test rotateAxisAngle() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.skewX(20);
checkDOMMatrix(matrix, initialMatrix());
},"test skewX() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.skewY(20);
checkDOMMatrix(matrix, initialMatrix());
},"test skewY() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.multiply({ m11:1, m12:2, m13: 0, m14:0,
m21:-1, m22:2, m23: -1, m24:0,
m31:0, m32:0, m33: 1, m34:0,
m41:5, m42:0, m43: 2, m44:1,
is2D: false,
isIdentity:false });
checkDOMMatrix(matrix, initialMatrix());
},"test multiply() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.flipX();
checkDOMMatrix(matrix, initialMatrix());
},"test flipX() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.flipY();
checkDOMMatrix(matrix, initialMatrix());
},"test flipY() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.inverse();
checkDOMMatrix(matrix, initialMatrix());
},"test inverse() doesn't mutate");
function checkDOMMatrix(m, exp) {
assert_equals(m.m11, exp.m11, "Expected value for m11 is " + exp.m11);
assert_equals(m.m12, exp.m12, "Expected value for m12 is " + exp.m12);
assert_equals(m.m13, exp.m13, "Expected value for m13 is " + exp.m13);
assert_equals(m.m14, exp.m14, "Expected value for m14 is " + exp.m14);
assert_equals(m.m21, exp.m21, "Expected value for m21 is " + exp.m21);
assert_equals(m.m22, exp.m22, "Expected value for m22 is " + exp.m22);
assert_equals(m.m23, exp.m23, "Expected value for m23 is " + exp.m23);
assert_equals(m.m24, exp.m24, "Expected value for m24 is " + exp.m24);
assert_equals(m.m31, exp.m31, "Expected value for m31 is " + exp.m31);
assert_equals(m.m32, exp.m32, "Expected value for m32 is " + exp.m32);
assert_equals(m.m33, exp.m33, "Expected value for m33 is " + exp.m33);
assert_equals(m.m34, exp.m34, "Expected value for m34 is " + exp.m34);
assert_equals(m.m41, exp.m41, "Expected value for m41 is " + exp.m41);
assert_equals(m.m42, exp.m42, "Expected value for m42 is " + exp.m42);
assert_equals(m.m43, exp.m43, "Expected value for m43 is " + exp.m43);
assert_equals(m.m44, exp.m44, "Expected value for m44 is " + exp.m44);
assert_equals(m.is2D, exp.is2D, "Expected value for is2D is " + exp.is2D);
assert_equals(m.isIdentity, exp.isIdentity, "Expected value for isIdentity is " + exp.isIdentity);
}
</script>
</body></html>

View file

@ -13,7 +13,7 @@
<body>
<h1>Geometry Interfaces Module Level 1 CR Test Suite</h1>
<h2>The DOMMatrix interfaces (1 tests)</h2>
<h2>The DOMMatrix interfaces (2 tests)</h2>
<table width="100%">
<col id="test-column">
<col id="refs-column">
@ -150,7 +150,15 @@
<!-- 0 tests -->
</tbody>
<tbody id="s6.#dom-dommatrixreadonly">
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="dommatrix-002-6.#dom-dommatrixreadonly" class="primary script">
<td><strong>
<a href="DOMMatrix-002.htm">dommatrix-002</a></strong></td>
<td></td>
<td><abbr class="script" title="Executes tests in script">Script</abbr></td>
<td>Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object
</td>
</tr>
</tbody>
<tbody id="s6.#dom-dommatrixreadonly-dommatrixreadonly-numbersequence">
<!-- 0 tests -->

View file

@ -47,7 +47,7 @@
<tbody id="s6">
<tr><th><a href="chapter-6.htm">Chapter 6 -
The DOMMatrix interfaces</a></th>
<td>(1 Tests)</td></tr>
<td>(2 Tests)</td></tr>
</tbody>
<tbody id="s7">
<tr><th><a href="chapter-7.htm">Chapter 7 -

View file

@ -3,8 +3,10 @@
# http://test.csswg.org/suites/geometry-1_dev/DATESTAMP/
# See http://wiki.csswg.org/test/implementation-report for instructions
testname revision result comment
html/dommatrix-001.htm 073bb957a964c40741226edda571b0051fde11d7 ?
xhtml1/dommatrix-001.xht 073bb957a964c40741226edda571b0051fde11d7 ?
html/dommatrix-001.htm 094c92af86543bc344ff68969950c23137ecb1de ?
xhtml1/dommatrix-001.xht 094c92af86543bc344ff68969950c23137ecb1de ?
html/dommatrix-002.htm fce1ff735543f8c1b50b650fd26ce2e1e1f40026 ?
xhtml1/dommatrix-002.xht fce1ff735543f8c1b50b650fd26ce2e1e1f40026 ?
html/dompoint-001.htm 665e2664c436ff50a27f1ab0532d656205e7f441 ?
xhtml1/dompoint-001.xht 665e2664c436ff50a27f1ab0532d656205e7f441 ?
html/domquad-001.htm 608cb7264f7f7f64838baf911bf9e470cf89444c ?

View file

@ -132,6 +132,7 @@
<p>Many thanks to the following for their contributions:</p>
<ul>
<li>Dirk Schulze</li>
<li>Peter Hall</li>
</ul>
</body>

View file

@ -132,6 +132,7 @@
<p>Many thanks to the following for their contributions:</p>
<ul>
<li>Dirk Schulze</li>
<li>Peter Hall</li>
</ul>
</body>

View file

@ -1,5 +1,6 @@
id references title flags links revision credits assertion
DOMMatrix-001 Geometry Interfaces: DOMMatrix and DOMMatrixReadOnly constructors script http://www.w3.org/TR/geometry-1/#DOMMatrix,http://www.w3.org/TR/geometry-1/#dommatrix-constructors,http://www.w3.org/TR/geometry-1/#dom-dommatrix-dommatrix 073bb957a964c40741226edda571b0051fde11d7 `Dirk Schulze`<mailto:dschulze@adobe.com>
DOMMatrix-001 Geometry Interfaces: DOMMatrix and DOMMatrixReadOnly constructors script http://www.w3.org/TR/geometry-1/#DOMMatrix,http://www.w3.org/TR/geometry-1/#dommatrix-constructors,http://www.w3.org/TR/geometry-1/#dom-dommatrix-dommatrix 094c92af86543bc344ff68969950c23137ecb1de `Dirk Schulze`<mailto:dschulze@adobe.com>
DOMMatrix-002 Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object script https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly fce1ff735543f8c1b50b650fd26ce2e1e1f40026 `Peter Hall`<mailto:peter.hall@algomi.com>
DOMPoint-001 Geometry Interfaces: DOMPoint and DOMPointReadOnly interface tests script http://www.w3.org/TR/geometry-1/#DOMPoint,http://www.w3.org/TR/geometry-1/#dictdef-dompointinit,http://www.w3.org/TR/geometry-1/#dom-dompoint-dompoint,http://www.w3.org/TR/geometry-1/#dom-dompointreadonly-dompoint-x,http://www.w3.org/TR/geometry-1/#dom-dompointreadonly-dompoint-y,http://www.w3.org/TR/geometry-1/#dom-dompointreadonly-dompoint-z,http://www.w3.org/TR/geometry-1/#dom-dompointreadonly-dompoint-w 665e2664c436ff50a27f1ab0532d656205e7f441 `Dirk Schulze`<mailto:dschulze@adobe.com>
DOMQuad-001 Geometry Interfaces: DOMQuad interface tests script http://www.w3.org/TR/geometry-1/#DOMQuad,http://www.w3.org/TR/geometry-1/#dom-domquad-domquad,http://www.w3.org/TR/geometry-1/#dom-domquad-p1,http://www.w3.org/TR/geometry-1/#dom-domquad-p2,http://www.w3.org/TR/geometry-1/#dom-domquad-p3,http://www.w3.org/TR/geometry-1/#dom-domquad-p4,http://www.w3.org/TR/geometry-1/#dom-domquad-bounds 608cb7264f7f7f64838baf911bf9e470cf89444c `Dirk Schulze`<mailto:dschulze@adobe.com>
DOMRect-001 Geometry Interfaces: DOMRect and DOMRectReadOnly interface tests script http://www.w3.org/TR/geometry-1/#DOMRect,http://www.w3.org/TR/geometry-1/#dom-domrect,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly,http://www.w3.org/TR/geometry-1/#dom-domrect-domrect,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-x,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-y,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-width,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-height,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-top,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-left,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-right,http://www.w3.org/TR/geometry-1/#dom-domrectreadonly-domrect-bottom 2683301224ae44225ab87152ac19e1cd866f59ae `Dirk Schulze`<mailto:dschulze@adobe.com>

View file

@ -25,8 +25,8 @@
m12: 0, m22: 2, m32: 0, m42: 10,
m13: 0, m23: 0, m33: 1, m43: 0,
m14: 0, m24: 0, m34: 0, m44: 1,
is2D: true,
isIdentity: true
is2D: false,
isIdentity: false
};
test(function() {
@ -41,7 +41,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0);
checkDOMMatrix(new DOMMatrix(float32Array), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(float32Array), scaleTranslate2D, false);
},'testConstructor2');
test(function() {
var float32Array = new Float32Array(2.0, 0.0, 0.0, 2.0, 10.0, 10.0);
@ -53,7 +53,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0]);
checkDOMMatrix(new DOMMatrix(float64Array), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(float64Array), scaleTranslate2D, false);
},'testConstructor4');
test(function() {
var float64Array = new Float64Array(2.0, 0.0, 0.0, 2.0, 10.0, 10.0);
@ -65,7 +65,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0];
checkDOMMatrix(new DOMMatrix(sequence), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(sequence), scaleTranslate2D, false);
},'testConstructor6');
test(function() {
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0, 10.0];
@ -134,11 +134,14 @@
assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(string); });
},'testConstructorIllegal1');
test(function() {
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0, 10.0];
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0];
assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(sequence); });
},'testConstructorIllegal2');
function checkDOMMatrix(m, exp) {
function checkDOMMatrix(m, exp, is2D) {
if (is2D === undefined) {
is2D = exp.is2D;
}
assert_equals(m.m11, exp.m11, "Expected value for m11 is " + exp.m11);
assert_equals(m.m12, exp.m12, "Expected value for m12 is " + exp.m12);
assert_equals(m.m13, exp.m13, "Expected value for m13 is " + exp.m13);
@ -155,7 +158,7 @@
assert_equals(m.m42, exp.m42, "Expected value for m42 is " + exp.m42);
assert_equals(m.m43, exp.m43, "Expected value for m43 is " + exp.m43);
assert_equals(m.m44, exp.m44, "Expected value for m44 is " + exp.m44);
assert_equals(m.is2D, exp.is2D, "Expected value for is2D is " + exp.is2D);
assert_equals(m.is2D, is2D, "Expected value for is2D is " + is2D);
assert_equals(m.isIdentity, exp.isIdentity, "Expected value for isIdentity is " + exp.isIdentity);
}

View file

@ -0,0 +1,126 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object</title>
<link href="mailto:peter.hall@algomi.com" rel="author" title="Peter Hall" />
<link href="https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly" rel="help" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<p>Test DOMMatrixReadOnly methods do not mutate the object</p>
<div id="log"></div>
<script>
function initialMatrix(){
return DOMMatrixReadOnly.fromMatrix(
{
m11:1, m12:-0.5, m13: 0.5, m14:0,
m21:0.5, m22:2, m23: -0.5, m24:0,
m31:0, m32:0, m33: 1, m34:0,
m41:0, m42:0, m43: 0, m44:1,
is2D: false
}
);
}
test(function() {
var matrix = initialMatrix();
matrix.translate(1,5,3);
checkDOMMatrix(matrix, initialMatrix());
},"test translate() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.scale(1,5,3,0,1,3);
checkDOMMatrix(matrix, initialMatrix());
},"test scale() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.scale3d(3,2,1,1);
checkDOMMatrix(matrix, initialMatrix());
},"test scale3d() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotate(Math.PI, Math.PI/2, Math.PI/6);
checkDOMMatrix(matrix, initialMatrix());
},"test rotate() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotateFromVector(10,-4);
checkDOMMatrix(matrix, initialMatrix());
},"test rotateFromVector() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotateAxisAngle(3,4,5, Math.PI/6);
checkDOMMatrix(matrix, initialMatrix());
},"test rotateAxisAngle() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.skewX(20);
checkDOMMatrix(matrix, initialMatrix());
},"test skewX() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.skewY(20);
checkDOMMatrix(matrix, initialMatrix());
},"test skewY() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.multiply({ m11:1, m12:2, m13: 0, m14:0,
m21:-1, m22:2, m23: -1, m24:0,
m31:0, m32:0, m33: 1, m34:0,
m41:5, m42:0, m43: 2, m44:1,
is2D: false,
isIdentity:false });
checkDOMMatrix(matrix, initialMatrix());
},"test multiply() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.flipX();
checkDOMMatrix(matrix, initialMatrix());
},"test flipX() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.flipY();
checkDOMMatrix(matrix, initialMatrix());
},"test flipY() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.inverse();
checkDOMMatrix(matrix, initialMatrix());
},"test inverse() doesn't mutate");
function checkDOMMatrix(m, exp) {
assert_equals(m.m11, exp.m11, "Expected value for m11 is " + exp.m11);
assert_equals(m.m12, exp.m12, "Expected value for m12 is " + exp.m12);
assert_equals(m.m13, exp.m13, "Expected value for m13 is " + exp.m13);
assert_equals(m.m14, exp.m14, "Expected value for m14 is " + exp.m14);
assert_equals(m.m21, exp.m21, "Expected value for m21 is " + exp.m21);
assert_equals(m.m22, exp.m22, "Expected value for m22 is " + exp.m22);
assert_equals(m.m23, exp.m23, "Expected value for m23 is " + exp.m23);
assert_equals(m.m24, exp.m24, "Expected value for m24 is " + exp.m24);
assert_equals(m.m31, exp.m31, "Expected value for m31 is " + exp.m31);
assert_equals(m.m32, exp.m32, "Expected value for m32 is " + exp.m32);
assert_equals(m.m33, exp.m33, "Expected value for m33 is " + exp.m33);
assert_equals(m.m34, exp.m34, "Expected value for m34 is " + exp.m34);
assert_equals(m.m41, exp.m41, "Expected value for m41 is " + exp.m41);
assert_equals(m.m42, exp.m42, "Expected value for m42 is " + exp.m42);
assert_equals(m.m43, exp.m43, "Expected value for m43 is " + exp.m43);
assert_equals(m.m44, exp.m44, "Expected value for m44 is " + exp.m44);
assert_equals(m.is2D, exp.is2D, "Expected value for is2D is " + exp.is2D);
assert_equals(m.isIdentity, exp.isIdentity, "Expected value for isIdentity is " + exp.isIdentity);
}
</script>
</body></html>

View file

@ -13,7 +13,7 @@
<body>
<h1>Geometry Interfaces Module Level 1 CR Test Suite</h1>
<h2>The DOMMatrix interfaces (1 tests)</h2>
<h2>The DOMMatrix interfaces (2 tests)</h2>
<table width="100%">
<col id="test-column"></col>
<col id="refs-column"></col>
@ -150,7 +150,15 @@
<!-- 0 tests -->
</tbody>
<tbody id="s6.#dom-dommatrixreadonly">
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="dommatrix-002-6.#dom-dommatrixreadonly" class="primary script">
<td><strong>
<a href="DOMMatrix-002.xht">dommatrix-002</a></strong></td>
<td></td>
<td><abbr class="script" title="Executes tests in script">Script</abbr></td>
<td>Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object
</td>
</tr>
</tbody>
<tbody id="s6.#dom-dommatrixreadonly-dommatrixreadonly-numbersequence">
<!-- 0 tests -->

View file

@ -47,7 +47,7 @@
<tbody id="s6">
<tr><th><a href="chapter-6.xht">Chapter 6 -
The DOMMatrix interfaces</a></th>
<td>(1 Tests)</td></tr>
<td>(2 Tests)</td></tr>
</tbody>
<tbody id="s7">
<tr><th><a href="chapter-7.xht">Chapter 7 -

View file

@ -25,8 +25,8 @@
m12: 0, m22: 2, m32: 0, m42: 10,
m13: 0, m23: 0, m33: 1, m43: 0,
m14: 0, m24: 0, m34: 0, m44: 1,
is2D: true,
isIdentity: true
is2D: false,
isIdentity: false
};
test(function() {
@ -41,7 +41,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0);
checkDOMMatrix(new DOMMatrix(float32Array), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(float32Array), scaleTranslate2D, false);
},'testConstructor2');
test(function() {
var float32Array = new Float32Array(2.0, 0.0, 0.0, 2.0, 10.0, 10.0);
@ -53,7 +53,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0]);
checkDOMMatrix(new DOMMatrix(float64Array), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(float64Array), scaleTranslate2D, false);
},'testConstructor4');
test(function() {
var float64Array = new Float64Array(2.0, 0.0, 0.0, 2.0, 10.0, 10.0);
@ -65,7 +65,7 @@
0.0, 2.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
10.0, 10.0, 0.0, 1.0];
checkDOMMatrix(new DOMMatrix(sequence), scaleTranslate2D);
checkDOMMatrix(new DOMMatrix(sequence), scaleTranslate2D, false);
},'testConstructor6');
test(function() {
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0, 10.0];
@ -134,11 +134,14 @@
assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(string); });
},'testConstructorIllegal1');
test(function() {
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0, 10.0];
var sequence = [ 2.0, 0.0, 0.0, 2.0, 10.0];
assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(sequence); });
},'testConstructorIllegal2');
function checkDOMMatrix(m, exp) {
function checkDOMMatrix(m, exp, is2D) {
if (is2D === undefined) {
is2D = exp.is2D;
}
assert_equals(m.m11, exp.m11, "Expected value for m11 is " + exp.m11);
assert_equals(m.m12, exp.m12, "Expected value for m12 is " + exp.m12);
assert_equals(m.m13, exp.m13, "Expected value for m13 is " + exp.m13);
@ -155,7 +158,7 @@
assert_equals(m.m42, exp.m42, "Expected value for m42 is " + exp.m42);
assert_equals(m.m43, exp.m43, "Expected value for m43 is " + exp.m43);
assert_equals(m.m44, exp.m44, "Expected value for m44 is " + exp.m44);
assert_equals(m.is2D, exp.is2D, "Expected value for is2D is " + exp.is2D);
assert_equals(m.is2D, is2D, "Expected value for is2D is " + is2D);
assert_equals(m.isIdentity, exp.isIdentity, "Expected value for isIdentity is " + exp.isIdentity);
}

View file

@ -0,0 +1,126 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object</title>
<link href="mailto:peter.hall@algomi.com" rel="author" title="Peter Hall" />
<link href="https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly" rel="help" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<p>Test DOMMatrixReadOnly methods do not mutate the object</p>
<div id="log"></div>
<script>
function initialMatrix(){
return DOMMatrixReadOnly.fromMatrix(
{
m11:1, m12:-0.5, m13: 0.5, m14:0,
m21:0.5, m22:2, m23: -0.5, m24:0,
m31:0, m32:0, m33: 1, m34:0,
m41:0, m42:0, m43: 0, m44:1,
is2D: false
}
);
}
test(function() {
var matrix = initialMatrix();
matrix.translate(1,5,3);
checkDOMMatrix(matrix, initialMatrix());
},"test translate() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.scale(1,5,3,0,1,3);
checkDOMMatrix(matrix, initialMatrix());
},"test scale() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.scale3d(3,2,1,1);
checkDOMMatrix(matrix, initialMatrix());
},"test scale3d() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotate(Math.PI, Math.PI/2, Math.PI/6);
checkDOMMatrix(matrix, initialMatrix());
},"test rotate() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotateFromVector(10,-4);
checkDOMMatrix(matrix, initialMatrix());
},"test rotateFromVector() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.rotateAxisAngle(3,4,5, Math.PI/6);
checkDOMMatrix(matrix, initialMatrix());
},"test rotateAxisAngle() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.skewX(20);
checkDOMMatrix(matrix, initialMatrix());
},"test skewX() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.skewY(20);
checkDOMMatrix(matrix, initialMatrix());
},"test skewY() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.multiply({ m11:1, m12:2, m13: 0, m14:0,
m21:-1, m22:2, m23: -1, m24:0,
m31:0, m32:0, m33: 1, m34:0,
m41:5, m42:0, m43: 2, m44:1,
is2D: false,
isIdentity:false });
checkDOMMatrix(matrix, initialMatrix());
},"test multiply() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.flipX();
checkDOMMatrix(matrix, initialMatrix());
},"test flipX() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.flipY();
checkDOMMatrix(matrix, initialMatrix());
},"test flipY() doesn't mutate");
test(function() {
var matrix = initialMatrix();
matrix.inverse();
checkDOMMatrix(matrix, initialMatrix());
},"test inverse() doesn't mutate");
function checkDOMMatrix(m, exp) {
assert_equals(m.m11, exp.m11, "Expected value for m11 is " + exp.m11);
assert_equals(m.m12, exp.m12, "Expected value for m12 is " + exp.m12);
assert_equals(m.m13, exp.m13, "Expected value for m13 is " + exp.m13);
assert_equals(m.m14, exp.m14, "Expected value for m14 is " + exp.m14);
assert_equals(m.m21, exp.m21, "Expected value for m21 is " + exp.m21);
assert_equals(m.m22, exp.m22, "Expected value for m22 is " + exp.m22);
assert_equals(m.m23, exp.m23, "Expected value for m23 is " + exp.m23);
assert_equals(m.m24, exp.m24, "Expected value for m24 is " + exp.m24);
assert_equals(m.m31, exp.m31, "Expected value for m31 is " + exp.m31);
assert_equals(m.m32, exp.m32, "Expected value for m32 is " + exp.m32);
assert_equals(m.m33, exp.m33, "Expected value for m33 is " + exp.m33);
assert_equals(m.m34, exp.m34, "Expected value for m34 is " + exp.m34);
assert_equals(m.m41, exp.m41, "Expected value for m41 is " + exp.m41);
assert_equals(m.m42, exp.m42, "Expected value for m42 is " + exp.m42);
assert_equals(m.m43, exp.m43, "Expected value for m43 is " + exp.m43);
assert_equals(m.m44, exp.m44, "Expected value for m44 is " + exp.m44);
assert_equals(m.is2D, exp.is2D, "Expected value for is2D is " + exp.is2D);
assert_equals(m.isIdentity, exp.isIdentity, "Expected value for isIdentity is " + exp.isIdentity);
}
</script>
</body></html>

View file

@ -13,7 +13,7 @@
<body>
<h1>Geometry Interfaces Module Level 1 CR Test Suite</h1>
<h2>The DOMMatrix interfaces (1 tests)</h2>
<h2>The DOMMatrix interfaces (2 tests)</h2>
<table width="100%">
<col id="test-column"></col>
<col id="refs-column"></col>
@ -150,7 +150,15 @@
<!-- 0 tests -->
</tbody>
<tbody id="s6.#dom-dommatrixreadonly">
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="dommatrix-002-6.#dom-dommatrixreadonly" class="primary script">
<td><strong>
<a href="DOMMatrix-002.xht">dommatrix-002</a></strong></td>
<td></td>
<td><abbr class="script" title="Executes tests in script">Script</abbr></td>
<td>Geometry Interfaces: DOMMatrixReadOnly methods do not mutate the object
</td>
</tr>
</tbody>
<tbody id="s6.#dom-dommatrixreadonly-dommatrixreadonly-numbersequence">
<!-- 0 tests -->

View file

@ -47,7 +47,7 @@
<tbody id="s6">
<tr><th><a href="chapter-6.xht">Chapter 6 -
The DOMMatrix interfaces</a></th>
<td>(1 Tests)</td></tr>
<td>(2 Tests)</td></tr>
</tbody>
<tbody id="s7">
<tr><th><a href="chapter-7.xht">Chapter 7 -