97 Commits

Author SHA1 Message Date
Jan Varga
902d5d10d9 storage: Add support for temporary storage (#44433)
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>
2026-04-25 10:18:21 +00:00
Taym Haddadi
5ac8bf4db3 Implement StorageManager API (#43976)
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 #39100

fixes #39101

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-21 13:41:58 +00:00
Ashwin Naren
c368a53fba storage: Enable indexeddb as an experimental feature (#44245)
Enables indexeddb as experimental; allows indexeddb to be tested on
wpt.fyi.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-04-15 19:05:45 +00:00
Abbas Olanrewaju Sarafa
316e6215a4 API: document which Preferences are experimental or enabled by default (#44171)
Referred users to
```https://book.servo.org/design-documentation/experimental-features.html```
documentation for ```Preferences``` and ```EXPERIMENTAL_PREFS```

Testing: No testing required, build was successful.
Fixes: #43706

---------

Signed-off-by: Sabb <sarafaabbas@gmail.com>
Signed-off-by: Abbas Olanrewaju Sarafa <109840351+sabbCodes@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2026-04-15 04:25:25 +00:00
Euclid Ye
b62dc72c73 config: Fix panic when converting convertible PrefValue::Int to u64 (#44079)
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>
2026-04-10 15:51:07 +00:00
Jonathan Schwender
64afd05d11 servoshell: Remove --userscripts option (#43573)
In #43182 it was [suggested to remove the
userscripts](https://github.com/servo/servo/pull/43182#issuecomment-4048383093)
option, since embedders can use the (new) `UserContentManager` API
instead.

Testing: This removes a commandline flag from servoshell. Existing tests
passing is sufficient.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-03-23 18:39:57 +00:00
Martin Robinson
5fec1395c9 prefs: Move Opts::print_pwm to DiagnosticsLogging::progressive_web_metrics (#43209)
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>
2026-03-13 09:45:39 +00:00
Martin Robinson
c80bdd9c92 prefs: Remove Opts::nonincremental_layout (#43207)
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>
2026-03-12 16:03:43 +00:00
Simon Wülker
c0ff7c1fc9 Everywhere: Remove instances of clippy::redundant-clone (#43212)
This change fixes all instances where
[`clippy::redundant-clone`](https://rust-lang.github.io/rust-clippy/master/index.html?groups=complexity%2Ccorrectness%2Cnursery%2Csuspicious&levels=allow#redundant_clone)
would trigger. It's allowed by default

I've also changed the lint to warn-by-default for servo.

Testing: Covered by WPT

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-12 13:28:21 +00:00
Martin Robinson
8432a21d63 prefs: Move Opts::user_stylesheets to ServoShellPreferences (#43206)
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>
2026-03-12 10:28:02 +00:00
Jonathan Schwender
1632e61ed6 servoshell: Rename executable to servoshell. (#42958)
This should help clarify the difference between servo the library /
engine and servoshell the browser (demo).

Other changes: 

- Removed etc/servo.sb ( [apple sandbox profile
format](https://angelica.gitbook.io/hacktricks/macos-hardening/macos-security-and-privilege-escalation/macos-security-protections/macos-sandbox#sandbox-profiles))
since it is not needed anymore. See [this
comment](https://github.com/servo/servo/pull/42958#discussion_r2876253489)
for more details.

Testing: This is a very invasive change, and there are bound to be
scripts / places I have overlooked. Searching for usages of `servo` is
very hard, since it's also the name of the library.
Try run: https://github.com/servo/servo/actions/runs/22637676818

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-03-07 08:08:38 +00:00
Qiaochu Hu
1b2ce4aaad prefs: Fix typo "arugment" -> "argument" (#43025)
Fixed a typo in the comment documentation in
`ports/servoshell/prefs.rs`. Changed "arugment" to "argument" on line
291.

Testing: This change does not need testing because it just fixes a typo
in a rustdoc comment.

Signed-off-by: hobostay <110hqc@gmail.com>
2026-03-05 10:52:14 +00:00
Tim van der Lippe
039eab4485 wpt: Move exec_command preference to experimental preferences (#42750)
That way, we correctly run it whenever we invoke WPT. This is relevant
for wpt.fyi, where currently we are not seeing any test coverage in the
`/editing` tests. To make tracking of progress possible, it should be
defined in prefs, not in the `.ini` configuration.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-22 10:58:16 +00:00
Narfinger
00fa5d3088 devtools: Allow specifiying an address to listen to and default to localhost (#42502)
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>
2026-02-19 03:24:56 +00:00
Tim van der Lippe
2988ba5a08 script: Ship navigator.sendBeacon (#41694)
With keep-alive requests implemented, this feature is now fully working.
Some tests still fail on
header parsing, which is #36801

Fixes #38302

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-05 20:17:50 +00:00
Wayne Van Son
5b9263690d Refactor allow to expect (#41586)
Replace `allow` with `expect` lints for `unused`, `unsafe_code`,
`dead_code`, and `non_upper_case_globals`.

Testing: So far just check it compiled on `x86_64-linux` on NixOS. Need
to use the module `system.fontconfig.enable = true;` I think in my NixOS
config.
Part of: #40383 

Searching `allow\(.*\)` for `.rs` files shows the following. for
(total_results:total_files) went from `707:386` to `675:368`, a
reduction of `32:18`.

How many files is too many files per PR? I feel like the 20-30 I have is
too big.

---------

Signed-off-by: Wayne Van Son <waynevanson@gmail.com>
2026-01-01 13:40:20 +00:00
Jonathan Schwender
f2028d61c3 servoshell: Reduce allocations during cmdline parsing (#41522)
- The helper method now accepts args without the binary name. This
allows us to remove the injection of servo / servoshell in the tests and
on android / ohos.
- Allow parsing str slices, instead of requiring Vec<String>. This
allows removing unnecessary conversions / allocations.

Testing: Covered by existing unit, integration and wpt tests, which pass
commandline arguments.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-12-25 14:28:47 +00:00
Narfinger
9fe6ac07b5 ohos / android: Fix missing error message for cli parsing errors (#41072)
On ohos/android the early redirect from stderr/stdout is not yet setup
when we parse commandline arguments.
This redirects these error on the standard logging facilities.

Testing: Tested on OHOS device with correct and incorrect arguments and
on linux desktop.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-12-08 10:42:07 +00:00
Anonmiraj
b207be05d9 change some allows to expects (#41040)
Changed some allow to expects and removed the unfulfilled expectations.

Testing: Refactor
Part of: #40383

Signed-off-by: anonmiraj <nabilmalek48@gmail.com>
2025-12-05 07:23:32 +00:00
atbrakhi
cb5f47e366 config: Add SERVO_DIAGNOSTICS environment variable for diagnostic options (#41013)
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>
2025-12-04 14:24:32 +00:00
Martin Robinson
105eb4256a servoshell: Add support for opening new windows on desktop (#40927)
This change finishes adding support for opening new windows in the
desktop version of servoshell. A new button is added to the tab bar
which opens a new window (this can be adjusted later, if necessary).
User interface commands now need to be processed in the context of the
`App` as we need access to a reference to the `ActiveEventLoop` to
create a new window.

Testing: servoshell is mainly untested, though a future change will add
new
unit tests for multi-window functionality.
Fixes: #13997.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-12-02 13:03:10 +00:00
atbrakhi
f0490926b5 config: Rename DebugOpts to DiagnosticsLogging and get rid of dump terminology (#40960)
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>
2025-12-01 12:14:02 +00:00
Euclid Ye
b4b3993d47 servoshell: Unset webdriver_port when scheduling shutdown (#40974)
This is the minimal possible changes after I've tried several
approaches. The original problem is tricky after multi-window support,
as we want to shutdown normally while not panic after no window is open
to support Servodriver.

Testing: 
1. We no longer panic on
f0ed7506cd/tests/wpt/tests/webdriver/tests/classic/close_window/close.py (L87)
2. Wpt can end normally instead of always **"Max retry exceeded to
normally shut down. Killing instead."**

Fixes:
https://github.com/servo/servo/issues/40972#issuecomment-3594308162

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-12-01 07:55:15 +00:00
Martin Robinson
c4b0d21180 libservo: Clean up Servo exports and export more at the root (#40951)
This change makes it easier for embedders to embed the types that they
need by exporting almost everything necessary to use Servo at the root
of libservo, apart from a few exceptions. In addition, the `Servo` is
moved
to its own file so that public exports can be more easily spotted from
`components/servo/lib.rs`.

Testing: This should not change behavior and is thus covered by existing
tests.
Fixes: #18475.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-11-29 17:26:48 +00:00
Jonathan Schwender
8d60e61028 servoshell: Remove unnecessary unwrap (#40921)
The unwrap would have never been hit, but
we can remove it so lets do that.
Also fixed some typos in surrounding code.

Testing: No behavior change, covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-11-27 14:00:05 +00:00
Simon Wülker
941aa63dac Add layout_variable_fonts_enabled to experimental preferences (#40861)
Part of #38800

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-11-24 18:39:14 +00:00
Manuel Rego
eb133a0c2c Remove dom_uievent_which from experimental features (#40783)
`UIEvent.which` was implemented in #40109 and is enabled by default, we
don't need it to be listed in the experimental features.

Testing: No change of behavior.

Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
2025-11-21 09:59:43 +00:00
Tim van der Lippe
c782da762b Implement protocol handler web API's behind flag (#40616)
This implements the web-facing API's behind a flag, where we further
design the embedding API in a
follow-up PR.

It passes all relevant WPT tests, since the HTML
specification leaves it up to user agents to
determine when to process these protocol handlers.

It also uses `once_cell` to lazily construct the
regex, which is what the CSP crate also uses for
its regexes [1].

Part of #40615

[1]:
db8f2e97fe/src/lib.rs (L1550-L1569)

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-11-14 12:53:33 +00:00
Josh Matthews
d2db3da424 config: Enable ResizeObserver by default. (#40378)
Per https://github.com/servo/servo/issues/39790#issuecomment-3460233532
we now pass tests for all the related engine features that Servo
implements, so there's no benefit to keeping this API disabled. Let's
ship it!

Testing: No behaviour change, just updating defaults.
Fixes: #39790

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-11-03 20:32:57 +00:00
lumiscosity
4aec1b2ddf servoshell: Fix typo in unrecognized debug option message (#40318)
Changes "urnecognized" to "unrecognized".

Testing: Not relevant.

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-10-31 15:19:08 +00:00
Simon Wülker
f9f2a132ab script: Enable xpath by default (#40212)
Fixes: #34527

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-10-27 19:24:22 +00:00
Taym Haddadi
7e2e7b5699 Implement UIEvent.which (#40109)
Implement UIEvent.which

Testing: existing test should pass.
Fixes: #40106
Fixes: #40099

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-10-23 22:54:30 +00:00
Martin Robinson
183f141a0e compositing: Move WebRender initialization to IOCompositor creation (#40101)
In order to support multiple WebRender instances in the renderer, we
need the ability for the renderer itself to manage their creation and
destruction. This change moves the initialization of the (currently)
single WebRender instances to the renderer initialization.

Testing: This should not change behavior, so is covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-10-23 12:21:35 +00:00
Josh Matthews
b15e215d45 config: Enable AbortController/AbortSignal by default. (#40079)
Make the engine default to enabling the AbortController implementation.

Testing: No behaviour change to tests, just flipping defaults.
Fixes: #34866

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-10-22 13:55:19 +00:00
Josh Matthews
86e61b0415 Add abort signal preference to experimental web features (#39421) (#39943)
This way we have full coverage on WPT rather than the specific folders
with tests. The timeout in `/performance-timeline/` will be addressed by
#39941. The timeout under `/webmessaging/` [makes us match all other
browsers](https://wpt.fyi/results/webmessaging/message-channels/close-event/document-destroyed.tentative.window.html?label=experimental&label=master&aligned).

Testing: Lots of new passing tests.
Fixes: #39904
Fixes: #39513

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2025-10-17 06:13:26 +00:00
Narfinger
98eed1f70f servoshell: Improve CLI help formatting (#39314)
This improves the servoshell CI help messaging.
Notice that spaces in front of comments are of importance in bpaf.
The output is probably not ideal yet but it should be way better.

Testing: Compiled and looked at the output.
Fixes: https://github.com/servo/servo/issues/39312

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-10-13 15:00:09 +00:00
Martin Robinson
d0dd9d7e3a servoshell: Do not override HiDPI ratio when taking screenshots (#39501)
This override is meant to force reftests to always run with a device
pixel ratio of 1.0. Reftests are always run in headless mode which uses
a device pixel ratio of 1.0 regardless (unless you override it).
Removing this particular override allows taking screenshots in the
system DPI when taking them in headed mode, which is actually a bit
useful.

Testing: A test verifying the old behavior is removed. This causes 
`/css/pixel_snapping_position_a.html` to start passing.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-30 17:44:14 +00:00
Martin Robinson
6ffc0cd482 libservo: Add a WebView::take_screenshot() API and use it for reftests (#39583)
This change adds a new API to the `WebView` for capturing screenshots.
This makes it possible to:

 - use the reftest waiting infrastructure via the API
   easily.
 - take more than a single screenshot in one Servo run.
 - take screenshots, but still paint the `WebView` normally prior
   to the moment that the screenshot is ready, instead of preventing
   all non-screenshot-ready paints while taking a screenshot.

In addition, the previous infrastructure, the `wait_for_stable_image`
option is removed completely.

Testing: This change is tested by the passing of the WPT tests,
as they commonly use the screenshot feature.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2025-09-30 11:39:47 +00:00
Josh Matthews
3f68bdacfe Revert "Add abort signal preference to experimental web features" (#39538)
Reverts servo/servo#39421 . There are too many new intermittent
failures.

Fixes: https://github.com/servo/servo/issues/39516 
Fixes: https://github.com/servo/servo/issues/39521 
Fixes: https://github.com/servo/servo/issues/39522 
Fixes: https://github.com/servo/servo/issues/39523 
Fixes: https://github.com/servo/servo/issues/39524 
Fixes: https://github.com/servo/servo/issues/39527 
Fixes: https://github.com/servo/servo/issues/39532 
Fixes: https://github.com/servo/servo/issues/39512 
Fixes: https://github.com/servo/servo/issues/39503
2025-09-27 12:42:15 +00:00
Tim van der Lippe
461c2427f3 Add abort signal preference to experimental web features (#39421)
This way we have full coverage on WPT rather than the
specific folders with tests.

Part of #34866

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-26 14:41:53 +00:00
Martin Robinson
b73538a676 servoshell: Move touch event simulation to servoshell (#39352)
This change removes the `DebugOption` (`-Z`) for touch event simulation
and moves the implementation of the feature to servoshell. The resaoning
for this is:

 - This is really a servoshell feature and can be implemented on top of
   the API. This moves more code out of the already too-complicated
   renderer.
 - I would like to consolidate `DebugOptions` into a `ServoLogOptions`
   to collect all options for configuring Servo logging. This requires
   moving away all of the non-logging options.
 - Eventually touch event simulation will be able to reuse the fling
   implementation from servoshell as we are actually simulating touch
   events sent to the `WebView`.

Testing: This changes a conditional feature that's used for manual
debugging.
It is difficult to write tests for this as there are no servoshell tests
that
verify input handling.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-23 07:00:11 +00:00
Shubham Gupta
fd402782aa OHOS: Fix empty log filter issue on OHOS (#39362)
Due to empty log filter, no logs are logged.

Testing: Tested locally
Fixes: None

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-09-19 02:36:44 +00:00
Martin Robinson
020b82e1fe profile: Remove integration with Instruments.app "Points of Interest" (#39354)
This changes removes the integration with Instruments.app "Points of
Interest" track for a variety of reasons:

 - This functionality is made somewhat redundant by Servo's support for
   Perfetto traces.
 - This functionality depends on the `signpost` crate which hasn't seen
   activity for 9 years and only supports macOS.

Testing: This removes some functionality that is only observable via
Instruments.app, so testing it is difficult.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-18 02:37:00 +00:00
Narfinger
76645e5e26 servoshell: Update the debug options (-Z) help to reflect current set of options (#39316)
The command-line help output for `-Z` and `DebugOptions were out of sync
again. This change makes sure they match again.

Testing: No tests necessary as this mainly just updates the help output.
Fixes: #39311

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-17 15:07:39 +00:00
Martin Robinson
5505d00334 libservo: Remove Opts::webrender_stats and -Z wr-stats (#39331)
This option is supported via the WebView API now and you can enable it
in servoshell by pressing `Ctrl` + `F12`. The command-line argument and
`Opts` field are older and I believe are no longer necessary.

Testing: This just removes a redundant command-line option, so no tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-17 11:58:16 +00:00
Martin Robinson
7b755471c7 libservo: Remove the Opts::trace_layout (#39332)
This is currently unused, so it can be removed.

Testing: This just removes an unused field, so does not require tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-16 17:12:18 +00:00
Integral
2d5eac386f servoshell: Add ParseResolutionError to parse elegantly (#39289)
When passing an invalid resolution string (such as `1x1x1`) to the
`--screen-size` or `--window-size` argument, Servo starts without any
error. Additionally, if the width or height is set to 0, Servo crashes
with a SIGSEGV (Address boundary error).

This patch addresses the following issue by several changes:

1. Introduce a custom error type ParseResolutionError.
2. Replace the `split()` method with `split_once()`.
3. Make the capital 'X' an acceptable separator.
4. Add a check to prevent crashes when width or height is set to 0.

---

Before: 
```
╰─❯ ./servo --screen-size=0
index out of bounds: the len is 1 but the index is 1 (thread main, at ports/servoshell/prefs.rs:236)
fish: Job 1, './servo --screen-size=0' terminated by signal SIGSEGV (Address boundary error)
```
```
╰─❯ ./servo --screen-size=0x1
xdg_surface#30: error -1: invalid window geometry size (0x1)
assertion `left != right` failed
  left: 0
 right: 0 (thread main, at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/surfman-0.10.0/src/platform/unix/wayland/connection.rs:140)
fish: Job 1, './servo --screen-size=0x1' terminated by signal SIGSEGV (Address boundary error)
```
After:
```
╰─❯ ./servo --screen-size=0
Error: couldn't parse `0`: invalid resolution format
```
```
╰─❯ ./servo --screen-size=0x1
Error: couldn't parse `0x1`: width and height must be greater than 0
```

Signed-off-by: Integral <integral@member.fsf.org>
2025-09-14 02:37:50 +00:00
Tim van der Lippe
2f252c9b78 Remove the dom_trusted_types_enabled preference (#39281)
Everything related to Trusted Types has been implemented. Failing WPT
tests are related to other features such as SVG scripts.

Fixes #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-13 09:57:15 +00:00
Narfinger
ed66e0b0ca servoshell: Replace getopts with bpaf for argument parsing (#37194)
This includes some small refactoring and some small breaking changes as
listed below. Other than these I tried to keep the functionality exactly
the same but because in the old code the parsing and settings of
preferences was intermingled it was difficult to figure out.

Small Breaking:
- Size and resources-path were unused but appeared in the help.
- soft-fail and hard-fail: Soft-fail flag got removed because it is too
  difficult to keep both. The default is now soft-fail and hard-fail can
be enabled.
- The help strings are obviously formatted differently now.
- -V does not work anymore but -v and --version.

Ideally, we want to have the ServoShellPreferences and Preferences be
directly the Argument structure but that needs a bit more discussion
because it would break backwards compatibility with the commandline.

This increases the binary size by ~280kb.

Testing: The testcases are still working but they do not cover much.
I added a unit test for the -p flag because it is the most difficult to
parse in general.
Fixes: This will fix a small number of various parsing misshaps. It will
also show if we are removing an option via unused lint.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-05 08:17:38 +00:00
Josh Matthews
aac6aa6c70 servoshell: Add button to toggle experimental web platform features. (#39125)
This makes it easier to experiment with the impact of experimental
features when browsing around in servoshell. The toggle is global and
causes all webviews to reload with the new preference values.

Testing: Manually tested; no UI testing for servoshell.

Not enabled:
<img width="317" height="82" alt="Screenshot 2025-09-03 at 9 34 30 PM"
src="https://github.com/user-attachments/assets/ca521ad5-ce1b-434e-a0c3-ea1b75d76d53"
/>

Enabled:
<img width="320" height="82" alt="Screenshot 2025-09-03 at 9 34 36 PM"
src="https://github.com/user-attachments/assets/7b6529b5-1055-4ae0-924a-96d57e115714"
/>

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-09-04 02:53:12 +00:00