aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
Commit message (Collapse)AuthorAgeFilesLines
...
* Make generated bindings generic over DOM types (#35169)Josh Matthews2025-01-252-3/+15
| | | | | | | | | | | | | | | | | * 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-24462-24960/+9
| | | | | (#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-223-16/+88
| | | | | | | | | | | | | | | | | * 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>
* 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-18206-387/+400
| | | | | | | | | | | | | * 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-184-14/+32
| | | 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-157-10/+347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* 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-14155-248/+270
| | | | | | | | | | | | | | | | | | | 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-133-14/+130
| | | | | | | | 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-118-76/+38
| | | | | | | | | | | | | | | | | | (#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-102-91/+201
| | | | | | | 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>
* Update wgpu and impl `WGSLLanguageFeatures` (#34928)Samson2025-01-105-3/+106
| | | | | | | | | | | | | | * Update wgpu and impl `WGSLLanguageFeatures` https://github.com/gfx-rs/wgpu/commit/dc9b2eb71807ccafb7414425f1f8f24b5691685d 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: Move navigation fetching to the `ScriptThread` (#34919)Martin Robinson2025-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | This allows reusing the asynchrnous fetch mechanism that we use for page resources and is likely a step toward removing the `FetchThread`. Benefits: - Reduces IPC traffic during navigation. Now instead of bouncing between the constellation and the `ScriptThread` responses are sent directly to the `ScriptThread`. - Allows cancelling loads after redirects, which was not possible before. There is the question of what to do when a redirect is cross-origin (#23037). This currently isn't handled properly as the `Constellation` sends data to the same `Pipeline` that initiated the load. This change doesn't fix this issue, but does make it more possible for the `ScriptThread` to shut down the pipeline and ask the `Constellation` to replace it with a new one. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Fix shadow root binding children to the tree (#34909)Taym Haddadi2025-01-101-3/+12
| | | | | | | | | | | | | | | | | | | | | * Fix Shadow roots bind children to the tree Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Avoid iterate over the shadow root itself Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Update test expectation 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>
* script: Limit public exports. (#34915)Josh Matthews2025-01-10537-4436/+4796
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add jpeg and webp support to canvas.toDataURL() (#34861)webbeef2025-01-091-9/+69
| | | Signed-off-by: webbeef <me@webbeef.org>
* script: Downgrade noisy debug logs. (#34914)Josh Matthews2025-01-092-4/+4
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Use `enum`s for event loop senders and receivers (#34896)Martin Robinson2025-01-0813-175/+84
| | | | | | | | | | | | | | | | | | | | | | | Previously, senders and receivers to different kinds of event loops (the main `ScriptThread`, different types of workers) used a rust `trait` mechanism to implement dynamic behavior. This led to having many unused implementations of this `trait`. This change moves to using an `enum` based approach for these senders and receivers and removes all of the dead code. In addition, to allowing for use of rust's dead code detection, it simplifies the code a great deal. All of these generic senders and receivers are moved to the `messaging.rs` file and given proper documentation. Finally, empty an `JSTraceable` implementation is made for all crossbeam `Sender<...>`s to avoid having to manually skip them everytime they are included in structs. The pre-existing empty `MallocSizeOf` implementation is used more thoroughly. Other unecessary wrappers around these senders and receivers are removed as well. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Consider shadow dom when dispatching events (#34788)Simon Wülker2025-01-075-263/+732
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement EventTarget::get_the_parent Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec steps to Event::init_event Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Rewrite Event::composedPath to be spec compliant Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Retarget EventTargets instead of Nodes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Rewrite event dispatch/invocation to better match the spec Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec comments to Event struct Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Don't traverse shadow roots when calculating an events path We can't do this correctly yet, and assuming that an events composed flag is never set is correct 99% of the time. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix typo in event dispatch Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * fix comment Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * allow crown error Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reduce item visibility where possible Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Simplify code a bit Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix Step 5.10 of Event::invoke Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix renamed method calls Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Expose `NodeTraits::owner_global` / `Window::as_global_scope` (#34843)Martin Robinson2025-01-0728-229/+235
| | | | | | | | | | | Expose two new helpers and start using them as much as possible. - `NodeTraits::owner_global`: which gets the `GlobalScope` that currenty owns a `Node`. This may be different than `.global()` in the case that the `Node` was adopted by a different `Document`. - `Window::as_global_scope`: A helper to avoid having to cast so much when treating a `Window` like a `GlobalScope`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Various servodriver fixes (#34871)Josh Matthews2025-01-071-1/+1
| | | | | | | | | | | | | | | | | * servodriver: Set initial URL to data:, instead of about:blank. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Ignore failed epoch update messages. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Make servo-max-session-history.html use an iframe. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Move the `FontContext` to `Window` (#34845)Martin Robinson2025-01-071-5/+12
| | | | | | | This will allow using layout's `FontContext` in `Window` letting script manage font selection and download. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* script: Unsilence all main thread `TaskQueue` errors (#34849)Martin Robinson2025-01-0736-458/+472
| | | | | | | | | | | | No longer hide errors while queueing tasks on the main thread. This requires creating two types of `TaskSource`s: one for the main thread and one that can be sent to other threads. This makes queueing a bit more efficient on the main thread and more importantly, no longer hides task queue errors. Fixes #25688. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Add shadow tree flags to Bind/UnbindContext (#34863)Simon Wülker2025-01-079-38/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename IS_IN_DOC flag to IS_IN_A_DOCUMENT_TREE Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add BindContext::is_in_a_shadow_tree Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add UnbindContext::tree_is_in_shadow_tree Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update test expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * fix build after rebasing Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Add initial support for WebGL 2 BlitFramebuffer (#26389)Josh Matthews2025-01-063-2/+123
| | | | | | Add initial support for the WebGL2 BlitFramebuffer call. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Istvan <istvan.miklos@h-lab.eu>
* Check regex syntax for pattern attribute with CheckRegexSyntax from mozjs ↵cybai (Haku)2025-01-061-2/+31
| | | | | (#28364) Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* ReadableStream: remove the use of get_js_stream and use ↵Taym Haddadi2025-01-058-44/+33
| | | | | | | | | | | | | | | DomRoot<ReadableStream> (#34836) * Remove the use of get_js_stream and use DomRoot<ReadableStream> Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * return an error instead of Option Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* Document's current script should not be updated when executing script ↵Domenico Rizzo2025-01-041-1/+9
| | | | | | | | | | | | | | | | | | | elements inside shadow trees (#34787) * check if node is in shadow tree Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> * Removed meta ini related file Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> * refactored as_parent()'s calls Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Remove readable streams from webidl/codegen (#34835)Taym Haddadi2025-01-042-39/+1
| | | Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* script: Move `TimerListener` creation to `OneShotTimers` (#34825)Martin Robinson2025-01-041-48/+2
| | | | | | | | | | | | | | Before each `OneShotTimers` would have a `TimerListener` for its lifetime, holding the timer `TaskSource`. The issue with this is that the `TaskSource` for dedicated workers keeps the main thread object alive, so as long as the `OneShotTimers` alive (until the worker thread exists), the main thread object would never be garbage collected. This change makes the creation of the listener on-demand, avoiding the long-lived handle to the main thread object and slightly simplifying `OneShotTimers` at the expense of some more operations when scheduling a timer. Signed-off-by: Martin Robinson <mrobinson@igalia.com>