Add support for temporary storage via a new config option
`temporary_storage`
and a corresponding command-line argument `--temporary-storage`.
When enabled, client storage uses a storage directory
(e.g. `clientstorage/temporary/<uuid>`) instead of the shared default
location.
This can be used to provide isolation between concurrent servo
instances.
This is especially useful for WPT runs, where multiple Servo instances
may
execute in parallel and would otherwise share the same storage, leading
to
cross-test interference.
Based on that, this PR also updates the WPT runner to enable temporary
storage
by default.
Testing: Manual testing and a full try run.
Signed-off-by: Jan Varga <jvarga@igalia.com>
Add the Storage Standard WebIDL for NavigatorStorage and StorageManager,
wire navigator.storage on Window and Worker, and implement persisted(),
persist(), and estimate().
Testing: covered by WP test.
part of #39100fixes#39101
---------
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Initialize Sanitizer API implementation with partially implemented
constructor and `get()` methods of the `Sanitizer` interface, which
allows the sub-sequential implementation to be tested by WPT.
The `Sanitizer` interface is hidden behind the feature flag
`dom_sanitizer_enabled`, which is disabled by default.
Specification: https://wicg.github.io/sanitizer-api/
Testing: Enable WPT tests for Sanitizer API.
Fixes: Part of #43948
---------
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
The macro `impl_from_pref!` would cause panic in this case.
Testing: Add more test cases to existing UT.
Fixes: #44078
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This fixes a warning of `cargo publish`:
```
warning: manifest has no description, documentation, homepage or repository
```
Testing: Compiling. Manual testing of `cargo publish --dry-run` (with
some additional patches, and until the next error, shows this warning
has been fixed)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
In order to prepare for publishing this PR does the following steps (see
commits):
- Move all `path` dependencies to the workspace Cargo.toml, and
reference that.
- Move all path dependencies in the workspace Cargo.toml into a
dedicated section, to make bumping version numbers easier later.
- Add the version requirement. Note that we currently only version bump
servoshell. There was agreement to version everything with the same
version as servoshell, but that be done in a follow-up. The diff is
already large enough as is.
- Add a tidy lint to catch `path` usages outside the root Cargo.toml. I
switched to [`tomllib`] (which was added to the python stdlib in 3.11),
since the third-party `toml` library failed to parse Cargo.toml files
with `workspace.version` (did not like the `.` in a `key`).
[`tomllib`]: https://docs.python.org/3/library/tomllib.html
Testing: Should be covered by regular CI testing.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This option controls whether progressive web metrics are printed to the
system console, which is essentially the purpose of
`DiagnosticsLogging`. This makes the API a bit more uniform.
Testing: We do not really have automated testing for this kind of
feature of the API.
Fixes: This is part of #34967.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This setting is used to control whether or not incremental legacy layout
was enabled. Nowadays incremental layout is always enabled as it is a
fundamental feature of how layout works. The setting also controls
whether or not nodes are traversed in Style, but that's also something
that's much less interesting today. This change just removes this
setting as it just controls the Stylo setting. A corresponding change in
Stylo will also remove the setting there.
Testing: This just removes a setting so existing tests should suffice.
Fixes: This is part of #34967.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This change adds support for a blinking text caret using WebRender
`DynamicProperties` updates. This ensures that text caret updates are as
lightweight as possible. As part of this change, the initial framework
for paint-side animations is added. Though this is driven by a timer for
now (in order to not have to run full speed animations for text carets),
the idea is that more animations can be driven by `Paint` in the future
(in order to avoid doing layouts during animations).
In addition, a preference is added which controls the caret blink speed.
This is used to disable caret blinking during WPT testing.
Testing: There are no tests for this change. We do not currently have a
good
way to test caret blinking as the caret is render only and fully testing
blinking would require well timed screenshot creation.
Fixes: #33237.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This concept does not need to be exposed to `Opts` any longer as it just
controls how servoshell uses the `WebView` API.
Testing: A successful compilation is enough here as this is just moving
an option.
Fixes: This is part of #34967.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Remove command invokers preference
This now passes most of the relevant tests. Most of the remaining
failures are due to missing functionality such as the popover API,
element reflection properties (see
https://github.com/servo/servo/issues/42884), and issues with the event
retargeting code that doesn't handle shadow dom correctly.
Signed-off-by: Luke Warlow <lwarlow@igalia.com>
Bumps Stylo to https://github.com/servo/stylo/pull/314
In particular, we would now get a compile error because we were setting
`layout.flexbox.enabled` and `layout.css.transition-behavior.enabled`,
even if Stylo removed at some point. So stop setting them.
Testing: Not needed, no behavior change
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This is a preparation for publishing to crates.io. Changes include:
- Add `servo-` prefixes to avoid name collisions on crates.io
- Use `-` instead of `_` in package names.
- Rename the crates to their original names in Cargo.toml,
to keep the diff minimal
- Rename `media` to `servo-media-thread` to avoid name collision with
`servo-media` (originally from the media repository).
This is an outcome of the previous discussion at [#general > Switch
remaining git dependencies to
crates.io](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Switch.20remaining.20git.20dependencies.20to.20crates.2Eio/with/576336288)
Testing: This should be mostly covered by our CI, but some amount of
breakage is to be expected, since some package names could still be
referenced from scripts which are not tested or run in CI. [mach try
run](https://github.com/jschwe/servo/actions/runs/22502945949)
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This patch removes `js_*` preferences that are not currently wired up to
the SM engine. The `js_mem_gc_allocation_threshold_factor` was being
used previously but got that usage was commented out in #28092, so the
dead code is removed.
The `dom_worklet_blockingsleep` preference is also renamed to
`dom_worklet_blockingsleep_enabled` to match the declared name in
`PaintWorkletGlobalScope.idl` which also matches the naming convention
of the other the boolean preferences.
Finally, the `network_mime_sniff` is also unused and remmoved in this
patch.
Testing: Should be covered by existing tests.
Fixes: #42868
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
That respects the user locale better than hardcoding en-US. This can
also be manually set with the `LANG` environment variable.
Testing: Manual testing with the devtools to check the header sent and
the value of `navigator.language`
Signed-off-by: webbeef <me@webbeef.org>
- Use `FxHashMap` for `active_pointer_ids`
- Refactor and fix logging message for touch, especially
`update_active_touch_points_when_early_return`
- Randomly fix some typos
Testing: This changes logging message but no other observable
behaviours. The logging should be more accurate, but I didn't test.
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This introduces a new `ServoTestUtils` namespace with a `forceLayout()`
function. This `forceLayout()` function returns an object which
currently has an array of the phases ran by layout. Also moves
`panic()`, `crashHard()` and `advanceClock()` from `TestBinding` to this
new namespace. `TestBinding` is meant to test the bindings generation,
but these are more generic helpers for Servo-only tests.
Testing: This change adds a series of Servo-only tests that verify the
behavior of the new `forceLayout()` function. Tests that rely on the
moved interfaces are updated and should continue to pass.
Signed-off-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Add a comment to the preference session_history_max_size that explains
the current behavi
Testing: Comments do not have tests.
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Previously we listened to 0.0.0.0. which means any connection coming to
a specific port. That seems a bit ill advised as not everybody has a
good firewall setup. Now we default listen only on 127.0.0.1 but
optionally can describe a full SocketAddr such as "192.168.1.23:1234".
Side note: Cleaned up the ipc-channel syntax.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Testing: Currently we don't have an automatic way to test this. Manually
run devtools and it connects.
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
The first step of `execCommand` commands is to figure out
if they are supported and enabled. Therefore, implement
these two pieces with only 1 command: delete.
The implementation of `delete` is currently mostly dummy,
to have at least something going. But the main part of
this change is to setup the infrastructure to figure out
when commands are supported and enabled.
For the first part, its simply the list of commands we
currently have implemented, which is only delete.
For the second part, we need to consider the active range
of the current selection and do various checks, as well as
check the presence of `contenteditable`.
Part of #25005
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This adds a pref which will be used to enable the experimental
accessibility tree.
Testing: No testing: just adds a pref which is currently unused.
Fixes: part of #4344
Signed-off-by: Alice Boxhall <alice@igalia.com>
Co-authored-by: delan azabani <dazabani@igalia.com>
Similar to about:config from firefox. All preferences are editable;
editing them mid-runtime is not guaranteed to cause any effects. This is
separate from servo:preferences, which selectively groups and exposes
preferences. This probably would become more useful if/when preferences
become persistent.
<img width="1136" height="880" alt="Screenshot 2025-10-31 at 10 19
57 PM"
src="https://github.com/user-attachments/assets/2ef759d8-06a4-457f-b9df-331cc3525338"
/>
Followup work:
- Remove `getStringPreference`, `getIntPreference`, and
`getBoolPreference`. Using `getPreference` and `preferenceType` is more
flexible.
- Make more of these config options work on the fly.
- Allow for reverting config options.
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
The implementation of `attr()` in Stylo is not complete, but this way we
can start testing for it.
Bumps Stylo to https://github.com/servo/stylo/pull/306
Testing: Various tests pass, also a few failures. No impact on users,
even with experimental features enabled.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
User activation is a concept used to prevents annoying usage of specific
API (Fullscreen API, Virtual Keyboard) to the user by states that the
API needs to have in order to process. This PR implements the
`UserActivation` interface and keep track of the last user interaction.
Each `Window` will keep track the [last activation time
stamp](https://html.spec.whatwg.org/multipage/interaction.html#last-activation-timestamp),
which will be set if there are a triggering input event firing in the
`Window` and propagating across the browsing contexts ancestors and
descendants. These timestamp could be consumed, and the timestamp will
be set to negative infinite.
It is then used to gate some APIs within browser that is determined as
transient activation consuming-gated APIs, which needs transient
activation to be true and consumes the activation. For the purpose of
testing, this PR would implement this behavior on fullscreen API which
is used to test activation consuming behavior.
Spec:
https://html.spec.whatwg.org/multipage/interaction.html#the-useractivation-interface
Testing: Existing WPT
---------
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
This PR targets on adding JSON to `IDL` to show all supported values in
JS API.
This was missed during implementation. Screenshot Attached for JS API
Testing: `components/servo/tests/largest_contentful_paint.rs`
Fixes: None, this is just an refinement.
<img width="772" height="360" alt="Screenshot from 2026-01-19 17-13-20"
src="https://github.com/user-attachments/assets/1730f3f6-423c-466c-b0d4-976d35d82827"
/>
---------
Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
This PR sets a timeout for the connecting part of hyper that is
configurable via the prefs.
The timeout is currently set to 15 seconds which should be enough.
This fixes an interesting potential hang for the following specific
situation:
- Load a Document that has some subresource (such as images) from a
String.
- The subresource is on a domain that a restricted internet might not
resolve.
- The connection hangs and does not change the LoadStatus of the
document as it is blocked by the subresource.
Testing: This fixes issues with the 'test_contextual_context_menu_items'
when running with a misbehaving proxy.
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
CoreResourceManager had a ThreadPool that was only used for reading
files as the fetching is handled via tokio.
Keeping 4 threads around on the chance that the user wants to read a
local file seems a bit much.
This removes the threadpool and just uses the standard thread::spawn
functionality.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Testing: Local file opening still works.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This now respects the no_proxy and https_proxy variables with a matching
pref (read from the environment).
We now have a new ProxyConnector which uses the hyper_util match to
either construct a Tunnel or clone the ServoHttpConnector inside.
This could potentially be slower if every connection is proxied as we
redo the tunnel for every new connection. I think this is how the
structure is intended to be used as
technically the http_proxy variable can have different proxy assignments
per uri.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Testing: Tested via setting the no_proxy variable and testing those
websites vs proxied websites.
Fixes: https://github.com/servo/servo/issues/41687
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
With keep-alive requests implemented, this feature is now fully working.
Some tests still fail on
header parsing, which is #36801Fixes#38302
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Add placeholder implementation of DOM `VisualViewport` according to the
spec https://drafts.csswg.org/cssom-view/#visualviewport. This is the
first step of implementing the interface and syncing it with the
`PinchZoom` struct that we had in the `Embedder`.
Since this interface's is not accurate and couldn't fulfill it's
purpose, it would be gated behind a preference
`dom_visual_viewport_enabled` and would be open after the interface had
been integrated with `PinchZoom`, viewport resizing, and viewport
scroll.
Testing: Existing WPT Test.
Part of: #41341
---------
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
This parses the env variable "http_proxy" for servoshell and sets the
network_http_proxy_uri if it exists to the same value.
Testing: Tested that it correctly picks it up.
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This change fixes a variety of build warnings on Android. In a related
change, the CA verifier preference allows using a list of certificate
overrides and the `rust-webpki` verifier regardless of platform. Whether
to use a list of certificate overrides and whether to use the platform
verifier are orthagonal, so this change unlinks those two and in the
process
fixes a build warning on Android.
Testing: This preference is untested (and quite hard to test honestly),
so this change
does not have tests. There should be no behavior change unless using a
combination
of forcing the webpki verifier and providing a list of CA overrides.
---------
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This changes the certificate verifier to use rustls_platform_verifier
under the hood.
**Note**: The rustls-platform-verifier has specific instructions for
android and currently we fall back to the webpki roots for this
platform.
Testing: This was tested on linux, macos and ohos and the rest in the
CI.
Fixes: Should fix https://github.com/servo/servo/issues/32903 and
partially https://github.com/servo/servo/issues/35227
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
With this change can now configure diagnostic logging via the
`SERVO_DIAGNOSTICS` environment variable in addition to the existing -Z
command-line flag.
The environment variable accepts the same comma-separated options as -Z
(e.g., `SERVO_DIAGNOSTICS=style-tree,display-list`). The help option
works from both sources and will display all available diagnostic flags.
Environment variable parsing is disabled in production builds
Testing: Tested locally for release, debug and production build to make
sure it is disabled for production
Fixes: Part of https://github.com/servo/servo/issues/40863
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Servo can now use a http proxy to connect to the internet. This
currently only supports using all connections through the proxy.
This uses the already used hyper_util crate which had the functionality
in it already.
We also switch from tower_service to tower with only util feature flag.
This might increase the binary size slightly.
Testing: Tested on a local machine which is behind a proxy with and
without the flag and it works correctly.
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
In this PR, we rename `DebugOpts` to `DiagnosticsLogging`, add some
documentation and rename variables to get rid of dump terminology.
Testing:
Fixes: part of https://github.com/servo/servo/issues/40863
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
This change move `DebugOpts::disable_share_style_cache` to
`Prefs::layout_style_sharing_cache_enabled` and ensure it is enabled by
default. We also inverted the usage.
Testing:
Fixes: Part of https://github.com/servo/servo/issues/40863
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Add CommandEvent
This is behind the new dom_command_invokers_enabled pref.
Testing: Existing WPTs
---------
Signed-off-by: Luke Warlow <lwarlow@igalia.com>