New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebIDL: use TypedArray #31064
Labels
A-content/script
Related to the script thread
I-safety
Some piece of code violates memory safety guarantees.
Comments
gterzian
added
I-safety
Some piece of code violates memory safety guarantees.
A-content/script
Related to the script thread
labels
Jan 11, 2024
This was referenced Jan 21, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 25, 2024
…ebIDL (#31164) <!-- Please describe your changes on the following line: --> part #31064 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because there is no behavior changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> There types are not used we can migrate them, in next PR I will make `HeapFloat32Array` generic and convert ArrayBufferView, ArrayBuffer, Uint8ClampedArray and Float64Array. Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This was referenced Jan 26, 2024
This was referenced Feb 11, 2024
@gterzian @mrobinson this issue can be closed now. |
@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
Labels
A-content/script
Related to the script thread
I-safety
Some piece of code violates memory safety guarantees.
As as follow-up to #30990, we should do the same for other typed arrays.
The list is found at
servo/third_party/WebIDL/WebIDL.py
Line 3634 in 92196d9
See the various arrays which currently default to
IDLType.Tags.interface
, and which currently all fallback to using aJSObject
in codegen. Each should be changed to use it's own type, like was done in the linked-to PR forFLoat32Array
. 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 likeHeapFloat32Array
would be useful, otherwise the unsafe code can simply be hidden behind utilities, such ascreate_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
The text was updated successfully, but these errors were encountered: