Skip to content

WebIDL: use TypedArray #31064

Closed
Closed

Description

@gterzian

As as follow-up to #30990, we should do the same for other typed arrays.

The list is found at

Types.ArrayBuffer: IDLType.Tags.interface,

See the various arrays which currently default to IDLType.Tags.interface, and which currently all fallback to using a JSObject in codegen. Each should be changed to use it's own type, like was done in the linked-to PR for FLoat32Array. Note that not all may be currently used by Servo, to find out if they are, search for it in *.webidl files.

Each could be done independently, although it might make sense to investigate making components/script/dom/bindings/typedarrays.rs generic first.

If the typed array is currently stored in a Heap, then a wrapper like HeapFloat32Array would be useful, otherwise the unsafe code can simply be hidden behind utilities, such as create_float32_array

The actual typed array JS types are found at https://github.com/servo/mozjs/blob/7184f658b7e2de8a8d288ff39001364513115782/mozjs/src/typedarray.rs

part of #30862

Activity

  1. added
    I-safety
    A-content/script
    on Jan 11, 2024
  2. changed the title [-]WebIDL: use ArrayBuffer[/-] [+]WebIDL: use TypedArray[/+] on Jan 11, 2024
  3. Taym95 commented on Feb 18, 2024

    @Taym95
    Member

    @gterzian @mrobinson this issue can be closed now.

  4. gterzian commented on Feb 19, 2024

    @gterzian
    MemberAuthor

    @Taym95 thanks a lot for the contrib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/scriptI-safety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions