LibWeb: Limit HTMLCanvasElement width and height to allowed values

Setting the `width` or `height` properties of `HTMLCanvasElement` to a
value greater than 2147483647 will now cause the property to be set to
its default value.
This commit is contained in:
Tim Ledbetter 2024-11-29 16:04:35 +00:00 committed by Tim Ledbetter
commit a486c86eee
Notes: github-actions[bot] 2024-12-01 15:12:58 +00:00
4 changed files with 73 additions and 10 deletions

View file

@ -42,6 +42,8 @@
return input;
}
testProperty("canvas", "width", (canvas) => canvas.width, (canvas, value) => canvas.width = value);
testProperty("canvas", "height", (canvas) => canvas.height, (canvas, value) => canvas.height = value);
testProperty("img", "height", (img) => img.height, (img, value) => img.height = value);
testProperty("img", "hspace", (img) => img.hspace, (img, value) => img.hspace = value);
testProperty("img", "width", (img) => img.width, (img, value) => img.width = value);