Files
ladybird/Tests/LibWeb/Text/input/geometry/dommatrix.html
2023-09-03 15:05:41 +02:00

34 lines
1.3 KiB
HTML

<script src="../include.js"></script>
<script>
test(() => {
let testCounter = 1;
function testPart(part) {
println(`${testCounter++}. ${JSON.stringify(part())}`);
}
// 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. Multiply DOMMatrix by DOMMatrix
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix([10, 20, 30, 40, 50, 60])));
// 4. Create translation DOMMatrix
testPart(() => new DOMMatrix().translate(25, 25));
// 5. Translate DOMMatrix
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).translateSelf(25, 25));
// 6. Translate DOMMatrix with multiply
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix().translate(25, 25)));
// 7. Translate DOMMatrix with multiplySelf
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiplySelf(new DOMMatrix().translate(25, 25)));
// 8. Translate DOMMatrix with preMultiplySelf
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).preMultiplySelf(new DOMMatrix().translate(25, 25)));
});
</script>