Commit graph

2235 commits

Author SHA1 Message Date
Integral
466641310f
mach: Format package hash files to ensure sha256sum command compatibility (#39432)
Format the package hash files to include the package hash and filename
separated by two spaces, ensuring compatibility with the `sha256sum -c`
and `shasum -c` command.

---

Before:
```
╰─❯ sha256sum -c servo-latest.tar.gz.sha256
sha256sum: servo-latest.tar.gz.sha256: no properly formatted checksum lines found
```

After:
```
╰─❯ sha256sum -c servo-latest.tar.gz.sha256
servo-latest.tar.gz: OK
```

Signed-off-by: Integral <integral@member.fsf.org>
2025-09-22 14:39:47 +00:00
Simon Wülker
4d43844ece
Remove test-content subcommand from mach (#39412)
Content tests have been replaced by web platform tests 10 years ago (see
9be71b941f).
I think it is fair to assume that no one is going to run the relevant
subcommand anymore. Let's remove it.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-21 00:36:07 +00:00
shuppy
b685c2f424
devtools: Fix race in tests due to asynchronous termination (#39309)
one of the flaky failure modes we found in #38658 was that on linux,
geckordp occasionally fails to connect to servoshell’s devtools server.
this happens despite our preliminary connect check passing, which should
imply that the devtools server is listening and ready to use. we closed
the issue without any fix for that failure mode, because we were
ultimately unable to reproduce it, but it still happens in the wild
(#39273). we’ve now found a way to reproduce it, and we think it’s
caused by a race that occurs when moving from one test to the next. for
example:

- test 1 finishes
- we send SIGTERM to test 1’s servoshell, but it does not stop its
devtools server yet
- test 2 begins
- we spawn test 2’s servoshell, but it does not start its devtools
server yet
- we try to do our preliminary connects, and it succeeds against test
1’s servoshell immediately (the failure logs on GitHub never make this
clear, due to some kind of buffering problem that delays the `.` and `+`
outputs)
- test 1’s servoshell stops its devtools server
- we try to do our actual connect, and it fails because no devtools
server is listening
- test 2 fails

very rarely, one test’s servoshell may even fail to start its devtools
server, which we think happens because the previous test’s servoshell is
still listening. this has only ever happened once, and we’ve been unable
to reproduce it since, but we think it’s caused by the same kind of
race. for example:

- test 1 finishes
- we send SIGTERM to test 1’s servoshell, but it does not stop its
devtools server yet
- test 2 begins
- we spawn test 2’s servoshell, but it does not start its devtools
server yet
- test 2’s servoshell tries to start its devtools server, but fails
because test 1’s servoshell is still listening
- test 2 fails

in both cases, the failure can be explained by the fact that we send
SIGTERM to the previous test’s servoshell without actually waiting for
the process to exit. this patch ensures that we wait, and also moves all
of the output we do in the test suite from stdout to stderr to avoid it
getting mangled in GitHub Actions.

Testing: see [this
comment](https://github.com/servo/servo/pull/39309#issuecomment-3291007931)
(before) vs [this
comment](https://github.com/servo/servo/pull/39309#issuecomment-3291188997)
(after)
Fixes: #39273

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-09-15 10:28:08 +00:00
Abdelrahman Hossam
7a28fd786c
ohos: Adding support for running WPT on OHOS devices using WebDriver (#38846)
Architecture:
```
Desktop (Test Controller)        OHOS Device (Test Target)
┌─────────────────────────┐     ┌─────────────────────────┐
│ WPT Server (port 8000)  │     │ Servo Browser           │
│ Test Runner Script      │---->│ WebDriver Server (7000) │
│ HDC Port Forwarding     │     │ Test Execution          │
└─────────────────────────┘     └─────────────────────────┘
```
After the test is finished, the script will parse the results and print
them in a readable format.

Tried to handle as many errors as possible and find workarounds for each
error to ensure the testing can be completed, or at least provide
comprehensive logs or information to identify exactly where the problem
is. Note that the used ports are just for testing; you can change them
to any other available ports, but make sure that the ports are
consistent in the script and given commands.

To run a WPT test on an OHOS device, you need to:
1. Connect OHOS device to the desktop via a cable (didn't try any other
way of communication)
2. Build and deploy servo with the changes in this PR using
[servoDemo](https://github.com/jschwe/ServoDemo). You can find there the
instructions to build and deploy servo to OHOS device.
3. While deploying servo to OHOS you need to ensure WebDriver is enabled
with the argument --webdriver=7000
4. Ensure OHOS SDK with HDC in PATH
5. Start WPT server on the desktop on a different terminal in servo
directory: ```bash python -m wpt serve --port 8000 ```
6. Update desktop IP in test scripts:
```python
desktop_ip = "192.168.1.100"  # Your desktop's IP
```
You can find your desktop IP with:
```bash
# Windows
ipconfig | findstr "IPv4"

# macOS/Linux
ifconfig | grep "inet "
```
script can be modified to detect the desktop's IP automatically ...
later.
7. Run tests using the new mach command:

```bash
./mach test-ohos-wpt \
    --test <test relative path> \
    --webdriver-port 7000 \
    --wpt-server-port 8000 \
    --verbose
```

The script will:
1. Set up HDC port forwarding and reverse port forwarding for WPT
automatically
2. Connect to WebDriver server on the device
3. Navigate to the test URL
4. Wait for test completion
5. Show test results

Troubleshooting common Issues and Solutions:

1. HDC command not found:
   - Install OHOS SDK and add HDC to PATH
   - Verify: `hdc --version`

2. Failed to connect to WebDriver:
   - Ensure Servo is running with `--webdriver=7000` argument
   - Check device connection: `hdc list targets`
   - Verify port forwarding: `hdc fport ls`
   - Test WebDriver directly: `curl http://localhost:7000/status`

3. Failed to navigate to test URL:
   - Update `desktop_ip` in the script
   - Ensure both devices are on same network or connected via cable
   - Test connectivity: ping from device to desktop

4. Test timeouts:
   - Increase timeout in script (default: 30 seconds)
   - Check if test requires specific dependencies
   - Verify WPT server is serving the test file

---------

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-09-09 08:57:36 +00:00
Ashwin Naren
3ac8875697
script: Initial stubs for Credential Management API (#38839)
Stubs `Credential`, `CredentialContainer`, and `PasswordCredential` and
adds the credentials attribute to navigator.

Testing: WPT
Fixes: Partially #38788

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-06 19:48:38 +00:00
Kenzie Raditya Tirtarahardja
9c840b05bc
CI: Enable webdriver classic on wpt workflow (#39087)
Since WebDriver is quite stable now, enable the `webdriver/classic`
tests on wpt CI.

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-09-03 03:50:44 +00:00
atbrakhi
eaab71d335
devtools: Fix flaky source list test assertions (#38969)
In the sources list tests, we assert that the sources for each target
are given to us in the same order as we specified in the test case, but
this is only true for classic &lt;script> and &lt;script src>. ES module
scripts and async/defer scripts are loaded asynchronously, so we can’t
rely on the order being the same every time.

this patch changes the test assertions to use a frozen multiset for each
target’s sources, rather than a frozen list (tuple), so the sources can
appear in any order but must still appear the expected number of times.
we also change the test assertions to use a multiset
([Counter](https://docs.python.org/3/library/collections.html#counter-objects))
of frozen multisets, rather than a set of multisets, so now two targets
can have the same set of sources without breaking tests.

Testing: this patch improves existing tests, but does not change
coverage
Fixes: part of #38658

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: delan azabani <dazabani@igalia.com>
2025-08-27 13:19:58 +00:00
atbrakhi
5909eb7684
devtools: Use correct servoshell path on Windows (#38938)
When we landed #38614, the devtools tests consistently failed on
GitHub-hosted Windows builds, because we were hardcoding the target
directory. This patch fixes that by taking the `CARGO_TARGET_DIR` into
account.

- before: `[D:\a\servo\servo\]target/release/servo`
- after: `C:\a\servo\servo\target\release\servo.exe`

Testing (cherry picked onto #38614 so it runs in CI):
- GitHub-hosted, before:
<https://github.com/atbrakhi/servo/actions/runs/17231549981/job/48886505825>
- GitHub-hosted, after:
<https://github.com/atbrakhi/servo/actions/runs/17232856662/job/48890768590>
- self-hosted, after:
<https://github.com/servo/servo/actions/runs/17234485907/job/48896322465>

Fixes: part of #38658

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2025-08-27 09:14:21 +00:00
atbrakhi
ad91c6e461
devtools: Fix test_source_breakable_lines_and_positions_with_functions (#38964)
In #38933 we removed `start_web_server` but
`test_source_breakable_lines_and_positions_with_functions` was not
updated because it was added later. In this patch we remove
`start_web_server` in that test as well.

Testing: fixes an existing test
Fixes: Part of #36325

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: delan azabani <dazabani@igalia.com>
2025-08-27 08:15:02 +00:00
Sam
3dc9184121
canvas: Use vello_cpu as default canvas backend (#38844)
We really want to remove font-kit from dep tree, so this is the first
step into removing raqote from servo. While vello_cpu is not perfect
replacement, I am confident that we will resolve all issues eventually:
https://github.com/servo/servo/issues/38345 (most important ones already
have PRs).

Reviewable per commit.

Testing: Existing WPT tests.
Try run: https://github.com/sagudev/servo/actions/runs/17138369290

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-27 07:22:20 +00:00
shuppy
7aad72838a
devtools: Reland test improvements from #38614 minus CI changes (#38933)
#38614 was reverted due to CI flakiness, but it also included several
improvements to the devtools tests. this patch relands those
improvements, described below.

we make three changes that speed up the devtools tests from 73 → 65 → 56
→ 51 seconds:

- we replace the hardcoded sleep(1) after starting servoshell with a
loop that waits until the devtools port is open (this also fixes
intermittent failures when servoshell starts too slowly, especially on
macOS)
- we start the internal web servers once, and reuse them across all
tests
- we run servoshell in headless mode (this is also required because most
CI runners have no GUI)

and we fix two bugs that cause very noisy but not very interesting error
messages:

- in the test code, we use a [context
manager](https://docs.python.org/3/reference/datamodel.html#context-managers)
to ensure the devtools client is disconnected unconditionally, even if
test methods or assert helper methods raise exceptions (this was causing
errors on all platforms)
- in the devtools server, we treat “connection reset” errors when
reading from the client like a normal EOF, rather than as a failure
(this was causing errors on Windows)

on self-hosted linux builds, there are still spurious error messages
like the following, but we can fix them later:

```
error: XDG_RUNTIME_DIR not set in the environment.
libEGL warning: egl: failed to create dri2 screen
```

Testing: this patch improves the devtools tests, but does not change
their coverage
Fixes: part of #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-26 10:06:51 +00:00
Jonathan Schwender
0a8146143a
mach: Improve test-speedometer error reporting (#38887)
Currently speedometer results are parsed by parsing the console output
from stdout (or a file in the case of ohos). Currently json decode
errors just cause mach to crash. Instead print an error message, point
to the problematic location and exit.
A crash can happen if something else also prints, e.g. on macos, we have
the `xx threads are still running` message at shutdown. Hence this PR
doesn't really fix the unreliable nature of the current implementation,
but at least adds a helpful error message, which would point people in
the right direction.

Testing: test-speedometer is run in CI

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-23 11:36:57 +00:00
Martin Robinson
f1a5da6836
mach: Split out post build tasks into their own command (#38853)
The main reason for this change is that this makes working on this part
of the build a lot easier.

Testing: No tests for this change as it just rearranges code in the
build scripts.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 18:21:15 +00:00
shuppy
4ba34b038c
devtools: Fix available breakpoint positions with nested scripts (#38826)
in the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), there is a
separate
[Debugger.Script](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html)
object for each function in a script, forming a tree of Script objects.
since we were only issuing
[getPossibleBreakpoints()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getpossiblebreakpoints-query)
queries to the [root Script
object](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewscript-script-global)
for each script, we were failing to report locations inside functions as
available for setting breakpoints.

this patch fixes that by recursively issuing the
getPossibleBreakpoints() requests over the
[getChildScripts()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getchildscripts)
tree.

Testing: this patch adds a new devtools test

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-21 11:00:32 +00:00
Sebastian C
b869b7eb96
script: initial CookieStore implementation (#37968)
This is a first draft at implementing the required infrastructure for
CookieStore, which requires setting up IPC between script and the
resource thread to allow for async/"in parallel" handling of cookie
changes that have a promise API.

Cookie Store also will need to receive change events when cookies for a
url are changed so the architecture needs to support that.

Expect this PR to be reworked once the architecture becomes more
settled, cookie change events will be implemented in follow up PRs

Testing: WPT tests exist for this API
Part of #37674

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-08-21 01:00:24 +00:00
Martin Robinson
8743a11ba4
tidy: Add a rule ensuring that // comments are followed by a space in Rust (#38698)
This shows up sometimes in code reviews, so it makes sense that tidy
enforces it. `rustfmt` supports this via comment normalization, but it
does many other things and is still an unstable feature (with bugs).

Testing: There are new tidy tests for this change.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-18 12:09:09 +00:00
Jerens Lensun
a4fdbe8be3
mach: add type annotation in function for 'python/servo' folder (#38592)
This part of function strictly typed in python by adding ANN rule in
ruff, similiar to #38531.

Testing: `./mach test-tidy`
Fixes: Not related to any issues

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-15 10:37:24 +00:00
sagudev
cf866d12b4
chore: Pin cargo-deny to 0.18.3 (#38681)
cargo-deny@0.18.4 requires Rust 1.88

Testing: Fixes CI.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-14 12:15:15 +00:00
Jerens Lensun
797db25c4e
mach: Enable ANN rules (type annotations) for ruff Python linter (#38531)
This changes will introduce [flake8-annotations
(ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) for
python type annotation, this will make all thing related to function
strictly typed in python

This rule will start to affected this directory from now:
- /python -> Root directory
- /python/tidy
- /python/wpt

Testing: `./mach test-tidy`
Fixes: Not related to any issues

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-14 10:36:17 +00:00
lumiscosity
97a114b248
mach: remove ubuntu version warning (#38656)
Removes the unsupported ubuntu version warning from mach. Also removes
the related version values on the Linux object, as they're not used
anywhere else nor are they maintained.

Testing: Only removes a warning, no test necessary.
Fixes: #38505.

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-13 18:56:38 +00:00
Martin Robinson
20ad1ce84e Revert "ci: Run devtools tests whenever we run unit tests (#38614)"
This reverts commit 47aa9ea8cf.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-13 07:53:20 -07:00
Jonathan Schwender
4b91dc6d82
CI: Check MSRV in CI (#37152)
As previously proposed on zulip and discussed in the coordination
meeting, add a check to CI to see if
servo still compiles with our minimum supported Rust version.
To avoid requiring changes, we define our MSRV as the current version we
are using now (1.85.0).

This does not prevent us from updating the default compiler version,
which we should still do, to
get benefits like faster compile times, newer lints and making sure
crown stays up-to-date.

We simply test that libservo compiles in CI, since libservo (and
dependencies) is what embedders would care about. We also don't need
mach (or bootstrap!) for this, so we just use cargo build.

Testing: This PR adds a CI test. [`./mach try windows-build-libservo
linux-build-libservo
mac-build-libservo`](https://github.com/jschwe/servo/actions/runs/16901171766)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-12 19:19:45 +00:00
Martin Robinson
6ff5c4ef99
tidy: Remove dead and redundant code from Servo Rust tidy check (#38632)
- Remove all handling of comments and attributes. This was not affecting
  the checks in any way.
- Remove `is_associated_type()` as it was unused.
- Remove the check for `&String`, `&Vec`, operators at the end of the
  line, and the unit return type as clippy already checks these (and
  handles the mutable variants).

Testing: This is covered by tidy script tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-12 17:57:35 +00:00
shuppy
47aa9ea8cf
ci: Run devtools tests whenever we run unit tests (#38614)
this patch updates linux.yml, mac.yml, and windows.yml to run the
devtools test suite (#36325), whenever unit tests are enabled in those
workflows. plus three changes that speed up the tests from 73 → 65 → 56
→ 51 seconds:

- we replace the hardcoded sleep(1) after starting servoshell with a
loop that waits until the devtools port is open (this also fixes
intermittent failures when servoshell starts too slowly, especially on
macOS)
- we start the internal web servers once, and reuse them across all
tests
- we run servoshell in headless mode (this is also required because most
CI runners have no GUI)

finally we fix two bugs that cause very noisy but not very interesting
error messages:

- in the test code, we use a [context
manager](https://docs.python.org/3/reference/datamodel.html#context-managers)
to ensure the devtools client is disconnected unconditionally, even if
test methods or assert helper methods raise exceptions (this was causing
errors on all platforms)
- in the devtools server, we treat “connection reset” errors when
reading from the client like a normal EOF, rather than as a failure
(this was causing errors on Windows)

on self-hosted linux builds, there are still spurious error messages
like the following, but we can fix them later:

```
error: XDG_RUNTIME_DIR not set in the environment.
libEGL warning: egl: failed to create dri2 screen
```

Testing: this patch effectively adds 44 tests to CI
Fixes: #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-12 15:10:45 +00:00
shuppy
319f4f0e38
devtools: Fix getBreakpointListActor handler in watcher actor (#38624)
the Firefox devtools client often sends multiple
`getBreakpointListActor` requests to the watcher actor when connecting,
and the Firefox devtools server returns the same breakpoint list actor
every time, but Servo returns a new breakpoint list actor each time.
this patch aligns Servo’s behaviour with Firefox.

Testing: this patch adds a devtools test

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-12 12:26:59 +00:00
shuppy
f5b631e270
devtools: Show clients where they can set breakpoints (#37667)
devtools clients query source actors to determine where the user can set
breakpoints in a source. there are two relevant requests here:
`getBreakableLines` controls which line numbers can be clicked in the
margin, and once a line number is clicked,
`getBreakpointPositionsCompressed` controls where to show breakpoint
buttons within that line.

this patch handles those requests by querying the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/) for that
information:
- devtools sends its script thread a GetPossibleBreakpoints message for
the source’s
[`spidermonkey_id`](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Source.html#id)
- the script thread fires a `getPossibleBreakpoints` event into its
debugger global
- the debugger script looks up the
[root](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewscript-script-global)
[Debugger.Script](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getpossiblebreakpoints-query)
for that source, calls
[getPossibleBreakpoints()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getpossiblebreakpoints-query),
and returns the result via
DebuggerGlobalScope#getPossibleBreakpointsResult()
- that method takes the pending result sender, and sends the result back
to devtools
- devtools massages the result into the format required by the request,
and replies to the client

as a result, users of the Firefox devtools client can now set
breakpoints, though they don’t have any effect.

Testing: this patch adds new devtools tests
Fixes: part of #36027

<img width="1433" height="1328" alt="image"
src="https://github.com/user-attachments/assets/f0cd31e0-742f-44d3-8c5d-ceedd9a2706d"
/>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-12 04:53:53 +00:00
Martin Robinson
be7625fc1e
tidy: Replace custom panic/unwrap lint with clippy lint (#38593)
This change replaces our custom `panic` / `unwrap` lint with the one
from clippy. This rule as not properly applied in servoshell, so this
change fixes some clippy errors raised by the new configuration.

Testing: This change removes the tidy tests for the custom lints, but
otherwise the behavior is tested as part of clippy itself.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-11 11:04:11 +00:00
Jerens Lensun
3ab56b16de
mach(test-tidy): Remove alphabetical order and line length rule from tidy (#38538)
As we plan to adopt more rules from Ruff and rustfmt, we would like to
retire the following rules:

1. `Line length check`, as this is already handled by Ruff and rustfmt
configurations.
2. `Alphabetical order`


Testing: `./mach test-tidy --no-progress --all`
Fixes: #37121

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-11 08:54:50 +00:00
shuppy
4784668fa9
devtools: Create source actors from Debugger API notifications (#38334)
currently our devtools impl creates source actors in script, when
executing scripts in HTMLScriptElement or DedicatedWorkerGlobalScope.
this approach is cumbersome, and it means that many pathways to running
scripts are missed, such as imported ES modules.

with the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we can pick
up all of the scripts and all of their sources without any extra code,
as long as we tell it about every global we create (#38333, #38551).
this patch adds a [Debugger#onNewScript()
hook](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewscript-script-global)
to the debugger script, which calls
DebuggerGlobalScope#notifyNewSource() to notify our script system when a
new script runs. if the source is relevant to the file tree in the
Sources tab, script tells devtools to create a source actor.

Testing: adds several new automated devtools tests
Fixes: part of #36027

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-11 06:04:51 +00:00
sagudev
2f0afb0ec0
python: Update pyOpenSSL to 24 (#38582)
WPT updated something and we need to update pyOpenSSL to 24 to make deps
resolvable.
This fixes WPT Imports:
https://github.com/servo/servo/actions/runs/16855379913/job/47753105229

Testing: WPT import run:
https://github.com/servo/servo/actions/runs/16859665646

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-10 10:31:01 +00:00
shuppy
c9541f2906
devtools: Expose introductionType to devtools clients (#38541)
in the devtools protocol, [source
forms](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#loading-script-sources)
announced in `resources-available-array` messages can include the
`introductionType`, which more or less mirrors the field of the same
name in SpiderMonkey’s CompileOptions.

this patch exposes `introductionType` accordingly, allowing us to check
for the correct values in automated tests.

Testing: new coverage in devtools tests
Fixes: part of #36027

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-08 12:20:30 +00:00
Jerens Lensun
8f52e28225
mach(test-tidy): Make wpt lint logic servo-tidy.toml and optimize checking for changed files (#38511)
Fix wpt lint logic to respect servo-tidy.toml ignores and --all flag

Testing: Should be covered on CI
Fixes: #38510  #37991

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-08 10:34:42 +00:00
Josh Matthews
842dd99698
Update to SpiderMonkey 137. (#37077)
Incorporates the updates from https://github.com/servo/mozjs/pull/584.

Testing: Existing WPT coverage is enough.
Fixes: Part of #36258

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-07 16:47:27 +00:00
shuppy
a9664c4199
devtools: Reland devtools test fixes missing from #38359 (#38516)
in #38359, we intended to land some fixes to the devtools tests, but we
failed to actually include those fixes in the patch. this patch adds a
second internal web server, then reworks test_sources_list() to load
scripts from the two distinct origins of our internal web servers:
<http://127.0.0.1:10000> and <http://127.0.0.1:10001>.

Testing: covered by existing devtools tests, which now actually pass
Fixes: part of #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-07 13:38:48 +00:00
shuppy
8cfd82f55c
mach: Allow filtering tests in mach test-devtools (#38514)
`mach test-devtools` uses
[unittest](https://docs.python.org/3/library/unittest.html) without
[unittest.main()](https://docs.python.org/3/library/unittest.html#unittest.main),
so we can parse arguments and set up the test runner how we want, but
this means there’s currently no way to filter tests on the command line.

this patch plumbs the positional arguments (if any) into the
TestLoader’s
[testNamePatterns](https://docs.python.org/3/library/unittest.html#unittest.TestLoader.testNamePatterns),
with extra logic to treat any pattern `pattern` not containing `*` like
`*pattern*`. this is the same behaviour as unittest.main()
[`-k`](https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k):

```
$ ./mach test-devtools domparser responsexml
Running devtools tests...
Running 2 tests:
- test_source_content_inline_script_with_domparser (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_domparser)
- test_source_content_inline_script_with_responsexml (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_responsexml)

test_source_content_inline_script_with_domparser (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_domparser) ... ok
test_source_content_inline_script_with_responsexml (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_responsexml) ... ok

----------------------------------------------------------------------
Ran 2 tests in 4.055s

OK
```

Testing: not really worth automated testing, but tested manually above
Fixes: part of #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-08-07 13:23:53 +00:00
Jerens Lensun
fca94336d3
mach: Add comment to ignore type on geteuid as it only available on unix (#38388)
Currently pyrefly have an issues with top level assertion on platform
gating, so we decide to ignore it for now.

https://github.com/facebook/pyrefly/issues/795

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-31 10:25:02 +00:00
shuppy
a671c50bc9
devtools: Fix source contents tests and fix a race (#38359)
test_sources_list() relied on <https://servo.org/js/load-table.js> to
test scripts loaded from multiple origins, but that file was deleted a
couple of weeks ago. this patch adds a second internal web server, then
replaces that load with scripts loaded from two distinct origins:
<http://127.0.0.1:10000> and <http://127.0.0.1:10001>.

fixing that test revealed an impl bug where inline module scripts
containing `import` statements may never get their source contents
populated. this is because the logic for populating source contents for
inline scripts only applied to source actors created *before* we
finished parsing the page. we assumed that inline scripts always block
the parser, but this is not the case. this patch ensures that inline
source contents can be populated for source actors created after parse.

Testing: adds a new test,
test_source_content_with_inline_module_import_external()
Fixes: part of #36325

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-30 11:29:24 +00:00
Jerens Lensun
c738bbc41c
mach: Make test-tidy line length check Unicode-aware (#38335)
Currently, our implementation for each line-checking function reads the
file as bytes, so we need to properly decode each line to UTF-8 before
evaluating it. This ensures it is counted as a string and not as bytes

Testing: I tested by changing the comment like the issue above and it
not give an error
Fixes: #38237

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-29 14:46:32 +00:00
Jerens Lensun
239bdd7c1a
mach: Fail on invalid argument in try_parser (#38324)
This will block the command, print an error message about an invalid
argument being passed to the ./mach try command, and return the exit
code.

Testing: `./mach try test-wpt`
Fixes: #38193

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-29 07:00:07 +00:00
Jerens Lensun
93d234d270
mach: Add type check on python/servo directory (#38085)
Introduce `python/servo` folder in pyrefly type checker

Testing: Manual testing via `./mach test-tidy` command

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-28 04:16:08 +00:00
sagudev
056b1538c0
canvas: Add vello_cpu backend (#38282)
vello_cpu does not have any tests timeouts, because we do not need
download stuff from GPU as all work happens on CPU. So performance wise
it's better then classic vello at least for our usecase. There are some
vello bugs, but I think we will be able to sort them out within
upstream, eventually. Interestingly enough there are no new PASS like
they were with classic vello.

Difference with raqote can be observed here:
https://github.com/sagudev/servo/actions/runs/16549241085/attempts/1#summary-46802486798

## Known vello problems:

- https://github.com/linebender/vello/issues/1119
- https://github.com/linebender/vello/issues/1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
https://github.com/linebender/vello/issues/1063
  - `/html/canvas/element/line-styles/2d.line.cross.html`
  - `/html/canvas/element/line-styles/2d.line.miter.acute.html`
- other lack of strong correct problems
(https://github.com/linebender/vello/issues/1063#issuecomment-2998084736):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- `putImageData(getImageData(...), ...)` is lossy (precision problems,
might be due to ImageData being unmultiplied)
-
`/html/canvas/element/pixel-manipulation/2d.imageData.put.unchanged.html`

Testing: Tested using vello_cpu_canvas subsuite

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-27 19:56:38 +00:00
sagudev
d678901122
canvas: Add vello backend (#36821)
Add vello backend by implementing Backend traits in canvas crate (so
this lives in canvas_paint_thread - embedded process). Current
implementation uses normal wgpu, so we block on GPU work. Vello backend
is gated behind `vello` feature and `dom_canvas_vello_enabled` pref.

Feature-wise this backend is on on par with raqote (sometimes better
sometimes worse), but performance wise it's worse.

## Known vello problems:

- image roundtrip does not work (fixed in
https://github.com/linebender/vello/pull/974)
- https://github.com/linebender/vello/issues/1066 (fixed)
- clip layers are not working properly:
https://github.com/linebender/vello/issues/1061
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
  - `/html/canvas/element/path-objects/2d.path.clip.intersect.html`
- https://github.com/linebender/vello/issues/1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
https://github.com/linebender/vello/issues/1063
  - `/html/canvas/element/line-styles/2d.line.cross.html`
  - `/html/canvas/element/line-styles/2d.line.miter.acute.html`
- other lack of strong correct problems
(https://github.com/linebender/vello/issues/1063#issuecomment-2998084736):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- There is currently no way to do put image properly in vello as we
would need to ignore all clips and other stuff (we try to work around
this on best effort basis)
https://github.com/linebender/vello/issues/1088
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
- precision problems
  - `/html/canvas/element/path-objects/2d.path.stroke.scale2.html`
  - `/html/canvas/element/path-objects/2d.path.arc.scale.1.html`

## Known servo problems

- bad performance due to blocking on GPU work
  - some get/put intensive tests `TIMEOUT`
- proper shadow support (non-blocker as we already are living without it
now)
- support for rect shadow is there but unimplemented currently as that's
the state in raqote

Testing: `mach try vello` will run normal WPT (with raqote) +
vello_canvas subsuite that runs only on `/html/canvas/element`. All
subsuite expectations are stored separately.
Fixes: #36823
Fixes: #35230

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-26 04:53:10 +00:00
Narfinger
d9f8fc505f
ohos CI: Add the build profile to speedometer results (#38231)
OHOS CI now has the build profile before the test cases to distringuish
dev, release, production and similar.

Testing: Tested on CI with a run here:
https://github.com/Narfinger/servo/actions/runs/16465984131/job/46543984398
Fixes: Same name in speedometer CI will have very different speeds
because of different profiles. This will fix this behaviour.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-23 10:09:46 +00:00
TIN TUN AUNG
7f6d4825cf
Ohos: include build id in ohos built binary (#38215)
add link-arg for ohos to include build id in its ELF binary. This could
enable us to do debugging and size checking more easily.

Testing: No test needed.
Fixes: N/A

cc @jschwe

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
2025-07-23 04:54:21 +00:00
Jerens Lensun
1c4797809a
Mach: add type check on python tidy folder (#38043)
Introduce `python/tidy` folder in pyrefly type checker

Testing: Manual testing via `./mach test-tidy` command

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-07-17 07:35:11 +00:00
Jerens Lensun
2ad250de26
remove test-wpt-android from mach command (#38135)
This command is no longer work as we arleady remove
`in_android_emulator` in this PR
[37958](https://github.com/servo/servo/pull/37958) cause of
`setup_configuration_for_android_target` is no longer exist in
`python/servo` codebase

These commands are being removed in order to implement Python type
checking the Servo repository.
Testing: This just removes some mach command so shouldn't need tests.

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-17 07:31:39 +00:00
Kenzie Raditya Tirtarahardja
5e8b3cc5eb
CI: Run webdriver tests using one process and 2 chunks (#38052)
- Make the test more stable with setting one process only for each
chunk, while still running it concurrently with different machine for
each chunk.
- Previously, there is an issue where the log files is too big to be
uploaded to intermittent tracker. Now the log file should be smaller
even if we have many errors, since we have multiple chunk.

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-17 06:01:48 +00:00
Josh Matthews
0e3165da01
tests: Force a blank config directory for each WPT test run. (#38078)
This ensures a consistent state when running tests that can otherwise
leave artifacts around (eg. localStorage/IndexedDB/cookies).

Testing: Existing test coverage is sufficient.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-15 05:38:38 +00:00
Euclid Ye
35a145613e
mach (Windows): make vswhere.exe work properly (#38028)
Previously, the args passed to `vswhere.exe` was wrong. There is no
generic component ID called
`Microsoft.VisualStudio.Component.Windows10SDK`, but always something
like `Microsoft.VisualStudio.Component.Windows10SDK.19041` /
`Microsoft.VisualStudio.Component.Windows11SDK.22621`.
That's why users always had to manually setup environment variable
`VSINSTALLDIR`, `VisualStudioVersion`.

This QoL PR also makes `mach` compatible with Windows 11 SDK, and update
README.md to be consistent with https://github.com/servo/book/pull/92.

Testing: Tested locally and working fine after removing environment
variables.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-13 12:23:55 +00:00
Mukilan Thiyagarajan
f7c7db3f71
ci: revert to non-relative import in export script (#38003)
Fixes #37999.
Testing: This has been tested on [my
fork](https://github.com/mukilan/servo/actions/runs/16224926807/job/45814509714?pr=5).

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-07-11 16:46:22 +00:00