aboutsummaryrefslogtreecommitdiffstats
path: root/components/config
Commit message (Collapse)AuthorAgeFilesLines
* dom: Implement `ClipboardItem` (#36336)Gae242025-04-061-0/+2
| | | | | | | | | | | implement the `ClipboardItem` interface Testing: covered by existing wpt tests part of #36084 --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Stub out Trusted Types interfaces (#36355)Tim van der Lippe2025-04-051-0/+2
| | | | | | | | | | | | Some methods are implemented fully, while others are implemented partly. With these implementations, there are no observed crashes when running the trusted-types web-platform-tests. Most notably, the tests/wpt/tests/trusted-types/idlharness.window.js is now fully passing. Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
* Implement TestUtils (#36301)Sebastian C2025-04-041-0/+3
| | | | | | | | | | | | | | | | Implement the TestUtils namespace from https://testutils.spec.whatwg.org/. This should make the `js/builtins/weakrefs` tests run faster and more consistently. This change will enable other WPT tests but no tests exist currently for TestUtils itself. Fixes: #36290 --------- Signed-off-by: Sebastian C <sebsebmc@gmail.com> Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
* libservo: Remove a couple `EmbedderMethods` (#36276)Martin Robinson2025-04-011-3/+81
| | | | | | | | | | | | | | | | | | | | | | | - Remove `EmbedderMethods::get_user_agent_string`. This is now part of the `Preferences` data structure, which should allow it to be per-`WebView` in the future. - Remove `EmbedderMethods::get_version_string`. This was used to include some data along with WebRender captures about the Servo version. This isn't really necessary and it was done to replace code in the past that output the WebRender version, so also isn't what the original code did. I think we can just remove this entirely. The idea with these changes is that `EmbedderMethods` can be removed in a followup and the rest of the methods can be added to `ServoDelegate`. These two methods are ones that cannot be added to a delegate as they are used during `Servo` initialization. Testing: There is currently no testing for libservo. These changes are meant as preparation for adding a suite of `WebView` unit tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Start implementing the `URLPattern` API (#36144)Simon Wülker2025-03-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start working on a basic URLPattern implementation This is API part of Interop 2025, so we should definitely support it! This change implements the basic workflow for parsing and compiling URL patterns. Parts of it are stubbed out and will be implemented later. For now the API is preference-gated behind "dom_urlpattern_enabled". Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Preference-gate the URLPattern API Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix full wildcard value (Should be ".*" not "*") Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Allow setting userscripts directly without the need of files (#35388)Tony2025-03-272-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow settings userscripts through preferences Signed-off-by: Tony <legendmastertony@gmail.com> * mach fmt instead of cargo fmt Signed-off-by: Tony <legendmastertony@gmail.com> * Fix pref loading not working for array values Signed-off-by: Tony <legendmastertony@gmail.com> * Use pref! in userscripts instead Signed-off-by: Tony <legendmastertony@gmail.com> * Implement the model jdm suggested - Remove userscripts from all places and move it to servoshell - Add in `UserContentManager` struct and passing it through `Servo::new` all the way down to script thread Signed-off-by: Tony <legendmastertony@gmail.com> * Apply suggestions from code review and format Signed-off-by: Tony <legendmastertony@gmail.com> * Revert unrelated change Signed-off-by: Tony <legendmastertony@gmail.com> --------- Signed-off-by: Tony <legendmastertony@gmail.com> Signed-off-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* Hide servo internal shadow roots from the inspector by default (#35958)Simon Wülker2025-03-131-0/+3
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove legacy layout (layout 2013) (#35943)Oriol Brufau2025-03-132-7/+0
| | | | | | We were already not compiling it and not running tests on it by default. So it's simpler to just completely remove it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Use new stylo crate renames (#35898)Nico Burns2025-03-122-10/+10
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Enable ShadowDom support by default (#35899)Simon Wülker2025-03-111-1/+1
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix the parsing error of PrefValue::Array, which is used for the parsing of ↵boluochoufeng2025-03-101-2/+2
| | | | | Preferences shell_background_color_rgba field (#35865) Signed-off-by: blycf <1355990831@qq.com>
* Remove obsolete memory profiler console output (#35861)webbeef2025-03-081-5/+0
| | | Signed-off-by: webbeef <me@webbeef.org>
* compositing: Move image output and shutdown management out of the compositor ↵Martin Robinson2025-02-201-7/+6
| | | | | | | | | | | | | | | | | | | | | | | (#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>
* script: add skeleton implementation of `FontFace` API (#35262)Mukilan Thiyagarajan2025-02-191-0/+2
| | | | | | | | | | | | | | | | This patch implements the `FontFace` interface, but with some caveats 1. The interface is only exposed on `Window`. Support for Workers will be handled in the future. 2. The concept of `css-connected` `FontFace` is not implemented, so `@font-face` rules in stylesheets will not be represented in the DOM. 3. The constructor only supports using `url()` strings as source and `ArrayBuffer` and `ArrayBufferView` are not supported yet. A skeleton implementation of the `load` method of `FontFaceSet` is also implemented in this patch. The intention is to support some web pages that don't load without this method. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* feat: add `Notification` Web API binding (#34842)Jason Tsai2025-02-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: add Notification Web API binding Signed-off-by: Jason Tsai <git@pews.dev> * chore: update spec link Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix clippy Signed-off-by: Jason Tsai <git@pews.dev> * fix: index overflow Signed-off-by: Jason Tsai <git@pews.dev> * test(tidy): add notification WebIDL standard URL Signed-off-by: Jason Tsai <git@pews.dev> * fix: allow crown::unrooted_must_root Signed-off-by: Jason Tsai <git@pews.dev> * implement GetPermission Signed-off-by: Jason Tsai <git@pews.dev> * fix silent type Signed-off-by: Jason Tsai <git@pews.dev> * add all properties Signed-off-by: Jason Tsai <git@pews.dev> * test: add Notification to global Signed-off-by: Jason Tsai <git@pews.dev> * chore: update wpt manifest and fix clippy Signed-off-by: Jason Tsai <git@pews.dev> * test: temp skip notifications Signed-off-by: Jason Tsai <git@pews.dev> * add vibration and apply suggestions Signed-off-by: Jason Tsai <git@pews.dev> * partially implement RequestPermission Signed-off-by: Jason Tsai <git@pews.dev> * call Permission request permission algorithm Signed-off-by: Jason Tsai <git@pews.dev> * chore: pub crate Notification Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix clippy Signed-off-by: Jason Tsai <git@pews.dev> * chore: crown attribute Signed-off-by: Jason Tsai <git@pews.dev> * fix part of suggestions Signed-off-by: Jason Tsai <git@pews.dev> * fix: store private `Action` structure Signed-off-by: Jason Tsai <git@pews.dev> * chore: fix typo Signed-off-by: Jason Tsai <git@pews.dev> * fix: serialize images URL Signed-off-by: Jason Tsai <git@pews.dev> * fix: use globalscope as environment settings object Signed-off-by: Jason Tsai <git@pews.dev> * chore: add pref `dom_notification_enabled` and default to disabled Signed-off-by: Jason Tsai <git@pews.dev> * fix: use `descriptor_permission_state` Signed-off-by: Jason Tsai <git@pews.dev> * apply suggestions Signed-off-by: Jason Tsai <git@pews.dev> Co-authored-by: Josh Matthews <josh@joshmatthews.net> * test: remove passed meta Signed-off-by: Jason Tsai <git@pews.dev> * test: enable notification prefs in mozilla tests Signed-off-by: Jason Tsai <git@pews.dev> --------- Signed-off-by: Jason Tsai <git@pews.dev> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* deps: Remove some unused `Cargo.toml` (#35466)Martin Robinson2025-02-141-3/+0
| | | | | These were discovered with cargo-machete. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* prefs: Stop precaching WebRender shaders by default (#35431)Martin Robinson2025-02-121-1/+1
| | | | | | In #34998, I inadvertantly enabled shader precaching by default during a cleanup. This change reverts that particular mistake. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* servoshell: Move `initial_window_size` and `screen_size_override` into ↵Martin Robinson2025-02-101-11/+0
| | | | | | | | `ServoShellPreferences` from `Opts` (#35407) These settings just configure `servoshell` so should be in `ServoShellPreferences` instead. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* dom: Always replace unpaired surrogates when handling page text (#35381)Martin Robinson2025-02-091-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* servoshell: Move `headless` setting to ServoShellPreferences (#35377)Martin Robinson2025-02-071-3/+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>
* libservo: Enable file directory listing by default (#35317)Martin Robinson2025-02-061-1/+1
| | | | | | | | This is a useful feature to have in a browser engine, so I think it should be enabled by default. I believe that the original concern was that there was a security issue, but this certainly has the same security concerns as normal file loading. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Consolidated opts into a manual Default trait implementation (#35257)Shalvin2025-02-011-32/+34
| | | Signed-off-by: Shalvin Deo <shalvin.deo@live.com>
* Remove `Preferences::network_tls_ignore_unexpected_eof` (#35080)Martin Robinson2025-01-201-7/+0
| | | | | | | This workaround was introduced to handle an issue with the WPT server, but it seems that it is no longer needed. This change removes the prefernce and the workarond code. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* config: Derive defaults for Opts. (#35057)Josh Matthews2025-01-181-1/+1
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* prefs: Move some `DebugOptions` to `Preferences` and clean up (#34998)Martin Robinson2025-01-172-23/+9
| | | | | | | | | - Move options configuring antialiasing and WebRender shader precache to the `Preferences` to group them with other related WebRender and DOM settings. - Remove the option to disable antialiasing for canvases. This was unused. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement Clipboard Event Api (#33576)Gae242025-01-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* fonts: Remove synchronous web font loading functionality (#35000)Martin Robinson2025-01-151-4/+0
| | | | | | | | Synchronous web font loading is not specification compliant and was added in #8341 to work around issues that do not exist any longer. This change removes the functionality and ensures that WPT tests are run with the spec compliant loader. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* config: Remove legacy-layout and unused `Preferences` and `Opts` (#34994)Martin Robinson2025-01-141-27/+0
| | | | | | There are some preferences and options that are only used by legacy layout or not used at all. This PR removes them. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-149-1771/+497
| | | | | | | | | | | | | | | | | | | 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>
* webxr: create glwindow with Rc window and without rendering context (#34813)Ngo Iok Ui (Wu Yu Wei)2025-01-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create webxr glwindow with Rc window Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Remove obselte gurad type Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Update GlWindow trait method Signed-off-by: Wu Yuwei <yuweiwu@pm.me> * Update how webxr discorvery is created Now glwindow will create a hidden window. It's better to not use it unless we really want to use this port. Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Link back to upstream webxr repo Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> --------- Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> Signed-off-by: Wu Yuwei <yuweiwu@pm.me>
* script: Add stub interface for AbortController. (#34519)Josh Matthews2024-12-101-0/+4
| | | | Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: syvb <me@iter.ca>
* Add XPath parser/evaluator (#34463)Ville Lindholm2024-12-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add XPath parser/evaluator Signed-off-by: Ville Lindholm <ville@lindholm.dev> * Correctly annotate XPathEvaluator IDL Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: have bindings pass in `can_gc` Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add docstrings Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: implement PartialEq for Value for readability Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add docstrings for CoreFunctions Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: simplify node test code Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add unit tests for string handling xpath functions Signed-off-by: Ville Lindholm <ville@lindholm.dev> * put xpath features behind dom.xpath.enabled pref Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review] remove rstest and insta dev-deps Signed-off-by: Ville Lindholm <ville@lindholm.dev> * update wpt test expectations Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: tweak metadata files Signed-off-by: Ville Lindholm <ville@lindholm.dev> * update wpt test expectations AGAIN Signed-off-by: Ville Lindholm <ville@lindholm.dev> --------- Signed-off-by: Ville Lindholm <ville@lindholm.dev>
* Add prefs to limit threadpool sizes (#34478)Jonathan Schwender2024-12-071-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | * Add prefs to limit threadpool sizes Add preferences to control the size of threadpools, so that we can easily reduce the amount of runtime threads and test which pools benefit from more threads. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Add pref for Webrender threadpool Add a preference to limit the size of the webrender threadpool. Note: WebRender by default calls hooks which register the threads with a profiler instance that the embedder can register with webrender. Servo currently doesn't register such a profiler with webrender, but in the future we might also want to profile the webrender threadpool. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Layout: Implement CSS Grid using `taffy` (#32619)Nico Burns2024-11-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add layout.grid.enabled pref Signed-off-by: Nico Burns <nico@nicoburns.com> * Add taffy dependency Signed-off-by: Nico Burns <nico@nicoburns.com> * Import taffy <-> stylo conversion code from taffy_stylo crate Signed-off-by: Nico Burns <nico@nicoburns.com> * Add `Grid` variant to DisplayInside Signed-off-by: Nico Burns <nico@nicoburns.com> * Implement CSS Grid using Taffy Signed-off-by: Nico Burns <nico@nicoburns.com> Import full stylo_taffy crate Signed-off-by: Nico Burns <nico@nicoburns.com> Squashed PR feedback changes Deduplicate is_document_only_whitespace Signed-off-by: Nico Burns <nico@nicoburns.com> Import taffy::AvailableSpace Signed-off-by: Nico Burns <nico@nicoburns.com> Rename FlexContext to TaffyContainerContext Signed-off-by: Nico Burns <nico@nicoburns.com> Eliminate references to flexbox in taffy/layout module Signed-off-by: Nico Burns <nico@nicoburns.com> Use constructors for geom types Signed-off-by: Nico Burns <nico@nicoburns.com> Remove comment about abspos elements splitting contiguous text runs Signed-off-by: Nico Burns <nico@nicoburns.com> Remove reference to flexbox in taffy/construct Signed-off-by: Nico Burns <nico@nicoburns.com> Deduplicate construction of flexbox/grid containers Signed-off-by: Nico Burns <nico@nicoburns.com> Make anonymous text runs InFlow Signed-off-by: Nico Burns <nico@nicoburns.com> Remove commented code Signed-off-by: Nico Burns <nico@nicoburns.com> Update comments Signed-off-by: Nico Burns <nico@nicoburns.com> Inline/vendor the stylo/taffy interop code Signed-off-by: Nico Burns <nico@nicoburns.com> * Update test expectations Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix nits from PR review Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Add `js.disable_jit` pref (#34231)Samson2024-11-131-0/+2
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* ohos: Remove unneeded dirs dependency in servo_config (#34166)Jonathan Schwender2024-11-062-3/+4
| | | | | | | `dirs` does not support OpenHarmony, and it also seems that there currently is no native API that `dirs` could use on OpenHarmony and the directory needs to be read from ArkTS. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* servoshell: Allow overriding screen resolution with a command-line argument ↵Martin Robinson2024-10-301-13/+42
| | | | | | | | | | | | | | | | | | | | | (#34038) There is a command-line argument to override the default window size, but not one for overriding the default screen resolution. This is important for testing pages that use screen size to have different behavior. In addition to adding the new option this change: - Renames the `--resolution` command-line argument to `--window-size` to remove ambiguity with the `--screen-size` argument. - Passes the screen size as device independent (device pixels scaled by HiDPI factor) to Servo internals. Not only it make it simpler to pass the `--window-size` override, it makes more sense. Different screens can have different HiDPI factors and these can be different from the scale of the window. This makes the screen HiDPI factor totally independent of the one that Servo uses for the window. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Support persisting unminified external stylesheets (#33919)Taym Haddadi2024-10-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * Support local tweaking of external stylesheets Signed-off-by: Taym <haddadi.taym@gmail.com> * Remove duplicated code between unminify_css and unminify_js Signed-off-by: Taym <haddadi.taym@gmail.com> * Add License Signed-off-by: Taym <haddadi.taym@gmail.com> * Use js-beautify instead of npx Signed-off-by: Taym <haddadi.taym@gmail.com> * Fix clippy warning Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
* dom: Stub out the `IntersectionObserver` interface (#33989)Martin Robinson2024-10-251-0/+3
| | | | | | | | This is the first step toward implementing the IntersectionObserver interface. It adds stubs which are exposed when a preference is turned on. This is enough to get some sites with `IntersectionObserver` to start working. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement `transition-behavior` (#33991)Oriol Brufau2024-10-241-0/+6
| | | | | Bump Stylo to https://github.com/servo/stylo/pull/84 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* clippy: Fix warnings in subtlecrypto.rs (#33943)tanishka2024-10-211-8/+0
| | | Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
* Remove some unused preferences (#33939)DK Liao2024-10-211-11/+0
| | | Signed-off-by: DK Liao <dklassic@gmail.com>
* doc(resources): `Preferences`, `HstsPreloadList`, `RippyPNG` (#33775)Ngo Iok Ui (Wu Yu Wei)2024-10-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Set to default if Preferences and HstsPreloadList are empty Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Add documentation of Preferences, HstsPreloadList, RippyPNG Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Add warn log when setting prefs to default Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Add error log instead Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Add error log to HSTS preload list Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Apply suggestions from code review Address a couple wording nits Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* crypto: Begin SubtleCrypto implementation (#33628)Daniel Adams2024-10-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update IDLs and Bindings conf Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add AES crate Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement DOM interfaces Signed-off-by: Daniel Adams <msub2official@gmail.com> * IDL tidy Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove deriveKey from inRealms for now until implemented Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix CryptoKey rustdoc comments Signed-off-by: Daniel Adams <msub2official@gmail.com> * Move string constants to top of file Signed-off-by: Daniel Adams <msub2official@gmail.com> * Use properly rooted CryptoKey Signed-off-by: Daniel Adams <msub2official@gmail.com> * Code clarity Signed-off-by: Daniel Adams <msub2official@gmail.com> * Rework NormalizedAlgorithm to not hold a DOMString Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add Rustdoc for CryptoKey interface Signed-off-by: Daniel Adams <msub2official@gmail.com> * Move ignore mallocsizeof to rand crate, remove from crypto Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update cargo lock Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix key handling, implement exportKey with JWK TODO Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec link Signed-off-by: Daniel Adams <msub2official@gmail.com> * Use create_buffer_source, remove aes dep from libservo Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix crash when running in worker Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * fmt Signed-off-by: Daniel Adams <msub2official@gmail.com> * Move CryptoKey and SubtleCrypto behind pref for now Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Readd timeout expectation Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Drop support for '--no-minibrowser' mode (#33677)Taym Haddadi2024-10-071-6/+0
| | | | | | | | | | | | | * Drop support for '--no-minibrowser' mode Signed-off-by: Taym <haddadi.taym@gmail.com> * remove unused import Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
* net: Refactor `Decoder` (#33611)Cristian Brinza2024-10-021-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor Decoder to be fully async Signed-off-by: crbrz <cristianb@gmail.com> * Update WPT results Signed-off-by: crbrz <cristianb@gmail.com> * Fix deflate unit test Signed-off-by: crbrz <cristianb@gmail.com> * Add compressed response update count test Signed-off-by: crbrz <cristianb@gmail.com> * Fix typo Signed-off-by: crbrz <cristianb@gmail.com> * Source error check without conversion to String Signed-off-by: crbrz <cristianb@gmail.com> * Simplify error check Signed-off-by: crbrz <cristianb@gmail.com> * Fix variable name Signed-off-by: crbrz <cristianb@gmail.com> * Added TODO note for network.tls.ignore_unexpected_eof Signed-off-by: crbrz <cristianb@gmail.com> --------- Signed-off-by: crbrz <cristianb@gmail.com>
* Add `rust-version` to all `Cargo.toml` files (#33483)Martin Robinson2024-09-171-0/+1
| | | | | | | This is another step preparing for building Servo without `mach`. Fixes #33430. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Enable flexbox by default on non-legacy layout (#33186)Martin Robinson2024-08-261-1/+0
| | | | | | | Flexbox is still very much in progress, but things are working well enough that we can enable it by default. It improves most pages that use flexbox now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add `dom.allow_scripts_to_close_windows` pref. (#33187)Samson2024-08-261-0/+1
| | | | | It's also present in firefox: https://searchfox.org/mozilla-central/search?q=allow_scripts_to_close_windows Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Upgrade font-kit, raqote, and stop using `dirs-next` (#33120)Martin Robinson2024-08-192-4/+4
| | | | | | | | | | | | | `dirs-next` is still used by the version of the `term` crate we are using, but this also remoes a version of `cstr` so our dependency count does not change. A new version of `raqote` hasn't been released, so this depends on the upstream repository directly. It's been almost 4 months since the release has been ready -- so it's unclear when it will happen. Fixes #32801. Signed-off-by: Martin Robinson <mrobinson@igalia.com>