Make ImageData more spec compliant (#37620)

I updated webidl, and all changes that bring, currently we still not
support float16array (there is no support in FF either). Most notable
change is refactored new_*/Constructors methods, that should now handle
HeapBufferSource more properly (with less unsafe).

Testing: Existing WPT tests
try run: https://github.com/sagudev/servo/actions/runs/15806083404
Fixes: #37618 (although not tested)

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev 2025-06-25 18:48:58 +02:00 committed by GitHub
parent 59b99de90a
commit 6f53d422b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 206 additions and 156 deletions

View file

@ -0,0 +1,3 @@
[2d.color.type.u8p3.to.f16srgb.to.u8p3.html]
[test srgb float16 canvas storing 8-bit display-p3 data accurately]
expected: FAIL

View file

@ -1,3 +0,0 @@
[2d.imageData.createImageBitmap.srgb.rgba.unorm8.html]
[Verify round-trip of 8-bit sRGB data ImageData through ImageBitmap]
expected: FAIL

View file

@ -1,3 +0,0 @@
[2d.imageData.object.properties.html]
[ImageData objects have the right properties]
expected: FAIL

View file

@ -0,0 +1,3 @@
[2d.color.type.u8p3.to.f16srgb.to.u8p3.html]
[test srgb float16 canvas storing 8-bit display-p3 data accurately]
expected: FAIL

View file

@ -0,0 +1,3 @@
[2d.color.type.u8p3.to.f16srgb.to.u8p3.worker.html]
[test srgb float16 canvas storing 8-bit display-p3 data accurately]
expected: FAIL

View file

@ -1,3 +0,0 @@
[2d.imageData.createImageBitmap.srgb.rgba.unorm8.html]
[Verify round-trip of 8-bit sRGB data ImageData through ImageBitmap]
expected: FAIL

View file

@ -1,3 +0,0 @@
[2d.imageData.createImageBitmap.srgb.rgba.unorm8.worker.html]
[Verify round-trip of 8-bit sRGB data ImageData through ImageBitmap]
expected: FAIL

View file

@ -1,3 +0,0 @@
[2d.imageData.object.properties.html]
[ImageData objects have the right properties]
expected: FAIL

View file

@ -1,3 +0,0 @@
[2d.imageData.object.properties.worker.html]
[ImageData objects have the right properties]
expected: FAIL

View file

@ -2,9 +2,6 @@
[CanvasPattern interface: operation setTransform(optional DOMMatrix2DInit)]
expected: FAIL
[ImageData interface: attribute colorSpace]
expected: FAIL
[Path2D interface: operation roundRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional (unrestricted double or DOMPointInit or sequence<(unrestricted double or DOMPointInit)>))]
expected: FAIL
@ -185,9 +182,6 @@
[OffscreenCanvasRenderingContext2D interface: attribute lang]
expected: FAIL
[ImageData interface: attribute pixelFormat]
expected: FAIL
[idlharness.any.shadowrealm-in-window.html]
expected: ERROR

View file

@ -950,9 +950,6 @@
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "textRendering" with the proper type]
expected: FAIL
[ImageData interface: attribute colorSpace]
expected: FAIL
[ImageData interface: new ImageData(10, 10) must inherit property "colorSpace" with the proper type]
expected: FAIL
@ -4349,12 +4346,6 @@
[CanvasPattern interface: operation setTransform(optional DOMMatrix2DInit)]
expected: FAIL
[ImageData interface: attribute colorSpace]
expected: FAIL
[ImageData interface: new ImageData(10, 10) must inherit property "colorSpace" with the proper type]
expected: FAIL
[Path2D interface: operation roundRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional (unrestricted double or DOMPointInit or sequence<(unrestricted double or DOMPointInit)>))]
expected: FAIL
@ -5216,12 +5207,6 @@
[OffscreenCanvasRenderingContext2D interface: attribute lang]
expected: FAIL
[ImageData interface: attribute pixelFormat]
expected: FAIL
[ImageData interface: new ImageData(10, 10) must inherit property "pixelFormat" with the proper type]
expected: FAIL
[CustomElementRegistry interface: operation initialize(Node)]
expected: FAIL