Commit graph

744 commits

Author SHA1 Message Date
Josh Matthews
a85241e635
Replace unsafe uses of HandleValueArray. (#34588)
* Replace unsafe uses of HandleValueArray.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy lint.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-12-13 23:21:55 +00:00
Josh Matthews
3515b83a95
Create two-phase initialization for generated JS engine bindings (#34366)
* script: Generate a runtime initialization for static JS binding information.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Replace dummy static initializers with OnceLock.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Only initialize statics for DOM interfaces with interface objects.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Remove one unnecessary Box::leak usage.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Tidy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Hide thread-unsafe OnceLock usage inside of a wrapper type.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Mark ThreadUnsafeOnceLock::get unsafe.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Simplify ThreadUnsafeOnceLock internals.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-12-06 07:34:24 +00:00
Josh Matthews
c60e4afbee
Support custom derives for generated types (#34356)
* script: Derive more Default implementations for dictionaries.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Support arbitrary derives on generated enums.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Support arbitrary derives for generated dictionaries.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Support arbitrary derives for generated unions.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Derive more impls for generated dicts and unions.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Implement FromStr for generated enums.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* crown: Allow returning unrooted values from Default::default.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-24 18:15:50 +00:00
Josh Matthews
e956f3124c
Generate a trait abstracting over all known DOM interfaces (#34357)
* script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Update trait implementations with new generic type.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-24 07:35:14 +00:00
Josh Matthews
25a0764a37
Use out parameter for generated methods returning JSVal (#34087)
* Make generated bindings that return a WebIDL `any` value use out parameters.

Returning raw JSVal values makes it easier to create GC hazards in code
that calls these methods. Accepting a MutableHandle argument instead
ensures that the values are rooted by the caller.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update mozjs.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-11-05 08:29:08 +00:00
Josh Matthews
1070f7ac12
Fix invalid rooting for PropertyDescriptor (#34018)
* Clean up unnecessary uses of RootedGuard.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update mozjs.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-28 19:03:24 +00:00
chickenleaf
bb4932026c
cangc fixes in node.rs (#33984)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2024-10-23 22:44:50 +00:00
chickenleaf
1ae90dcd95
clippy: Fix a variety of clippy warnings in fonts, layout_2020 and the DOM code (#33894)
* fixed some clippy warnings

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* Delete extra file

Signed-off-by: chickenleaf <lashwinib@gmail.com>

* preserved newline in compositionevent.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>

* removed the newline in PrototypeList

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

* removed the trailing whitespace

Signed-off-by: L Ashwin B <lashwinib@gmail.com>

---------

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: chickenleaf <lashwinib@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-10-18 13:57:13 +00:00
Gae24
c6d305fbb3
fix clippy warnings in codegen (#33781)
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2024-10-10 16:15:05 +00:00
Gae24
5ba8054b69
refactor CGClassConstructHook to use handwritten constructors (#33614)
* extract generated class constructor hook into handwritten functions

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* downcast to window only when it's actually used

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* simplify downcast

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* rename htmlconstructor to constructor, include call_default_constructor in it

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2024-10-09 12:33:44 +00:00
Josh Matthews
7d931e673a
script: Include constructors and static methods in generated DOM traits (#33665)
* Add all constructors, special operations, and static methods to generated DOM interface traits.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Move all constructors and static methods defined in bare impl blocks inside FooMethods trait impls.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add missing doc links.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-10-08 01:51:58 +00:00
Samson
163e477668
Less allow(crown::unrooted_must_root) in bindings (#33630)
* Limit `allow(crown::unrooted_must_root)` in bindings

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extra_decorators

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-10-03 10:14:43 +00:00
Akash Pateria
c76524e63b
Fix panic in webstorage/symbol-props.window.js (#33108)
Issue: https://github.com/servo/servo/issues/32987

Signed-off-by: Akash Pateria <pateria.akash77@gmail.com>
2024-10-02 00:34:35 +00:00
Daniel Adams
4e4b137eaa
bindings: Allow Guard to take multiple conditions, check for SecureContext in ConstructorEnabled (#33508)
* Update condition handling for exposing values

- Let Guard take a list of conditions
- Check for secure context condition when exposing constructor

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Python tidy

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Make interfaces test run in secure context

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-21 09:50:05 +00:00
Martin Robinson
37ab4b9825
chore: Fix two compiler warnings (#33421)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-12 13:24:05 +00:00
Andriy Sultanov
e5150dbda1
Propagate CanGc from Document::new() (#33386)
* Add canGc as a parameter to autogenerated trait methods

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

* Propagate CanGc from Document::new()

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

---------

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
2024-09-09 22:38:01 +00:00
Taym Haddadi
6c0394bc80
Impl PartialEq and Eq for DomObject (#33212)
* Impl PartialEq and Eq for DomObject

Signed-off-by: Taym <haddadi.taym@gmail.com>

* move to Eq and PartialEq to domobject_derive

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-02 09:50:46 +00:00
Josh Matthews
60ef6bc461
Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from reflect_dom_object_with_proto.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Mark DOM constructors as GC operations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-22 11:42:36 +00:00
Koki Saito
280063eee2
Make string formatting more consistent in CodegenRust.py (#33096)
* fix: Replace string concatenation with f-string

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Replace substitute method with f-string

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Cleanup unused function `onFailureInvalidEnumValue`

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Replace %formatting with f-string

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Fix some typo

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Lint

Signed-off-by: Koki Saito <saitoto828@gmail.com>

---------

Signed-off-by: Koki Saito <saitoto828@gmail.com>
Co-authored-by: kokisaito <kosaito@indeed.com>
2024-08-18 05:02:11 +00:00
Koki Saito
db312319ae
fix: Replace callargs_is_constructing with is_constructing method (#33101)
Signed-off-by: Koki Saito <saitoto828@gmail.com>
Co-authored-by: kokisaito <kosaito@indeed.com>
2024-08-18 01:48:39 +00:00
Samson
68f4b359c5
Add exception to rejection logic in generic_call (#32950)
* exception in JS Promise

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* EXCEPTION_TO_REJECTION on generic_call

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* PromiseRejectionEvent should handle promise as object

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-06 17:12:31 +00:00
Samson
5e59988c87
webgpu: Use wgpu's instead of string errors and update limits handling (#32925)
* Use wgpu specific errors

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* WIP

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix records erasing enforcerange

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* page can already be destroyed

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Support more limits

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set good results

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set OK (not PASS) expect CRASH

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup expectation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* bad expectations

https://github.com/gfx-rs/wgpu/issues/6075
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set bad expectation

render bundleencoder needs to be rewritten

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-04 17:19:46 +00:00
Samson
f3bec0aed3
bindings: Convert certain Exceptions into Promise rejections (#32923)
* Impl promise exception to rejection for methods

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Impl promise exception to rejection for getters

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Impl promise exception to rejection for static methods

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add tests for exception to rejection

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-03 12:58:37 +00:00
Rémy SAISSY
eac54183c1
clippy: components/script/realms (#32859)
Signed-off-by: Rémy Saissy <remy.saissy@gmail.com>
2024-07-26 10:15:02 +00:00
Danila Matveev
0189b89fd1
Fixes typo in clippy::enum_variant_names (#32784)
Signed-off-by: Danila Matveev <optician_owl@fastmail.com>
Signed-off-by: Danila Matveev <usurname.r@gmail.com>
2024-07-16 09:59:12 +00:00
Bumsoo Kim
c6cb7ee981
script: Use the new C string literal in the DOM bindings (#32741)
* simple conversion to cstrings using as_ptr()

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* replaced byte strings with c strings using new helper functions

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* changed &[u8] type parameters to &CStr

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

---------

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
2024-07-11 04:18:54 +00:00
Martin Robinson
26624a109f
clippy: Fix a bunch of warnings in script (#32680)
This is just a portion of the errors that are remaining to be fixed.
2024-07-04 11:40:23 +00:00
Ngo Iok Ui (Wu Yu Wei)
63889b732f
fix: codegen on callback (#32537)
* Fix codegen on callback

* Add test callbacks to testbinding.rs
2024-06-18 16:00:14 +00:00
Samson
8bc49299c8
Revert "script: implement AbortController (#31361)" (#32243)
This reverts commit 7fce850cff.
2024-05-07 06:23:14 +00:00
Smitty
7fce850cff
script: implement AbortController (#31361)
* Implement AbortController

Signed-off-by: syvb <me@iter.ca>

* Update WPT tests

Signed-off-by: syvb <me@iter.ca>

* Address review comments

* Fix duplicate import generation

* Update WPT test expectations

* Change expectation to FAIL for flaky test

---------

Signed-off-by: syvb <me@iter.ca>
2024-05-04 15:00:01 +00:00
eri
9a76dd9325
clippy: Fix remaining warnings in generated code (#31844)
* clippy: fix warnings in generated code

* clippy: fix wrap_panic closure warnings
2024-03-25 11:12:36 +00:00
eri
8c7e9a15e1
Remove repeated imports from generated code (#31711)
* feat: try to deduplicate imports in codegen

* feat: another attempt

* feat: start testing imports

* feat: clean all global imports

* feat: remove shared imports from CGDescriptor

* feat: remove redundant imports from CGDescriptor

* fix: formatting

* fix: remove libc (base level import)

* feat: roll back named path changes

* feat: last changes and tidy

* experiment: move imports into a separate file

* fix: extra parenthesis

* fix: remove repeated allow statement
2024-03-21 13:38:16 +00:00
eri
99ddab43e8
clippy: Fix warnings in generated code (#31721)
* clippy: remove extra static lifetimes in generated code

* clippy: fix return and cast in generated code

* clippy: fix more warnings in codegen

* clippy: fix all errors from generated files
2024-03-17 21:32:47 +00:00
Samson
099bb0fa19
Use get_desired_proto in htmlconstructor (#31600)
* Use get_desired_proto in htmlconstructor

* Update expectations
2024-03-10 14:44:25 +00:00
Josh Matthews
19f1f2a8f4
Extract generated finalizers into generic helper functions. (#31569) 2024-03-08 14:15:26 +00:00
Taym Haddadi
328c376ff1
WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings (#31317)
* WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* fmt

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* introduce new_initialized_heap_typed_array function

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unsed unsafe_code

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use doc comments for ImageData

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use get_internal instead of acquire_data

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Handle JS errors in ImageData GetData and new_initialized_heap_typed_array

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix wrong assert that causes CRASH in test

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Early return for error

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Address review comments

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-02-16 16:40:45 +00:00
Taym Haddadi
c3e3e72cf2
WebIDL: Use ArrayBufferViewU8 instead of raw JSObject in bindings (#31325)
* WebIDL: Use ArrayBufferViewU8 instead of raw JSObject in bindings

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unused imports

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Address review comments

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-02-16 11:22:16 +00:00
Taym Haddadi
9be989146d
WebIDL: Use ArrayBuffer instead of raw JSObject in bindings (#31202)
* WebIDL: Use ArrayBuffer instead of raw JSObject in bindings

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Convert GPUBufferMapInfo mapping to Arc<Mutex>

* Remove #[allow(unsafe_code)] from GPUBuffer

* Add doc comments

* Implement trace for Arc<Mutex<Vec<T>>>

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use #[no_trace] for GPUBufferMapInfo.mapping

* Make create_new_external_array_buffer generic

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Address review comments

* Remove HeapTypedArray::new and avoid cloning Arc

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use expect for GetMappedRange and ReadAsArrayBuffer

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use doc comments for FileReaderSyncMethods

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Return for Error::JsFailed GetMappedRange and ReadAsArrayBuffer

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix detached_internal implementation and comments

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* format code

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update expectations

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-02-13 07:58:48 +00:00
Taym Haddadi
967925c119
webidlg: Handle Float64Array as a TypedArray rather than a raw JSObject (#31189)
* WebIDL use FLoat64Array

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use to_vec to convert array to vec

* avoid allocating a new vec

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-01-30 08:45:29 +00:00
Taym Haddadi
bb04c97f15
Use Int8array, int16array, uint16array, int32array & uint32array in WebIDL (#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>
2024-01-25 14:28:43 +00:00
Taym Haddadi
890588945d
Use Uint8Array for TextEncoder (#31145)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-01-23 12:15:42 +00:00
Taym Haddadi
9d2c102fa0
Use FLoat32Array in GamepadPose (#31106)
* Use FLoat32Array in GamepadPose

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unused create_typed_array

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-01-19 04:39:09 +00:00
Taym Haddadi
f76982e2e7
script: Use FLoat32Array in XRRay (#31087)
* use FLoat32Array in XRRay

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Apply suggestions from code review

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-01-17 10:38:01 +00:00
Taym Haddadi
6a7b450478
use FLoat32Array in XRRigidTransform (#31076)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-01-17 08:14:35 +00:00
tannal
8c53a8c745
use FLoat32Array in XRView (#31077)
* use FLoat32Array in XRView

* handle error when calling set_data

Yes, we should handle this.

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix: error handling

* chore: error message

---------

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
2024-01-16 15:56:32 +00:00
Gregory Terzian
e145c51234
WebIDL: use FLoat32Array (#30990)
* inital

* audiobuffer: return float 32 array as channel data

* add on heap float 32 array type

* fix warnings

* add list of webidl interfaces to ignore for float 32

* codegen: remove duplication of builtin return type handling

* bindings: derive default for float 32 array wrapper

* bindings: allow unsafe code in typedarrays module

* bindings: rename float 32 array wrapper

* bindings: rename HeapFloat32Array is_set method to is_initialized

* bindings: assert float 32 array is initialized before data can be acquired

* bindings: use let syntax for error handling in float 32 array wrapper

* bindings: use copy_from_slice where possible in float 32 array wrapper

* bindings: rename args in typedarray copy methods

* codegen: use idl type in builtin names for float 32 array

* bindings: add a util to create float 32 arrays, use in dom matrix readonly

* codegen: tidy

* bindings: box the heap inside heaped float 32 arrays
2024-01-11 09:43:36 +00:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +00:00
Samson
8436002383
Support Namespace const in webidl (#30492)
* Add TestNS with const

* Implement namespace const in codegen
2023-10-04 11:29:54 +00:00
Samson
ddc47aa56b
Codegen support multiple interfaces in single webidl file & WebGPU single webidl (#30448)
* Codegen support multiple interfaces in single webidl file

* Merge GPU*.webidl into WebGPU.webidl

* Update gpu files to use WebGPUBinding module file
2023-09-30 12:30:12 +00:00
Samson
ebd41d4101
Use Foo_Binding instead of FooBinding for namespace modules (#30447)
* Update Codegen.py to emit Foo_Binding instead of FooBinding

* s/FooBinding/Foo_Binding/g
2023-09-30 00:52:04 +00:00