mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
LibWeb: Validate arguments when creating DOMPoint from matrix transform
Previously, it was possible to create a DOMPoint from a matrix transform with inconsistent arguments. A TypeError is now thrown in this case.
This commit is contained in:
parent
c5d1ec4dea
commit
fe66aeb225
3 changed files with 14 additions and 2 deletions
|
@ -3,7 +3,12 @@
|
|||
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 DOMPoint
|
||||
|
@ -33,5 +38,11 @@
|
|||
const matrix = new DOMMatrix([10, 20, 30, 40, 50, 60]);
|
||||
return matrix.transformPoint({x: 10, y: 20});
|
||||
});
|
||||
|
||||
// 7. Transforming a point using a matrixTransform with an invalid DOMMatrixInit
|
||||
testPart(function () {
|
||||
const point = new DOMPoint(10, 20);
|
||||
return point.matrixTransform({ is2D: true, m33: 1.0000001 });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue