LibWeb/HTML: Enforce width and height range for OffscreenCanvas

We should be throwing a TypeError on values outside of the range
for an unsigned long instead of the default modulo behaviour.
This commit is contained in:
Shannon Booth 2025-09-20 18:55:31 +02:00 committed by Sam Atkins
parent e3b5507113
commit c1d022523b
Notes: github-actions[bot] 2025-09-22 11:38:51 +00:00
3 changed files with 36 additions and 2 deletions

View file

@ -20,8 +20,8 @@ enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2", "w
interface OffscreenCanvas : EventTarget {
constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height);
attribute unsigned long long width;
attribute unsigned long long height;
[EnforceRange] attribute unsigned long long width;
[EnforceRange] attribute unsigned long long height;
OffscreenRenderingContext? getContext(OffscreenRenderingContextId contextId, optional any options = null);
ImageBitmap transferToImageBitmap();