aboutsummaryrefslogtreecommitdiffstats
path: root/components
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't recurse in Node::GetRootNode (#35725)Simon Wülker2025-03-011-9/+6
| | | | | | | | | | | | | | | | * Don't recurse in Node::GetRootNode This causes servo to crash when computing the root of deeply nested shadow roots. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add test case Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* refactor: add CanGc as argument to methods in CanvasRenderingContext2D and ↵Yerkebulan Tulibergenov2025-03-013-17/+16
| | | | | OffscreenCanvasRenderingContext2D (#35732) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to OffscreenCanvas methods (#35731)Yerkebulan Tulibergenov2025-03-012-6/+12
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to BaseAudioContext::{Destination, Listener} ↵Yerkebulan Tulibergenov2025-03-012-5/+5
| | | | | (#35729) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* fonts: Remove the per-FontGroup cached fallback font (#35705)Martin Robinson2025-02-286-28/+39
| | | | | | | | | | | | | | | | | | | Instead of keeping a per-FontGroup cache of the previously used fallback font, cache this value in the caller of `FontGroup::find_by_codepoint`. The problem with caching this value in the `FontGroup` is that it can make one layout different from the next. Still, it is important to cache the value somewhere so that, for instance, Chinese character don't have to continuously walk through the entire fallback list when laying out. The heuristic here is to try to last used font first if the `Script`s match. At the very least this should make one layout consistent with the next. Fixes #35704. Fixes #35697. Fixes #35689. Fixes #35679. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Stop double-buffering `OffscreenRenderingContext` (#35638)Martin Robinson2025-02-282-67/+80
| | | | | | | | | | | The `OffscreenRenderingContext` does not need to be double-buffered. Instead, when resizing the framebuffer, create a new one and blit the old contents onto the new surface. This allows immediately displaying the contents without having to render paint the WebRender scene one more time. In addition to speeding up the rendering pipeline, the goal here is to reduce flickering during resizes (though there is more work to do). Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Avoid double borrow crash in `DataTransferItem` (#35699)Gae242025-02-271-1/+2
| | | | | | | | | | | | | * avoid double borrow inside GetAsString Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * added crashtest Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* script: Implement `Blob::bytes()` (#35151)Kousuke Takaki2025-02-274-2/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Implement Blob.bytes() Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * improve read_all_bytes Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * fix read_all_bytes Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * fix bug Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * something went wrong Signed-off-by: Kousuke Takaki <98276492+yoseio@users.noreply.github.com> * fix read loop Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add use of can_gc to promise code following rebase Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix rooting of fulfillment handler Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * Update test expectations Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * use dom for reader in read loop fulfillment handler Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * use the global of the reader in read loop fulfillment handler Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * remove FAIl expectations for blob methods in detached iframe Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> --------- Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> Signed-off-by: Kousuke Takaki <98276492+yoseio@users.noreply.github.com> Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com> Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
* layout: Implement a non-recursive version of CSS `quotes` (#34770)Xiaocheng Hu2025-02-275-9/+488
| | | | | | | | | | | | | | | | | * Squash and don't explicitly use noto-cjk in tests Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Mark quotes-034.html.ini failure Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Address review comments Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> --------- Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* winit_mininal: support proper window resizing (#35691)webbeef2025-02-271-0/+10
| | | Signed-off-by: webbeef <me@webbeef.org>
* clippy: Fix a couple clippy warnings on macOS (#35703)Martin Robinson2025-02-272-2/+2
| | | | | | The new version of rust has more checks trying to prevent mistakes around order of operations and shifts. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* compositor Remove `frame_tree_id` member (#35702)Martin Robinson2025-02-271-18/+0
| | | | | This is unused. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Use definite cross size to compute flex base size (#35688)Oriol Brufau2025-02-271-25/+23
| | | | | | | | An intrinsic flex base size depends on the contents, which may depend on the cross size through an aspect ratio. We were only taking this into account if the preferred cross size was numeric, but `auto` or `stretch` can also be definite. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Update sensitivity naming in `DisplayList::new` (#35694)Euclid Ye2025-02-271-2/+2
| | | Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Set limits on pinch zoom (#35692)Shubham Gupta2025-02-271-2/+3
| | | Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
* Reuse same `ImageKey` for 2d canvas (#35695)Samson2025-02-271-59/+34
| | | | | this was not possible when original code was written due to wr limitations (image sizes could not be changed) Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* bindings: Fix support for interface members in setlike/maplike. (#35651)Mukilan Thiyagarajan2025-02-2711-26/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | #30151 added support for setlike and maplike declarations in WebIDL, but the tests only validated if generator code worked with 'DOMString' as the key type. The support for interface type as members was broken as `DomRoot<T>` didn't satify the bounds `Eq` and `Hash` needed by the `Key` and `Value` types in `Setlike` and `Maplike` traits respectively. In addition, the splitting of bindings into a separate 'script_bindings' crate had also broken support for this in CodegenRust.py, as the types used within the definition of `DomTraits` were not referenced using `Self::`. This patch fixes the WebIDL code generator by doing a simple string replacement on the return value of `getRetvalDeclarationForType` so that the proper `Self::` is used. I'm not not sure if there is a better approach to this as it seems most logic in CodegenRust.py uses the `D::` prefix that is expected to be available only when compiling `script` crate and not `script_bindings`. This patch also adds the missing trait implementations for `DomRoot` and ensures that the generated code works for both members of primitive and interface types by splitting the existing `TestBinding{Map,Set}Like` interfaces into `TestBinding{Map,Set}LikeWith{Primitive,Interface}` tests. Fixes #35542. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* winit_minimal: fix build breakage (#35686)webbeef2025-02-271-6/+1
| | | Signed-off-by: webbeef <me@webbeef.org>
* libservo: Clean up interfaces for alert()/confirm()/prompt() (#35579)Delan Azabani2025-02-275-47/+115
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* layout: Support `stretch` cross size for flex base size (#35663)Oriol Brufau2025-02-261-5/+7
| | | | | | | | The computation of the flex base size may involve transferring a definite cross size into the main axis through the aspect ratio. We were only considering numeric sizes as definite, but `stretch` can also be definite. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Support `stretch` cross size for automatic min size in flexbox (#35652)Oriol Brufau2025-02-261-5/+7
| | | | | | | | The computation of the automatic minimum size may involve transferring a definite cross size into the main axis through the aspect ratio. We were only considering numeric sizes as definite, but `stretch` can also be definite. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* libservo: Add `WebView` immediately to the Compositor (#35662)Martin Robinson2025-02-2610-80/+37
| | | | | | | | | When creating a `WebView`, let the Compositor know synchronously that it exists. This allows the embedder to immediately call methods like `WebView::focus()`. In addition remove messages associated with the `WebViewDelegate::notify_ready_to_show()` method (and the method itself), as now `WebView`s can be shown immediately. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Make auxiliary webviews exist in the constellation immediately (#35672)Delan Azabani2025-02-265-87/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To allow embedders to interact with webviews as soon as they are created, we need to ensure that they exist in both the compositor and the constellation before those interactions happen. #35662 does this for the compositor, while this patch does this for the constellation. When a webview opens another webview (via <a target>, <form target>, window.open(), etc), the embedder creates an “auxiliary” webview, which previously went as follows: - script create_auxiliary_browsing_context - libservo AllowOpeningWebView - embedder request_open_auxiliary_webview (→ constellation FocusWebView) - script create_auxiliary_browsing_context - constellation ScriptNewAuxiliary In that model, the constellation may receive FocusWebView before it receives ScriptNewAuxiliary. Now they are created as follows: - script create_auxiliary_browsing_context - constellation CreateAuxiliaryWebView - libservo AllowOpeningWebView - embedder request_open_auxiliary_webview (→ constellation FocusWebView) - constellation CreateAuxiliaryWebView - script create_auxiliary_browsing_context Since these messages are all synchronous and the constellation will have set up the webview before handling any new messages, the webview will always exist by the time we handle the embedder’s FocusWebView. Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Implement the <progress> element (#35531)Simon Wülker2025-02-262-3/+103
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Don’t prompt user for credentials for non-Navigate request (#35664)Isaac Marovitz2025-02-262-1/+57
| | | Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
* libservo: Move size handling to `RenderContext` from `WindowMethods` (#35621)Martin Robinson2025-02-257-214/+168
| | | | | | | | | | | | | | | | | | | | | This is the first step toward removing `WindowMethods`, which will gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing of the `WebView` is now handled by the a size associated with a `RenderingContext`. `WebView`s will eventually just paint the entire size of their `RenderingContext`. Notes: - This is transitionary step so now there is a `WebView::resize` and a `WebView::move_resize`. The first is the future which will resize the `WebView` and its associated `RenderingContext`. The second is a function that the virtual `WebView`s that will soon be replaced by a the one-`WebView` per `WebView` model. - We do not need to call `WebView::move_resize` at as much any longer because the default size of the `WebView` is to take up the whole `RenderingContext`. - `SurfmanRenderingContext` is no longer exposed in the API, as a surfman context doesn't naturally have a size unless a surface is bound to it. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Change the `IndefiniteContainingBlock` sizes to `Option<Au>` (#35653)Oriol Brufau2025-02-256-37/+19
| | | | | Thus avoiding the need to convert to/from `AuOrAuto`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* refactor: add CanGc as argument to exception_to_promise (#35647)Yerkebulan Tulibergenov2025-02-252-11/+16
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Allow the `<details>` element to be opened and closed (#35261)Simon Wülker2025-02-253-37/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement the <summary> element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement UA shadow root for <details> Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Invalidate style when display is opened or closed Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix /_mozilla/mozilla/duplicated_scroll_ids.html This test previously assumed that <details> elements would not be rendered. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement implicit summary elements Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Remove test for duplicated scroll IDs See https://github.com/servo/servo/pull/35261#discussion_r1969328725 for reasoning. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Use Iterator::find to find implicit summary element Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* refactor: add CanGc as argument to Promise::reject_error (#35646)Yerkebulan Tulibergenov2025-02-2543-249/+323
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* 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>