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>
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 />
[](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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
`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>
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>
`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>
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>
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>
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 "v2.0.0" 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 />
[](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>
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 />
[](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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>