Commit graph

51913 commits

Author SHA1 Message Date
batu_hoang
8df5e1e74d
webdriver: Properly insert the user agent into the capabilities data structure (#37876)
Add user agent into webdriver capabilities.

Testing:
`/mach test-wpt -r --product servodriver
./tests/wpt/tests/webdriver/tests/classic/new_session/response.py`

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-04 18:09:59 +00:00
Oriol Brufau
4ee7a34f32
layout: Unify logic for laying out replaced and non-replaced in a BFC (#37864)
The logic for laying out block-level replaced elements wasn't taking
floats into account when resolving a `stretch` inline size. By handling
them with the same logic as non-replaced elements, we fix that problem,
and reduce the amount of code.

Testing: Adding new tests
Fixes: #37861

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-04 17:47:40 +00:00
dependabot[bot]
72b1331949
build(deps): bump cc from 1.2.27 to 1.2.28 (#37884)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.27 to 1.2.28.
<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.28</h2>
<h3>Other</h3>
<ul>
<li>Recognize <code>mlibc</code> environment (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1488">#1488</a>)</li>
<li>Fix clippy warnings about not using variables in
<code>format!</code> strings (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1489">#1489</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.27...cc-v1.2.28">1.2.28</a>
- 2025-07-04</h2>
<h3>Other</h3>
<ul>
<li>Recognize <code>mlibc</code> environment (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1488">#1488</a>)</li>
<li>Fix clippy warnings about not using variables in
<code>format!</code> strings (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1489">#1489</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8f0143a5fb"><code>8f0143a</code></a>
chore: release v1.2.28 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1491">#1491</a>)</li>
<li><a
href="6f0dd80fa3"><code>6f0dd80</code></a>
Recognize <code>mlibc</code> environment (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1488">#1488</a>)</li>
<li><a
href="d3c85ef947"><code>d3c85ef</code></a>
Fix clippy warnings about not using variables in <code>format!</code>
strings (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1489">#1489</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.27...cc-v1.2.28">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.27&new-version=1.2.28)](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-04 17:23:53 +00:00
sagudev
da81fd1b76
Support WPT subsuites in agregating and flake detection (#37584)
Handle subsuites in wpt flake detection and aggregation as outlined in
https://github.com/servo/servo/issues/37319#issuecomment-2969528022.
Based on #37540.

Testing: Manual CI run with vello_canvas subsuite:
https://github.com/sagudev/servo/actions/runs/16021200215

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-04 16:58:42 +00:00
sagudev
b57c9acc65
canvas: Join Path and PathBuilder into Path (#37842)
Dealing with both path and builder makes code complicated and this is
backend internal specific anyway (we often do conversions between the
two just so we get specific functionality). Now I joined both into
single abstractions `Path`, that has all what one needs and let raqote
backend deal with path/pathbuilder coversions.

Motivation: Simplification and in Vello there is only
[BezPath](https://docs.rs/kurbo/0.11.2/kurbo/struct.BezPath.html) so we
use it as both path and pathbuilder.

Reviewable per commit.

Testing: Existing WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-04 16:32:20 +00:00
batu_hoang
940eff9497
Move webdriver actions commands to servoshell (#37669)
Move webdriver actions commands to servoshell.

Testing: Test with webdriver enable in the CI
[Test result
1](https://github.com/longvatrong111/servo/actions/runs/15875355256)
[Test result
2](https://github.com/longvatrong111/servo/actions/runs/15875356595)
[Test result
3](https://github.com/longvatrong111/servo/actions/runs/15875361886)

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

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-04 16:29:38 +00:00
Andrei Volykhin
9bd8d4f026
canvas: Add OffscreenCanvas 'transferToImageBitmap' method (#37880)
Follow the HTML speficication and add missing 'transferToImageBitmap'
method to OffscreenCanvas interface.

https://html.spec.whatwg.org/multipage/#dom-offscreencanvas-transfertoimagebitmap

Testing: Improvements in the following tests
- html/canvas/offscreen/compositing/2d.composite.grid*
- html/canvas/offscreen/fill-and-stroke-styles/2d.gradient*
- html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas*
- html/canvas/offscreen/reset/2d.reset*
- html/canvas/offscreen/text/2d.text*

Fixes (partially): #34111

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-04 16:25:36 +00:00
Euclid Ye
70b0fb840e
embedder: Improve documentation for various places that talk about "available screen size" (#37879)
Testing: Just add comment. It turns out difficult to achieve, see
https://github.com/rust-windowing/winit/issues/2494.
Fixes: Nothing. Provide some guidance to #37878

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-04 16:05:01 +00:00
Euclid Ye
a81ddd5c18
Rename original window_resizeTo.html to window_resize_event.html & Fix wrong usage of innerHeight & add new test (#37856)
1. rename original `window_resizeTo.html` to `window_resize_event.html`
to reflect the purpose. Also change {innerWidth, innerHeight} to
{outerWidth, outerHeight} to match spec.
2. Add a new test `window_resizeTo.html` for
https://github.com/servo/servo/pull/37848

Testing: new test always fails because of
https://github.com/servo/servo/issues/37824, which gives inaccurate
outerHeight.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-04 15:41:11 +00:00
JoeDow
19ceccc8eb
layout: Add incremental box tree construction for inline floats and abspos (#37868)
This changes extend the incremental box tree construction for inline
out-of-flow-box, including the
`InlineItem::OutOfFlowAbsolutelyPositionedBox` and
`InlineItem::OutOfFlowFloatBox`.

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

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-07-04 14:30:00 +00:00
Jerens Lensun
5eb7c397fe
Mergeruff.toml into pyproject.toml (#37741)
add a pyproject.toml config file that includes the settings for ruff

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-04 12:21:48 +00:00
Jerens Lensun
b9347bf302
Remove cargo-update, update-cargo, grep, ndk-stack, and ndk-gdb mach commands (#37874)
Remove some seldomly used `mach commands:

- `ndk-stack` and `ndk-gdb`: These commands have bit rotted completely,
so need to be reimplemented. Remove them for now to make them less
confusing.
- `cargo-update` / `update-cargo`: This command just calls `cargo`
directly so isn't really necessary.
- `grep`: There are much better grep tools now such as `rg` that make
these kind of special-cases obsolete. In addition, we can improve the
default behavior of `git grep` by using the git attributes feature.

These commands are being removed in order to implement Python type
checking the Servo repository.

Testing: This just removes some mach command so shouldn't need tests.

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-04 11:36:33 +00:00
JoeDow
75e5c1bced
layout: Add incremental box tree construction for inline atomics (#37866)
This changes extend the incremental box tree construction for inline
atomic

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

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-07-04 10:54:54 +00:00
Euclid Ye
291b42f6e9
servoshell: Set dom_testing_html_input_element_select_files_enabled when WebDriver is enabled (#37873)
Testing:
`.\tests\wpt\tests\webdriver\tests\classic\execute_script\collections.py`
can now run to the end when running either locally or `try`.
Fixes: #37870

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-04 10:02:41 +00:00
Fuguo
fe7aa91235
compositor|script: Update script's active_touch_points when hit tests on compositor fail (#37779)
[RootCause]:Tochdown executes normally, but touchup fails during hittest
and does not send a touchup event to the script, causing the script to
save an incorrect number of active_touch_points. The application
receives an incorrect event.touches.length, causing a logic error and
preventing the carousel from sliding.
[Solution]:
When hit test on compositor fails, we also need to send the
EmbedderToConstellationMessage::ForwardInputEvent message to
constellation. In the script's handle_touch_event, if it exits early, we
also need to update active_touch_points.

Testing: 
Fixes: #37763

---------

Signed-off-by: kongbai1996 <1782765876@qq.com>
2025-07-04 09:57:24 +00:00
JoeDow
068406ee6e
Layout: Continue support incremental box tree reconstruction for flex&taffy level box (#37854)
Layout: Continue support incremental box tree reconstruction for
flex&taffy level box

This change reuse the flex/taffy level box from old box slot if the box
slot is valid and there is no LayoutDamage to the element.

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

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-07-04 09:35:09 +00:00
Jan Varga
934b3341d7
storage: Isolate sessionStorage per top-level browsing context and copy sessionStorage when creating a new auxiliary browsing context (#37803)
This pull request introduces changes to the storage subsystem to:
- Isolate sessionStorage per top-level browsing context (WebViewId), in
  addition to origin.
- Copy sessionStorage when creating a new auxiliary browsing context
without
  noopener, as required by the corresponding spec
 
These changes bring Servo closer to spec compliance, matching expected
browser
behavior.

Testing: This work affects observable behavior. As a result, some
previously
failing WPT tests now pass. No new tests are added, since the behavior
is
already covered by existing web-platform-tests.

Fixes: #21291

---------

Signed-off-by: Jan Varga <jan.varga@gmail.com>
2025-07-04 09:15:12 +00:00
Euclid Ye
aaf04883dd
servoshell: Make fn request_resize resize window w.r.t. outer_size accurately (#37848)
`toolbar_height` is already part of `inner_size`, caused wrongly
calculated `outer_size`. Even worse, it tried to `request_inner_size`
with the already wrong `outer_size`.

This PR make sure resize is accurate by first calculate the title/border
height, and then compute the `inner_size` for `request_inner_size`. This
is necessary because no direct `request_outer_size` is available.

Testing: As manually tested, set window size WebDriver command no longer
overshoot. This is also shared by
[window.resizeTo](https://drafts.csswg.org/cssom-view/#dom-window-resizeto)
JS method. WPT test would be necessary. (But that one is intermittent
TIMEOUT. So created new one in
https://github.com/servo/servo/pull/37856)
 
WebDriver test will be postponed after
https://github.com/web-platform-tests/wpt/pull/53421 is merged and
synced to Servo.

Fixes: Task 3 of https://github.com/servo/servo/issues/37804

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-04 08:10:58 +00:00
Kenzie Raditya Tirtarahardja
a990ff82b9
Webdriver: Implement calculate the absolute position for Get Element Rect (#37847)
Implementing [calculate the absolute
position](https://w3c.github.io/webdriver/#dfn-calculate-the-absolute-position)
and make [Get Element
Rect](https://w3c.github.io/webdriver/#get-element-rect) conforms the
spec .

Testing: Covered in webdriver WPT, especially for pointer test that
needs to find the element rect.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-04 07:22:29 +00:00
Simon Wülker
13eeb29878
Don't explicitly handle dirty roots that are shadow roots (#37862)
Dirty roots are never shadow roots, since we use the flat tree for
invalidation. The flat tree does not contain shadow roots.

Reverts https://github.com/servo/servo/pull/35132. When that patch was
submitted we used the DOM tree for invalidation, so it was possible to
encounter shadow roots.

Testing: Covered by
`shadow-dom/untriaged/events/event-dispatch/test-003.html`

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-07-04 07:11:04 +00:00
Simon Wülker
a6b27c5078
Don't increment node revision twice when attaching shadow root to element (#37865)
`Node::dirty` already increments the version. `Node::rev_version`
traverses all ancestors, so it can end up being fairly expensive.

Testing: I'm not sure about WPT coverage but I think this change is
trivial enough to merge without tests.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-07-04 07:10:06 +00:00
Jason Tsai
cf408f7302
refactor(webdriver): move webdriver_port option to servoshell pref (#37867)
Move `webdriver_port` option from servo config options to servoshell
preference.

Testing: run `./mach run` with/without `--webdriver` option and see if
the webdriver server runs on the port (default: 7000)
Fixes: https://github.com/servo/servo/issues/37843

Signed-off-by: Jason Tsai <git@pews.dev>
2025-07-04 07:04:49 +00:00
Andrei Volykhin
6ba54e4d79
canvas: Add OffscreenCanvas 'convertToBlob' method (#37786)
Follow the HTML speficication and add missing 'convertToBlob' method
to OffscreenCanvas interface.

https://html.spec.whatwg.org/multipage/#dom-offscreencanvas-converttoblob

Testing: Improvements in the following tests
-
html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob*
-
html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html

Fixes: #24272

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-04 06:58:12 +00:00
dependabot[bot]
3ba5b89ef2
build(deps): bump async-channel from 2.3.1 to 2.4.0 (#37858)
Bumps [async-channel](https://github.com/smol-rs/async-channel) from
2.3.1 to 2.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/async-channel/releases">async-channel's
releases</a>.</em></p>
<blockquote>
<h2>v2.4.0</h2>
<ul>
<li>Add <code>Sender::same_channel()</code> and
<code>Receiver::same_channel()</code>. (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/98">#98</a>)</li>
<li>Add <code>portable-atomic</code> feature to support platforms
without atomics. (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/106">#106</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/async-channel/blob/master/CHANGELOG.md">async-channel's
changelog</a>.</em></p>
<blockquote>
<h1>Version 2.4.0</h1>
<ul>
<li>Add <code>Sender::same_channel()</code> and
<code>Receiver::same_channel()</code>. (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/98">#98</a>)</li>
<li>Add <code>portable-atomic</code> feature to support platforms
without atomics. (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/106">#106</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c250f2822a"><code>c250f28</code></a>
Release 2.4.0 (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/108">#108</a>)</li>
<li><a
href="c950c6e781"><code>c950c6e</code></a>
Fix description of <code>recv_blocking</code> (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/107">#107</a>)</li>
<li><a
href="9a963172f0"><code>9a96317</code></a>
Support portable atomic (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/106">#106</a>)</li>
<li><a
href="3ce79379bc"><code>3ce7937</code></a>
Fix clippy::needless_lifetimes warning</li>
<li><a
href="e4132e3d9b"><code>e4132e3</code></a>
ci: Use reusable workflows for fmt and security_audit</li>
<li><a
href="43459d1818"><code>43459d1</code></a>
ci: Use &quot;v2.0.0&quot; branch for audit check</li>
<li><a
href="1623170abe"><code>1623170</code></a>
Fix grammar in description of <code>WeakSender</code> and
<code>WeakReceiver</code></li>
<li><a
href="74b2c749c3"><code>74b2c74</code></a>
Add example usage for fn same_channel in Sender and Receiver</li>
<li><a
href="681541ab63"><code>681541a</code></a>
Add a fn to check if two senders or two receivers use the same
underlying cha...</li>
<li>See full diff in <a
href="https://github.com/smol-rs/async-channel/compare/v2.3.1...v2.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-channel&package-manager=cargo&previous-version=2.3.1&new-version=2.4.0)](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-03 17:31:58 +00:00
dependabot[bot]
59cff375e3
build(deps): bump zune-jpeg from 0.4.18 to 0.4.19 (#37857)
Bumps [zune-jpeg](https://github.com/etemesi254/zune-image) from 0.4.18
to 0.4.19.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/etemesi254/zune-image/releases">zune-jpeg's
releases</a>.</em></p>
<blockquote>
<h2>v0.1.0</h2>
<p>No release notes provided.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/etemesi254/zune-image/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zune-jpeg&package-manager=cargo&previous-version=0.4.18&new-version=0.4.19)](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-03 17:15:53 +00:00
Oriol Brufau
95d85f96a4
layout: Add incremental box tree construction for table column (#37851)
This change extends incremental box tree updates to table columns.

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

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-03 15:40:52 +00:00
sagudev
a631b42e60
pixels: Ensure expected formats when accesing bytes of snapshot (#37767)
I introduced snapshot in #36119 to pack raw bytes and metadata together,
now we take the next step and require for user to always specify what
kind of byte data they want when calling `as_bytes` or `to_vec`
(basically joining transform and data). There are also valid usages when
one might require just one property of bytes (textures can generally
handle both RGBA and BGRA). There are also valid usages of using just
raw bytes (when cropping). This PR tries to make such usages more
obvious.

This will make it easier to fix stuff around 2d canvas (we do not want
to assume any bytes properties in abstraction).

Testing: Code is covered by WPT tests.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-03 15:02:41 +00:00
Michael Mc Donnell
e3baec4807
servoshell: Select address bar text on click (#37839)
In Firefox, clicking on the address bar selects all the text. This makes
Servo to do the same. I reworked the code so that the shortcut only
changes the focus. That means that either clicking or the shortcut
changes the focus which in turn selects the text.

Testing: I tested it manually by clicking in the address bar and using
the shortcuts and noticing that the text was selected.

Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
2025-07-03 14:04:02 +00:00
Narfinger
ca47cc2fa3
Add a basic caching mechanism for ImageKeys. (#37369)
This creates a new method in shared/compositing/lib to generate image
keys that are send over the webview. This does not immediately return
the keys but goes over the constellation to receive the keys from the
IOCompositor. To make this more efficient, we now cache the keys in
image_cache in a simple FIFO order. The old blocking method stays intact
for now but got renamed to make the blocking clear.
The blocking calls that are left are in:
- `components/canvas/canvas_data.rs`
- `components/script/dom/htmlmediaelement.rs`

Testing: WPT tests should cover this as this doesn't change any
functionality.
Fixes: Was mentioned in
https://github.com/servo/servo/issues/37161#issuecomment-2915750051 and
part of https://github.com/servo/servo/issues/37086

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-07-03 13:16:43 +00:00
Martin Robinson
89bfa26f00
libservo|compositor: Have scroll offset directionality match that of WebRender and the web (#37752)
Previously, our Servo-specific spatial tree scroll offsets were opposite
to
that of WebRender and also the web platform. This is due to the fact,
likely, that `winit` wheel directionality is also flipped. This change
has both the Servo spatial tree and the API take offsets that are
consistent with the web.

Any possible changes to the meaning of wheel directionality will be
handled in a followup change.

This is a breaking change to the Servo API.

Testing: This change updates unit tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-03 13:04:06 +00:00
Oriol Brufau
d33d057763
layout: Add incremental box tree construction for table cell (#37850)
This change extends incremental box tree updates to table cells. In
addition, for simplicity this refactors `BoxSlot::take_layout_box()`
into `BoxSlot::take_layout_box_if_undamaged()`.

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

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-03 12:06:31 +00:00
Euclid Ye
06cc4bdae7
layout: Ensure that the last transition for a property take precedence (#37176)
This change bumps stylo to servo/stylo#214, to fix an issue where
transition
properties defined earlier on the list of transitions were taking
preference over
those defined later.

Testing: This fixes a couple WPT tests.
Fixes: #37164

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-03 11:28:14 +00:00
Martin Robinson
82f7f761d9
layout: Add incremental box tree construction for table caption (#37849)
This change extends incremental box tree updates to table captions. In
addition, calls to `LayoutBox::invalidate_cached_fragment()` are moved
to the damage calculation traversal.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-03 10:32:05 +00:00
Oriol Brufau
00472dec8e
layout: Implement list-style-position quirk (#37837)
In quirks mode, the ::marker of a bare `<li>` should be
`list-style-position: inside`,

Testing: Some WPT improvement

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-03 09:16:54 +00:00
Martin Robinson
6dafeb7a59
layout: Add a first pass at incremental box tree construction (#37751)
This change:

- Adds a new type of LayoutDamage that signifies that a box needs its
  children recollected, because one or more of them need to be rebuilt.
- During restyle damage propagation, propagate this new damage upward in
  the tree. Then box tree construction should be able to preserve any
  still-valid box tree nodes from box slots.
- During BlockLevelBox job finalization, if a box slot is valid and
  there is not LayoutDamage to the element, use the old box slot,
  ensuring that its fragment cache is invalidated.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: coding-joedow <ibluegalaxy_taoj@163.com>
2025-07-03 08:13:20 +00:00
Michael Mc Donnell
9aa06b2c17
Fix DBus warning when running mach (#37818)
I get the following warning message I run ./mach build:
```console
Could not generate notification: No module named 'dbus'
```

I asked in the Zulip chat[1] if anyone was still using the feature and
it sounds like most people do not use it anymore. It has been broken a
while too and no one has stepped up to fix it.

Gnome Terminal will automatically show a notification when a long
running command is done. Some other terminals can also be configured to
automatically show a notification when a long running command is done.

I think it is safe to remove the feature.

[1]
https://servo.zulipchat.com/#narrow/channel/263398-general/topic/DBus.20warning.20when.20running.20.60.2E.2Fmach.20build.60

Testing: I manually tested it on Linux by running ./mach bootstrap
followed by ./mach build

Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
2025-07-02 23:17:01 +00:00
dependabot[bot]
6e8a0518d7
build(deps): bump tokio from 1.45.1 to 1.46.0 (#37835)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.45.1 to 1.46.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tokio/releases">tokio's
releases</a>.</em></p>
<blockquote>
<h2>Tokio v1.46.0</h2>
<h1>1.46.0 (July 2nd, 2025)</h1>
<h3>Fixed</h3>
<ul>
<li>net: fixed <code>TcpStream::shutdown</code> incorrectly returning an
error on macOS (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7290">#7290</a>)</li>
</ul>
<h2>Added</h2>
<ul>
<li>sync: <code>mpsc::OwnedPermit::{same_channel,
same_channel_as_sender}</code> methods (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7389">#7389</a>)</li>
<li>macros: <code>biased</code> option for <code>join!</code> and
<code>try_join!</code>, similar to <code>select!</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7307">#7307</a>)</li>
<li>net: support for cygwin (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7393">#7393</a>)</li>
<li>net: support <code>pope::OpenOptions::read_write</code> on Android
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7426">#7426</a>)</li>
<li>net: add <code>Clone</code> implementation for
<code>net::unix::SocketAddr</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7422">#7422</a>)</li>
</ul>
<h2>Changed</h2>
<ul>
<li>runtime: eliminate unnecessary lfence while operating on
<code>queue::Local&lt;T&gt;</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7340">#7340</a>)</li>
<li>task: disallow blocking in <code>LocalSet::{poll,drop}</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7372">#7372</a>)</li>
</ul>
<h2>Unstable</h2>
<ul>
<li>runtime: add <code>TaskMeta::spawn_location</code> tracking where a
task was spawned (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7417">#7417</a>)</li>
<li>runtime: removed borrow from <code>LocalOptions</code> parameter to
<code>runtime::Builder::build_local</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7346">#7346</a>)</li>
</ul>
<h2>Documented</h2>
<ul>
<li>io: clarify behavior of seeking when <code>start_seek</code> is not
used (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7366">#7366</a>)</li>
<li>io: document cancellation safety of
<code>AsyncWriteExt::flush</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7364">#7364</a>)</li>
<li>net: fix docs for <code>recv_buffer_size</code> method (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7336">#7336</a>)</li>
<li>net: fix broken link of <code>RawFd</code> in <code>TcpSocket</code>
docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7416">#7416</a>)</li>
<li>net: update <code>AsRawFd</code> doc link to current Rust stdlib
location (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7429">#7429</a>)</li>
<li>readme: fix double period in reactor description (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7363">#7363</a>)</li>
<li>runtime: add doc note that <code>on_*_task_poll</code> is unstable
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7311">#7311</a>)</li>
<li>sync: update broadcast docs on allocation failure (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7352">#7352</a>)</li>
<li>time: add a missing panic scenario of <code>time::advance</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7394">#7394</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/7290">#7290</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7290">tokio-rs/tokio#7290</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7307">#7307</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7307">tokio-rs/tokio#7307</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7311">#7311</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7311">tokio-rs/tokio#7311</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7336">#7336</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7336">tokio-rs/tokio#7336</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7340">#7340</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7340">tokio-rs/tokio#7340</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7346">#7346</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7346">tokio-rs/tokio#7346</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7352">#7352</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7352">tokio-rs/tokio#7352</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7363">#7363</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7363">tokio-rs/tokio#7363</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7364">#7364</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7364">tokio-rs/tokio#7364</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7366">#7366</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7366">tokio-rs/tokio#7366</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7372">#7372</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7372">tokio-rs/tokio#7372</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7389">#7389</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7389">tokio-rs/tokio#7389</a>
<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7393">#7393</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7393">tokio-rs/tokio#7393</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3f1f268583"><code>3f1f268</code></a>
chore: prepare Tokio v1.46.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7437">#7437</a>)</li>
<li><a
href="3e890cc017"><code>3e890cc</code></a>
rt(unstable): add spawn <code>Location</code> to <code>TaskMeta</code>
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7417">#7417</a>)</li>
<li><a
href="69290a6432"><code>69290a6</code></a>
net: derive <code>Clone</code> for <code>net::unix::SocketAddr</code>
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7422">#7422</a>)</li>
<li><a
href="e2b175848b"><code>e2b1758</code></a>
fuzz: cfg fuzz tests under cfg(test) (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7428">#7428</a>)</li>
<li><a
href="b7a75b5be3"><code>b7a75b5</code></a>
net: update <code>AsRawFd</code> doc link to current Rust stdlib
location (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7429">#7429</a>)</li>
<li><a
href="6b705b3053"><code>6b705b3</code></a>
net: allow <code>pipe::OpenOptions::read_write</code> on Android (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7426">#7426</a>)</li>
<li><a
href="3636fd018a"><code>3636fd0</code></a>
net: fix broken link of <code>RawFd</code> in <code>TcpSocket</code>
docs (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7416">#7416</a>)</li>
<li><a
href="2506c9fa99"><code>2506c9f</code></a>
benches: revert &quot;properly gate unix benches&quot; (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7412">#7412</a>)</li>
<li><a
href="b3a14483bf"><code>b3a1448</code></a>
sync: improve docs of <code>tokio_util::sync::CancellationToken</code>
(<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7408">#7408</a>)</li>
<li><a
href="013f323def"><code>013f323</code></a>
docs: add a missing panic scenario of <code>time::advance</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7394">#7394</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.45.1...tokio-1.46.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio&package-manager=cargo&previous-version=1.45.1&new-version=1.46.0)](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-02 16:59:41 +00:00
Oriol Brufau
26f5eb476a
Upgrade Stylo to 2025-07-01 (#37822)
This continues #37444

Changelog:
- No-op change because of https://github.com/servo/stylo/pull/186:
7e2201c32c..0a5440a8af
- Upstream:
0a5440a8af...fe9eadf47b
- Servo fixups:
e8dbccb254...31a2c9cfa9

Stylo tracking issue: https://github.com/servo/stylo/issues/211

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 16:38:58 +00:00
Martin Robinson
19b5e14851
layout: Improve and expand category names for layout profiling (#37833)
This improves naming of layout categories and adds tracing for each
layout phase.

Testing: This just adds / adjusts profiling categories, so doesn't need
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 15:02:56 +00:00
Narfinger
afdd9778e5
OHOS CI: Robustness of speedometer (#37830)
OHOS CI: If speedometer does not finish we currently abort the whole
job.
This fixes this behaviour by adding an emtpy file and continuing the
job.

Runs with errors will now look like this. Notice annotation.
https://github.com/Narfinger/servo/actions/runs/16026933009

Successful run:
https://github.com/Narfinger/servo/actions/runs/16027530625

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Tested on CI.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-02 14:48:47 +00:00
Anatol Ulrich
5f0bbce9d2
bhm: Add backtrace demangling (#37819)
This PR adds backtrace demangling to background hang monitor, thereby
removing a `TODO` in the component source.
The required `rustc-demangle` crate dependency is gated behind
`#[cfg(feature = "sampler")]` as it is my understanding that the
surrounding code is only called when `sampler` is enabled.

Testing: testing was done manually - I suppose a substring match for a
known demangled string could be used for adding a proper test case, and
checking `RUSTFLAGS` to discern whether `v0` demangling should be
expected? Open to suggestions. Manual testing was done by printf
debugging (not part of the PR):

```diff
diff --git a/components/background_hang_monitor/tests/hang_monitor_tests.rs b/components/background_hang_monitor/tests/hang_monitor_tests.rs
index a35ef7bfd..1ebd7d001 100644
--- a/components/background_hang_monitor/tests/hang_monitor_tests.rs
+++ b/components/background_hang_monitor/tests/hang_monitor_tests.rs
@@ -61,6 +61,7 @@ fn test_hang_monitoring() {
     // Check for a permanent hang alert.
     match background_hang_monitor_receiver.recv().unwrap() {
         HangMonitorAlert::Hang(HangAlert::Permanent(component_id, _annotation, _profile)) => {
+            println!("{:?}", _profile);
             let expected = MonitoredComponentId(TEST_PIPELINE_ID, MonitoredComponentType::Script);
             assert_eq!(expected, component_id);
         },
```

here is the output of running the test cases on my Linux (pop!_OS 2024)
system with both legacy mangling (the default) and "v0":


```

❯ cargo test --features background_hang_monitor/sampler --package background_hang_monitor  -- --nocapture                                         
   Compiling background_hang_monitor v0.0.1 (/tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 1.07s
     Running tests/hang_monitor_tests.rs (/tmp/cargo/debug/deps/hang_monitor_tests-2ef5768739c27dd6)

running 6 tests
Some(HangProfile backtrace:
                         - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2649f14f1b1c150d
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/alloc/src/boxed.rs:1993
                         - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb2ade58cb34e1bc4
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/alloc/src/boxed.rs:1993
                         - std::sys::pal::unix:🧵:Thread:🆕:thread_start::ha07e360225fa3528
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/pal/unix/thread.rs:106
                         - core::ops::function::FnOnce::call_once{{vtable.shim}}::hfed2d99b0f690670
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250
                         - std::panicking::try::h72c6a91b66ed940c
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:547
                         - std::panic::catch_unwind::h977d45286c990a5c
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:358
                         - std:🧵:Builder::spawn_unchecked_::{{closure}}::h3e66aedadec0e66b
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:562
                         - __rust_try
                         - std::panicking::try::do_call::h638036fc728c36b1
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:584
                         - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hff781dc648b37712
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272
                         - std:🧵:Builder::spawn_unchecked_::{{closure}}::{{closure}}::h676d8813fe1265ec
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:564
                         - std::sys::backtrace::__rust_begin_short_backtrace::h3225fcf5f71669b6
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:152
                         - background_hang_monitor::background_hang_monitor::HangMonitorRegister::init::{{closure}}::hfdbd05eb9a4d2c1f
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/background_hang_monitor.rs:61
                         - background_hang_monitor::background_hang_monitor::BackgroundHangMonitorWorker::run::h33cc7072a6114a19
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/background_hang_monitor.rs:480
                         - background_hang_monitor::background_hang_monitor::BackgroundHangMonitorWorker::perform_a_hang_monitor_checkpoint::hda50a6aa6d103807
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/background_hang_monitor.rs:562
                         - <background_hang_monitor::sampler_linux::LinuxSampler as background_hang_monitor::sampler::Sampler>::suspend_and_sample_thread::h0bd3d9753717c480
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/sampler_linux.rs:172
                         - backtrace::backtrace::libunwind::trace::h4b1b880a458591ce
                        at /home/ace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.75/src/backtrace/libunwind.rs:117
                         - backtrace::backtrace::trace_unsynchronized::hfdd102bb42227ed3
                        at /home/ace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.75/src/backtrace/mod.rs:66)
test test_hang_monitoring ... ok
test test_hang_monitoring_exit_signal3 ... ok
test test_hang_monitoring_unregister ... ok
test test_hang_monitoring_exit_signal1 ... ok
test test_hang_monitoring_exit_signal4 ... ok
test test_hang_monitoring_exit_signal2 ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.14s
```

```
❯ RUSTFLAGS="-Csymbol-mangling-version=v0" cargo test --features background_hang_monitor/sampler --package background_hang_monitor  -- --nocapture
   Compiling background_hang_monitor v0.0.1 (/tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 1.64s
     Running tests/hang_monitor_tests.rs (/tmp/cargo/debug/deps/hang_monitor_tests-9a8a75f69169c1ff)

running 6 tests
Some(HangProfile backtrace:
                         - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2649f14f1b1c150d
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/alloc/src/boxed.rs:1993
                         - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb2ade58cb34e1bc4
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/alloc/src/boxed.rs:1993
                         - std::sys::pal::unix:🧵:Thread:🆕:thread_start::ha07e360225fa3528
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/pal/unix/thread.rs:106
                         - <<std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1} as core[3b140760090fa97d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250
                         - std[cba35227022cdb8c]::panicking::try::<(), core[3b140760090fa97d]::panic::unwind_safe::AssertUnwindSafe<<std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1}::{closure#0}>>
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:547
                         - std[cba35227022cdb8c]::panic::catch_unwind::<core[3b140760090fa97d]::panic::unwind_safe::AssertUnwindSafe<<std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1}::{closure#0}>, ()>
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:358
                         - <std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_::<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1}
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:562
                         - __rust_try
                         - std[cba35227022cdb8c]::panicking::try::do_call::<core[3b140760090fa97d]::panic::unwind_safe::AssertUnwindSafe<<std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1}::{closure#0}>, ()>
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:584
                         - <core[3b140760090fa97d]::panic::unwind_safe::AssertUnwindSafe<<std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1}::{closure#0}> as core[3b140760090fa97d]::ops::function::FnOnce<()>>::call_once
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272
                         - <std[cba35227022cdb8c]:🧵:Builder>::spawn_unchecked_::<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>::{closure#1}::{closure#0}
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:564
                         - std[cba35227022cdb8c]::sys::backtrace::__rust_begin_short_backtrace::<<background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}, ()>
                        at /home/ace/.rustup/toolchains/1.85.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:152
                         - <background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::HangMonitorRegister>::init::{closure#0}
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/background_hang_monitor.rs:61
                         - <background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::BackgroundHangMonitorWorker>::run
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/background_hang_monitor.rs:480
                         - <background_hang_monitor[5f27e502ead78af0]::background_hang_monitor::BackgroundHangMonitorWorker>::perform_a_hang_monitor_checkpoint
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/background_hang_monitor.rs:562
                         - <background_hang_monitor[5f27e502ead78af0]::sampler_linux::LinuxSampler as background_hang_monitor[5f27e502ead78af0]::sampler::Sampler>::suspend_and_sample_thread
                        at /tmp/aec.25_06_30_20_04_42.P8A/servo/components/background_hang_monitor/sampler_linux.rs:172
                         - backtrace[ecf2c71ec589035a]::backtrace::libunwind::trace
                        at /home/ace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.75/src/backtrace/libunwind.rs:117
                         - backtrace[ecf2c71ec589035a]::backtrace::trace_unsynchronized::<<background_hang_monitor[5f27e502ead78af0]::sampler_linux::LinuxSampler as background_hang_monitor[5f27e502ead78af0]::sampler::Sampler>::suspend_and_sample_thread::{closure#0}>
                        at /home/ace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.75/src/backtrace/mod.rs:66)
test test_hang_monitoring ... ok
test test_hang_monitoring_exit_signal1 ... ok
test test_hang_monitoring_exit_signal4 ... ok
test test_hang_monitoring_exit_signal3 ... ok
test test_hang_monitoring_exit_signal2 ... ok
test test_hang_monitoring_unregister ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.13s
```

---------

Signed-off-by: Anatol Ulrich <e+github@mail.taugt.net>
Co-authored-by: Anatol Ulrich <e+github@mail.taugt.net>
2025-07-02 13:39:36 +00:00
Martin Robinson
647122d0f6
layout: Stop using Rayon in single-threaded mode (#37832)
In layout, some parts of the code were still using parallel iterators
from Rayon even when single-thread layout was activated. This change
modifies those parts to use non-parallel iterators when
`LayoutContext::use_rayon` is not active.

Testing: It's very hard to make an automated test for this, but I've
manually
verified this by building with tracing and observing that layout runs
only on
a single thread now when loading https://servo.org.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-02 12:44:43 +00:00
Oriol Brufau
da364f7a61
script: Remove the quirk of flooring rowSpan by 1 (#37831)
Only Firefox has this quirk, Chrome and Safari don't. So it's simpler to
just remove it.

Testing: tested by WPT

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 12:16:28 +00:00
Euclid Ye
94f35ba998
webdriver: Get the window position as well as the size when resolving "Get Window Rect" (#37812)
1. Rename `GetWindowSize` to `GetWindowRect`
2. Return the WindowRect in device pixels correctly. Previously, it
returns `(0, 0, ScreenWidth, ScreenHeight)` which is a static value.
3. Add `fn window_rect` to `WindowPortsMethods`. Implement it for both
Headless Window and Headed Window.

Testing: Tested manually with powershell script. Result is now dynamic
and reflects the truth.
Fixes: Task 1 & 2 of https://github.com/servo/servo/issues/37804

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-02 10:01:27 +00:00
Oriol Brufau
95d9d3a412
script: Only enforce rowSpan >= 1 in actual quirks mode (#37820)
We were also enforcing that in limited-quirks mode, but no other browser
does that. In fact, Blink and WebKit don't have this quirk at all, so we
should consider removing it too, but for now restrict it to quirks mode
like Firefox.

Testing: adding new tests
Part of #37813

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 09:52:00 +00:00
Andrei Volykhin
4cbadde144
htmlimageelement: Reject decode promises on the current request mutation (#37828)
Follow the HTML specification and reject the pending image decode
promises
on any current request mutation.
https://html.spec.whatwg.org/multipage/#updating-the-image-data (step
18)
https://html.spec.whatwg.org/multipage/#dom-img-decode (step 3)

Fulfill and reject image decode promises by queueing
a global tasks on the DOM manipulation task source.

Testing: Improvements in the following tests
- html/semantics/embedded-content/the-img-element/decode/*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-02 09:29:47 +00:00
Kenzie Raditya Tirtarahardja
45fb0bac82
webdriver: enable getting closed shadow root (#37826)
Previously, when getting element shadow root, we are using
[GetShadowRoot](https://dom.spec.whatwg.org/#dom-element-shadowroot).
This is a getter which only allows javascript to access shadow root with
`open` mode.

In [webdriver
spec](https://www.w3.org/TR/webdriver2/#dfn-get-element-shadow-root),
particularly step 5, it seems that they imply for us to get the shadow
root without going through the above getter.

P.S. Other browser seems to also allows getting closed shadow root, like
Chromium here:
https://chromium-review.googlesource.com/c/chromium/src/+/5923865.

Testing: Covered in webdriver WPT test that access closed shadow root.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-02 08:51:50 +00:00
sagudev
944713ddd0
canvas: use Transform2D instead of Transform3D when possible (#37759)
While this makes our implementation deviate slightly from the
specification, this clarifies an invariant with the code itself. This
helps to resolve some confusion as seen in
https://github.com/servo/servo/issues/37695#issuecomment-3013823350.

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

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-02 08:44:56 +00:00
Simon Wülker
e2ad9c14c6
deps: Bump html5ever and friends to version 0.35.0 (#37736)
Companion PR for https://github.com/servo/html5ever/pull/637.

Testing: Covered by existing web platform tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-07-02 08:44:39 +00:00
Andrei Volykhin
d0579256bb
canvas: Unify retrieving image data from the HTMLImageElement (#37809)
Currently, HTMLImageElement uses as an image source
(ImageBitmapSource, CanvasImageSource, TexImageSource)
in various canvas2D/WebGL operations, and there is a small
inconsistency in how we get the image data of the 'img' element:
usability checking and retrieving the image data from the image cache.

To simplify and avoid state inconsistency between the window's image
cache and the 'img' element, let's retrieve the image data (as a raster)
from the HTMLImageElement itself.

Testing: No expected changes in testing results, except the
'drawimage_svg_image_with_foreign_object_does_not_taint.html'
which is 'false' passed because drawing of the non supported vector
image
is silently skip instead of throwing the 'InvalidState' exception
anymore.

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-02 08:13:30 +00:00