script: Let canvas serialization to image fail gracefully (#37184)

Instead of panicking when serialization of canvas to image data (whether
through `toBlob()` or via `toDataURL()`), properly handle failed
serialization. This is an implementation of the appropriate error
handling from the specification text.

Testing: This change includes a new Serov-specific test, because it is
impossible to know what the canvas size limits are of all browsers.
Fixes: #36840.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-05-29 18:09:05 +02:00 committed by GitHub
parent 36e4886da1
commit 559ba4b3ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 100 additions and 40 deletions

View file

@ -12850,6 +12850,13 @@
]
]
},
"canvas-oversize-serialization.html": [
"3330ee2b8c4e33a18a3e17151fd7c398c9a5d024",
[
null,
{}
]
],
"canvas.initial.reset.2dstate.html": [
"e276ed09ffcf16eff16b784c622b93665c4109ee",
[