aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings
Commit message (Collapse)AuthorAgeFilesLines
...
* Impl PartialEq and Eq for DomObject (#33212)Taym Haddadi2024-09-021-6/+0
| | | | | | | | | | | | | * 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>
* webgpu: Sync `GPUBuffer` (#33154)Samson2024-08-272-41/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * More helpers on `Promise` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Sync `GPUBuffer` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set some good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Some bad expect also on firefox Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Extract DataBlock, DataView impl from GPUBuffer Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix size check to work on 32bit platforms Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Use global exports from derives (#33169)Samson2024-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pub reexport *Traceable Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * reexport `HasParent` for derives Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * reexport DomObject, Reflector, MutDomObject Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fmt Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update lib.rs Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com> * Update lib.rs Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com> * Update lib.rs Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
* Start marking functions that can transitively trigger a GC (#33144)Josh Matthews2024-08-224-6/+22
| | | | | | | | | | | | | | | | | * 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>
* Fix incorrect documentation and add `track_caller` to DomRefCell methods ↵Simon Wülker2024-08-191-4/+16
| | | | | | | | | | | | | | | | | | | (#33111) * Fix DomRefCell documentation about panic behaviour Fixes https://github.com/servo/servo/issues/33099 Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Annotate DomRefCell::borrow/borrow_mut with #[track_caller] Fixes https://github.com/servo/servo/issues/27336 Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Make string formatting more consistent in `CodegenRust.py` (#33096)Koki Saito2024-08-181-1047/+927
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* fix: Replace callargs_is_constructing with is_constructing method (#33101)Koki Saito2024-08-184-13/+8
| | | | Signed-off-by: Koki Saito <saitoto828@gmail.com> Co-authored-by: kokisaito <kosaito@indeed.com>
* webxr: Update XRSession to latest spec (#33059)Daniel Adams2024-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add missing XRSession members, initial implementations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement supportedFramerates getter Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement framerate changes, add spec links Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update WPT expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * ./mach fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec link Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Handle failed string conversions in console.log. (#33085)Josh Matthews2024-08-161-0/+1
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Update codegen for GetOpener:inRealms in Bindings.conf (#33062)Taym Haddadi2024-08-151-1/+1
| | | Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Fix warnings after latest rust upgrade (#33043)Martin Robinson2024-08-141-6/+6
| | | | | | | This fixes various unused code warnings after the recent rust upgrade. Some of the dead code is maintained, as it is quite likely that it will be used in future changes. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Replace the lazy_static crate whth `std::sync::LazyLock` in ↵Hayashi Mikihiro2024-08-121-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | components/script (#33004) * replace in str.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace navigator.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace htmlmetaelement.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace document.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace cssstyledeclaration.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace script_runtime.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * replace window_named_properties.rs Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * reduce dependency lazy_static Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * reduce lazy in script_runtime.rs `Mutex::new()` is const contexts. I think that `JS_ENGINE` is need not lazy initialize. Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* Add exception to rejection logic in `generic_call` (#32950)Samson2024-08-062-14/+30
| | | | | | | | | | | | | | | | | | | | | * 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>
* webgpu: Use wgpu's instead of string errors and update limits handling (#32925)Samson2024-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* bindings: Convert certain Exceptions into Promise rejections (#32923)Samson2024-08-033-16/+187
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* fix: Memory leak from CreateProxyWindowHandler (#32773)Erik Hennig2024-08-012-15/+6
| | | | | | | | | | | | | | | | | * fix: Memory leak from CreateProxyWindowHandler Signed-off-by: ede1998 <online@erik-hennig.me> * fix: memory leak in WindowProxy Signed-off-by: ede1998 <online@erik-hennig.me> * fix: Memory leak in WindowProxyHandler through static Signed-off-by: ede1998 <online@erik-hennig.me> --------- Signed-off-by: ede1998 <online@erik-hennig.me>
* Update mozjs (SpiderMonkey) to 128.0 (#32769)Samson2024-07-293-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix changed readTransfer callback https://bugzilla.mozilla.org/show_bug.cgi?id=1842713 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Use NewExternalArrayBuffer from glue https://github.com/servo/mozjs/pull/474/commits/d33454be74ec5b8d8faf51fab3ed477b8913898b Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix columnorigin and filename being in latin1 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup newexternalarray Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Float16 (this might require more work for codegen support) https://bugzilla.mozilla.org/show_bug.cgi?id=1833647 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * js.strict is removed https://bugzilla.mozilla.org/show_bug.cgi?id=1621603 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * asm options are now somewhere else https://hg.mozilla.org/mozilla-central/rev/26045c88e3972957087d535e7f259e08857bd2a2 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Comment out offthread compilation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set NDK to 26 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix 1-origin handling Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Expect `FinalizationRegistry` interface Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * more expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Add `WeakRef` to interfaces expectation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * mozjs upgrade: fixes for Android Android NDK's layout has changed in r26 and 'lib64' no longer exists under `toolchain/llvm/prebuilt/linux-x86_64`. The libraries that used to be it are now present in `lib` folder itself. This patch updates the build configuration to use the `lib` folder instead when configuring the LIBCLANG_PATH environment variable. This patch also updates to a newer mozjs version that includes fixes for linker errors faced on Android (see #32769). Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Patch libz-sys & update mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * update NDK version in README Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Use servo/mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update mozjs again Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* clippy: components/script/realms (#32859)Rémy SAISSY2024-07-261-1/+1
| | | Signed-off-by: Rémy Saissy <remy.saissy@gmail.com>
* Gamepad: Implement GamepadHapticActuator (#32046)Daniel Adams2024-07-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement Servo side of GamepadHapticActuator Signed-off-by: Daniel Adams <msub2official@gmail.com> * Get build working Signed-off-by: Daniel Adams <msub2official@gmail.com> * Create effect handling on embedder side Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update tracing for GamepadHapticEffect Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update gilrs to point to commit with effect complete event Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement playing and preempting haptic effects Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update IDL to add trigger rumble Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update WPT expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Handle stopping haptic effects from reset() Signed-off-by: Daniel Adams <msub2official@gmail.com> * ./mach fmt, fix test-tidy issues Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add extra validity checks for trigger rumble Signed-off-by: Daniel Adams <msub2official@gmail.com> * Retrieve supported haptic effects from embedder Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix test expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec link, pin gilrs commit Signed-off-by: Daniel Adams <msub2official@gmail.com> * servoshell cargo formatting Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix Cargo.toml Signed-off-by: Daniel Adams <msub2official@gmail.com> * Additional comments, realm proof, naming Signed-off-by: Daniel Adams <msub2official@gmail.com> * ./mach fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update gilrs rev to gilrs-core 0.5.12 release Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement sequence ids for gamepad haptic promises Signed-off-by: Daniel Adams <msub2official@gmail.com> * Take playing effect promise instead of cloning Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement listener for reset function Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix Cargo.lock Signed-off-by: Daniel Adams <msub2official@gmail.com> * Restructure IPC listeners, add comments, handle visibility change Signed-off-by: Daniel Adams <msub2official@gmail.com> * Check that haptic effect still exists before handling ff completion event Signed-off-by: Daniel Adams <msub2official@gmail.com> * Visibility steps, add InRealm bindings for promises Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add Gamepad EmbedderMsg arms to egl servo_glue Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fixes typo in clippy::enum_variant_names (#32784)Danila Matveev2024-07-161-1/+1
| | | | Signed-off-by: Danila Matveev <optician_owl@fastmail.com> Signed-off-by: Danila Matveev <usurname.r@gmail.com>
* script: Use the new C string literal in the DOM bindings (#32741)Bumsoo Kim2024-07-114-61/+58
| | | | | | | | | | | | | | | | | * 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>
* Fix more clippy (#32740)石蕊 (Pi-Cla)2024-07-091-2/+2
|
* Replace null-byte terminated string literals with C-string literals (#32716)Bumsoo Kim2024-07-062-6/+6
| | | | | | | | | | | | | * simple conversion from byte string to c-string Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> * convert byte strings to c-strings to c_char ptr Signed-off-by: Bum Kim <bumcrystlbum@gmail.com> --------- Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
* script: Impl cloning of JSPrincipals (#32706)Samson2024-07-062-3/+61
| | | | | | | * Impl cloning of JSPrincipals * bincode as workspace dependency * Update mozjs and cc
* clippy: Fix a bunch of warnings in `script` (#32680)Martin Robinson2024-07-0412-50/+89
| | | This is just a portion of the errors that are remaining to be fixed.
* webgpu: Implement ShaderCompilationInfo (#32642)Samson2024-07-021-1/+6
| | | | | | | | | * ShaderCompilationInfo * expectations * Handle CompilationInfo promise in GPUShaderModule * Fix my english
* webgpu: Update wgpu and revamp computepass (#32575)Samson2024-06-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not wait on drop, but rather wake poller thread * Update wgpu and render stuff * Set some good expectations * Update wgpu again * handle IPC error as warning * More good expectations * Some more expectations CTS does not match the spec: https://github.com/gpuweb/cts/issues/3806 * This expectations are due to other changes in servo also happening on main * Explain error_command_encoders and remove RefCell around it * fixup * store validness of passes * More good expectations * More docs * this assert is wrong * This is even more right per CTS/spec Only Command encoder state errors are allowed here, but wgpu does not exposes them. * More good expectations * One bad expectation * Fix my english
* Proper GPUDevice cleanup (#32520)Samson2024-06-201-0/+1
| | | | | | | | | | | * Make device cleanup right * Use weakref for GPUDevice in globalscope * No need to destroy device on drop * DeviceReason early return * make remove_gpu_device to be the only way to remove device
* fix: codegen on callback (#32537)Ngo Iok Ui (Wu Yu Wei)2024-06-181-6/+15
| | | | | * Fix codegen on callback * Add test callbacks to testbinding.rs
* implement basic infra for ResizeObserver (#31108)Gregory Terzian2024-06-171-0/+1
|
* webgpu: Implement device lost (#32354)Samson2024-06-171-1/+1
| | | | | | | | | | | | | * device lost promise should be init at creation of device object * device lost impl * lock for device poll workaround for wgpu deadlocks * expect * Less lost reason reasoning in script
* Update WebIDL.py (#32495)Ngo Iok Ui (Wu Yu Wei)2024-06-151-5/+5
| | | | | | | | | | | | | | | | | * Update WebIDL.py * Update WebIDL.py * Add builtin-array.patch * Fix CodegenRust.py and Configuration.py * Fix missing downcasts * mach fmt * Update check and comment to explain why we need this check * Update Global of DissimilarOriginWindow.webidl
* Update to Rust 1.78 (#32217)Samson2024-06-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update to rust 1.78 * Update crown for rust 1.78 * rust 1.78 is now stable * Update for nix * Update comment Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update support/crown/src/common.rs * Update support/crown/Cargo.toml * Update support/crown/src/common.rs * Fix ipc problem * Update ipc-channel to 0.18.1 * fixed fixme --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* webgpu: Move errorscopes to WGPU thread (#32304)Samson2024-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | * Prepare errorscopes logic in wgpu_thread * remove scope_id from ipc * new GPUErrors per spec * remove cotent timeline error_scope * fixup poperrorscope types * device_scope -> gpu_error and nice errors * Handle errors detection more elegantly * good expectations * new expectations * Make error_scope.errors Vec as per spec
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* fix: Implement additional logic in ↵shanehandley2024-05-131-1/+12
| | | | DOMString::set_best_representation_of_the_floating_point_number in order to correct some failing tests related to -0 values. (#32272)
* clippy: Fix vtable_address_comparisons error (#32262)sergiitomusiak2024-05-091-1/+5
| | | | | | | | | | | | * clippy: Fix vtable_address_comparisons error * Update components/script/dom/bindings/root.rs Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com> --------- Co-authored-by: Sergii Tomusiak <sergiitomusiak@github.com> Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
* Revert "script: implement AbortController (#31361)" (#32243)Samson2024-05-073-10/+6
| | | This reverts commit 7fce850cffb72a6fbcf763a40164a9b35b7fa833.
* script: implement AbortController (#31361)Smitty2024-05-043-6/+10
| | | | | | | | | | | | | | | | | | | | | * 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>
* Fix some clippy warnings in `components/gfx` and `components/script` (#32215)Pi-Cla2024-05-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clippy: Squish warnings and errors in gfx warning: redundant closure (gfx/font.rs:415:18) warning: useless conversion to the same type (gfx/font.rs:534:9) warning: the following explicit lifetimes could be elided: 'a (gfx/font.rs:619:16) error: this loop never actually loops (gfx/font_cache_thread.rs:112:9) warning: this expression creates a reference which is immediately dereferenced by the compiler (gfx/font_cache_thread.rs:229:51) warning: redundant closure (gfx/font_cache_thread.rs:551:18) 3 instances of: warning: casting integer literal to `f64` is unnecessary (gfx/platform/freetype/font_list.rs:271-273) * clippy: methods called `from_*` usually take no `self` It reports that by standard convention, from_* methods should not take any `&self` parameter * clippy: you should consider adding a `Default` implementation It reports that public types with a pub fn new() -> Self should have a Default implementation since they can be constructed without arguments * clippy: casting to the same type is unnecessary (`f32` -> `f32`) * clippy: use of `unwrap_or_else` to construct default value * clippy: methods called `is_*` usually take `self` by mutable reference or `self` by reference or no `self` * clippy: manual `!RangeInclusive::contains` implementation contains expresses the intent better and has less failure modes (such as fencepost errors or using || instead of &&) * clippy: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]` * clippy: Fix some new warnings warning: this `if` statement can be collapsed (gfx/font.rs:468:130) warning: this lifetime isn't used in the impl (gfx/platform/freetype/font.rs:341:6) warning: field assignment outside of initializer for an instance created with Default::default() (compositor.rs:881:17)
* Address issues uncovered by rust-1.78 beta (#32130)Martin Robinson2024-04-222-31/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes changes to allow Servo to compile with the 1.78 version of Rust: - Dead code is removd (Rust seems to have gotten better at detecting it). - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice [^1]. - The `imports.rs` now explicitly silences warnings about unused imports. [^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179 <!-- Please describe your changes on the following line: --> --- <!-- 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 - [x] These changes do not require tests because they should not change behavior. <!-- 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. -->
* clippy: Fix several warnings in `components/script/dom/bindings` (#31945)Azhar Ismagulova2024-04-034-5/+6
| | | | | | | | | * clippy: fix several warnings in components/script/dom/bindings * fix: allow non_canonical_clone_impl in components/script/dom/bindings * chore: removed unnecessary curly braces * fix: removed vtable_address_comparisons allow
* script: Reduce the use of `unsafe` in LayoutDom (#31979)Martin Robinson2024-04-031-1/+1
| | | | | | | | | | | | | Remove the use of unsafe code in the layout wrappers of the DOM. The main change here is that `unsafe_get()` no longer needs to be an unsafe method, which allows us to transitively remove or reduce unsafe blocks from callers. The function itself is not renamed, because it's still a bit dangerous to start removing the layers of abstraction from actual DOM nodes. In addition `init_style_and_opaque_layout_data` can be merged into `initialize_data`, which removes one more unsafe method. Finally, a "Safety" section is added to some unsafe methods.
* clippy: Allow `too_many_arguments` for all functions (#31962)komuhangi2024-04-012-0/+4
| | | | | This is the start of preventing this in the future. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fixed various clippy warnings (#31954)Rosemary Ajayi2024-03-311-1/+1
|
* clippy: Fix `from_over_into` warnings (#31946)eri2024-03-302-15/+15
|
* clippy: Fix `match_like_matches` warnings (#31947)eri2024-03-301-4/+2
| | | | | | | | | * clippy: Fix `match_like_matches` warnings * Fix link to custom element state in specification. --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix a variety of warnings in components/script/dom (#31894)Ekta Siwach2024-03-295-17/+26
|
* clippy: Fix needless_lifetimes warnings (#31933)Oluwatobi Sofela2024-03-291-2/+2
|
* clippy: Fix len_zero warnings (#31935)Oluwatobi Sofela2024-03-291-1/+1
|