Commit graph

52055 commits

Author SHA1 Message Date
Josh Matthews
d0a93a8b02
script: Minimize layout queries for window scroll offsets. (#38018)
These changes reduce the number of times we need to query layout for the
same information when creating mouse/pointer events.

Testing: No new tests required for maintaining existing behaviour.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-12 14:17:55 +00:00
Josh Matthews
6dbd64e72d
net: Split read-only and read-write IndexedDB operations into separate enums (#37575)
This change allows the compiler to recognize if any read-only operations
are missing an implementation when processing a readonly transaction.

Testing: The existing behaviour is unchanged, so current tests suffice.
The new code is unused and cannot be tested.
Fixes: part of #6963

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-12 11:29:36 +00:00
Tim van der Lippe
2c116f4011
Fix reporting when only the report-only CSP header is present (#38002)
This was a bit confusing at first, but the report-only only
had an effect if it was used in conjunction with the regular
CSP header. This is incorrect, as the report-only header
can be present on its own.

Additionally, there was double-logic for parsing the CSP list
values, since we can only concatenate CSP lists if we have
an initial value, which requires a concrete policy value.

Therefore, abstract that way by looping over both headers and
handling the case where initially it is `None` and, if the
CSP header is not present, still `None` when we parse
the `report-only` header.

Additionally, update a WPT test. It was expecting the image
to load, yet was showing the fail image.

Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-07-12 10:38:30 +00:00
sagudev
9b5b26386c
canvas: Use wrapped kurbo::BezPath for path everywhere (#37967)
This PR removes existing path(segment) abstractions in favor of
`kurbo::BezPath`, well actually wrapped `kurbo::BezPath`, to ensure
building of valid paths. This allows us better Path2D building in script
and doing all validation and segmentation there and also allows us
remove blocking is_point_in_path on Path2D as we can now do this in
script. Current path is still done on canvas thread side as it will be
harder to move to script (will be done as a follow up), but it now uses
this new path abstraction.

Using kurbo also allows us to ditch our manual svgpath parser with the
one provided by kurbo.

Same code is stolen from: https://github.com/servo/servo/pull/36821.

Testing: Existing WPT tests
Fixes: #37904

wpt run: https://github.com/sagudev/servo/actions/runs/16172191716

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-12 10:37:47 +00:00
Alex Touchet
d4528e84b9
Use consistent spacing and alphabetize dependabot.yml (#38012)
This uses consistent spacing for indentation. I'm not sure if it was
causing any issues but it has been a problem before (#36642). Also
reorder categories to be in alphabetical order.

Testing: No testing for Dependabot file.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-12 10:37:26 +00:00
Jay Wang
204af81d2c
script: Add a Constraint DOMException for IndexedDB (#37605)
Add Constraint DOMException to handle the name conflict error in
`IDBDatabase::createObjectStore` method.

Testing: `./mach test-wpt tests/wpt/tests/IndexedDB/`, but it seems
there are many test failures even in main branch already ([related
comment](https://github.com/servo/servo/pull/37605#issuecomment-2993889163)).
Fixes: #37571

---------

Signed-off-by: iamlockon <xdddxyyyxzzz123@gmail.com>
2025-07-12 10:08:40 +00:00
sagudev
12d262ec23
chore: Fix expectation of dom/xslt/large-cdata.html and disable HOS in CI (#38016)
I've seen two multiple runs failing that reported this test as stable
FAIL (and in worst case it's intermittent TIMEOUT, but it does not look
like it). We also disable HOS in CI, because they currently do not work:
[#general > CI runners @
💬](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/CI.20runners/near/528443964)

Testing: Just expectation fix.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-12 09:40:34 +00:00
Josh Matthews
7eedeca715
layout: Reverse vertical orientation of gradients using corner directions. (#37802)
Found and manually tested by comparing rendering between Firefox and
Servo.

Testing: Existing WPT coverage is sufficient.
Fixes: #37782

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-11 20:02:13 +00:00
Euclid Ye
c5aeac3cea
script: Get the window rectangle from the WebViewDelegate instead of via the compositor (#37960)
Previously, `screenX`, `screenY`, `outerHeight`, `outerWidth`, `moveBy`,
`resizeBy` ask compositor for window rectangle, which then return
"inner" rectangle after consulting Embedder.

This PR 
1. removes `GetClientWindowRect` from compositor, and directly let
script ask embedder.
2. add `window_size` to `ScreenGeometry`
3. add a lot of docs to `ScreenGeometry`

Testing: `tests\wpt\mozilla\tests\mozilla\window_resizeTo.html` can now
pass for Headed Window.
Fixes: #37824

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-11 18:31:24 +00:00
dependabot[bot]
d40e9f82a2
build(deps): bump winnow from 0.7.11 to 0.7.12 (#38011)
Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.7.11 to
0.7.12.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md">winnow's
changelog</a>.</em></p>
<blockquote>
<h2>[0.7.12] - 2025-07-11</h2>
<h3>Features</h3>
<ul>
<li>Add <code>impl Accumulate for VecDeque</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a0360f6fc0"><code>a0360f6</code></a>
chore: Release</li>
<li><a
href="15bc372c8d"><code>15bc372</code></a>
docs: Update changelog</li>
<li><a
href="6c193ed0ae"><code>6c193ed</code></a>
Merge pull request <a
href="https://redirect.github.com/winnow-rs/winnow/issues/802">#802</a>
from molarmanful/vecdeque-accumulate</li>
<li><a
href="5db615de45"><code>5db615d</code></a>
feat(stream): Implement Accumulate for VecDeque</li>
<li><a
href="f226010843"><code>f226010</code></a>
Merge pull request <a
href="https://redirect.github.com/winnow-rs/winnow/issues/800">#800</a>
from Kijewski/pr-chars</li>
<li><a
href="73ce9fabff"><code>73ce9fa</code></a>
Implement <code>\&lt;&amp;str as Stream&gt;::next_token()</code> without
panics</li>
<li><a
href="18f20ee310"><code>18f20ee</code></a>
Merge pull request <a
href="https://redirect.github.com/winnow-rs/winnow/issues/796">#796</a>
from epage/docs</li>
<li><a
href="fa51dd4d8d"><code>fa51dd4</code></a>
docs(ref): Clarify distinction between parse and parse_next</li>
<li>See full diff in <a
href="https://github.com/winnow-rs/winnow/compare/v0.7.11...v0.7.12">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=winnow&package-manager=cargo&previous-version=0.7.11&new-version=0.7.12)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-11 18:06:41 +00:00
dependabot[bot]
f75d49e538
build(deps): bump h2 from 0.3.26 to 0.3.27 (#38009)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.26 to 0.3.27.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/h2/blob/v0.3.27/CHANGELOG.md">h2's
changelog</a>.</em></p>
<blockquote>
<h1>0.3.27 (July 11, 2025)</h1>
<ul>
<li>Fix notifying wakers when detecting local stream errors.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f6237accb3"><code>f6237ac</code></a>
v0.3.27</li>
<li><a
href="f61332ed48"><code>f61332e</code></a>
refactor: change local reset counter to use type system more</li>
<li><a
href="3f1a8e34cd"><code>3f1a8e3</code></a>
style: fix anonymous lifetime syntax</li>
<li><a
href="778aa7eba9"><code>778aa7e</code></a>
fix: notify_recv after send_reset() in reset_on_recv_stream_err() to
ensure l...</li>
<li><a
href="be10b774f0"><code>be10b77</code></a>
ci: pin more deps for MSRV job (<a
href="https://redirect.github.com/hyperium/h2/issues/817">#817</a>)</li>
<li><a
href="c0d9febc18"><code>c0d9feb</code></a>
ci: pin deps for MSRV</li>
<li><a
href="5ccd9cfb10"><code>5ccd9cf</code></a>
lints: fix unexpected cfgs warnings</li>
<li><a
href="e6e3e9c87f"><code>e6e3e9c</code></a>
fix: return a WriteZero error if frames cannot be written (<a
href="https://redirect.github.com/hyperium/h2/issues/783">#783</a>)</li>
<li>See full diff in <a
href="https://github.com/hyperium/h2/compare/v0.3.26...v0.3.27">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=h2&package-manager=cargo&previous-version=0.3.26&new-version=0.3.27)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-11 17:52:48 +00:00
dependabot[bot]
36847fcf66
build(deps): bump aws-lc-rs from 1.13.1 to 1.13.2 (#38008)
Bumps [aws-lc-rs](https://github.com/aws/aws-lc-rs) from 1.13.1 to
1.13.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/aws/aws-lc-rs/releases">aws-lc-rs's
releases</a>.</em></p>
<blockquote>
<h2>aws-lc-rs v1.13.2</h2>
<h2>What's Changed</h2>
<ul>
<li>aws-lc-sys v0.30.0 is aligned w/ <a
href="https://github.com/aws/aws-lc/releases">AWS-LC v1.55.0</a> by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/838">aws/aws-lc-rs#838</a></li>
<li>expose algorithm used to create ecdsa keypair by <a
href="https://github.com/soundofspace"><code>@​soundofspace</code></a>
in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/834">aws/aws-lc-rs#834</a></li>
<li>Change 'try_sign' to pub in ED25519 module by <a
href="https://github.com/theswiftfox"><code>@​theswiftfox</code></a> in
<a
href="https://redirect.github.com/aws/aws-lc-rs/pull/832">aws/aws-lc-rs#832</a></li>
</ul>
<h3>Build improvements</h3>
<ul>
<li>Fix target-specific env variable usage by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/810">aws/aws-lc-rs#810</a></li>
<li>Improved support for msys2 and &quot;prebuilt-nasm&quot; by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/830">aws/aws-lc-rs#830</a></li>
</ul>
<h3>Issues Being Resolved</h3>
<ul>
<li>Failed to Build aws-lc-sys 0.29.0 on Windows with target
x86_64-pc-windows-gnu -- <a
href="https://redirect.github.com/aws/aws-lc-rs/issues/835">aws/aws-lc-rs#835</a></li>
<li>Failed to Build aws-lc-sys 0.29.0 on Windows -- <a
href="https://redirect.github.com/aws/aws-lc-rs/issues/833">aws/aws-lc-rs#833</a></li>
<li>MSYS2 - &quot;No rule to make target&quot; for
libaws_lc_0_29_0_crypto.a -- <a
href="https://redirect.github.com/aws/aws-lc-rs/issues/814">aws/aws-lc-rs#814</a></li>
</ul>
<h2>Other Merged PRs</h2>
<ul>
<li>Disallow external bindgen when AWS_LC_SYS_EXTERNAL_BINDGEN=0 by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/808">aws/aws-lc-rs#808</a></li>
<li>Test w/ CMake 4.0 release by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/756">aws/aws-lc-rs#756</a></li>
<li>Fix CI for i686-pc-windows-gnu by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/809">aws/aws-lc-rs#809</a></li>
<li>Fix spelling errors by <a
href="https://github.com/atouchet"><code>@​atouchet</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/817">aws/aws-lc-rs#817</a></li>
<li>Ensure ConstPointers don't outlive parent by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/693">aws/aws-lc-rs#693</a></li>
<li>Fix CI for riscv64gc-unknown-linux-gnu by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/816">aws/aws-lc-rs#816</a></li>
<li>Prepare aws-lc-fips-sys v0.13.7 by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/823">aws/aws-lc-rs#823</a></li>
<li>Fix CI by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/825">aws/aws-lc-rs#825</a></li>
<li>Prepare aws-lc-sys v0.30.0 by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/829">aws/aws-lc-rs#829</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/atouchet"><code>@​atouchet</code></a>
made their first contribution in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/817">aws/aws-lc-rs#817</a></li>
<li><a
href="https://github.com/theswiftfox"><code>@​theswiftfox</code></a>
made their first contribution in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/832">aws/aws-lc-rs#832</a></li>
<li><a
href="https://github.com/soundofspace"><code>@​soundofspace</code></a>
made their first contribution in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/834">aws/aws-lc-rs#834</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/aws/aws-lc-rs/compare/v1.13.1...v1.13.2">https://github.com/aws/aws-lc-rs/compare/v1.13.1...v1.13.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e2e9e8222a"><code>e2e9e82</code></a>
Align aws-lc-sys v0.30.0 w/ AWS-LC v1.55.0 (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/838">#838</a>)</li>
<li><a
href="880d3818fd"><code>880d381</code></a>
Test msys2 w/ prebuilt-nasm (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/830">#830</a>)</li>
<li><a
href="a2ed335732"><code>a2ed335</code></a>
expose algorithm used to create ecdsa keypair (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/834">#834</a>)</li>
<li><a
href="db7d6cddc5"><code>db7d6cd</code></a>
Change 'try_sign' to pub in ED25519 module (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/832">#832</a>)</li>
<li><a
href="f0a6350abb"><code>f0a6350</code></a>
Prepare aws-lc-sys v0.30.0 (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/829">#829</a>)</li>
<li><a
href="378163b244"><code>378163b</code></a>
Fix CI (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/825">#825</a>)</li>
<li><a
href="f031c04e65"><code>f031c04</code></a>
Prepare aws-lc-fips-sys v0.13.7 (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/823">#823</a>)</li>
<li><a
href="8b8122b2df"><code>8b8122b</code></a>
Fix CI for riscv64gc-unknown-linux-gnu (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/816">#816</a>)</li>
<li><a
href="6cd8ac8d2a"><code>6cd8ac8</code></a>
Ensure ConstPointers don't outlive parent (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/693">#693</a>)</li>
<li><a
href="25a6040660"><code>25a6040</code></a>
Fix spelling errors (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/817">#817</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/aws/aws-lc-rs/compare/v1.13.1...v1.13.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-lc-rs&package-manager=cargo&previous-version=1.13.1&new-version=1.13.2)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-11 17:39:47 +00:00
Servo WPT Sync
c631220311
Sync WPT with upstream (11-07-2025) (#38001)
Automated downstream sync of changes from upstream as of 11-07-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-07-11 16:06:40 +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
Oriol Brufau
b7133478e1
layout: Unify layout logic for replaced and non-replaced grid items (#37985)
Laying out a grid item will now use the same logic regardless of whether
it's replaced or not.
This reduces the amount of code, and should have no observable effect
(but hard to say since and I don't understand Taffy).

Testing: Unneeded (no behavior change)
This part of #37942

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-11 13:47:03 +00:00
Jerens Lensun
55fd7b862f
Mach: introduce Pyrefly for Python type checking, starting with the wpt folder (#37953)
This is the first stage of adopting Pyrefly. It introduces the Python
folder and focuses on fixing issues around it.

Testing: *Describe how this pull request is tested or why it doesn't
require tests*
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-11 13:07:36 +00:00
Martin Robinson
2366a8bf9e
script: Wrapping unsafe code in unsafe blocks for basic DOM types (#37997)
There is a new default cargo clippy lint, `unsafe_op_in_unsafe_fn`,
which requires unsafe code to be wrapped in unsafe blocks, even inside
functions marked as unsafe. The lint is disabled as much of our code
doesn't fulfill this contract. The thing itself is pretty useful in
order to gradually remove unsafety, so this change starts adding
`unsafe` blocks so we can eventually enable this lint.

Testing: This doesn't change behavior so existings tests should suffice.
Fixes: This is part of #35955.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-11 11:38:02 +00:00
Narfinger
a13cc1b25a
Do not duplicate console messages on OHOS/Android (#37994)
Console messages on OHOS/Android targets were duplicated.
Originally messages were on the debug level directed to stdout and then
redirected to the logger. https://github.com/servo/servo/pull/37912
changed this behavior recently.


Testing: Tested by looking at the debug log of certain things.
ohos-speedometer for example.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-11 11:08:39 +00:00
Narfinger
90a73f7021
OHOS: Fix speedometer hang sometimes. (#37995)
This fixes the speedometer hang on CI.
Sometimes on CI we have the servoshell app not being in the foreground
(because popups have higher priority). Then, for some reason the
eventloop does not get pumped after some time.
This fixes this and is consistent with the current code in android.

Here is a succesful run
https://github.com/Narfinger/servo/actions/runs/16214904687/job/45782241427.
This needs also https://github.com/servo/servo/pull/37994 to be
successful but these two PR are independent.

Testing: Having the usb popup on the screen while running speedometer
without this changes hangs consistently (until input which calls
present_if_needed). With this change the hang does not occur anymore.
Fixes: I think https://github.com/servo/servo/issues/37727 is the same
issue and I confirmed that in the above case testinput does nothing
useful. We will see if this occurs again.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-11 09:22:48 +00:00
Tim van der Lippe
8edc6ba1b2
Return correct source position for element CSP violations (#37970)
The scripted_caller only has information if the context is coming
from a script. If an element fetch listener processes CSP
violations, then this information doesn't exist. Instead, we should
use the global URL and the line number. WPT tests don't appear
to expect a column number, as they are all zero. Not all elements
are updated, as I am not actually sure all of them need it.

The source position remains an Option, since there are also code
paths that don't correspond to element or script sources. Maybe
in the future we can always determine the source position, but
let's take small steps towards that.

Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-07-11 08:42:51 +00:00
webbeef
3c1bc1a92d
Avoid rooting/unrooting in Node::rev_version (#37885)
The iterator produced by Node::inclusive_ancestors roots the items but
rev_version just drop and unroot them right away. This patch makes it
possible to work on the Node references instead to avoid rooting.

*Describe the changes that this pull request makes here. This will be
the commit message.*

Testing: *Describe how this pull request is tested or why it doesn't
require tests*
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*

Signed-off-by: webbeef <me@webbeef.org>
2025-07-11 07:46:23 +00:00
batu_hoang
edfacec9c8
script_thread: handle_unfocus_msg ignores unfocus request of top-level document (#37955)
`ScriptThread::handle_unfocus_msg` ignores unfocus request of top-level
document
Fix errors in webdriver navigation commands, which may request unfocus
on top-level documents.

Testing: 
`tests/wpt/meta/webdriver/tests/classic/back/back.py`
`tests/wpt/meta/webdriver/tests/classic/forward/forward.py`

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-11 07:13:16 +00:00
sagudev
75c13f1422
canvas: Properly bound all image pattern axis by inserting clip (#37668)
Before we only handled no-repeat for rect, this means we rendered
https://sagudev.github.io/briefcase/no-repeat.html incorrectly (like
firefox). Now if one of the axis is bounded (does not repeat) we clip it
and let other axis be unbounded (technically we clip it to end of
canvas).

This is also needed for vello backend.

Testing: Tests in WPT exists and another test is added.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-11 06:49:09 +00:00
Kingsley Yung
464d71ecfc
Implement cookie expiry date parsing algorithm (#37715)
The cookie-rs library parses the cookie expiry date based on the format
from RFC 2616 (for HTTP/1.1), which is stricter than the format from RFC
6265 (for HTTP cookie).

This patch implements the cookie expiry date algorithm from RFC 6265.
When Cookie::parse fails in parsing the expiry date, we try to parse the
expiry again with this algorithm, to provide extra compatibility with
legacy systems.

Testing: Pass a WPT test that was expected to fail before, and add a
unit test.
Fixes: #36452

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-07-11 05:18:11 +00:00
Kenzie Raditya Tirtarahardja
099d20fe94
Webdriver: limit tick action duration to ECMA maximum safe integer (#37977)
Workaround to prevent
`webdriver/tests/classic/perform_actions/invalid.py` from TIMEOUT. I
don't see the spec telling us to limit this number, so I assume the
correct fix is to handle it on parsing.

Testing: `webdriver/tests/classic/perform_actions/invalid.py`.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-11 03:23:49 +00:00
minghuaw
5b507dc871
script: Update name validation for attribute, element, and doctype (#37747)
A recent update in the spec (https://github.com/whatwg/dom/pull/1079)
introduced new rules for name validation of attribute, element, and
doctype. This PR implements the new name validation rules in
`components/script/dom/bindings/domname.rs`. The old XML name validation
rules are not fully removed because there remains a few usage of it in
`ProcessingInstructions` and `xpath`.

Testing: Covered by WPT tests
Fixes: #37746

---------

Signed-off-by: minghuaw <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
2025-07-11 02:45:52 +00:00
Oriol Brufau
e14556959d
layout: Lay out grid items with a consistent tentative block size (#37981)
When laying out a grid item, the tentative block size that is used to
determine the intrinsic inline sizes was different than the one used in
the containing block for the contents. The latter is now used for both
cases.

Testing: A test is now passing.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-10 19:46:21 +00:00
dependabot[bot]
a02877e6b4
build(deps): bump clap from 4.5.40 to 4.5.41 (#37988)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.40 to 4.5.41.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.41] - 2025-07-09</h2>
<h3>Features</h3>
<ul>
<li>Add <code>Styles::context</code> and
<code>Styles::context_value</code> to customize the styling of
<code>[default: value]</code> like notes in the <code>--help</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="92fcd83b76"><code>92fcd83</code></a>
chore: Release</li>
<li><a
href="aca91b99c1"><code>aca91b9</code></a>
docs: Update changelog</li>
<li><a
href="8434510cee"><code>8434510</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5869">#5869</a>
from tw4452852/patch-1</li>
<li><a
href="33b1fc304e"><code>33b1fc3</code></a>
fix(complete): Fix env leakage in elvish dynamic completion</li>
<li><a
href="e5f1f4884c"><code>e5f1f48</code></a>
chore: Release</li>
<li><a
href="9466a552fb"><code>9466a55</code></a>
docs: Update changelog</li>
<li><a
href="d74b793512"><code>d74b793</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5865">#5865</a>
from gifnksm/nushell-completion-value-types</li>
<li><a
href="ecbc775d3b"><code>ecbc775</code></a>
fix(nu): Set argument type based on <code>ValueHint</code></li>
<li><a
href="6784054536"><code>6784054</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5857">#5857</a>
from epage/empty</li>
<li><a
href="cca5f32b3a"><code>cca5f32</code></a>
test(complete): Show empty option-value behavior</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.40...clap_complete-v4.5.41">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.40&new-version=4.5.41)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 19:01:17 +00:00
Ashwin Naren
6ad57a343e
[IndexedDB] Key ranges implementation (#37684)
Improves the implementation of keys to a point where key ranges can be
implemented as well.

Due to me making branching mistakes I'll have to cherry-pick out the
first commit (it's from #37682)

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-10 18:33:23 +00:00
dependabot[bot]
32d889f770
build(deps): bump xml-rs from 0.8.26 to 0.8.27 (#37990)
Bumps [xml-rs](https://github.com/kornelski/xml-rs) from 0.8.26 to
0.8.27.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/kornelski/xml-rs/blob/main/Changelog.md">xml-rs's
changelog</a>.</em></p>
<blockquote>
<h2>Version 0.8.27</h2>
<ul>
<li>Added detection of invalid <code>&lt;?</code> in attributes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cb01aadb3e"><code>cb01aad</code></a>
Bump</li>
<li><a
href="be66722ed9"><code>be66722</code></a>
Remove accidental whitespace</li>
<li><a
href="e481000896"><code>e481000</code></a>
Also flag &quot;&lt;?&quot; as error inside attribute values</li>
<li>See full diff in <a
href="https://github.com/kornelski/xml-rs/compare/0.8.26...0.8.27">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=xml-rs&package-manager=cargo&previous-version=0.8.26&new-version=0.8.27)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 17:37:59 +00:00
dependabot[bot]
b13d6cfc51
build(deps): bump rustls from 0.23.28 to 0.23.29 (#37989)
Bumps [rustls](https://github.com/rustls/rustls) from 0.23.28 to
0.23.29.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4e0b5fed17"><code>4e0b5fe</code></a>
Bump version to 0.23.29</li>
<li><a
href="b8540790dc"><code>b854079</code></a>
Propagate context for webpki signature algorithm errors</li>
<li><a
href="c84675e34b"><code>c84675e</code></a>
key_schedule: minimise lifetime of resumption secret</li>
<li><a
href="788b0df122"><code>788b0df</code></a>
key_schedule: erase master secret in traffic state</li>
<li><a
href="d2c64f0416"><code>d2c64f0</code></a>
key_schedule: separate ops not using current secret</li>
<li><a
href="e5998cd100"><code>e5998cd</code></a>
key_schedule: add state for derivations before finish</li>
<li><a
href="9620bec130"><code>9620bec</code></a>
tls13::key_schedule: move <code>KeySchedule</code> struct down</li>
<li><a
href="373ad888e2"><code>373ad88</code></a>
tls13::key_schedule: move <code>SecretKind</code> down</li>
<li><a
href="efa2066469"><code>efa2066</code></a>
Improve compactness of Debug impl for extensions</li>
<li><a
href="a5433a154b"><code>a5433a1</code></a>
Correct calculation of ServerHello ECH confirmation</li>
<li>Additional commits viewable in <a
href="https://github.com/rustls/rustls/compare/v/0.23.28...v/0.23.29">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls&package-manager=cargo&previous-version=0.23.28&new-version=0.23.29)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 17:14:10 +00:00
dependabot[bot]
f390cc590c
build(deps): bump rustls-webpki from 0.103.3 to 0.103.4 (#37987)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls-webpki&package-manager=cargo&previous-version=0.103.3&new-version=0.103.4)](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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-10 17:06:54 +00:00
Euclid Ye
827261ab03
Chore: cleanup unused EmbedderMsg::WebDriverCommand (#37979)
Also fix doc for `WebDriverCommandMsg::GetWindowRect`.

Testing: No behaviour change.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-10 12:54:46 +00:00
Kenzie Raditya Tirtarahardja
a475175949
Webdriver: Send Keys use webview::notify_input_event (#37911)
Previously, we SendKeys will be forwarded to constellation by the
embedder. Now we use webview.notify_input_event, which will send
WebDriverCommandMsg::ForwardInputEvent for the KeyboardEvent and
CompositionEvent.

Fixes: part of https://github.com/servo/servo/issues/37370

---------

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-10 12:37:01 +00:00
TIN TUN AUNG
f88dd2a12c
add support for apng and webp animated image decoding (#37637)
Add support for APNG animated image decoding. Rework `load_from_memory`
image decoding api, to handle all the image format that currently
supported.

Testing: This change should allow `apng` and `webp` format image start
moving, and should make some WPT test related to APNG pass.

Partially address: https://github.com/servo/servo/issues/37493

[wpt try
run](https://github.com/rayguo17/servo/actions/runs/15840339570)

cc @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-07-10 08:54:16 +00:00
Oriol Brufau
ff050b71fa
layout: Remove IndependentNonReplacedContents (#37971)
With the work to unify the layout logic for replaced and non-replaced
boxes (#37942), I think the `IndependentNonReplacedContents` enum does
no longer make much sense.

Therefore, this removes `IndependentNonReplacedContents`, merging its
values into `IndependentFormattingContextContents`.

The methods defined on `IndependentFormattingContextContents` can now be
on `IndependentFormattingContext`, in particular this implies that the
layout results of a replaced box will now be cached.

Testing: Unneeded (no behavior change)
This part of #37942

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-10 07:46:04 +00:00
Euclid Ye
07247cd4fd
servoshell: Enable headless event loop for Windows (#37975)
Testing: For windows, it now passes
`/_mozilla/mozilla/window_resizeTo.html` in headless mode but fails in
headed window as expected in
https://github.com/servo/servo/pull/37899#issuecomment-3052566865.

Fixes: #37973 
Fixes: #26431 
Fixes: #20365

Signed-off-by: Euclid Ye yezhizhenjiakang@gmail.com 
Co-authored-by: Josh Matthews josh@joshmatthews.net

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-07-10 04:41:41 +00:00
batu_hoang
2e44aba753
webdriver: Implement support for simple dialogs (#37913)
Implement webdriver user prompt: accept alert, dismiss alert, get alert
text.

Tests:
https://github.com/longvatrong111/servo/actions/runs/16175408035
https://github.com/longvatrong111/servo/actions/runs/16175409545

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-10 03:15:46 +00:00
Servo WPT Sync
84f0cd5801
Sync WPT with upstream (10-07-2025) (#37974)
Automated downstream sync of changes from upstream as of 10-07-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-07-10 03:09:13 +00:00
Narfinger
4615464388
OHOS CI allow profile (#37963)
OHOS CI: We now allow a profile flag. The profile name will be prepended
to all measurements.
This allows us to distinguish different build profiles in bencher.
Additionally we are more robust on duplicated entries for some
measurements.

Testing: Tested on CI with a run here:
https://github.com/Narfinger/servo/actions/runs/16168150429/job/45635086884
Fixes: https://github.com/servo/servo/issues/37890

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-10 00:58:15 +00:00
Oriol Brufau
47c56d8d74
layout: Unify layout logic for replaced and non-replaced floats&atomics (#37897)
Laying out a float or atomic inline will now use the same logic
regardless of whether it's replaced or not.
This reduces the amount of code, and should have no observable effect.

Testing: Unneeded (no behavior change)
This part of #37942

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-09 19:46:22 +00:00
Tim van der Lippe
70c57c6136
Add support for Reporting-Endpoints (#37965)
Does not yet handle failures of endpoints, which requires us to update
metadata. I don't see that metadata being used anywhere, so I am not
sure if there is WPT coverage for it.

Part of #37238

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-07-09 19:07:29 +00:00
JoeDow
16aca5516d
layout: remove the finished animations to avoid to mark their dom nodes dirty (#37954)
Remove the finished animations to avoid marking their dom nodes dirty.
The mainly change happens at [stylo PR
216](https://github.com/servo/stylo/pull/216).

In Servo's current animation implementation, the finished animations are
retained and continue to mark their corresponding DOM nodes as dirty.
This can lead to a significant number of unnecessary and expensive
reflow operations. For example, during page scrolling, the dirtied state
from finished animations forces the whole reflow process on every
update_the_rendering cycle, severely impacting scroll performance.

The [code comments in stylo
repo](https://github.com/servo/stylo/blob/main/style/matching.rs#L752-L755)
stated that retaining finished animations was necessary to correctly
compute the final frame state for
[animation-fill-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode).
However, test results—including those from WPT test cases and manual
verification—indicate that this functionality is already guaranteed
without this overhead.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-09 18:19:09 +00:00
Josh Matthews
9b05d36cea
WPT upstreamer: Make all failed merge operations leave a comment. (#37949)
The WPT exporter currently assumes that removing a label from a github
PR will never fail. This is obviously false and the result is a silent
failure. By moving the operation inside the existing try block we ensure
that a comment will be posted if any part of the merge step fails.

Testing: Untested; did not feel worth the time investment to determine
if the existing test harness can mock this particular situation.
Fixes: #37914

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-09 17:43:15 +00:00
Martin Robinson
436c9072c4
layout: Skip box tree construction when possible (#37957)
When a style change does not chang the structure of the box tree, it is
possible to skip box tree rebuilding for an element. This change adds
support for reusing old box trees when no element has that type of
damage. In order to make this happen, there needs to be a type of
"empty" `LayoutDamage` that just indicates that a fragment tree layout
is necessary.

This is the first step toward incremental fragment tree layout.

Testing: This should not change observable behavior and thus is covered
by
existing WPT tests. Performance numbers to follow.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-09 17:33:09 +00:00
Oriol Brufau
d5d131c172
layout: Unify layout logic for replaced and non-replaced flex items (#37962)
Laying out a flex item will now use the same logic regardless of whether
it's replaced or not.
This reduces the amount of code, and should have no observable effect.

Testing: Unneeded (no behavior change)
This part of #37942

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-09 15:57:58 +00:00
Steven Novaryo
378c4648e4
script: Use an implemented pseudo-element to fortype=color ::color-swatch (#37427)
Implement internal pseudo element, which would be resolved as a
"Implemented Pseudo Element" within style computation. This is an
concrete element that would has a primary style after the style
computation, but could match and style resolved like an pseudo element.
Therefore, it would have a different behavior compared to how does
`pseudo`s that `ServoLayoutNode` had. Where they would not have a
concrete element behind it. Note that, due to the nature of these pseudo
elements residing inside a UA widget, these pseudo elements would
therefore not be accessible in JavaScript by default.

This kind of element is required in order to implement the [form control
pseudo element](https://drafts.csswg.org/css-forms-1/#pseudo-elements)
like `::placeholder`, `::color-swatch`, `::field-text`, etc.
 
See [this docs](https://hackmd.io/@ChaKweTiau/BJ3zRdLQlg) for more
details of the implementation.

Then, the implemented pseudo element is utilized to implement style
matching for input `type=text`.

Servo's side of: https://github.com/servo/stylo/pull/212

Testing: No WPT regression.

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-07-09 15:36:58 +00:00
Oriol Brufau
d2ccf419c3
layout: Move BoxFragment's block-level info into a dedicated struct (#37938)
`BoxFragment` had 2 fields that are only relevant for block-level boxes:
`clearance` and a boxed `block_margins_collapsed_with_children`.

This moves both pieces of data into a new `BlockLevelLayoutInfo` struct,
which is boxed.

As a result, the size of `BoxFragment` is reduced from 272 to 264 bytes.

Testing: Unneeded (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-09 15:04:57 +00:00
Andrei Volykhin
26f4da8249
script: Propagate a pending JS exception on structured cloning (#37964)
During the object (de)serialization steps on structured cloning
https://html.spec.whatwg.org/multipage/#safe-passing-of-structured-data
it is possible to throw a JS exception.

`self.postMessage({ get whatever() { throw customError } }));`

Require to propagate a pending JS exception and not throw the default
"DataCloneError" DOM exception.

Testing: Improvements in the following tests
- html/infrastructure/safe-passing-of-structured-data/*
- html/webappapis/structured-clone/structured-clone.any.js*
- wasm/serialization/arraybuffer/transfer.window.js
- webmessaging/without-ports/026.html
- workers/semantics/structured-clone/dedicated.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-09 14:47:55 +00:00
Ngo Iok Ui (Wu Yu Wei)
34c31ee418
WebGL2: support TexImage3D (#37718)
Add TexImage3D method to WebGL2RenderingContext

Testing: conformance2 should pass. Also it should get
http://webglsamples.org/WebGL2Samples/#texture_2d_array and
http://webglsamples.org/WebGL2Samples/#texture_3d running.
Fixes: #26511

Now Servo can run texture_2d_array and texture_3d samples!

![圖片](https://github.com/user-attachments/assets/41b87563-08b8-4db3-b503-12f3a61dbed7)

![圖片](https://github.com/user-attachments/assets/3c62a4de-35ea-488d-b2e5-00e3aed52090)

And it can now run three.js too!

![圖片](https://github.com/user-attachments/assets/d880aa92-a154-4895-aa06-b7919d1fc869)

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-07-09 14:22:03 +00:00