aboutsummaryrefslogtreecommitdiffstats
path: root/components
Commit message (Collapse)AuthorAgeFilesLines
...
* layout: Let `automatic_min_size()` take a flex-relative cb size (#35642)Oriol Brufau2025-02-251-20/+14
| | | | | | | | | | This method was taking an `IndefiniteContainingBlock` parameter, and then it would first take the size corresponding to the main axis, and then the one for the cross axis. But it's simpler to just let it take a `FlexRelativeVec2<AuOrAuto>` parameter. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Touch handler: Fix race condition and rate-limit move events (#35537)Bi Fuguo2025-02-257-239/+714
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TouchSequenceInfo is added to store information about a touch sequence. For details about TouchSequenceInfo, see the code comments. The handling_touch_move attribute is added to the TouchHandler, indicating that the script is processing the touch move event. When handling_touch_move is set to true, the touch move event does not need to be sent to the script thread. Signed-off-by: kongbai1996 <1782765876@qq.com> * move touch state, active_touch_point and handling_touch_move to TouchSequenceInfo form TouchHandler. remove TouchSequenceInfo end_sequence property, add Finished state mark sequence end. if preventDefault on touchup, do not prevent Fling. Signed-off-by: kongbai1996 <1782765876@qq.com> * Refactor Touchhandler - Add a newtype wrapper for the TouchSequenceId - Move more state back into the TouchSequenceState - Rename TouchAction to TouchMoveAction, since it only covers immediate actions now. Everything else is handled via state, since it needs to wait on the handler. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix test-tidy Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix clippy missing-default lint Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix remaining clippy lints Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Remove accidental committed test file Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Remove wrong todo comment (move events that are sent to script are just raw touchpoints, no merging needed) Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix preventdefault after long touch_down handler Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* refactor: add CanGc as argument to Promise::reject_native (#35640)Yerkebulan Tulibergenov2025-02-2518-136/+148
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* chore: Update wgpu (#35639)Samson2025-02-241-2/+2
| | | | | | | | | | | | | | * Update wgpu https://github.com/gfx-rs/wgpu/commit/2f255edc60e9669c8c737464c59af10d59a31126 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>
* Don't tell stylo about stylesheets that are not in a browsing context (#35606)Simon Wülker2025-02-241-10/+11
| | | | | | | | | | | | | * Don't register stylesheets outside of a browsing context with stylo 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>
* Update to rust 1.85 (#35628)Simon Wülker2025-02-2427-75/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | * Update to rust 1.85 This is needed for cargo-deny Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Upgrade crown Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Clippy fixes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Re-upgrade cargo-deny to 0.18 Keeping it locked to 0.18 just in case they update their required rustc version again Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Support for the `isolation` CSS property (#35552)Kingsley Yung2025-02-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Support for the isolation CSS property Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> * Temporarily bump stylo to refs/pull/125/head for testing Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> * Remove FAIL expectation of CSS isolation tests Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> * Add behavior test Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Revert temporary changes in Cargo.toml Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* script: Fix typo in `ScriptThread::process_pending_input_events` (#35627)Euclid Ye2025-02-242-5/+5
| | | | | Also remove an unused import. Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* libservo: Refactor ipc-channel default response logic (#35624)Delan Azabani2025-02-243-71/+88
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Do not assume `OffscreenCanvasContext` to be 2d (#35629)Samson2025-02-243-18/+30
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* libservo: Move WebDriver messages to the `embedder` crate (#35602)Martin Robinson2025-02-2411-124/+121
| | | | | | | | | | | | | | | | | | | | This is the first step toward moving the WebDriver implementation to servoshell. This move will make it possible to start testing the embedding API with WebDriver. See [this zulip thread][a] for more details. While WebDriver will be able to use a lot of API commands to do what it is doing now, there will still need to be some "cheat codes" for more gnarly access to `ScriptThread` details. That's why we likely won't be able to remove all WebDriver-specific messages from the API -- but maybe they will be useful for embedders somehow. A couple messages have to change as they depended on `script_traits` types, particularly those that used `WindowSizeData` and `LoadData`. I think this helps to encapsulate the WebDriver commands a bit more though. [a]: https://servo.zulipchat.com/#narrow/channel/437943-embedding/topic/webdriver.20as.20embedding.20api.20playgound Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Ignore indefinite `stretch` on min and max sizing properties (#35630)Oriol Brufau2025-02-245-67/+89
| | | | | | | | We were always treating an indefinite `stretch` as the automatic size. This instead treats it as `0px` on min sizing properties, and as `none` on max sizing properties, aligning with Blink and this recent CSSWG resolution: https://github.com/w3c/csswg-drafts/issues/11006 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Remove `get_ipc_sender` from `OffscreenCanvasRenderingContext2D` (#35625)Samson2025-02-244-36/+7
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* refactor: add CanGc as argument to Promise::reject (#35622)Yerkebulan Tulibergenov2025-02-235-10/+10
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Improve scheduling of the memory profiler. (#35618)webbeef2025-02-232-2/+24
| | | | | | | Switch the delay to be used between the end of a previous run and the next, instead of the start of consecutive runs. That ensure that we don't enqueue messages when processing is slower than the delay. Signed-off-by: webbeef <me@webbeef.org>
* Propagate more `CanGc` (#35604)Auguste Baum2025-02-233-21/+36
| | | Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
* Unify `(Offscreen)CanvasRenderingContext2d` and make ↵Samson2025-02-236-290/+237
| | | | | `PaintRenderingContext2D` standalone (#35619) Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* refactor RTCError::new_inherited (#35617)Yerkebulan Tulibergenov2025-02-231-15/+6
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Move more bindings types to script_bindings (#35620)Josh Matthews2025-02-2321-391/+435
| | | | | | | | | | | | | | | | | | | | | * Move weak references implementation to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move maplike/setlike definitions to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move base error types to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* refactor: add CanGc as argument to Promise::resolve (#35616)Yerkebulan Tulibergenov2025-02-2357-294/+330
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* script: add `CanGc` argument to `Promise::new_resolved` and ↵Gae242025-02-238-29/+23
| | | | | | | | | | | | | | | `Promise::new_rejected` (#35605) * add CanGc to new_resolved and use it where possible Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add CanGc to new_rejected Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* refactor: add CanGc as argument to DataBlock::view (#35610)Yerkebulan Tulibergenov2025-02-233-3/+4
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: propagate CanGc arguments through callers (#35591)Auguste Baum2025-02-2374-275/+403
| | | Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
* refactor: add CanGc as argument to WindowProxy::set_window (#35609)Yerkebulan Tulibergenov2025-02-234-16/+22
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Remove the traversal for DomRoot values when collection memory usage (#35607)webbeef2025-02-221-2/+2
| | | Signed-off-by: webbeef <me@webbeef.org>
* Use counter instead of time for HTMLFormElement. (#35555)Narfinger2025-02-221-5/+10
| | | | | | | | | | | | | | | | * Use counter instead of time for HTMLFormElement. Fixes #25455 Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> * Update components/script/dom/htmlformelement.rs to include suggestions Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* refactor: add CanGc as argument to SubtleCrypto::import_key_{pbkdf2, aes, ↵Yerkebulan Tulibergenov2025-02-221-18/+29
| | | | | | | | | | | | | | | hkdf, hmac} (#35601) * refactor: add CanGc as argument to SubtleCrypto::import_key_pbkdf2 Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com> * refactor: add CanGc as argument to SubtleCrypto::{import_key_aes, import_key_hkdf, import_key_hmac} Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com> --------- Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to create_buffer_source_with_length (#35596)Yerkebulan Tulibergenov2025-02-222-9/+11
| | | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* refactor: add CanGc as argument to CountQueuingStrategy::GetSize (#35595)Yerkebulan Tulibergenov2025-02-222-1/+5
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to ByteLengthQueuingStrategy::GetSize (#35594)Yerkebulan Tulibergenov2025-02-222-1/+5
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to create_buffer_source (#35597)Yerkebulan Tulibergenov2025-02-2222-96/+169
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Move more bindings code to script_bindings (#35578)Josh Matthews2025-02-2223-641/+788
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move JSContext wrapper to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move webidl constant bindings to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move CanGc to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move Dom<T> and Root<T> types to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Extra docs for new traits. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* refactor: add CanGc as argument to extract_size_algorithm (#35593)Yerkebulan Tulibergenov2025-02-223-5/+8
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* dom: Move child_list to rare data (#35592)webbeef2025-02-222-8/+12
| | | | | | This is only created when calling the ChildNodes method. Gecko also stores it in their similar data structure at https://searchfox.org/mozilla-central/rev/155d514d72473453492a822e97dc1c68cf49d110/dom/base/nsINode.h#1464 Signed-off-by: webbeef <me@webbeef.org>
* build winit_minimal with bluetooth disabled (#35590)webbeef2025-02-211-1/+0
| | | Signed-off-by: webbeef <me@webbeef.org>
* script: Add `CanvasContext` trait (#35448)Samson2025-02-2112-210/+317
| | | | | | | | | | | | | | | | | * trait `CanvasContext` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup most stuff Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * explain and limit crown `allow(crown::unrooted_must_root)` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Add get_url() to GlobalScopeHelper (#35589)webbeef2025-02-211-0/+6
| | | | | This is needed to build with the tracing feature Signed-off-by: webbeef <me@webbeef.org>
* dom: move node ranges to raredata (#35554)webbeef2025-02-213-21/+25
| | | Signed-off-by: webbeef <me@webbeef.org>
* refactor: propagate CanGc arguments through callers (#35565)Auguste Baum2025-02-2111-42/+62
| | | Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
* Support the `<meter>` element (#35524)Simon Wülker2025-02-214-7/+163
| | | | | | | | | | | | | | | | | | | | | * Allow attaching UA shadow roots to any element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement a UA shadow tree for the <meter> element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add UA styles for the meter element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Include spec text when computing meter state Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow resetting multiple flags at once in Element::set_state (#35580)Simon Wülker2025-02-211-5/+9
| | | | | | | Previously, the code would incorrectly return without updating the flags if the caller tried to reset multiple flags at once and the not all of them were true. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* libservo: Convert `intercept_web_resource_load` into `load_web_resource` ↵Martin Robinson2025-02-2113-208/+244
| | | | | | | | | | | | | | | | | | | | | (#35564) Rework the `WebViewDelegate::intercept_web_resource_load` into `WebViewDelegate::load_web_resource` and clean up internal messaging. The main thing here is adding objects which manage the response to these delegate methods. Now we have `WebResourceLoad` and `InterceptedWebResourceLoad` which make it much harder to misuse the API. In addition, the internal messaging for this is cleaned up. Canceling and finishing the load are unrelated to the HTTP body so they are no longer subtypes of an HttpBodyData message. Processing of messages is made a bit more efficient by collecting all body chunks in a vector and only flattening the chunks at the end. Finally, "interceptor" is a much more common spelling than "intercepter" so I've gone ahead and made this change everywhere. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Make callbacks generic over DOM interfaces. (#35459)Josh Matthews2025-02-219-97/+141
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Refer to DOM interfaces with generic types in generated bindings. ↵Josh Matthews2025-02-2120-167/+627
| | | | | (#35457) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* fix touch event wrong coordinates. pageX, pageY, clientX, clientY etc. (#35550)Bi Fuguo2025-02-211-4/+6
| | | Signed-off-by: kongbai1996 <1782765876@qq.com>
* compositing: Move image output and shutdown management out of the compositor ↵Martin Robinson2025-02-2014-226/+140
| | | | | | | | | | | | | | | | | | | | | | | (#35538) This is a step toward the renderer-per-WebView goal. It moves various details out of `IOCompositor`. - Image output: This is moved to servoshell as now applications can access the image contents of a `WebView` via `RenderingContext::read_to_image`. Most options for this are moved to `ServoShellPreferences` apart from `wait_for_stable_image` as this requires a specific kind of coordination in the `ScriptThread` that is also very expensive. Instead, paint is now simply delayed until a stable image is reached and `WebView::paint()` returns a boolean. Maybe this can be revisited in the future. - Shutdown: Shutdown is now managed by libservo itself. Shutdown state is shared between the compositor and `Servo` instance. In the future, this sharing might be unecessary. - `CompositeTarget` has been removed entirely. This no longer needs to be passed when creating a Servo instance. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
* Propagate `CanGc` arguments through callers in constructors (#35541)Auguste Baum2025-02-20260-603/+986
| | | Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
* libservo: Move GL acclerated media setup out of `RenderingContext` and ↵Martin Robinson2025-02-2011-465/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | simplify it (#35553) This moves the GL accelerated media setup out of `RenderingContext` which prevents making libservo dependo on the Wayland and X11 versions of surfman explicitly. This support is experimental and (honestly) a bit broken. I've confirmed that this works as well as it did before the change. The main thing here is that the configuration, which currently needs surfman types, moves to servoshell. In addition: 1. Instead of passing the information to the Constellation, the setup is stored statically. This is necessary to avoid introducing a dependency on `media` in `webrender_traits`. It's quite likely that `media` types should move to the internal embedding API to avoid this. This is preserved for a followup change. 2. The whole system of wrapping the media channels in an abstract type is removed. They could be either mpsc channels or IPC channels. This was never going to work because mpsc channels cannot be serialized and deserialized with serde. Instead this just uses IPC channels. We also have other ways of doing this kind of abstraction in Servo so we do not need another. The `mpsc` version was hard-coded to be disabled. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Clean up destroyed webview handles (#35547)Delan Azabani2025-02-201-0/+11
| | | | | | | | | | | When the embedder drops the last WebView handle, the webview is destroyed, but the weak handle in libservo never gets cleaned up. This patch adds a step to `spin_event_loop` that cleans up any weak handles that have been destroyed. In theory, checking the strong count should be more efficient than trying to upgrade each handle (only to throw away the strong handle). Signed-off-by: Delan Azabani <dazabani@igalia.com>
* compositing: Split non-WebView-specific data into `ServoRenderer` (#35536)Martin Robinson2025-02-192-122/+168
| | | | | | | This will become the new global Servo renderer while each WebView will also have its renderer (but not yet). Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>