This reduces the memory used by the preload list to just 1.9MB. The
total memory savings in HSTS from
pre-103cbed928
is now 62MB, or 96%. And in terms of total resident memory is a 7.5%
reduction. The DAFSA/DAWG used by Firefox is 1.1MB so there could be
additional gains available but this seems like the best option based on
maintained libraries available (I could not find a good maintained
library for DAFSAs in Rust).
The main trick is this: the FST map API is currently designed to map
byte sequences to u64 values. Because we only need to determine if a
preloaded domain has the `includeSubdomains` flag set, we encode that
into the lowest bit of the ids in the map. This way finding an entry in
the map directly provides us with the `includeSubdomains` flag and we
don't need to keep another mapping in memory or on disk.
Updated the `./mach update-hsts-preload` command to generate the new FST
map file. (Not sure if I need to update any dev-dependencies anywhere
for this change)
This change also replaces the use of "mozilla.org" with "example.com" in
the HSTS unit tests to make sure that entries in the preload list do not
influence the tests (since example.com should not ever end up on the
preload list)
Testing: Updated unit tests
Fixes: #25929
---------
Signed-off-by: Sebastian C <sebsebmc@gmail.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 70.0.0 to
78.1.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/setuptools/blob/main/NEWS.rst">setuptools's
changelog</a>.</em></p>
<blockquote>
<h1>v78.1.1</h1>
<h2>Bugfixes</h2>
<ul>
<li>More fully sanitized the filename in PackageIndex._download. (<a
href="https://redirect.github.com/pypa/setuptools/issues/4946">#4946</a>)</li>
</ul>
<h1>v78.1.0</h1>
<h2>Features</h2>
<ul>
<li>Restore access to _get_vc_env with a warning. (<a
href="https://redirect.github.com/pypa/setuptools/issues/4874">#4874</a>)</li>
</ul>
<h1>v78.0.2</h1>
<h2>Bugfixes</h2>
<ul>
<li>Postponed removals of deprecated dash-separated and uppercase fields
in <code>setup.cfg</code>.
All packages with deprecated configurations are advised to move before
2026. (<a
href="https://redirect.github.com/pypa/setuptools/issues/4911">#4911</a>)</li>
</ul>
<h1>v78.0.1</h1>
<h2>Misc</h2>
<ul>
<li><a
href="https://redirect.github.com/pypa/setuptools/issues/4909">#4909</a></li>
</ul>
<h1>v78.0.0</h1>
<h2>Bugfixes</h2>
<ul>
<li>Reverted distutils changes that broke the monkey patching of command
classes. (<a
href="https://redirect.github.com/pypa/setuptools/issues/4902">#4902</a>)</li>
</ul>
<h2>Deprecations and Removals</h2>
<ul>
<li>Setuptools no longer accepts options containing uppercase or dash
characters in <code>setup.cfg</code>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8e4868a036"><code>8e4868a</code></a>
Bump version: 78.1.0 → 78.1.1</li>
<li><a
href="100e9a61ad"><code>100e9a6</code></a>
Merge pull request <a
href="https://redirect.github.com/pypa/setuptools/issues/4951">#4951</a></li>
<li><a
href="8faf1d7e0c"><code>8faf1d7</code></a>
Add news fragment.</li>
<li><a
href="2ca4a9fe47"><code>2ca4a9f</code></a>
Rely on re.sub to perform the decision in one expression.</li>
<li><a
href="e409e80029"><code>e409e80</code></a>
Extract _sanitize method for sanitizing the filename.</li>
<li><a
href="250a6d1797"><code>250a6d1</code></a>
Add a check to ensure the name resolves relative to the tmpdir.</li>
<li><a
href="d8390feaa9"><code>d8390fe</code></a>
Extract _resolve_download_filename with test.</li>
<li><a
href="4e1e89392d"><code>4e1e893</code></a>
Merge <a
href="https://github.com/jaraco/skeleton">https://github.com/jaraco/skeleton</a></li>
<li><a
href="3a3144f0d2"><code>3a3144f</code></a>
Fix typo: <code>pyproject.license</code> ->
<code>project.license</code> (<a
href="https://redirect.github.com/pypa/setuptools/issues/4931">#4931</a>)</li>
<li><a
href="d751068fd2"><code>d751068</code></a>
Fix typo: pyproject.license -> project.license</li>
<li>Additional commits viewable in <a
href="https://github.com/pypa/setuptools/compare/v70.0.0...v78.1.1">compare
view</a></li>
</ul>
</details>
<br />
[](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 merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@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>
Add `build-args` input in CI and try_parser job definition so we can
pass own build args to `./mach build`
Testing: There are tests for try parser and I tested CI in my fork.
Fixes: partial fix#36823
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
`--with-asan` now also will instrument C/C++ code. This also increases
the requirements on the user environment, since a clang compiler with
the same major version as the LLVM version rustc is using must be in
PATH.
ASAN without C/C++ code is IMHO not so interesting, so I'm not sure if
it would be worth adding a separate flag.
Testing: Manual testing with `--with-asan`. I believe we don't run ASAN
in CI yet, although perhaps we should.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This patch adds test cases for Debugger > Sources with inline module
scripts and external classic scripts. We also fix the big test case in
#36401 to receive and assert the worker script URLs.
Testing: this patch improves test coverage for the Debugger > Sources
feature
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>
This patch adds our first automated test for devtools, covering the
changes in #36164. These tests are not run in CI yet, but you can run
them as follows:
```sh
$ ./mach build --release
$ ./mach test-devtools
```
Testing: this patch adds automated tests!
Start of: #36325
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Aria Edmonds <aria@ar1as.space>
https://github.com/web-platform-tests/wpt/pull/50041 allows us to start
running the webdriver conformance tests in Servo, which will make it
easier for us to track regressions/improvements in our webdriver server
implementation.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes are part of #15274
- [x] There are tests for these changes
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
The command `./mach test-tidy` did not check the TOML files in the
subdirectories of components/shared/, since the argument for taglo
command was written as `components/shared/*.toml`.
This patch fixes it to include those TOML files in test-tidy.
Testing: It only involves python script for test-tidy. No test is
needed.
Fixes: #36659
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Now that legacy layout has been removed, the name `layout_2020` doesn't
make much sense any longer, also it's 2025 now for better or worse. The
split between the "layout thread" and "layout" also doesn't make as much
sense since layout doesn't run on it's own thread. There's a possibility
that it will in the future, but that should be something that the user
of the crate controls rather than layout iself.
This is part of the larger layout interface cleanup and optimization
that
@Looriool and I are doing.
Testing: Covered by existing tests as this is just code movement.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Updates wgpu to v25 and remove some verbose logging from CTS (that also
causes OOM).
Testing: WebGPU CTS
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This allows changing number of chunks used for WPT testing (sometimes
useful for WebGPU).
Testing: Manual try runs
Fixes: #30062
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Add `wpt` alias for `linux-wpt` in try_parser, because that's the what I
have in muscle memory.
Testing: Tested with new try_parser unit tests.
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
These two traits both exposed different parts of the compositing API,
but now that the compositor doesn't depend directly on `script` any
longer and the `script_traits` crate has been split into the
`constellation_traits` crate, this can be finally be cleaned up without
causing circular dependencies. In addition, some unit tests for the
`IOPCompositor`'s scroll node tree are also moved into
`compositing_traits` as well.
Testing: This just combines two crates, so no new tests are necessary.
Fixes: #35984.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Some methods are implemented fully, while others are implemented
partly. With these implementations, there are no observed crashes
when running the trusted-types web-platform-tests.
Most notably, the tests/wpt/tests/trusted-types/idlharness.window.js
is now fully passing.
Part of #36258
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Implement the TestUtils namespace from
https://testutils.spec.whatwg.org/.
This should make the `js/builtins/weakrefs` tests run faster and more
consistently.
This change will enable other WPT tests but no tests exist currently for
TestUtils itself.
Fixes: #36290
---------
Signed-off-by: Sebastian C <sebsebmc@gmail.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
Since we switched to using `aws-lc-rs` instead of `ring`,
cross-compiling on windows (to non-windows) had been broken. Using the
default MSVC Generator results in CMake erroneously being configured for
the host platform, with failing compiler checks. Switching to Ninja
fixes that issue.
The CMake build rules of aws-lc-rs also make use of `tr` and assume it
is installed, hence we provide a helpful error message suggesting to try
using mach from `git bash` which does provide the `tr` command.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix cross-compiling servo on windows hosts to
non-windows targets
- [x] These changes do not require tests because: We don't test
cross-compiling from windows hosts in CI. These changes were manually
tested by compiling for OpenHarmony on windows.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This PR fixes the broken unit-test after
[#35662](https://github.com/servo/servo/pull/35662)
Testing: Verified locally and CI confirms too.
Fixes: Migrate the test to use new API
cc: @xiaochengh
Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
Devtools clients need a `browserId`, `browsingContextID`, and
`outerWindowID`, which correspond to WebViewId, BrowsingContextId, and
PipelineId in Servo. These u32 values were previously derived from our
sharded (u32,u32) id values by taking only the `index` (second u32) and
ignoring the `namespace_id` (first u32), leading to collisions.
This patch fixes that by mapping those Servo ids to sequential u32
values.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#35954
<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->
<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Check for existence of sudo command in ./mach bootstrap on Linux (#35736)
Signed-off-by: Tom Overlund <tomov@dilacero.org>
* Remove extraneous semicolon from previous commit (test-tidy fix).
Signed-off-by: Tom Overlund <tomov@dilacero.org>
---------
Signed-off-by: Tom Overlund <tomov@dilacero.org>
* Start working on a basic URLPattern implementation
This is API part of Interop 2025, so we should definitely support it!
This change implements the basic workflow for parsing
and compiling URL patterns. Parts of it are stubbed out and will be
implemented later.
For now the API is preference-gated behind "dom_urlpattern_enabled".
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Preference-gate the URLPattern API
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update WPT expectations
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix full wildcard value (Should be ".*" not "*")
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Simply how `ProgressiveWebMetrics` works:
1. Keep only a single struct instead of one in layout and one script
that both implement the `ProgressiveWebMetrics` trait. Since layout
and script are the same thread these can now just be a single
`ProgressiveWebMetrics` struct stored in script.
2. Have the compositor be responsible for informing the Constellation
(which informs the ScripThread) about paint metrics. This makes
communication flow one way and removes one dependency between the
compositor and script (of two).
3. All units tests are moved into the `metrics` crate itself since there
is only one struct there now.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
We were already not compiling it and not running tests on it by default.
So it's simpler to just completely remove it.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
WPT tests are very specific to the directory in which they are created.
In addition, since `create-wpt` takes care of running `update-manifest`
it hides the fact that any future changes to tests need this command run
again. No other browser has a `create-wpt` command, instead developers
are expected to craft their own tests, usually by starting from an
example in the directory they create the test in. I think this works
fine for Servo.
Closes#35726.
Closes#8427.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
The prebuilt directory only contains an `darwin-x86_64`
toolchain, but that is perfectly fine, since that also
works.
In General, if there is only one prebuilt toolchain available,
it should be a very safe assumption that it is usable on the host
platform, especially if the OS matches.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Create a new `RenderingContext` which is used to render to a
`SurfmanRenderingContext`-related offscreen buffer. This allows having a
temporary place to render Servo and then blitting the results to a
subsection of the parent `RenderingContext`.
The goal with this change is to remove the details of how servoshell
renders from the `Compositor` and prepare for the compositor-per-WebView
world.
Co-authred-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* crown: Pass `--cfg crown` to rustc from crown
also includes minor fix in crown for wrapper running based on clippy code
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fix doc
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update python/servo/command_base.py
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix building libservo with `cargo build -p libservo`
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Test the libservo build in CI
Signed-off-by: Delan Azabani <dazabani@igalia.com>
* Work around build issue on macOS (#34517)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
---------
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
The previous code was simply reporting the number of categories,
instead of the sum of the number of expected tests in each category.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Before we appended all subdirs of unused_dir to unused_dirs, which caused errors on removing because root dir was already removed.
Fix#35026, tested locally.
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
The python code set a preference that was renamed
as part of https://github.com/servo/servo/pull/34966.
This fixes MQ runs which currently all fail
(3562334330)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
The new images published in servo/ci-runners#12 should have `uv`
installed already and the initial build of servo triggered during the
base image construction will force the installation of the Python
version mentioned at the time of the image construction (3.12). When
.python-version changes, we can no longer use the .venv baked into the
image and must recreate the it to avoid activating the environment.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This reverts commit bc0c8366f8,
relanding commit 11424f90b3.
Reason: it wasn't the cause behind #34688.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>