diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/geometry/DOMMatrix-invert-non-invertible.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/geometry/DOMMatrix-invert-non-invertible.html')
-rw-r--r-- | testing/web-platform/tests/css/geometry/DOMMatrix-invert-non-invertible.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/geometry/DOMMatrix-invert-non-invertible.html b/testing/web-platform/tests/css/geometry/DOMMatrix-invert-non-invertible.html new file mode 100644 index 0000000000..b3295321e0 --- /dev/null +++ b/testing/web-platform/tests/css/geometry/DOMMatrix-invert-non-invertible.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<link rel="help" href="https://drafts.fxtf.org/geometry-1/#DOMMatrix"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<p>Test DOMMatrix.inverse()/invertSelf() for non-invertible matrix</p> +<script> +function checkResult(m) { + assert_false(m.is2D, 'is2D'); + assert_false(m.isIdentity, 'isIdentity'); + assert_true(isNaN(m.m11), 'm11 isNaN'); + assert_true(isNaN(m.m12), 'm12 isNaN'); + assert_true(isNaN(m.m13), 'm13 isNaN'); + assert_true(isNaN(m.m14), 'm14 isNaN'); + assert_true(isNaN(m.m21), 'm21 isNaN'); + assert_true(isNaN(m.m22), 'm22 isNaN'); + assert_true(isNaN(m.m23), 'm23 isNaN'); + assert_true(isNaN(m.m24), 'm24 isNaN'); + assert_true(isNaN(m.m31), 'm31 isNaN'); + assert_true(isNaN(m.m32), 'm32 isNaN'); + assert_true(isNaN(m.m33), 'm33 isNaN'); + assert_true(isNaN(m.m34), 'm34 isNaN'); + assert_true(isNaN(m.m41), 'm41 isNaN'); + assert_true(isNaN(m.m42), 'm42 isNaN'); + assert_true(isNaN(m.m43), 'm43 isNaN'); + assert_true(isNaN(m.m44), 'm44 isNaN'); + + var f32 = m.toFloat32Array(); + assert_equals(f32.length, 16, 'toFloat32Array().length'); + for (var i = 0; i < 16; i++) + assert_true(isNaN(f32[i]), 'toFloat32Array()[' + i + '] isNaN'); + + var f64 = m.toFloat64Array(); + assert_equals(f64.length, 16, 'toFloat64Array().length'); + for (var i = 0; i < 16; i++) + assert_true(isNaN(f64[i]), 'toFloat64()[' + i + '] isNaN'); +} + +test(function() { + var m = new DOMMatrix(); + m.a = 0; + m.invertSelf(); + checkResult(m); +},"invertSelf()"); + +test(function() { + var m = new DOMMatrix(); + m.a = 0; + checkResult(m.inverse()); +},"inverse()"); +</script> |