aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
Commit message (Collapse)AuthorAgeFilesLines
...
* bindings: Support non-object this values for callbacks. (#35427)Josh Matthews2025-02-122-11/+13
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: remove a fixed todo from script/dom/xmlhttprequest.rs (#35417)shanehandley2025-02-111-6/+1
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: make Error::to_jsval safe (#35411)Stephen Muss2025-02-107-59/+38
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* implemented feture and tests (#35309)Domenico Rizzo2025-02-101-2/+9
| | | Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Revert "Use surfman with glow bindings (#34328)" (#35402)Samson2025-02-101-2/+3
| | | | | This reverts commit 503bb10c5b1fafe01ebfb6b320902be2e8671c69. Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* libservo: Flesh out permissions API (#35396)Martin Robinson2025-02-104-104/+119
| | | | | | | | | | | | | - Update the script crate to better reflect the modern Permission specifcation -- removing the necessity for an `Insecure` variant of the permissions prompt. - Have all allow/deny type requests in the internal API use an `AllowOrDeny` enum for clarity. - Expose `PermissionsRequest` and `PermissionFeature` data types to the API and use them in the delegate method. - Update both servoshell implementations to use the API. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* script: Add shadow dom check to custom element constructor (#35382)Max T.2025-02-091-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Add shadow dom check to custom element constructor Signed-off-by: maxtidev <max@maxti.dev> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Update components/script/dom/customelementregistry.rs Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> * Remove unnecessary custom-elements upgrading test .ini Signed-off-by: maxtidev <max@maxti.dev> * script: tidy comments in run_upgrade_constructor Signed-off-by: maxtidev <max@maxti.dev> --------- Signed-off-by: maxtidev <max@maxti.dev> Signed-off-by: Max T. <163015439+maxtidev@users.noreply.github.com> Co-authored-by: maxtidev <max@maxti.dev> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* dom: Always replace unpaired surrogates when handling page text (#35381)Martin Robinson2025-02-092-46/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: > JavaScript strings are potentially ill-formed UTF-16 (arbitrary > Vec<u16>) and can contain unpaired surrogates. Rust’s String type is > well-formed UTF-8 and can not contain any surrogate. Surrogates are > never emitted when decoding bytes from the network, but they can sneak > in through document.write, the Element.innerHtml setter, or other DOM > APIs. In 2015, Servo launched an experiment to see if unpaired surrogates cropped up in page content. That experiment caused Servo to panic if unpaired surrogates were encountered with a request to report the page to bug #6564. During that time several pages were reported with unpaired surrogates, causing Servo to panic. In addition, when running the WPT tests Servo will never panic due to the `-Z replace-surrogates` option being passed by the test driver. Motivation: After this 10 year experiment, it's clear that unpaired surrogates are a real concern in page content. Several reports were filed of Servo panicking after encountering them in real world pages. A complete fix for this issue would be to somehow maintain unpaired surrogates in the DOM, but that is a much larger task than simply emitting U+FFD instead of an unpaired surrogate. Since it is clear that this kind of content exists, it is better for Servo to try its best to handle the content rather than crash as production browsers should not crash due to user content when possible. In this change, I modify Servo to always replace unpaired surrogates. It would have been ideal to only crash when debug assertions are enabled, but debug assertions are enabled by default in release mode -- so this wouldn't be effective for WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Replace unnecessary macro in get_constructor_object_from_local_name ↵Max T.2025-02-091-137/+132
| | | | | | (#35383) Signed-off-by: maxtidev <max@maxti.dev> Co-authored-by: maxtidev <max@maxti.dev>
* make report_pending_exception safe and adjust callers (#35351)Nolen Scaife2025-02-087-36/+39
| | | Signed-off-by: Nolen Scaife <nolen@scaife.org>
* suppress build warnings when disabling webgpu and webxr (#35379)webbeef2025-02-086-14/+23
| | | Signed-off-by: webbeef <me@webbeef.org>
* Handle assigned slottables in an Event's path (#35380)Simon Wülker2025-02-081-6/+44
| | | | | | | | | | | | | * Handle slots in an event's path 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>
* script: make methods of ErrorInfo safe (#35367)Stephen Muss2025-02-071-22/+31
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* servoshell: Move `headless` setting to ServoShellPreferences (#35377)Martin Robinson2025-02-075-17/+0
| | | | | | | | | | This is only used in servoshell, even though it was plumbed through script previously. It's just about how the `RenderingContext` is set up, which is something managed entirely outside of servo itself. In addition, make the name of `servo_shell_preferences` in `app.rs` more consistent with the rest of the codebase. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: make throw_invalid_this and throw_constructor_without_new safe (#35360)Stephen Muss2025-02-073-14/+15
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* deps: Upgrade to `webrender@0.66` (#35325)Martin Robinson2025-02-0710-10/+12
| | | | | | | | | In addition to some small API changes, this downstream version of WebRender no longer depends on a very old version of time. This is the last step toward removing the dependency on `time0.1`. The review for this commit should also include: https://github.com/servo/webrender/commit/9f552bebab81a73e62068c42d94be2f9c0586ce4 Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Add a `ClipboardDelegate` and a default implementation (#35297)Martin Robinson2025-02-071-5/+15
| | | | | | | | | | | | | | | | | Add a `ClipboardDelegate` to the `WebView` API and a default implementation in libservo for this delegate that works on Mac, Windows, and Linux. Support for Android will be added in the future. This means that embedders do not need to do anything special to get clipboard support, but can choose to override it or implement it for other platforms. In addition, this adds support for handling fetches of clipboard contents and renames things to reflect that eventually other types of clipboard content will be supported. Part of this is removing the string argument from the `ClipboardEventType::Paste` enum because script will need to get other types of content from the clipboard than just a string. It now talks to the embedder to get this information directly. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Annotate steps for custom element creation. (#35354)Josh Matthews2025-02-072-43/+82
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Implement ServoLayoutNode::traversal_parent (#35338)Simon Wülker2025-02-076-155/+63
| | | | | | | | | | | | | | | | | | | | | This fixes common crash related to slottables, currently present on wpt.fyi. Previously, the traversal parent of `Text` nodes was incorrectly assumed to always be the parent or shadow host. That caused crashes inside stylo's bloom filter. Now the traversal parent is the slot that the node is assigned to, if any, and the parent/shadow host otherwise. The slottable data for Text/Element nodes is now stored in NodeRareData. This is very cheap, because NodeRareData will already be instantiated for assigned slottables anyways, because the containing_shadow_root field will be set (since assigned slottables are always in a shadow tree). This change is necessary because we need to hand out references to the assigned slot to stylo and that is not possible to do (without unsafe code) if we need to downcast the node first. As a side effect, this reduces the size of `Text` from 256 to 232 bytes, because the slottable data is no longer stored there. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Inform the devtools about shadow roots on a node (#35294)Simon Wülker2025-02-052-2/+37
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Make generated proxy handlers and DOM object hooks generic (#35292)Josh Matthews2025-02-056-6/+28
| | | | | | | | | | | | | * script: Make DOM proxy handlers generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make finalize and trace hooks generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add support for Upgrade request to a potentially trustworthy URL. (#34986)Shubham Gupta2025-02-0524-11/+121
| | | | | | | | | | | | | | | | * Add support for Upgrade request to a potentially trustworthy URL. Signed-off-by: Shubham Gupta <shubham13297@gmail.com> * script: Support inheritable insecure request policy in documents and workers. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Shubham Gupta <shubham.gupta@chromium.org> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* script: delay Mutation initialization (#35291)Euclid Ye2025-02-055-23/+31
| | | Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Use surfman with glow bindings (#34328)Samson2025-02-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use glowing surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Port https://github.com/servo/webxr/pull/255 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixups rebase Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fmt Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix stale TODO Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Make traverse_preorder follow children of shadow hosts (#35276)Simon Wülker2025-02-041-2/+8
| | | | | | | | | | | | | | | | | | | | * Make traverse_preorder follow children of shadow hosts Children of shadow hosts are not displayed, but they still exist in the DOM and must be traversed. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix traverse_preorder over shadow roots 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 `get_ipc_renderer` from `CanvasRenderingContext2D` (#35285)Samson2025-02-043-24/+21
| | | | | | | | | | | | | * Remove `get_ipc_renderer` from `CanvasRenderingContext2D` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fix warnings Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* servoshell: Migrate to egui-file-dialog from tinyfiledialogs (#34823)chickenleaf2025-02-041-3/+10
| | | | | | This is the first step toward completely replacing tinyfiledialogs with an egui-based solution. Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* Script: implement ReadableStreamBYOBRequest (#35074)Taym Haddadi2025-02-042-11/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Script: implement ReadableStreamBYOBReader::Read 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> * Correct BufferSource implemntation 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> * Scriptt: implement ReadableStreamBYOBRequest Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix is_detached_buffer and viewed_buffer_array_byte_length Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Use if let Some instead of unwrap() Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* Move more foundational types to script_bindings (#35280)Josh Matthews2025-02-045-148/+28
| | | | | | | | | | | | | | | | | * script: Move DOMClass to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move DOMJSClass and get_dom_class to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move Castable/DerivedFrom/IDLInterface to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Move various reflector types and traits to script_bindings (#35279)Josh Matthews2025-02-04195-306/+204
| | | | | | | | | | | | | * script: Move Reflector to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* libservo: Combine `LoadStart, `HeadParsed`, and `LoadComplete` messages (#35260)Martin Robinson2025-02-032-6/+15
| | | | | | | | | These will be a single method in the upcoming `WebView` delegate, so it makes sense to also combine the internal message to match this. In addition, since `LoadStatus` is now exposed to the API if there is ever the need to add more statuses or to move to an event-based version, the API is already set up for this. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Lay out the contents of slot elements (#35220)Simon Wülker2025-02-025-77/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make Slottable match layout/alignment of NonNull<Node> Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement ServoLayoutElement::slotted_nodes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Bump mozjs Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Layout the contents of slot elements Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement ServoLayoutElement::assigned_slot Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * implement ServoLayoutElement::traversal_parent Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Simplify slottable name update Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Don't iterate over children of shadow hosts Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Recompute slot style when contents change Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Change match_slottable to a function instead of a macro Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix crown errors Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reset a slottable's assigned slot when it's removed from the slot Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Implement the Bytes() method on Request and Response (#35250)shanehandley2025-02-022-0/+10
| | | | | | | | | | | | | * Implement the Bytes() method on Request and Response Signed-off-by: Shane Handley <shanehandley@fastmail.com> * avoid unsafe code during buffer creation Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Only consider fully active documents when running the 'update the rendering' ↵webbeef2025-02-011-0/+4
| | | | | | | steps (#35245) This is specified in https://html.spec.whatwg.org/multipage/#update-the-rendering step 3.2 but we where not filtering out inactive documents. Signed-off-by: webbeef <me@webbeef.org>
* webgpu: implement get image for webgpu canvas (#35237)Samson2025-01-312-7/+25
| | | | | | | | | | | | | | | | | * Implement `get_image_data` for WebGPU canvas Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Add docs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* 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-301-5/+5
| | | | | | | | | | | (#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-301-1/+1
| | | 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-302-4/+30
| | | | | | | | | | | | | | | 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-3025-129/+196
| | | | | | | | | | | | | | | | | `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-294-600/+7
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* libservo: Stop using `script_traits` in the embedding layer (#35185)Martin Robinson2025-01-288-17/+22
| | | | | | | | | | | | | | | 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-275-11/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-271-15/+2
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* script: Do not set up an IPC route for every image load (#35041)Martin Robinson2025-01-254-135/+203
| | | | | | | | | | | | 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>