aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix crash in screenX and screenY getters returning negative values (#35235)webbeef2025-01-311-3/+3
| | | | | Instead of casting the window client rect to `u32`, keep it as `i32` and just cast the size dimensions to `u32`. Signed-off-by: webbeef <me@webbeef.org>
* script_traits: Rename `ConstellationControlMsg` to `ScriptThreadMessage` ↵Martin Robinson2025-01-303-97/+93
| | | | | | | | | | | (#35226) At some point in the past this message was only sent from the `Constellation` to `script`, but nowadays this is sent from various parts of servo to the `ScriptThread`, so this is a better name. In particular, the current name makes it seeem like this message controls the `Constellation`, which it does not. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Use aws-lc-rs as rust-tls provider (#35106)Jonathan Schwender2025-01-302-2/+2
| | | Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Don't fire slotchange events when there's already a pending event for the ↵Simon Wülker2025-01-303-13/+33
| | | | | | | | | | | | | | | same slot (#35222) * Don't fire slotchange events if there is already a pending event for the same slot Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Include `WebViewId` into EmbedderMsg variants where possible (#35211)Delan Azabani2025-01-3033-194/+262
| | | | | | | | | | | | | | | | | `EmbedderMsg` was previously paired with an implicit `Option<WebViewId>`, even though almost all variants were either always `Some` or always `None`, depending on whether there was a `WebView involved. This patch adds the `WebViewId` to as many `EmbedderMsg` variants as possible, so we can call their associated `WebView` delegate methods without needing to check and unwrap the `Option`. In many cases, this required more changes to plumb through the `WebViewId`. Notably, all `Request`s now explicitly need a `WebView` or not, in order to ensure that it is passed when appropriate. Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Potentially signal a slot change in Node::insert (#35221)Simon Wülker2025-01-301-1/+28
| | | | | | | | | | | | | * Potentially signal a slot change in Node::insert Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Use "slot" attribute for slottable name (#35191)Simon Wülker2025-01-292-74/+14
| | | | | | | | | | | | | | | | | * Implement Element::slot attribute Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Simplify slottable name update Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* bindings: Move string-related bindings code to script_bindings. (#35172)Josh Matthews2025-01-295-601/+8
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Never compute style for children of shadow hosts (#35198)Simon Wülker2025-01-281-25/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is some interesting history to this change: * https://github.com/servo/servo/issues/33495: Servo crashes on Cloudflare's turnstile, because we didn't compute style for elements inside shadow trees * https://github.com/servo/servo/pull/34298: Resolves the issue by computing style for children of a potential shadow root, in addition to the children of an element * https://github.com/servo/servo/pull/34701: Changes layout of elements with shadow roots such that only the contents of the shadow root are laid out Now, we compute style for both the children of the element and a potential shadow root, but only lay out the contents of the shadow tree (if there is one). This behaviour is not technically incorrect, since regular children are not included in layout their style doesn't matter. However, it is inefficient: the only case where we need to compute style for a child of a shadow host is when that child is an assigned slottable in a slot somewhere else. This part 1/n of upstreaming the changes necessary to lay out `<slot>` contents. Note that trying to compute style for `<slot>` contents *and* children of shadow hosts will crash in stylo, since it expects to see each element only once. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* libservo: Stop using `script_traits` in the embedding layer (#35185)Martin Robinson2025-01-289-23/+30
| | | | | | | | | | | | | | | Many types used directly in the `libservo` API are in the `script_traits` crate, which was created to break circular dependencies. Move all API exposed types to `embedder_traits` which now contains types exposed via the `libservo` embedding API. Also expose these at the root of the `libservo` `servo` crate so that the API won't break when they move around in the future. The idea with `embedder_traits` in the future is that it contains types that are available throughout servo because they are used in the embedding API and thus should have minimal dependencies on other Servo crates (a bit like `base`). Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Script: implement `ReadableStreamBYOBReader::Read` (#35040)Taym Haddadi2025-01-276-222/+399
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Script: implement ReadableStreamBYOBReader::Read Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix ReadRequest::close_steps Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * implement viewed_buffer_array_byte_length and byte_length Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Correct BufferSource implemntation Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Correct detach_buffer implemantation Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix JS_IsArrayBufferViewObject usage Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Reduce BufferSource to two variants ArrayBuffer and ArrayBufferView Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Add more doc and use promise.reject_error Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* Propagate events from slottables to their assigned slot instead of their ↵Simon Wülker2025-01-271-3/+26
| | | | | | | | | | | | | | | parent (#35177) * Propagate events from slottables to their assigned slot instead of their parent Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fire slot change events when the slot content changes (#35137)Simon Wülker2025-01-277-12/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add the onslotchange attribute to ShadowRoot Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec comments to MutationObserver::queue_mutation_observer_microtask Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add DomRefCell::take Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec comments to notify_mutation_observers Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fire slotchange events when a slot changes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix check for when to dispatch slot events Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Potentially fire slot change events in Node::remove Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Bump stylo Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Move "signal a slot change" into ScriptThread impl Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove UTF-8 BOM before parsing JSON (#35175)shanehandley2025-01-272-19/+26
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: Do not set up an IPC route for every image load (#35041)Martin Robinson2025-01-258-200/+222
| | | | | | | | | | | | Instead of setting up a route for every image load in the DOM / Layout, route all incoming image cache responses through the `ScriptThread`. This avoids creating a set of file descriptor for every image that is loaded. This change requires having the `ImageCache` track the `PipelineId` of the original the listener so that the `ScriptThread` can route it properly to the correct `Window`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Add an initial WebView data structure to the API (#35119)Delan Azabani2025-01-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new handle-based webview API to libservo, with two main design goals: 1. The lifetime of the handles controls the lifetime of the webview, giving the embedder full control over exactly when webviews are created and destroyed. This is consistent with how WebKitGTK’s WebView works; the engine can only create webviews via a create request, and can only destroy them via a close request. 2. All methods are infallible; if the constellation dies, the embedder finds out when calling Servo::handle_events. For the moment, the embedder is only responsible for creating the WebView id, and not the internal TopLevelBrowsingContext data structures. This is so that the ScriptThread is able to get a handle on the new WebView's WindowProxy in the case that it's an auxiliary browsing context. In the future, the embedder should also be responsible for creating the TopLevelBrowsingContext and the ScriptThread should have mechanism to associate the two views so that WebView creation is always executed through the same code path in the embedding layer. For now, it's enough that the embedder can get a handle to the new WebView when it's creation is requested. Once we replace EmbedderMsg with a webview delegate trait, we will pass WebView handles to the embedder, rather than webview ids. We’ll also add detailed docs, once the design settles. Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Make generated bindings generic over DOM types (#35169)Josh Matthews2025-01-253-5/+17
| | | | | | | | | | | | | | | | | * bindings: Start making generated bindings methods generic over DOM trait. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * bindings: Make binding initialization generic over the DOM types trait. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * bindings: Start making proxyhandler code generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add support for HTMLStyleElement.media (#35148)webbeef2025-01-251-28/+48
| | | Signed-off-by: webbeef <me@webbeef.org>
* [35131] Borrow hazard in Document::broadcast_active_resize_observations (#35168)Domenico Rizzo2025-01-251-3/+5
| | | | | | | | | | | | | * removed panic status: added cloned and collect Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> * applied fmt Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Use Dom in native promise handlers instead of Trusted (#35145)Taym Haddadi2025-01-251-49/+33
| | | | | | | | | | | | | * Use Dom in native promise handlers instead of Trusted Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove #[cfg_attr(crown, allow(crown::unrooted_must_root))] Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* script: Move code generation and webidl files to new script_bindings crate. ↵Josh Matthews2025-01-24464-25082/+17
| | | | | (#35157) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Handle shadow roots when determining common ancestors of dirty ↵Josh Matthews2025-01-241-2/+9
| | | | | roots. (#35132) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* dom: set composed flag when constructing `ClipboardEvent` (#35146)Gae242025-01-233-3/+9
| | | | | | | | | | | | | * clipboardevent: set composed flag Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add clipboardevent test expectations Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Update the FormData constructor to allow providing a submitter (#35066)shanehandley2025-01-233-7/+52
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: Avoid unwraps in DocumentOrShadowRoot::element_from_point. (#35130)Josh Matthews2025-01-231-1/+11
| | | | | | | | | | | | | * script: Handle shadow roots in DocumentOrShadowRoot::element_from_point. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clippy fixes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Implement Event propagation across shadow roots (#34884)Simon Wülker2025-01-224-16/+89
| | | | | | | | | | | | | | | | | * Implement Event.composed flag Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow composed events to pass shadow boundaries Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove BlobState abstraction (#35114)Simon Wülker2025-01-221-182/+128
| | | | | | | | | | | | The BlobState enum was used to track whether a GlobalScope was managing any blobs (effectively like an `Option<HashMap>`, being `None` if no blobs are being managed) This is a pointless abstraction, as a HashMap is already allowed to be empty. Removing `BlobState` and just using a HashMap directly reduces noise and panic! invocations when working with the blob store. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Add support for HTMLStyleElement.type (#35038)webbeef2025-01-212-8/+51
| | | Signed-off-by: webbeef <me@webbeef.org>
* Set descendant's attribute's owner document in Node::adopt (#35076)Simon Wülker2025-01-192-6/+23
| | | | | | | | | | | | | * Set descendant's attribute's owner document in Node::adopt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add test that adopting an element into a new doc updates the attribute' owner docs Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement shadow dom slots (#35013)Simon Wülker2025-01-1913-12/+736
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement slot-related algorithms Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Hook up slot elements to DOM creation logic Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set a slot assignment mode for servo-internal shadow roots Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Assign slots when a slottable's slot attribute changes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Properly compute slot name Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach test-tidy Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update <slot> name when name attribute changes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement fast path for Node::assign_slottables_for_a_tree assign_slottables_for_a_tree traverses all descendants of the node and is potentially very expensive. If the node is not a shadow root then assigning slottables to it won't have any effect, so we take a fast path out. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Move slottable data into ElementRareData This shrinks all element descendants back to their original size. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Address review comments Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Make worker script errors more informative. (#35070)Josh Matthews2025-01-191-2/+2
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix crash when using builtin memory profiler (#35058)Josh Matthews2025-01-192-5/+18
| | | | | | | | | | | | | * script: Don't store explicit global roots inside timer storage. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Expose hook for MallocConditionalSizeOf usage. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Remove workaround for fixed ICE (#35069)Simon Wülker2025-01-191-4/+1
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove unneeded allow annotation. (#35025)Josh Matthews2025-01-192-2/+0
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Feature-gate all crown support. (#35055)Josh Matthews2025-01-18219-415/+435
| | | | | | | | | | | | | * script: Feature-gate all crown support. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Use cfg(crown) instead of a cargo feature. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* DataTransfer: propagate CanGc argument (#35062)Gae242025-01-185-18/+41
| | | Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* servo-media 1e28d1d997: don't unwrap ServoMedia::get() (#35049)mcclure2025-01-186-8/+7
| | | Signed-off-by: mcc <andi.m.mcclure@gmail.com>
* Support future uses of traits with associated types in rooting analysis (#34359)Josh Matthews2025-01-163-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * crown: Support Rc<T::Promise> and callback objects parameterized over a trait.. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * crown: Verify that attributes match between trait associated types and impls. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * crown: Check type aliases as part of associated type checks. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * crown: Add periods to all diagnostic messages. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix compile-fail test expectations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Remove typedarray_elem_siz (#35022)Taym Haddadi2025-01-161-19/+6
| | | Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* chore: Update wgpu and fix webgpu pref (#35020)Samson2025-01-161-3/+3
| | | | | | | | | | | | | | | | | * Update wgpu to v24 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * `dom.webgpu.enabled` -> `dom_webgpu_enabled` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* script: Implement `set_up`, `ReleaseLock`, `Closed`, `Cancel`, ↵Taym Haddadi2025-01-158-196/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `acquire_byob_reader` for `ReadableStreamBYOBReader` (#34958) * introduce ReadableStreamGenericReader to share functionality between ReadableStreamDefaultReader and ReadableStreamBYOBReader Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * implement set_up, ReleaseLock, Closed, Cancel for ReadableStreamBYOBReader Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Implement acquire_byob_reader Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove #[allow(crown::unrooted_must_root)] from ReadRequest and ReadIntoRequest Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* Fix build failure with tracing feature (#35009)Jonathan Schwender2025-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | * Fix build failure with tracing feature Skip tracing preferences for now to avoid: ``` error[E0277]: `Preferences` doesn't implement `std::fmt::Debug` ``` Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix warning about unused tracing span. The tracing span is "used" when it is dropped, so in that sense it is a false positive. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Implement Clipboard Event Api (#33576)Gae242025-01-1510-11/+455
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement ClipboardEvent interface Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * draft implementation of clipboard events Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * handle received clipboard events inside html elemtents Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * use rustdoc style Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix compilation errors due to rebase Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * update arboard crate Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * improve paste events Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * code cleanup revert arboard crate's update, handle text only Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * restrict visibility of some methods to script crate Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * propagate CanGc argument Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * simplify handle_clipboard_msg Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * remove code duplication Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix potential borrow hazard Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add clipboard_event pref, restore unit test code Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * retrict visibility of some document's methods Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * check if clipboardevent is trusted Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * enable clipboardevent Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix compilation for egl ports Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* webdriver: Serialize JS int values as i32. (#34997)Josh Matthews2025-01-151-1/+8
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Script: remove `SafeHandleValue::from_raw` from `DefaultTeeReadRequest` (#34995)Taym Haddadi2025-01-151-10/+7
| | | | | | | | | | | | | * remove SafeHandleValu::efrom_raw from DefaultTeeReadRequest Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * remove #[allow(unsafe_code)] Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-14160-280/+302
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Remove incorrect TODO comment in htmlinputelement.rs (#34970)Simon Wülker2025-01-131-1/+46
| | | | | | | | | | | | | | | | | | | | | | | * Add doc comments to InputType Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add doc comment to HtmlInputElement::checked_changed Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Remove incorrect TODO comment The comment indicated that we should fire a change event at a radio input when changed the checkedness. This is incorrect, as events should only be fired as part of the input element's activation behaviour. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement HTMLCanvasElement.transferControlToOffscreen (#34959)webbeef2025-01-134-14/+139
| | | | | | | | This follows the spec by introducing a new "Placeholder" canvas context mode. The underlying offscreen canvas is kept accessible from the DOM element to allow for the drawImage() implementation to work with canvases that have transfered their control. Signed-off-by: webbeef <me@webbeef.org>
* net: Use `RequestId` to cancel fetches instead of creating an IPC channel ↵Martin Robinson2025-01-1114-141/+67
| | | | | | | | | | | | | | | | | | (#34883) Instead of creating an IPC channel for every fetch, allow cancelling fetches based on the `RequestId` of the original request. This requires that `RequestId`s be UUIDs so that they are unique between processes that might communicating with the resource process. In addition, the resource process loop now keeps a `HashMap` or `Weak` handles to cancellers and cleans them up. This allows for creating mutiple `FetchCanceller`s in `script` for a single fetch request, allowing integration of the media and video elements to integrate with the `Document` canceller list -- meaning these fetches also get cancelled when the `Document` unloads. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement HTMLCanvasElement.toBlob (#34938)webbeef2025-01-104-91/+205
| | | | | | | This refactors some of the code that is shared with toDataURL, and updates the webidl definition to match the current spec (using a default value for the mime type). Signed-off-by: webbeef <me@webbeef.org>