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

@ -18,6 +18,9 @@ pub(crate) mod base {
pub(crate) use js::panic::maybe_resume_unwind;
pub(crate) use js::rust::wrappers::Call;
pub(crate) use js::rust::{HandleObject, HandleValue, MutableHandleObject, MutableHandleValue};
pub(crate) use js::typedarray::{
ArrayBuffer, ArrayBufferView, Float32Array, Float64Array, Uint8Array, Uint8ClampedArray,
};
pub(crate) use crate::callback::{
CallSetup, CallbackContainer, CallbackFunction, CallbackInterface, CallbackObject,
@ -84,9 +87,6 @@ pub(crate) mod module {
CustomAutoRooterGuard, GCMethods, Handle, MutableHandle, get_context_realm,
get_object_class, get_object_realm,
};
pub(crate) use js::typedarray::{
ArrayBuffer, ArrayBufferView, Float32Array, Float64Array, Uint8Array, Uint8ClampedArray,
};
pub(crate) use js::{
JS_CALLEE, JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL,
JSCLASS_RESERVED_SLOTS_MASK, typedarray,