Commit graph

52055 commits

Author SHA1 Message Date
Euclid Ye
9352a9db7c
script: Support webdriver's Get Element Text operation for non-HTML elements (#37470)
Fix `WebDriverScriptCommand::GetElementText` similar to
https://github.com/servo/servo/pull/37452#discussion_r2146350739, by
correctly retrieving rendered text.

Testing: `./mach test-wpt -r --log-raw "D:\servo test
log\gt_ele_txt.txt" webdriver/tests/classic/get_element_text --product
servodriver`

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-15 05:32:29 +00:00
batu_hoang
810c0e6891
Remove duplication in dispatch_pending_point_input_events (#37426)
Follow up to:
https://github.com/servo/servo/pull/37285#pullrequestreview-2916829212,
this PR removes duplicate code.
cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-15 05:32:13 +00:00
Euclid Ye
5d42ab05fb
[WebDriver] Improve get active element (#37425)
Report `NoSuchElement` if the active element is null, according to spec.

Testing: `./mach test-wpt -r --log-raw "D:\servo test log\all.txt"
.\tests\wpt\tests\webdriver\tests\classic\get_active_element --product
servodriver`
Partly fixes: #37420. We can pass `get_active_element` test once #37424
is done.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-15 05:17:59 +00:00
Servo WPT Sync
1eb62a1ffb
Sync WPT with upstream (15-06-2025) (#37468)
Automated downstream sync of changes from upstream as of 15-06-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-06-15 04:21:56 +00:00
Jay Wang
96adb1e959
improvement: body element check (#37442)
Created a new method `HTMLElement::is_body_element` that replaces
`HTMLBodyElement::is_the_html_body_element`.

Testing: Existing WPT tests should pass.
Fixes: https://github.com/servo/servo/issues/37429

---------

Signed-off-by: iamlockon <xdddxyyyxzzz123@gmail.com>
2025-06-15 04:11:32 +00:00
Tim van der Lippe
c74a422e4c
Implement script prepare text for Trusted Types (#37466)
Recently added WPT tests for this are now mostly passing. The remaining
tests fail on importmap support.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-14 22:33:25 +00:00
Oriol Brufau
f963f2731d
layout: Properly handle intrinsic min/max block sizes on replaced element (#37457)
This change aligns Servo with both Blink and WebKit in common cases.

When the `aspect-ratio` property is set to a different value than the
natural ratio, then Blink and WebKit disagree, we match Blink.

Gecko doesn't support intrinsic min/max block sizes at all.

Note this patch doesn't fix the intrinsic contributions, they will need
to be addressed in a follow-up patch.

Testing: Covered by WPT
Fixes: #37433

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-14 09:24:10 +00:00
Michael Mc Donnell
a27f2bb84d
Fix Rust-analyzer errors and warnings in blurmac (#37439)
I got 22 errors and 63 warnings when I opened the Servo project in
Visual Studio Code with the Rust-analyzer extension on Linux. The
`blurmac` package, which is vendored in the source tree, only needs to
be be compiled on macOS.

With this change I get zero errors and 2 unrelated warnings.

Testing: I don't have a mac and cannot test it there. I only tested it
building on Linux. I also did not test test the Bluetooth feature. I
think the change is pretty straightforward and unlikely to cause a major
regression.

Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
2025-06-14 06:08:07 +00:00
dependabot[bot]
e6ae4434cb
build(deps): bump windows-link from 0.1.1 to 0.1.3 (#37450)
Bumps [windows-link](https://github.com/microsoft/windows-rs) from 0.1.1
to 0.1.3.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/microsoft/windows-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=windows-link&package-manager=cargo&previous-version=0.1.1&new-version=0.1.3)](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-06-14 03:48:30 +00:00
dependabot[bot]
b65f78c83f
build(deps): bump syn from 2.0.102 to 2.0.103 (#37449)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.102 to 2.0.103.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.103</h2>
<ul>
<li>Insert parentheses around binary operation with attribute (<a
href="https://redirect.github.com/dtolnay/syn/issues/1871">#1871</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="85d427679f"><code>85d4276</code></a>
Release 2.0.103</li>
<li><a
href="6f7b0f39b3"><code>6f7b0f3</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1871">#1871</a>
from dtolnay/binaryattr</li>
<li><a
href="89f88facd1"><code>89f88fa</code></a>
Correctly track bailouts in parenthesized binary expressions</li>
<li><a
href="0e07372e40"><code>0e07372</code></a>
Add binary operator attribute bailout test</li>
<li><a
href="ca8d876bde"><code>ca8d876</code></a>
Insert parentheses around binary operation with attribute</li>
<li><a
href="5be0f7121f"><code>5be0f71</code></a>
Add binary operator attribute tests</li>
<li><a
href="026bb3cf32"><code>026bb3c</code></a>
Discard paren attrs in unparenthesize test</li>
<li><a
href="217dd626aa"><code>217dd62</code></a>
Preserve attributes of Expr::Paren in FlattenParens</li>
<li><a
href="ef977c1059"><code>ef977c1</code></a>
Update test suite to nightly-2025-06-11</li>
<li>See full diff in <a
href="https://github.com/dtolnay/syn/compare/2.0.102...2.0.103">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=syn&package-manager=cargo&previous-version=2.0.102&new-version=2.0.103)](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-06-13 17:29:36 +00:00
dependabot[bot]
851f8b9200
build(deps): bump cc from 1.2.26 to 1.2.27 (#37448)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.26 to 1.2.27.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>cc-v1.2.27</h2>
<h3>Other</h3>
<ul>
<li>Regenerate windows sys bindings (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1485">#1485</a>)</li>
<li>Update windows-bindgen requirement from 0.61 to 0.62 (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1484">#1484</a>)</li>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1483">#1483</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md">cc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.26...cc-v1.2.27">1.2.27</a>
- 2025-06-13</h2>
<h3>Other</h3>
<ul>
<li>Regenerate windows sys bindings (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1485">#1485</a>)</li>
<li>Update windows-bindgen requirement from 0.61 to 0.62 (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1484">#1484</a>)</li>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1483">#1483</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7043e38035"><code>7043e38</code></a>
chore: release v1.2.27 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1486">#1486</a>)</li>
<li><a
href="1d99fe33a4"><code>1d99fe3</code></a>
Regenerate windows sys bindings (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1485">#1485</a>)</li>
<li><a
href="2e34d13d5d"><code>2e34d13</code></a>
Update windows-bindgen requirement from 0.61 to 0.62 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1484">#1484</a>)</li>
<li><a
href="191bcf56c4"><code>191bcf5</code></a>
Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1483">#1483</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.26...cc-v1.2.27">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.2.26&new-version=1.2.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-06-13 17:19:05 +00:00
dependabot[bot]
94af8e5a3d
build(deps): bump thread_local from 1.1.8 to 1.1.9 (#37446)
Bumps [thread_local](https://github.com/Amanieu/thread_local-rs) from
1.1.8 to 1.1.9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Amanieu/thread_local-rs/releases">thread_local's
releases</a>.</em></p>
<blockquote>
<h2>v1.1.9</h2>
<h3>Other</h3>
<ul>
<li>Add release-plz for automated releases</li>
<li>Remove once_cell dependency</li>
<li>Bump MSRV to 1.61</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Amanieu/thread_local-rs/blob/master/CHANGELOG.md">thread_local's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/Amanieu/thread_local-rs/compare/v1.1.8...v1.1.9">1.1.9</a>
- 2025-06-12</h2>
<h3>Other</h3>
<ul>
<li>Add release-plz for automated releases</li>
<li>Remove once_cell dependency</li>
<li>Bump MSRV to 1.61</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4b7cc0f30b"><code>4b7cc0f</code></a>
chore: release v1.1.9</li>
<li><a
href="11f0bcc9f1"><code>11f0bcc</code></a>
Add release-plz for automated releases</li>
<li><a
href="b5aa929035"><code>b5aa929</code></a>
Merge pull request <a
href="https://redirect.github.com/Amanieu/thread_local-rs/issues/76">#76</a>
from james7132/remove-once-cell-dependency</li>
<li><a
href="d7f100ab3f"><code>d7f100a</code></a>
Remove once_cell dependency</li>
<li><a
href="6920311014"><code>6920311</code></a>
Merge pull request <a
href="https://redirect.github.com/Amanieu/thread_local-rs/issues/73">#73</a>
from Swatinem/msrv</li>
<li><a
href="e3d9a42add"><code>e3d9a42</code></a>
Bump MSRV to 1.61</li>
<li>See full diff in <a
href="https://github.com/Amanieu/thread_local-rs/compare/1.1.8...v1.1.9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thread_local&package-manager=cargo&previous-version=1.1.8&new-version=1.1.9)](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-06-13 17:11:36 +00:00
Servo WPT Sync
a7e9df0fef
Sync WPT with upstream (13-06-2025) (#37436)
Automated downstream sync of changes from upstream as of 13-06-2025
[no-wpt-sync]

---------

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-13 14:15:36 +00:00
Simon Wülker
e4da496e2d
Cleanup Cargo.toml [patch] section (#37437)
* Removes a reference to my stylo fork i accidentally added in
https://github.com/servo/servo/pull/37345
* Removes a similar reference for rust-content-security-policy 
* Adds `web_atoms` to the `html5ever` patch list. This crate lives in
the html5ever repo since https://github.com/servo/html5ever/pull/599 and
you'll need to patch it when you're patching htmlever

Testing: These are comments, no tests needed

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-13 13:00:39 +00:00
Ngo Iok Ui (Wu Yu Wei)
11be71b56c
chore: revert patch suggestions (#37435)
Revert unintended change in #37345

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-13 12:48:26 +00:00
Jonathan Schwender
6ad6542aac
mach: Add TSAN support (#37195)
Add ThreadSanitizer support to mach (`--with-tsan`).

This refactors the current infrastructure to support `--with-asan` to a
more generic `Santiizer`.
If the need for adding multiple sanitizers at once (e.g. address + leak
sanitizer) arises, we can easily change the `SanitizerKind` enum to a
`enum.Flag` instead.

Testing: Manually run `./mach build --with-tsan` and `./mach run
--with-tsan` (on macos) and observe TSAN reporting data races.

Closes: #14869

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-13 12:26:57 +00:00
Domenico Rizzo
b8738074d1
[#26488] Refactored RTCDataChannel for safer dropping and added Promise comment (#37332)
Fixes (partially) #26488 and apply the
https://github.com/servo/servo/pull/37324#discussion_r2133989190
comment.

Testing: No tests added
Fixes: Partially #26488

---------

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2025-06-13 12:20:45 +00:00
Martin Robinson
f451dccd0b
layout: Store scroll offsets in the ScrollTree (#37428)
There are currently five places that scroll offsets are stored:

 - DOM: A set of scroll offsets used for script.
 - Layout: An array of scroll offsets that is used for tracking
   layout-side scroll offsets.
 - Layout: The scroll offsets stored in the `ScrollTree`. These are
   currently unset and unused.
 - Compositor: The scroll offsets stored in the `ScrollTree` mirrored
   from layout.
 - WebRender: The scrolled offsets stored in the WebRender spatial tree.

This change is the first step in combining the first three into the
layout `ScrollTree`. It eliminates the extra array of scroll offsets
stored in layout in favor of the storing them in the `ScrollTree`. A
followup change will eliminate the ones stored in the DOM.

- In addition the `ScrollState` data structure is eliminated as these
are
now stored in a `HashMap` everywhere when passing them via IPC.
- The offsests stored in layout can now never scroll past the boundaries
of the scrolled content.

Testing: This should not change behavior and is thus covered by existing
WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: stevennovaryo <steven.novaryo@gmail.com>
2025-06-13 12:01:27 +00:00
Simon Wülker
6cac782fb1
Support exporting shadow parts with the exportparts attribute (#37345)
The attribute is implemented as a new `AttrValue` variant containing the
mappings of exported part names
(https://github.com/servo/stylo/pull/197).

Take a look at the [MDN
page](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/exportparts)
for more information about the attribute.


Testing: Covered by WPT
Fixes: https://github.com/servo/servo/issues/35349

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-13 11:32:20 +00:00
Gregory Terzian
730fe35b42
AbortController: integrate with stream piping. (#37244)
Start using abort signal in Use in
https://streams.spec.whatwg.org/#readablestream-pipe-to-signal

Part of https://github.com/servo/servo/issues/34866

Will also cover https://github.com/servo/servo/issues/37230 and
https://github.com/servo/servo/issues/37232

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-06-13 09:52:38 +00:00
Narfinger
099fd10317
OHOS: Use native API to get most of the information needed for starting servoshell. (#37392)
Uses the native ohos-api crates to get the required information for
starting servoshell.
This increases the minimum API version requirement to API-14.

Testing: Tested on device.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-13 09:38:56 +00:00
atbrakhi
7a801f0ef5
DevTools: Implement support for showing source_content in Debugger > Source panel (#36774)
This patch adds support for showing source_content in `Debugger >
Source` panel. This works by handling the clients `source` messages in
the source actor. These source actors are already advertised as resource
via the watcher, populating the source list. We also update the
`sources` handler in thread actor for future work in thread debugging.

Note: while this PR also adds support for showing worker script
source_content, worker has been broken (See
https://github.com/servo/servo/issues/37012). I was able to confirm the
`content_type` and `source_content` for worker script in logs.


![image](https://github.com/user-attachments/assets/bd53ea29-003a-4b5e-a3e8-6e280afa4671)

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

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-06-13 09:31:33 +00:00
JoeDow
5159529888
Layout: refactor the box tree update logic for better readability (#37390)
Refactor the box tree update logic to improve readability and facilitate
the addition of incremental update logic in the following PRs.

Testing: No logic changed, just covered by existing WPT tests
Fixes: Nothing to fix

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-06-13 08:42:59 +00:00
batu_hoang
6818d5c600
Wait enough time for tick duration in webdriver dispatch actions (#37423)
Add step `wait at least tick duration milliseconds have passed`
https://w3c.github.io/webdriver/#dfn-dispatch-actions-inner

Testing: Fix intermittent timeout in:

`/tests/wpt/tests/webdriver/tests/classic/perform_actions/pointer_dblclick.py`

cc: @xiaochengh , @jdm

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-13 08:40:23 +00:00
batu_hoang
4c598037a5
Verify webview still open in webdriver switch frame command (#37411)
SwitchToParentFrame webdriver commands do not handle the case where the
current top-level browsing context has been closed.

Tests:

`./tests/wpt/tests/webdriver/tests/classic/switch_to_parent_frame/switch.py`
`./tests/wpt/tests/webdriver/tests/classic/switch_to_frame/switch.py`

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-13 08:32:59 +00:00
Oriol Brufau
1bbdcb1911
layout: Avoid useless LazyCell when resolving replaced element's size (#37419)
The callback can be used instead, since `Size::resolve()` already takes
care of creating a `LazyCell`.

Testing: Unnecessary, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-13 08:29:37 +00:00
Martin Robinson
23acb623c8
script: Allow reflows that do not produce display lists (#37186)
This change has two parts which depend on each other:

1. An early exit in the layout process, which allows for skipping
   display list construction entirely when nothing would change.
2. A simplification and unification of the way that "fake" animation
   frames are triggered. Now this happens on an entire ScriptThread at
   once and is based on whether or not any Pipeline triggered a display
   list update.

   Animations are never canceled in the compositor when the Pipeline
   isn't updating, instead the fake animation frame is triggered far
   enough in the future that an unexpected compositor tick will cancel
   it. This could happen, for instance, if some other Pipeline in some
   other ScriptThread produced a new display list for a tick. This makes
   everything simpler about these ticks.

The goal is that in a future change the ScriptThread-based animation
ticks will be made more generic so that they can throttle the number of
"update the rendering" calls triggered by script.

This should make Servo do a lot less work when moving the cursor over a
page. Before it would constantly produce new display lists.

Fixes: #17029.
Testing: This should not cause any web observable changes. The fact that
all WPT tests keep passing is the test for this change.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-12 19:25:04 +00:00
Martin Robinson
29fc878e15
compositor: Do not allow script to scroll beyond node boundaries (#37412)
The compositor was accepting scroll offsets from the ScriptThread
without checking their boundaries. In some cases this could cause a
temporary discrepancy with the rendered scroll offset. This change makes
it so that all offset updates for scroll ayers in the compositor do not
scroll past the scroll boundaries of the node.

Testing: Two new tests pass with this change:
 - `/css/css-position/sticky/position-sticky-left-003.html`
 -  `/css/css-position/sticky/position-sticky-top-003.html`

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-12 17:32:50 +00:00
Kingsley Yung
b28e796647
Implement MicrotaskRunnable for DefaultTeeReadRequestMicrotask (#37404)
Implement `MicrotaskRunnable` for `DefaultTeeReadRequestMicrotask` to
run the microtask, instead of using its own ad-hoc mechanism via
`DefaultTeeReadRequestMicrotask::microtask_chunk_steps`.

Testing: No need for this refactoring.
Fixes: #37246

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-06-12 10:46:31 +00:00
Jason Tsai
41bed9840a
feat(script): create import map parse result (#37405)
Implement import map parser
Spec:
https://html.spec.whatwg.org/multipage/#create-an-import-map-parse-result

- Create an import map parse result
- Sorting and normalizing a module specifier map
- Sorting and normalizing scopes
- Normalizing a module integrity map

Testing: should pass current WPT
Fixes: part of https://github.com/servo/servo/issues/37316

---------

Signed-off-by: Jason Tsai <git@pews.dev>
Co-authored-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-12 09:34:31 +00:00
Euclid Ye
f242c120b6
[WebDriver] Improve some session/window handling (#37406)
Improve some session/window handling according to spec.

Testing:`./mach test-wpt -r --log-raw "D:\servo test log\all.txt"
.\tests\wpt\tests\webdriver\tests\classic\ --product servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-12 09:06:51 +00:00
batu_hoang
73c2864233
Handle Touch events in dispatch_pending_point_input_events (#37285)
Add a missing step in hit test retry
[(comment)](https://github.com/servo/servo/pull/37085/files/0d02b61f72c24e575273b6240e04351762ef000a#r2131567216).

cc: @xiaochengh , @kongbai1996

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-12 03:13:11 +00:00
sagudev
8a14dd318a
chore: Remove some stale files (#37401)
Stale files in root dir are really annoying.

We could probably remove more stuff in etc/ci, but I was very
conservative.

Testing: Just removing old as earth files

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-11 22:11:06 +00:00
Usman Yahaya Baba
8e1cf31db3
Replace NetworkEventUpdateMsg with ResourcesUpdatedArray (#37384)
*Replaces NetworkEventUpdateMsg with ResourcesUpdatedArray in
HttpResponse case of handle_network_event *
- Adds ResourcesUpdatedArray and UpdateEntry structs in
`devtools/network_handler.rs` to hold an array of updates
(requestHeaders, responseCookies). Updates handle_network_event to use
BrowsingContextActor::resource_available for sending
"resources-updated-array").
- Adds browsing_context_actor_name parameter to handle_network_event to
resolve borrow checker issues and enable BrowsingContextActor lookup.
- Ensures borrow safety by scoping mutable actor access.

Testing: *Does not require test*
Fixes: part of https://github.com/servo/servo/issues/33556

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-06-11 22:07:57 +00:00
Narfinger
ea5a20ab8d
OHOS: update ci to use api-14 and newer action (#37395)
Update the CI to use api version 14 and 5.0.2 sdk. Additionally, update
the action. This is required because of
https://github.com/servo/servo/pull/37392.

Testing: CI does not have tests.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-11 19:34:09 +00:00
dependabot[bot]
84372d5734
build(deps): bump memchr from 2.7.4 to 2.7.5 (#37400)
Bumps [memchr](https://github.com/BurntSushi/memchr) from 2.7.4 to
2.7.5.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3962118774"><code>3962118</code></a>
2.7.5</li>
<li><a
href="599d9d92aa"><code>599d9d9</code></a>
cargo: remove <code>compiler-builtins</code> from
<code>rustc-dep-of-std</code> dependencies</li>
<li><a
href="ceef3c921b"><code>ceef3c9</code></a>
ci: fix wasm32 environment variables</li>
<li><a
href="cf4057f2c9"><code>cf4057f</code></a>
ci: try bumping wasmtime version</li>
<li><a
href="89b3d9a350"><code>89b3d9a</code></a>
ci: fix wasm32 actions (wasm32-wasi was renamed to wasm32-wasip1)</li>
<li><a
href="12d358d22f"><code>12d358d</code></a>
benchmarks: update to stringzilla 3.12.3</li>
<li><a
href="8c1e043ebb"><code>8c1e043</code></a>
benchmarks: update memchr dependencies</li>
<li><a
href="9898622ad9"><code>9898622</code></a>
benchmarks: fix wasm32-wasi target</li>
<li><a
href="746182171d"><code>7461821</code></a>
lint: add docs to item because of <code>deny(missing_docs)</code></li>
<li><a
href="a7dbafe373"><code>a7dbafe</code></a>
doc: fix typographical errors</li>
<li>Additional commits viewable in <a
href="https://github.com/BurntSushi/memchr/compare/2.7.4...2.7.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=memchr&package-manager=cargo&previous-version=2.7.4&new-version=2.7.5)](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-06-11 17:12:21 +00:00
dependabot[bot]
4381b39345
build(deps): bump winnow from 0.7.10 to 0.7.11 (#37399)
Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.7.10 to
0.7.11.
<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.11] - 2025-06-10</h2>
<h3>Fixes</h3>
<ul>
<li>Remove a stackoverflow in <code>PartialEq</code> and
<code>PartialOrd</code> with <code>Bytes</code> and
<code>BStr</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1b571615f6"><code>1b57161</code></a>
chore: Release</li>
<li><a
href="d5b9208a6d"><code>d5b9208</code></a>
docs: Update changelog</li>
<li><a
href="01c8883d29"><code>01c8883</code></a>
Merge pull request <a
href="https://redirect.github.com/winnow-rs/winnow/issues/793">#793</a>
from epage/impl</li>
<li><a
href="9b31e4fc60"><code>9b31e4f</code></a>
fix(stream): Don't overflow stack on PartialEq/PartialOrd</li>
<li><a
href="cf65757a7e"><code>cf65757</code></a>
Merge pull request <a
href="https://redirect.github.com/winnow-rs/winnow/issues/790">#790</a>
from epage/template</li>
<li><a
href="c09c67e549"><code>c09c67e</code></a>
chore: Update from _rust/main template</li>
<li><a
href="271edc6a4c"><code>271edc6</code></a>
chore: Add zlib license</li>
<li><a
href="6acb890d7a"><code>6acb890</code></a>
chore(deps): Update Rust crate automod to v1.0.15 (<a
href="https://redirect.github.com/winnow-rs/winnow/issues/27">#27</a>)</li>
<li><a
href="b8a7ea49d9"><code>b8a7ea4</code></a>
chore(deps): Update Rust Stable to v1.87 (<a
href="https://redirect.github.com/winnow-rs/winnow/issues/18">#18</a>)</li>
<li><a
href="f9842b3b3f"><code>f9842b3</code></a>
chore: Avoid MSRV problems out of the box</li>
<li>Additional commits viewable in <a
href="https://github.com/winnow-rs/winnow/compare/v0.7.10...v0.7.11">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.10&new-version=0.7.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot 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-06-11 17:05:12 +00:00
Nico Burns
7427ea4aed
Move to_bidi_level method from Stylo to Servo (#37343)
This method is only used in Servo and is the only reason that `stylo`
depends on `unicode-bidi`.

Stylo PR: https://github.com/servo/stylo/pull/196
2025-06-11 14:44:13 +00:00
Euclid Ye
c1ee354c38
webdriver: Assume more consistently that the BrowsingContext exists (#37389)
1. Tidy up some WebDriver handling with browsing context
2. Enable more wpt-test which no longer panic

Testing: `./mach test-wpt -r --log-raw "D:\servo test log\all.txt"
.\tests\wpt\tests\webdriver\tests\classic\ --product servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-11 14:23:47 +00:00
Martin Robinson
fab958258e
script: Remove unused Window::page_clip_rect (#37394)
This value was used when rendering was not done by WebRender. Nowadays,
we do not need this page clip rect concept and it is completely
unused.

Testing: This just remove dead code, so should be covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-11 13:08:33 +00:00
Martin Robinson
c36ef34464
layout: Remove two arguments from StackingContextTree::new() (#37396)
This is a minor cleanup that simplifies the construct of
`StackingContextTree`. The two arguments removed are derived from the
`FragmentTree` which is already passed as an argument.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-11 12:42:54 +00:00
JoeDow
bda3e23c74
Fix potential clippy warning for NodeDamage enum variant (#37391)
The default of `enum-variant-name-threshold` is 3, so adding any new
variants will lead to the lint being triggered, reference:

[enum_variant_names](https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names).
This PR fix this potential clippy lint warning for facilitate the
addition of new variant in following PR about incremental box tree
update.

Testing: No logic changed, just covered by existing WPT tests
Fixes: None

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-06-11 09:53:15 +00:00
Euclid Ye
5f1452f9d3
[WebDriver: Dispatch Action] Check if browsing context still open for each tick action (#37393)
As titled. This is what
[spec](https://w3c.github.io/webdriver/#dfn-dispatch-actions-inner)
requires. The motivation is that the previous action might have changed
the browsing context.

Testing: `./mach test-wpt -r --log-raw "D:\servo test log\all.txt"
.\tests\wpt\tests\webdriver\tests\classic\ --product servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-11 09:53:06 +00:00
Martin Robinson
048d4a2a5a
libservo: Let libservo manage compositor message reception (#37372)
Instead of receiving message in the compositor during a spin of the
Servo event loop, receive them in libservo and then send them to the
compositor. This is preparation for allowing libservo to wait for
messages without spinning the main application event loop. This is
useful for two situations:

1. Allowing a blocking shutdown mode, which can be used to ensure clean
   shutdown, regardless of how the API is used.
2. Allowing unit tests to wait until message are received instead of
   using a timer like they do now.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-11 09:50:20 +00:00
Kenzie Raditya Tirtarahardja
15eadb56a4
[webdriver] Add synchronization for wheel action (#37260)
Implement action synchronization for wheel event. Previously only done
for pointer here https://github.com/servo/servo/pull/36932.

Testing:
`tests/wpt/meta/webdriver/tests/classic/perform_actions/wheel.py`

---------

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-06-11 09:03:08 +00:00
Narfinger
5114e24db1
Servoshell: Refactor save_output_image and implement into OHOS (#37237)
Split out `save_output_image_if_necessary` into its own file so the code
can be shared by servoshell on the desktop and ohos.
Additionally, hook it up to the loop in OHOS and have OHOS allow
exiting.

Testing: Manual testing on ohos and desktop.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-11 08:51:44 +00:00
Ngo Iok Ui (Wu Yu Wei)
f60c857fcf
Add WPT baseline for import maps (#37388)
Part of #37316

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-11 07:26:10 +00:00
Shubham Gupta
f1767e6c1e
Use own ViewportDescription to clamp() initial_scale (#37337)
Use own `ViewportDescription` to `clamp()` initial_scale.

If use `self` it will use current module `ViewportDescription`, which is
old one because new `ViewportDescription` is not set yet.

Testing: Tested Locally
Fixes: #37338

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-06-11 05:31:05 +00:00
Josh Matthews
73361d0f5f
script: Replace use of UnsafeCell in WeakRangeVec. (#37327)
I can't find any historical motivation for the use of UnsafeCell in the
implementation of WeakRangeVec from #8506. We can replace all the uses
of unsafe in this code by using RefCell, and the resulting code is
easier to understand.

Testing: Existing WPT tests using Ranges show no behaviour changes.
Fixes: #37276

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-11 04:01:12 +00:00
Oriol Brufau
6617fe3b91
Have transform and related changes conditionally trigger only overflow damage (#37380)
Bumps Stylo to https://github.com/servo/stylo/pull/190

Testing: Unnecessary (there should be no change in behavior)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-06-10 21:54:53 +00:00