aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove repeated imports from generated code (#31711)eri2024-03-214-364/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* clippy: fix `result_unit_err` warnings (#31791)eri2024-03-211-83/+76
| | | | | | | | | | | | | | | | | * clippy: fix `result_unit_err` warnings * feat: fix result warnings in script * doc: document `generate_key` return type Co-authored-by: Martin Robinson <mrobinson@igalia.com> * feat: add back result to RangeRequestBounds::get_final Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Add pseudo async Create*PipelineAsync methods (#31695)Samson2024-03-191-1/+1
| | | | | | | * Create fake CreatePipelineAsync * Update WebGPU CTS * Update expectations and disable some webgpu tests
* clippy: Fix several warnings (#31710)RustAndMetal2024-03-186-15/+10
| | | Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
* clippy: Fix warnings in generated code (#31721)eri2024-03-171-41/+49
| | | | | | | | | * 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
* rusdoc: Fix `idl` warning in components/script/dom/bindings (#31643)Oluwatobi Sofela2024-03-131-2/+2
| | | | | * rusdoc: Add valid domstring link * rustdoc: Replace unused idl link ref
* rustdoc: Fix warnings in `components/script/dom` (#31632)Azhar Ismagulova2024-03-131-2/+4
| | | | | | | | | | | | | | | * fix: fixed warnings in components/script/dom * fix: resolved comment by setting explicit link to HTMLConstructor * fix: changed the format of WHATWG link * Fix line breaking * Remove trailing white space --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix rustdoc errors in `components/script/dom` (#31617)Mucha Naibei2024-03-112-2/+2
| | | | | * Fix rustdoc errors in components/script/dom * Revert if to iff in audiobuffer.rs
* Use get_desired_proto in htmlconstructor (#31600)Samson2024-03-102-42/+15
| | | | | * Use get_desired_proto in htmlconstructor * Update expectations
* Extract generated finalizers into generic helper functions. (#31569)Josh Matthews2024-03-083-31/+60
|
* mach: Do not use unstable rust for `rustfmt` (#31441)Martin Robinson2024-02-281-5/+8
| | | | | | | | | | We can use stable rust if we pass the unstable configuration as command-line arguments to rustfmt itself. This prevents needing to install an unstable rust toolchain. The one downside here is that it doesn't seem that "ignore" is supported so we have to start formatting the files in "third_party." This shouldn't be a huge issue because we don't plan to check much more rust code into those directories.
* Rename buffer_source_type to buffer_source (#31426)Taym Haddadi2024-02-261-11/+10
| | | | | | | | | | | | | * Rename buffer_source_type to buffer_source Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Code format Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* WedIDL: bring dom/bindings/typedarray further in line with spec (#31375)Taym Haddadi2024-02-253-251/+442
| | | | | | | | | | | | | | | | | * WedIDL: bring dom/bindings/typedarray further in line with spec Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Rename HeapBufferSourceTypes to HeapBufferSource Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * fmt code Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Fix crash when closing window containing video element (#31413)Josh Matthews2024-02-231-0/+9
| | | | | * Forbid casting DOM objects when JS runtime is shutting down. * Remove media controls from document when element is removed from the tree.
* script: Do not run layout in a thread (#31346)Martin Robinson2024-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Do not run layout in a thread Instead of spawning a thread for layout that almost always runs synchronously with script, simply run layout in the script thread. This is a resurrection of #28708, taking just the bits that remove the layout thread. It's a complex change and thus is just a first step toward cleaning up the interface between script and layout. Messages are still passed from script to layout via a `process()` method and script proxies some messages to layout from other threads as well. Big changes: 1. Layout is created in the script thread on Document load, thus every live document is guaranteed to have a layout. This isn't completely hidden in the interface, but we can safely `unwrap()` on a Document's layout. 2. Layout configuration is abstracted away into a LayoutConfig struct and the LayoutFactory is a struct passed around by the Constellation. This is to avoid having to monomorphize the entire script thread for each layout. 3. Instead of having the Constellation block on the layout thread to figure out the current epoch and whether there are pending web fonts loading, updates are sent synchronously to the Constellation when rendering to a screenshot. This practically only used by the WPT. A couple tests start to fail, which is probably inevitable since removing the layout thread has introduced timing changes in "exit after load" and screenshot behavior. Co-authored-by: Josh Matthews <josh@joshmatthews.net> * Update test expectations * Fix some issues found during review * Clarify some comments * Address review comments --------- Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* WebIDL: Use Uint8ClampedArray instead of raw JSObject in bindings (#31317)Taym Haddadi2024-02-162-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* WebIDL: Use ArrayBufferViewU8 instead of raw JSObject in bindings (#31325)Taym Haddadi2024-02-161-0/+2
| | | | | | | | | | | | | | | | | * 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>
* Fix rooting of external array buffer pointer (#31342)Taym Haddadi2024-02-141-3/+5
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* WebIDL: Use `ArrayBuffer` instead of raw `JSObject` in bindings (#31202)Taym Haddadi2024-02-132-11/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* docs: dom binding link fixes (#31311)Abhay Raj Singh2024-02-111-4/+5
|
* webidlg: Handle `Float64Array` as a `TypedArray` rather than a raw ↵Taym Haddadi2024-01-301-0/+2
| | | | | | | | | | | | | | | `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>
* Make HeapFloat32Array generic (#31167)Taym Haddadi2024-01-291-26/+48
| | | | | | | | | | | | | | | | | * Make HeapFloat32Array generic Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Define all the methods defaults on the HeapTypedArray trait Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use generic type instead of trait Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Use Int8array, int16array, uint16array, int32array & uint32array in WebIDL ↵Taym Haddadi2024-01-251-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#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>
* Use Uint8Array for TextEncoder (#31145)Taym Haddadi2024-01-232-16/+26
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-227-31/+31
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Fix trivial typo in variable name (#31143)Olivier Tilloy2024-01-211-2/+2
|
* Use FLoat32Array in GamepadPose (#31106)Taym Haddadi2024-01-193-15/+10
| | | | | | | | | | | | | * 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>
* script: Use FLoat32Array in XRRay (#31087)Taym Haddadi2024-01-171-1/+1
| | | | | | | | | | | | * 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>
* use FLoat32Array in XRRigidTransform (#31076)Taym Haddadi2024-01-171-1/+1
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* use FLoat32Array in XRView (#31077)tannal2024-01-161-1/+1
| | | | | | | | | | | | | | | | | * 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>
* WebIDL: use FLoat32Array (#30990)Gregory Terzian2024-01-113-5/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-019-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix intermittent crashes in paint worklets (#30671)Martin Robinson2023-11-021-0/+7
| | | | | | | | | | Garbage collection means that the worklets might drop after the script head has been cleaned up. The worklet now caches the thread pool in the DOM object itself which should prevent it from needing to access script thread TLS when being cleaned up. The value is stored as a OnceCell to maintain the same lazy thread pool creation pattern as before. Fixes #25838. Fixes #25258.
* Support Namespace const in webidl (#30492)Samson2023-10-042-8/+15
| | | | | * Add TestNS with const * Implement namespace const in codegen
* Codegen support multiple interfaces in single webidl file & WebGPU single ↵Samson2023-09-302-4/+25
| | | | | | | | | webidl (#30448) * Codegen support multiple interfaces in single webidl file * Merge GPU*.webidl into WebGPU.webidl * Update gpu files to use WebGPUBinding module file
* Use Foo_Binding instead of FooBinding for namespace modules (#30447)Samson2023-09-303-12/+28
| | | | | * Update Codegen.py to emit Foo_Binding instead of FooBinding * s/FooBinding/Foo_Binding/g
* Update mozjs to a version that includes SpiderMonkey ESR 115 (#30379)Samson2023-09-201-2/+0
| | | | | | | | | | | | | | | * Update mozjs to sm115 * fix module stuff https://phabricator.services.mozilla.com/D163949 * fix always allow cloning https://bugzilla.mozilla.org/show_bug.cgi?id=1774866 * Update expectations toStringTag now works on wasm object due to SM bump
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-1127-404/+347
| | | | | * strict imports formatting * Reformat all imports
* Use MozTools 4 and update mozjs (#30326)Samson2023-09-114-5/+5
| | | | | | | | | | | | | | | | | | | * Update mozjs * moztools4 in bootstrap * no autoconf * tidy * switch to servo-build-deps * update mozjs for real * glue mozjs * fmt * move to servo/mozjs
* remove `extern crate` (#30311)Samson2023-09-084-3/+4
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Replace a method call now deprecated in mozjs (#30307)Martin Robinson2023-09-061-1/+1
|
* Impl Setlike and Maplike (#30237)Samson2023-09-064-4/+382
| | | | | | | | | | | | | | | | | | | * MallocSizeOf for Index{Set, Map} * like as iterable in WebIDL * Codegen magic for like interfaces * TestBinding for like * Test for Setlike and Maplike test bindings * Some fixes * Switch to any.js * nit * Keep order
* build(deps): bump bitflags from 1.3.2 to 2.3.1 (#30273)Martin Robinson2023-09-011-1/+1
| | | | | | Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.2 to 2.3.1. - [Release notes](https://github.com/bitflags/bitflags/releases) - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md) - [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.3.1)
* Use std::cell::OnceCell and remove mitochondria dependency (#30207)Martin Robinson2023-08-251-4/+3
| | | | | `OnceCell` is now part of the standard library and we'll be able to use it once we upgrade rust. For now we can use the version that's shipped behind a feature flag in rust. This removes a dependency on one crate.
* Fix the 32-bit build (#30204)Martin Robinson2023-08-251-2/+2
| | | | Use the `libc::char` to represent a pointer to characters rather than `i8`. This fixes the build for the Raspberry Pi and Android 32-bit.
* Fix warnings after chrono upgrade (#30165)Martin Robinson2023-08-231-5/+8
| | | | Some functions are now deprecated, so use the suggested ones and do a general cleanup of the affected lines of code.
* Upgrade whole webgpu stack (#29795)Samson2023-08-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow noidl files in script/dom/webidls * Upgrade wgpu to 0.16 and refresh whole webgpu implementation * Update WebGPU test expectations * misc * MutNullableDom -> DomRefCell<Option<Dom for GPUTexture * Direct use of GPUTextureDescriptor * Remove config from GPUCanvasContext * misc * finally blue color * gpubuffer "handle" error * GPU object have non-null label * gpu limits and info * use buffer_size * fix warnings * Cleanup * device destroy * fallback adapter * mach update-webgpu write webgpu commit hash in file * Mising deps in CI for webgpu tests * Updated expectations * Fixups * early reject * DomRefCell<Option<Dom -> MutNullableDom for GPUTexture
* Use mozjs tracing infrastructure (#29918)Samson2023-08-102-336/+51
| | | | | | | * Update mozjs https://github.com/servo/mozjs/commit/64711ec2e6dc4595df691bffc7f1e5052ab86c8d also fixes https://github.com/servo/servo/issues/30043 * Move to mozjs Traceable and introduce CustomTraceable
* No tracing of nop traceable fields (#29926)Samson2023-08-041-482/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add `no_trace` option to JSTraceable derive * NoTrace wrapper * Port some types to no_trace schematics * Fixing my unsafe mistakes (not tracing traceables) * Add docs & safety guards for no_trace Safety guards (trait shenanigans) guarantees safety usage of `no_trace` * Port canvas_traits to no_trace * Port servo_media to no_trace * Port net_traits to no_trace * Port style to no_trace * Port webgpu to no_trace * Port script_traits to no_trace * Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace * unrooted_must_root lint in seperate file * Add trace_in_no_trace_lint as script_plugin * Composable types in must_not_have_traceable * Introduced HashMapTracedValues wrapper * `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>` * Port rest of servo's types to no_trace * Port html5ever, euclid, mime and http to no_trace * Port remaining externals to no_trace * Port webxr and Arc<Mutex<_>> * Fix spelling in notrace doc
* Auto merge of #29850 - servo:css-viewport-removal, r=mrobinsonbors-servo2023-06-301-7/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | CSS viewport removal It was removed from the spec and it's disabled everywhere. This also removes the meta viewport support (which was implemented on top), but that also had a single test and is disabled everywhere, so I'm not too concerned, it can be implemented again if / when needed. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26349 - [x] There are tests for these changes