55945 Commits

Author SHA1 Message Date
Narfinger
68ca2808ee net: Refactor obtain_response and split devtools (#44271)
This PR refactors parts of the net crate with one minor functional
change.
Most of the main functions in the net crate are quite long and rather
unwieldly. This PR tries to help make them more understandable.

- Split parts of obtain_response to have the Router callback setup in
another function.
- Move functions related to devtools into another file.
- Add some servo_tracing.
- http_network_or_cache_fetch has another function for append_cache_data
to headers.
- One functional change: previously in obtain_response, we used the
encoded_url via copies and multiple replace calls. We now use the
percent_encode crate which is already included in
content_security_policy to do this a bit more efficiently. In practice
the compiler probably fixed the multiple copies but this is more
straightforward. The output should be identical.

Testing: As this is mostly a refactor compilation is the test. The
percent_encode change is tested in multiple unit tests.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-04-17 16:29:19 +00:00
Tim van der Lippe
9259a7ed69 script: Set shorthand text-decoration instead of longhand (#44312)
The generated HTML was setting `text-decoration-line` whereas it instead
should set `text-decoration`.

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-17 15:38:20 +00:00
Euclid Ye
467fdb1dc0 git: Fix CI by removing wrongly commited FETCH_HEAD (#44309)
This is somehow introduced in #43617. This is causing CI failure.
For whatever reason, this thing should only be in `.git` folder. But
somehow it is at the root?

Also changed `.yml` to avoid ambiguity: we are using revision instead of
path.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-04-17 15:23:39 +00:00
Martin Robinson
789974975f layout: Remove dependency on xi-unicode (#44303)
This functionality already provided by `icu_properties` which is already
in our dependency graph, so this change allows us to remove one
dependency.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-17 13:09:44 +00:00
Shubham Gupta
53d7a0e08a script: Generate custom fields also, for interfaces inheriting from PerformanceEntry, from impl_performance_entry_struct! (#44289)
Add definition for generation of custom fields for interfaces inheriting
from PerformanceEntry.

Testing: More WPT Tests Passed

---------

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
2026-04-17 12:16:52 +00:00
Simon Wülker
fdf1e09a2a style: When animating a property, ignore keyframes that don't declare that property (#43461)
Companion PR for https://github.com/servo/stylo/pull/338 (Refer to that
PR for a proper description)

Testing: This change adds a test
Fixes: https://github.com/servo/servo/issues/41302

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-17 11:32:58 +00:00
Simon Sapin
56345cdab0 layout: Fix which axis to consider for baseline propagation of flex items (#44281)
* When a flex item line participates in baseline alignment, the relevant
baseline must be parallel to the **main axis** (affected by
`flex-direction`) of the flex container.
* When a flex item propagates a baseline to a parent layout (such as for
`display: inline-flex`) the relevant baseline must be parallel to the
**inline axis** (not affected by `flex-direction`) of the flex
container.

See:

* https://drafts.csswg.org/css-flexbox-1/#box-model
* https://drafts.csswg.org/css-flexbox-1/#flex-direction-property
* https://drafts.csswg.org/css-flexbox-1/#baseline-participation
* https://drafts.csswg.org/css-align-3/#baseline-export

Testing: covered by existing WPT tests
Fixes: https://github.com/servo/servo/issues/43687

Signed-off-by: Simon Sapin <simon@igalia.com>
2026-04-17 10:08:26 +00:00
Gregory Terzian
9f81a8f54d storage: use client storage in indexeddb (#43900)
Integrate client storage into indexeddb for the creation and deletion of
databases.

Testing: Existing WPT tests.
Fixes: None

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2026-04-17 09:53:28 +00:00
Tim van der Lippe
e7c29c3330 script: Check correct element if text-decoration is effective (#44293)
Rather than node, we should check `new_parent` for this. Unfortunately
some regressions, which have been flip-flopping in recent PRs. That's
because underline itself uses its own state to determine what to do.
However, this is a net positive PR that also adheres to the spec, so
it's another step in the right direction.

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-17 08:32:08 +00:00
Euclid Ye
aefcd94ee5 build: Upgrade mako to 1.3.11 in uv.lock to fix security alert (#44291)
Fixes: https://github.com/servo/servo/security/dependabot/285

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-04-17 07:35:09 +00:00
Kingsley Yung
617c28f631 script: Default configuration of sanitizer (#44290)
This patch implements the built-in safe default configuration for
`Sanitizer` constructor.

Specification:
https://wicg.github.io/sanitizer-api/#sanitization-defaults

Testing: Covered by WPT test in
`sanitizer-api/sanitizer-default-config.tentative.html`.
Fixes: Part of #43948

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-04-17 07:34:38 +00:00
dependabot[bot]
5d5a38048d build: bump mako from 1.2.2 to 1.3.11 (#44286)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.2 to 1.3.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sqlalchemy/mako/releases">mako's
releases</a>.</em></p>
<blockquote>
<h1>1.3.11</h1>
<p>Released: Tue Apr 14 2026</p>
<h2>bug</h2>
<ul>
<li>
<p><strong>[bug] [template]</strong> Fixed issue in
<code>TemplateLookup</code> where a URI with a double-slash
prefix (e.g. <code>//../../</code>) could bypass the directory traversal
check in
<code>Template</code>, allowing reads of arbitrary files outside of the
template directory. The issue was caused by an inconsistency in how
leading
slashes were stripped between <code>TemplateLookup.get_template()</code>
and
<code>Template</code> initialization.</p>
<p>References: <a
href="https://redirect.github.com/sqlalchemy/mako/issues/434">#434</a></p>
</li>
</ul>
<h1>1.3.10</h1>
<p>Released: Thu Apr 10 2025</p>
<h2>bug</h2>
<ul>
<li>
<p><strong>[bug] [lexer]</strong> Fix undefined variable errors when
<code>strict_undefined=True</code> when using a
nested list comprehension. Pull request courtesy Sébastien Granjoux.</p>
<p>References: <a
href="https://redirect.github.com/sqlalchemy/mako/issues/418">#418</a></p>
</li>
</ul>
<h1>1.3.9</h1>
<p>Released: Tue Feb 4 2025</p>
<h2>bug</h2>
<ul>
<li>
<p><strong>[bug] [tests]</strong> Fixed test suite to not rely upon
ancient &quot;future division&quot; statement to
test the <code>Template.future_imports</code> feature.   The test is
replaced with one that tests only the rendering, not the ultimate
effect.</p>
<p>References: <a
href="https://redirect.github.com/sqlalchemy/mako/issues/408">#408</a></p>
</li>
</ul>
<h1>1.3.8</h1>
<p>Released: Sat Dec 7 2024</p>
<h2>bug</h2>
<ul>
<li><strong>[bug] [lexer]</strong> Reverted the fix for <a
href="https://redirect.github.com/sqlalchemy/mako/issues/140">#140</a>
released in Mako 1.3.7 as it produced
regressions in existing user code.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/sqlalchemy/mako/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mako&package-manager=uv&previous-version=1.2.2&new-version=1.3.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/servo/servo/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-16 22:02:02 +00:00
dependabot[bot]
4dc82fe2c0 build: bump mako from 1.2.2 to 1.3.11 in /python (#44287)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.2 to 1.3.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sqlalchemy/mako/releases">mako's
releases</a>.</em></p>
<blockquote>
<h1>1.3.11</h1>
<p>Released: Tue Apr 14 2026</p>
<h2>bug</h2>
<ul>
<li>
<p><strong>[bug] [template]</strong> Fixed issue in
<code>TemplateLookup</code> where a URI with a double-slash
prefix (e.g. <code>//../../</code>) could bypass the directory traversal
check in
<code>Template</code>, allowing reads of arbitrary files outside of the
template directory. The issue was caused by an inconsistency in how
leading
slashes were stripped between <code>TemplateLookup.get_template()</code>
and
<code>Template</code> initialization.</p>
<p>References: <a
href="https://redirect.github.com/sqlalchemy/mako/issues/434">#434</a></p>
</li>
</ul>
<h1>1.3.10</h1>
<p>Released: Thu Apr 10 2025</p>
<h2>bug</h2>
<ul>
<li>
<p><strong>[bug] [lexer]</strong> Fix undefined variable errors when
<code>strict_undefined=True</code> when using a
nested list comprehension. Pull request courtesy Sébastien Granjoux.</p>
<p>References: <a
href="https://redirect.github.com/sqlalchemy/mako/issues/418">#418</a></p>
</li>
</ul>
<h1>1.3.9</h1>
<p>Released: Tue Feb 4 2025</p>
<h2>bug</h2>
<ul>
<li>
<p><strong>[bug] [tests]</strong> Fixed test suite to not rely upon
ancient &quot;future division&quot; statement to
test the <code>Template.future_imports</code> feature.   The test is
replaced with one that tests only the rendering, not the ultimate
effect.</p>
<p>References: <a
href="https://redirect.github.com/sqlalchemy/mako/issues/408">#408</a></p>
</li>
</ul>
<h1>1.3.8</h1>
<p>Released: Sat Dec 7 2024</p>
<h2>bug</h2>
<ul>
<li><strong>[bug] [lexer]</strong> Reverted the fix for <a
href="https://redirect.github.com/sqlalchemy/mako/issues/140">#140</a>
released in Mako 1.3.7 as it produced
regressions in existing user code.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/sqlalchemy/mako/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mako&package-manager=pip&previous-version=1.2.2&new-version=1.3.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/servo/servo/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-16 21:59:55 +00:00
Tim van der Lippe
d096560b51 script: Correctly handle modifiable elements in contenteditable (#44250)
First of all, the effective command value was wrong, since there is no
relevant CSS property for the underline command. Instead, we should
directly use the text-decoration property. This then allows us to
implement reordering of modifiable elements.

We also need to "change the element to a span", which is quite annoying
to do. Instead, it mimics what would have happened by moving children
and copying attributes.

There are some regressions, but overall this is another big step towards
the right track. The regressions look related to tricky edge cases that
I am not even sure other browsers handle.

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-16 20:50:06 +00:00
Martin Robinson
3ffecfb60c wpt: Correct the name of a __dir__.ini metadata file after #44232 (#44260)
This file was renamed incorrectly due to automated renaming of directory
contents.

Testing: This does not seem to change test results, but whether or not
the
option in this `__dir__.ini` file is another issue.

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
2026-04-16 20:36:52 +00:00
Nico Burns
df3f915465 layout: depend on web_atoms rather than html5ever (#44277)
`servo-layout` only depends on `html5ever` for it's atom types which are
now split out into the `web_atoms` crate. This switches the dependency
to `web_atoms` to remove the unncessary dependency

Testing: This just imports the same types from a different crate. So if
it builds, it should work.

Signed-off-by: Nico Burns <nico@nicoburns.com>
2026-04-16 20:36:04 +00:00
Abbas Olanrewaju Sarafa
77e75aaf9e script: Make adjacent errors and console.log messages log in correct order (#44243)
Made adjacent errors and console.log messages log in correct order

Testing: ```./mach test-unit -p servo --
test_console_log_and_error_ordering``` passed.
Fixes: #44204

---------

Signed-off-by: Sabb <sarafaabbas@gmail.com>
2026-04-16 20:33:50 +00:00
Ashwin Naren
83eacc517a script: Add messages to all errors in components/script/dom/location.rs (#44282)
Mostly reuses the original error message from #39051, but on the rest of
the methods that require it. Also adds a new error message for
`document_if_same_origin`.

Testing: None
Fixes: Partially #40756

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-04-16 19:00:23 +00:00
Ashwin Naren
b4a569536c servoshell: Remove IndexedDB preference from servo:preferences (#44283)
Since indexeddb is now part of the experimental features list, we can
remove it from the "more experimental" features list.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-04-16 18:59:28 +00:00
Jonathan Schwender
f77fe5eadd release: Build android in production mode (#44278)
Since https://github.com/servo/servo/pull/44182 production builds for
android are now possible in CI.
Let's unify this, since all other platforms already use production. The
production build is also ~45MB small, which is a huge reduction compared
to the ~159MB our nightly builds have. I didn't investigate further why
the difference is that large, but I installed the production version on
my phone and didn't spot any obvious issues (on servo.org).

[Mach try
android-production](https://github.com/jschwe/servo/actions/runs/24525178123)

Testing: We don't test CI workflows themselves.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-04-16 18:03:34 +00:00
Oriol Brufau
9ef8fe5e42 layout: Avoid unnecessary borrow in TextRun::segment_text_by_font() (#44279)
No need to borrow `self.inline_styles.style` when the result is already
available as a parameter of the function.

Also, avoid calling `parent_style.get_font()` multiple times.

Testing: Not needed, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-04-16 17:17:37 +00:00
Jonathan Schwender
2cb556a87a android: Support custom build profiles (#44182)
Pass the build directory to gradle via an environment variable, to
support custom profiles.
Building the custom profiles already works, but follow-up commands
expect the artifact at the location of the profile.
This allows switching the android release build to production (in a
follow-up PR).

Testing: We don't run any runtime tests for android in CI

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-04-16 16:22:41 +00:00
eri
7b6f2e5a39 devtools: Use serde structs for ObjectActorMsg (#44262)
Replace previous `serde_json::Value` manual encoding.

Testing: Existing tests pass.
Part of: #39858

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-04-16 14:01:46 +00:00
Simon Martin
5634eab8cc webgl: check TexImage3D's input data length (#44270)
tex-3d-size-limit.html currently crashes because we don't check that the
input data is large enough, and happily access memory that's not ours if
it's not.

The referenced ticket comes from the fact that we don't systematically
detect a crash (which makes sense if we're (un)lucky), and this patch
eradicates the crash altogether by checking the input buffer size. The
size computation is a (partial) port of WPT's computeImageSizes3D JS
function.

Fixes: https://github.com/servo/servo/issues/42881
Testing: Some expected failures in wpt/webgl can be removed, including a
crash.

Signed-off-by: Simon Martin <simon@nasilyan.com>
2026-04-16 13:47:55 +00:00
Martin Robinson
b3fdbf9821 script: Clear style data from detached subtrees when attaching a shadow DOM (#44259)
Instead of just clearing layout data, also clear style data from
descendants that are now no longer part of the flat tree when attaching
shadow DOM. This ensures that Stylo does not try to process them during
restyling. This matches what Gecko does.

Testing: This change adds a crash test and also causes a few subtests
to start passing.
Fixes: #40731.

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
2026-04-16 13:37:21 +00:00
eri
496c5c0e80 devtools: Separate actors into their own files (#44265)
Switch the actors to the register pattern.

Testing: Just a refactor, existing tests pass.
Part of: #43800

Signed-off-by: eri <eri@igalia.com>
2026-04-16 12:34:14 +00:00
Martin Robinson
8da073a80c layout: Cache SameFormattingContextBlock layout results (#42904)
Add a cache for `SameFormattingContextBlock`s: A new kind of cache
is added which allows reusing fragments for
`SameFormattingContextBlock` (the majority of block level elements).
This can reduce the amount of fragment tree construction during
incremental layout (although with a 40 byte overhead per
`SameFormattingContextBlock`).

Testing: This change adds a new Servo-specific WPT test that verifies
that
the minimal number of `Fragment`s are rebuilt after an incremental
layout.
Previously, when running `flexbox-deeply-nested-column-flow.html` from
`tests/blink_perf_tests/perf_tests/layout/`, performance would degrade
with successive test runs. This is due to how slow inline layout is.
This change
removes that progressive degradation, though we may be able to remove
this cache with improvements to inline layout.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-04-16 12:04:39 +00:00
张喜昌
562609f876 mach: Support Visual Studio 2026 and VC145 redistributables (#44264)
Testing: Visual Studio 2026 builds are not run in CI. 
Fixes: #44261.

Signed-off-by: 张喜昌 <zhang.xichang@outlook.com>
2026-04-16 11:19:02 +00:00
Kingsley Yung
b23ee51d00 script: Initialize Sanitizer API implementation (#44198)
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>
2026-04-16 10:31:53 +00:00
Steven Novaryo
02ba2eaa62 script: Partially implement IntersectionObserver compute the intersection algo (#42204)
Depends on #42251 for the overflow query.

Use containing block queries to implement the iteration of step [3.2.7.
Compute the Intersection of a Target Element and the
Root](https://w3c.github.io/IntersectionObserver/#compute-the-intersection)
within `IntersectionObserver` algorithm.

Contrary to the algorithm in the spec that maps the coordinate space of
the element for each iteration, we uses bounding client rect queries to
get the appropriate clip rect. And, to handle the mapping between
different coordinate spaces of iframes, we use a simple translation.

Due to the platform limitation, currently it would only handle the same
`ScriptThread` browsing context. Therefore innaccuracy any usage with
cross origin iframes is expected.

Testing: Existing and new WPTs.
Part of: https://github.com/servo/servo/issues/35767

Co-authored-by: Josh Matthews
[josh@joshmatthews.net](josh@joshmatthews.net)

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2026-04-16 09:04:53 +00:00
Kingsley Yung
6c14aed993 script: Encapsulate logic of underlying compression algorithms (#44195)
In CompressionStream API, the compression algorithms are provided by
`flate2::write::{DeflateEncoder, GzEncoder, ZlibEncoder}` and
`brotli::CompressorWriter`, and the decompression algorithms are
provided by `flate2::write::{DeflateDecoder, GzDecoder, ZlibDecoder}`
and `brotli::DecompressorWriter`.

Although all of them `std::io::Write`, they have subtle difference in
their workflow. For example, `DeflateEncoder`, `GzEncoder` and
`ZlibEncoder` are closed by `fn try_finish(&mut self)` or `fn
finish(self)`, while `brotli::CompressorWriter` must be closed by `fn
into_inner(self)`.

We currently directly call those methods from specification steps. This
patch move those method calls into new structs `CompressionContext` and
`DecompressorContext`, to provide an abstraction layer between
specification steps and underlying logics of compression algorithms from
external libraries. This helps to separate the subtle difference in
compression algorithms away from specification steps.

Testing: Refactoring. Covered by tests in `tests/wpt/tests/compression/`

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-04-16 03:40:03 +00:00
Euclid Ye
2dedd4087e ci: Install cargo nextest conditionally; Give the step consistent name for linux & mac (#44226)
There is no point to install it if we don't run UT. 
This step takes 1 min to install for self-hosted runner:
[try](https://github.com/servo/servo/actions/runs/24436253745/job/71391055444#step:15:11).
Given the rising energy price nowadays, let's save it.

Also take the chance to give the consistent name. Somehow only Windows
had the name "Install cargo nextest"

Testing: Previously, the step is called "Run taiki-e/install-action@v2"
in the linux/mac CI.
Now it has the proper name and skipped if UT will not be run:
[try](https://github.com/servo/servo/actions/runs/24440166415/job/71403276390).

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-04-16 01:47:46 +00:00
Florian König
4a3ee306db api: WebView::animating should only take a reference to self (#44253)
Fixed that `WebView::animating` takes `self` instead of `&self` as
argument.

Testing: Unsure how this could be tested for, beyond creating a unit
test for each individual function as a sanity check that all parameters
are correct. This seems excessive.
Fixes: #44251

Signed-off-by: Java <javaderg@pm.me>
2026-04-15 22:27:43 +00:00
Simon Wülker
7873d8a6c3 tests: Remove src from audio element in move-element-with-ua-shadow-tree-crash.html (#44252)
The original bug was triggered by the shadow tree for audio controls,
and that tree exists without the `src` element too.

Let's see if this fixes https://github.com/servo/servo/issues/39473

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-15 21:55:29 +00:00
rovertrack
2578b5b78a script: Use OffscreenRenderingContextId instead of DOMString in OffscreenCanvas (#44227)
replaced use of `DOMString` with `OffscreenRenderingContextId` made the
enum be initialized in bindings
([OffscreenCanvas.webidl](https://github.com/servo/servo/compare/main...rovertrack:servo:issue-44211?expand=1#diff-3a74afa4763f3f36099b9717328f9516edc3eecd5131d216a8cd024fa4fd96d9))
and use them in `getcontext()`
Testing: `./mach test-wpt tests/wpt/tests/html/canvas/offscreen` there
are no failing tests regarding the use of `OffscreenRenderingContextId`
but there were some regarding other things such as `TextMetrics`.
Fixes:  #44211

Signed-off-by: Rover track <rishan.pgowda@gmail.com>
2026-04-15 21:29:34 +00:00
Martin Robinson
57cc4931bd wpt: Make /_mozilla/css/offset-properties-inline.html wait for fonts to load (#44247)
This is a speculative fix for #40543. Although I could not get this test
to flake locally, it is obviously wrong to assumee that web fonts (Ahem
in this case) is loaded at the time of `window.onload`. This change
makes all the tests Promise tests and has them await
`document.fonts.ready` before running. This should fix the
intermittency.

Testing: This should fix itnermittency as seen on the CI.
Fixes: #40543.

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
2026-04-15 21:26:09 +00:00
Martin Robinson
730fa9d47d wpt: Make /_mozilla/mozilla/getBoundingClientRect.html wait for fonts to load (#44248)
This is a speculative fix for #39668. Although I could not get this test
to flake locally, it is obviously wrong to assumee that web fonts (Ahem
in this case) is loaded at the time of `window.onload`. This change
makes all the tests Promise tests and has them await
`document.fonts.ready` before running. This should fix the
intermittency.

Testing: This should fix intermittency as seen on the CI.
Fixes: #39668

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
2026-04-15 19:25:28 +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
Taym Haddadi
93a57147ce script: generalize worker common code for non-dedicated worker globals (#44244)
Testing: No new tests needed this is a refactor and no behavior changes
for any existing workers.
part of https://github.com/servo/servo/issues/7458

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-15 17:13:22 +00:00
Oriol Brufau
3cd71cf05a layout: Reuse abspos fragments when they didn't change (#44231)
When laying out an absolutely positioned box, if the layout results are
taken from the cache, and the resulting fragment would have the same
size and position, then use the fragment from the previous layout
instead.

Testing: Not needed, there shouldn't be any observable behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-04-15 16:40:15 +00:00
Martin Robinson
d22435c6f6 wpt: Rename Servo-specific WPT-style tests to match WPT conventions (#44232)
This is a very minor, but annoying bit of technical debt that we have
carried for over a decade. Many of the Servo-specific WPT-style tests
had names that didn't match the naming convention used in WPT. In some
cases tests and references were named `test_a.html` for the test and
`test_b.html` for the reference. To make things more confusing,
sometimes two tests in a series were named `test_a.html`, `test_b.html`
and `test_ref.html` for the reference.

This change makes it so that tests are named consistenty and with
hyphens which are more common in WPT:

 - `test-001.html`
 - `test-002.html`
 - `test-ref.html`

Testing: This shouldn't change results, as this just renames the test
files.
Fixes #2463.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-15 16:15:28 +00:00
eri
d37e6f1bb5 devtools: Implement function preview in console (#44233)
Testing: Added new tests for console array and function previews
Part of: https://github.com/servo/servo/issues/39858
Depends on: #44196

<img width="934" height="388" alt="image"
src="https://github.com/user-attachments/assets/8589ef9c-7a58-47dd-83dd-4f66607125fe"
/>

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-04-15 15:11:16 +00:00
Narfinger
4fafdd1c23 script: JSContextify parts of DocumentEventHandler (#44241)
This "JSContextify"s part of DocumentEventHandler, namely the actions
from `handle_pending_input_events`.
Additionally, we also switch the MouseEvent and KeyboardEvent. This does
not change yet PointerEvent and some other events used to keep the diff
reasonable.

Testing: This is part of the JSContextify work that is fundamental and
tested by WPT.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-04-15 13:59:07 +00:00
Martin Robinson
d4729c05b2 wpt: Remove the /_mozilla/mozilla/sslfail.html (#44238)
This tests a feature (`about:sslfail`) that was removed in #14360 and
has been flaky for years. At this point, the test has been flaking for a
decade longer after the original feature existed! We can just go ahead
and remove it I think.

Testing: This change just removes a test, so doesn't need new tests.
Fixes: #10760

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-15 13:57:51 +00:00
Tim van der Lippe
a8e8f2ae89 script: Fix command state for underline command (#44234)
For any generic command, the spec doesn't specify how to determine
whether its state is set. In the case of underline, it at least means
that it has an effective command value that is set (to underline in this
case).

Also implements "simple modifiable" elements, since the relevant tests
depend on that for correctness.

Lastly, also rewrite `JSContext` to use imports.

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-15 13:56:50 +00:00
Martin Robinson
12bac57c3e wpt: Remove empty test ini for /_mozilla/mozilla/localeCompare.html (#44240)
Judging by the expected result in the test, the situation described in
the bug is no longer the case.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Testing: This updates test results.
Closes: #25802.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-15 13:37:40 +00:00
Martin Robinson
0353e0fd2e wpt: Convert several old Servo-specific crash tests into WPT crashtests (#44237)
This change converts a collection of old Servo-specific crash tests into
WPT style crash tests, which are supported directly by the WPT test
harness. The main change here is the addition of `-crash.html` to the
end
of the test name (this is how the harness detects crash tests) and the
removal of `testharness.js` from the tests. This is a preparation for
#44232.

Testing: This change just changes the tests, so should be tested by the
test run.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-15 12:42:29 +00:00
atbrakhi
77458b2312 devtools: implement ArrayPreview in console (#44196)
Show preview of `ArrayItems` in console

Testing: Current tests are passing
Fixes: Part of #39858 
<img width="941" height="795" alt="image"
src="https://github.com/user-attachments/assets/e121265c-3987-4e37-a97d-b7cef0e05f4b"
/>

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
2026-04-15 10:06:10 +00:00
rovertrack
134beac3f0 Match on NonNull::new instead of using is_null() and expect() (#44221)
The code was doing repetitive work by checking if `compiled_script` is
null and then assigning and expecting the same, combined and replaced
with condition based working
Testing: The flow remains the same no new tests needed
Fixes: #44210

Signed-off-by: Rover track <rishan.pgowda@gmail.com>
2026-04-15 09:32:33 +00:00
Alice
31be152bfa layout: Send accessibility updates directly to embedder from layout. (#44208)
This introduces a `ScriptToEmbedderChan` property on `LayoutThread`,
which is used to send accessibility updates directly to the embedder.

Follow-up to https://github.com/servo/servo/pull/42338.

Testing: Covered by existing tests.

Signed-off-by: Alice Boxhall <alice@igalia.com>
2026-04-15 09:14:40 +00:00