mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
Update web-platform-tests to revision 58b72393db0bd273bb93268c33666cf893feb985
This commit is contained in:
parent
43a4f01647
commit
64e0a52537
12717 changed files with 59835 additions and 59820 deletions
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Geometry Interfaces: DOMMatrix attributes</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/geometry/#dommatrix-attributes">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
const initial = {
|
||||
a: 1, b: 0, c: 0, d: 1, e: 0, f: 0,
|
||||
m11: 1, m12: 0, m13: 0, m14: 0,
|
||||
m21: 0, m22: 1, m23: 0, m24: 0,
|
||||
m31: 0, m32: 0, m33: 1, m34: 0,
|
||||
m41: 0, m42: 0, m43: 0, m44: 1,
|
||||
};
|
||||
|
||||
// Attributes that always preserve is2D.
|
||||
["a", "b", "c", "d", "e", "f",
|
||||
"m11", "m12", "m21", "m22", "m41", "m42" ].forEach(attribute => {
|
||||
test(() => {
|
||||
let m = new DOMMatrix();
|
||||
assert_true(m.is2D);
|
||||
assert_equals(m[attribute], initial[attribute]);
|
||||
m[attribute] = 42;
|
||||
assert_true(m.is2D);
|
||||
assert_equals(m[attribute], 42);
|
||||
}, `DOMMatrix.${attribute}`);
|
||||
});
|
||||
|
||||
// Attributes that clear is2D for values other than 0 or -0.
|
||||
["m13", "m14", "m23", "m24", "m31", "m32", "m34", "m43" ].forEach(attribute => {
|
||||
test(() => {
|
||||
let m = new DOMMatrix();
|
||||
assert_true(m.is2D);
|
||||
assert_equals(m[attribute], initial[attribute]);
|
||||
m[attribute] = 0;
|
||||
assert_true(m.is2D, "0 preserves is2D");
|
||||
assert_equals(m[attribute], 0);
|
||||
m[attribute] = -0;
|
||||
assert_true(m.is2D, "-0 preserves is2D");
|
||||
assert_equals(m[attribute], -0);
|
||||
m[attribute] = 42;
|
||||
assert_false(m.is2D, "a value other than 0 or -0 clears is2D");
|
||||
assert_equals(m[attribute], 42);
|
||||
m[attribute] = 0;
|
||||
assert_false(m.is2D, "is2D can never be set to true after having been set to false");
|
||||
assert_equals(m[attribute], 0);
|
||||
}, `DOMMatrix.${attribute}`);
|
||||
});
|
||||
|
||||
// Attributes that clear is2D for values other than 1.
|
||||
["m33", "m44" ].forEach(attribute => {
|
||||
test(() => {
|
||||
let m = new DOMMatrix();
|
||||
assert_true(m.is2D);
|
||||
assert_equals(m[attribute], initial[attribute]);
|
||||
m[attribute] = 1;
|
||||
assert_true(m.is2D, "1 preserves is2D");
|
||||
assert_equals(m[attribute], 1);
|
||||
m[attribute] = 42;
|
||||
assert_false(m.is2D, "a value other than 1 clears is2D");
|
||||
assert_equals(m[attribute], 42);
|
||||
m[attribute] = 1;
|
||||
assert_false(m.is2D, "is2D can never be set to true after having been set to false");
|
||||
assert_equals(m[attribute], 1);
|
||||
}, `DOMMatrix.${attribute}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue