mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
LibWeb: Add DOMMatrix fromFloat32Array and fromFloat64Array
This commit is contained in:
parent
2e122b16e4
commit
3c27843cfe
9 changed files with 146 additions and 13 deletions
|
@ -3,19 +3,42 @@
|
|||
test(() => {
|
||||
let testCounter = 1;
|
||||
function testPart(part) {
|
||||
println(`${testCounter++}. ${JSON.stringify(part())}`);
|
||||
try {
|
||||
println(`${testCounter}. ${JSON.stringify(part())}`);
|
||||
} catch (e) {
|
||||
println(`${testCounter}. Exception: ${e.name}`);
|
||||
}
|
||||
testCounter++;
|
||||
}
|
||||
|
||||
// 1. Creating a DOMMatrix
|
||||
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]));
|
||||
|
||||
// 2. Creating a DOMMatrix with fromMatrix
|
||||
testPart(() => DOMMatrix.fromMatrix({ a: 10, b: 20, c: 30, d: 40, e: 50, f: 60 }));
|
||||
|
||||
// 3. Creating a DOMMatrix
|
||||
// 2. Creating a DOMMatrix
|
||||
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]));
|
||||
|
||||
// 3. Creating a DOMMatrix with fromMatrix
|
||||
testPart(() => DOMMatrix.fromMatrix({ a: 10, b: 20, c: 30, d: 40, e: 50, f: 60 }));
|
||||
|
||||
// 4. Creating a DOMMatrix with fromMatrix
|
||||
testPart(() => DOMMatrix.fromMatrix({ m11: 10, m12: 20, m13: 30, m14: 40, m21: 50, m22: 60, m23: 70, m24: 80, m31: 90, m32: 100, m33: 110, m34: 120, m41: 130, m42: 140, m43: 150, m44: 160 }));
|
||||
|
||||
// 5. Creating a DOMMatrix with fromFloat32Array
|
||||
testPart(() => DOMMatrix.fromFloat32Array(new Float32Array([10, 20, 30, 40, 50, 60])));
|
||||
|
||||
// 6. Creating a DOMMatrix with fromFloat32Array
|
||||
testPart(() => DOMMatrix.fromFloat32Array(new Float32Array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160])));
|
||||
|
||||
// 7. Creating a DOMMatrix with fromFloat64Array
|
||||
testPart(() => DOMMatrix.fromFloat64Array(new Float64Array([10, 20, 30, 40, 50, 60])));
|
||||
|
||||
// 8. Creating a DOMMatrix with fromFloat64Array
|
||||
testPart(() => DOMMatrix.fromFloat64Array(new Float64Array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160])));
|
||||
|
||||
// 9. Creating a DOMMatrix with fromFloat32Array wrong amount
|
||||
testPart(() => DOMMatrix.fromFloat32Array(new Float32Array([10, 20, 30, 40])));
|
||||
|
||||
// 10. Creating a DOMMatrix with fromFloat64Array wrong amount
|
||||
testPart(() => DOMMatrix.fromFloat64Array(new Float64Array([10, 20, 30, 40])));
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue