This clarifies the units for scrolling:
- `f32` is used for internal Servo scrolling APIs as that is the unit
used in WebRender.
- `f64` is used for the web-exposed scrolling APIs as that is what the
WebIDL code generator gives us.
Conversions are done consistently at the boundaries of the two APIs.
In addition, web-exposed scrolling methods are refactored a bit to more
closely follow the specification text. In addition, specification text
is added to those methods so that it is clearer that we are following
it.
Testing: This should not change behavior and is thus covered by existing
tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
There were still some accesses to the inner BrowsingContextId from the
WebViewId. This changes it to completely rely on the From trait for
these methods. This also means we can make the field private.
For testing we add a way to create arbitrary WebViewIds.
Testing: Does not change functionality.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Implements more of calculate_box_size, ensuring that the proper
rectangle is returned when the border box is requested.
Testing: WPT
Fixes: Partially #38811
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Jo Steven Novaryo <65610990+stevennovaryo@users.noreply.github.com>
We were performing a structured clone but throwing away any serializable
DOM interfaces included in the result. We need to instead serialize the
full structured clone result so we can deserialize the DOM interfaces
when getting the data out of the object store.
Testing: Existing WPT coverage is sufficient.
Fixes: #38818Fixed: #38842
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
With incremental layout adding a restyle to a node isn't enough to force
its layout to update. We also need to explicitly mark the node as dirty
so that its contents are updated when layout is run. This change makes
this consistent for all node state changes. This might be a bit too
conservative as all node state may not affect layout, but should catch
issues in the future.
Testing: This is very hard to test as it requires moving the mouse over
the
WebView, and the moving it away, and then testing the rendered contents.
This
kind of coordination would be difficult to manage with unit tests.
Fixes: #38989.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
The steps were incorrectly numbered, this PR fixes that and copies over
the description of each step.
Testing: None, just expanding on the comments/fixing the step numbering
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Since WebDriver is quite stable now, enable the `webdriver/classic`
tests on wpt CI.
---------
Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
Rework the flow of code in `Element:scroll_into_view_with_options` to
more closely follow the specification. This also simplifies the code a
bit and adds some TODOs about future improvements.
Testing: This should not change behavior and is thus covered by existing
tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
It was originally throwing a TypeError, which was making WPT fail.
Testing: Many happy WPT subtests
Fixes: #39050
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Sam <16504129+sagudev@users.noreply.github.com>
Uses clipped time to convert dates that are stored as `f64`s into JS
values.
Testing: WPT
Fixes: #25327
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This makes future implementations easier where we will reuse most of
this code to parse Link headers.
Part of #35035
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Instead of panicking when doing a geometry script query on a node with
an uninvertible transform, return a zero-sized rectangle at the
untransformed position. This is similar to what Gecko and Blink do
(though it seems there are some differences in positioning this
zero-sized rectangle). Mostly importantly, do not panic.
Testing: This change adds a new WPT crash test.
Fixes: #38848.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This will complete the type annotation on `codegen.py` so we can safely
remove the ignore from `pyproject` configurataion
---------
Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Move the construction of hit test items for scroll nodes to the display
list construction stage. This way they respect the `z-index` of their
originating fragments and stacking context ordering in general.
Testing: We currently do not have great testing for this as this tests
the combination of hit testing of input events and scrolling at that
point. The completion of WebDriver support should make this easier to
test.
Fixes: #38967
Signed-off-by: coding-joedow <ibluegalaxy_taoj@163.com>
Co-authored-by: kongbai1996 <1782765876@qq.com>
This PR **removes** `ScriptToConstellationMessage::ForwardToEmbedder`,
and replaces it with an explicit `ScriptToEmbedderChannel`. This new
channel is based on `GenericCallback` and in single-process mode will
directly send the message the to the embedder and wake it. In
multi-process mode, the message is routed via the ROUTER, since waking
is only possible from the same process currently. This means in
multi-process mode there are likely no direct perf benefits, since we
still need to hop the message over the ROUTER (instead of over the
constellation).
In single-process mode we can directly send the message to the embedder,
which should provide a noticable latency improvement in all cases where
script is blocked waiting on the embedder to reply.
This does not change the way the embedder receives messages - the
receiving end is unchanged.
## How was sending messages to the embedder working before?
1. Script wraps it's message to the embedder in
`ScriptToConstellationMessage::ForwardToEmbedder` and sends it to
constellation.
2. The [constellation event loop] receives the message in
[handle_request]
3. If deserialization fails, [an error is logged and the message is
ignored]
4. Since our message came from script, it is handle in
[handle_request_from_script]
5. The message is logged with trace log level
6. If the pipeline is closed, [a warning is logged and the message
ignored]
7. The wrapped `EmbedderMsg` [is forwarded to the embedder]. Sending the
message also invokes `wake()` on the embedder eventloop waker.
[constellation event loop]:
2e1b2e7260/components/constellation/constellation.rs (L755)
[handle request]:
2e1b2e7260/components/constellation/constellation.rs (L1182)
[an error is logged and the message is ignored]:
2e1b2e7260/components/constellation/constellation.rs (L1252)
[handle_request_from_script]:
https://github.com/servo/servo/blob/main/components/constellation/constellation.rs#L1590
[a warning is logged and the message ignored]:
2e1b2e7260/components/constellation/constellation.rs (L1599)
[is forwarded to the embedder]:
2e1b2e7260/components/constellation/constellation.rs (L1701)
Testing: Communication between Script and Embedder is extensive, so this
should be covered by existing tests.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Adding an optional message to be attached to a SyntaxError. Unblocks
#39050.
The enum definition of Syntax is now `Syntax(Option<String>)`. Future
PRs should probably add more appropriate messages to some of the
`Syntax(None)`s.
Testing: Just a refactor
Fixes: Partially #39053
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Absolutely positioned elements get blockified, but their static position
still depends on the original display. Therefore, if we encounter an
abspos with an inline-level original display, we will now ensure that
it's handled in an inline formatting context. This way its static
position will correctly take into account things like `text-align`.
Testing: Several WPT tests are now passing.
Fixes: #39017
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Migrate `ServiceWorkerMsg` and `SWManagerMsg` to GenericChannel
Testing: Covered by service worker wpt tests
Part of #38912
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Use the new GenericCallback abstraction for serviceworker job results.
Testing: Covered by service worker wpt tests
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
It's expected that script queries be able to interact with collapsed
table rows and columns, so this change starts laying them out. They
still do not affect table dimensions, nor are they painted.
This does not fix all interaction with collapsed rows and columns. For
instance, setting scroll offsets of contained scrolling nodes does not
work properly. It does fix the panic though, which is the most important
thing.
Testing: this change includes a new WPT crash test.
Fixes: #37421.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
In #37410 for webdriver mode, we introduced mechanism to keep program
alive when all webview are closed to comply with spec. But the test
fails with 90% probability, as the `browsing_context` is only registered
in constellation's `browsing_contexts` map when documents are ready.
This PR waits for navigation to complete without verifying browsing
context existence (as it's guaranteed from context) in this special case
by refactoring existing code.
Testing:
4571cc1b3b/tests/wpt/tests/webdriver/tests/classic/close_window/close.py (L87)
is no longer flaky. Previously, it has 90% probability to fail. Now it
always pass.
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Implement raw export of HMAC keys. JWT export of HMAC keys will come in
a separate PR.
Testing: WPT
Fixes: Partially #39060
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Phantom line boxes should be treated as non-existing for most purposes,
so don't let them affect the baseline of their block container.
Testing: An existing test passes, and also adding a new one which
doesn't rely on `<button>`
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Bumps [getopts](https://github.com/rust-lang/getopts) from 0.2.23 to
0.2.24.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/getopts/releases">getopts's
releases</a>.</em></p>
<blockquote>
<h2>v0.2.24</h2>
<h3>Other</h3>
<ul>
<li>Make unicode-width an optional default dependency (<a
href="https://redirect.github.com/rust-lang/getopts/pull/133">#133</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/getopts/blob/master/CHANGELOG.md">getopts's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/getopts/compare/v0.2.23...v0.2.24">0.2.24</a>
- 2025-08-29</h2>
<h3>Other</h3>
<ul>
<li>Make unicode-width an optional default dependency (<a
href="https://redirect.github.com/rust-lang/getopts/pull/133">#133</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="40846923f0"><code>4084692</code></a>
chore: release v0.2.24 (<a
href="https://redirect.github.com/rust-lang/getopts/issues/134">#134</a>)</li>
<li><a
href="03ce599970"><code>03ce599</code></a>
Make unicode-width an optional default dependency (<a
href="https://redirect.github.com/rust-lang/getopts/issues/133">#133</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/getopts/compare/v0.2.23...v0.2.24">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 [time](https://github.com/time-rs/time) from 0.3.41 to 0.3.42.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.42</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.42 [2025-08-31]</h2>
<h3>Added</h3>
<ul>
<li><code>Time::duration_until</code></li>
<li><code>Time::duration_since</code></li>
<li><code>per_t</code> method for all types in
<code>time::convert</code>. This is similar to the existing
<code>per</code> method, but
can return any of the primitive numeric types that can represent the
result. This will cut down on
<code>as</code> casts while ensuring correctness. Type inference isn't
perfect, so you may need to provide a
type annotation in some situations.</li>
<li><code>impl PartialOrd for Month</code> and <code>impl Ord for
Month</code>; this assumes the months are in the same year</li>
<li><code>SystemTimeExt</code> trait, adding methods for checked
arithmetic with <code>time::Duration</code> and obtaining
the difference between two <code>SystemTime</code>s as a
<code>time::Duration</code></li>
<li>Permit using <code>UtcDateTime</code> with <code>rand</code> (this
was inadvertently omitted previously)</li>
<li><code>impl core::error::Error</code> for all error types (now
available when the <code>std</code> feature is disabled)</li>
<li>MacOS can now obtain the local UTC offset in multi-threaded programs
as the system APIs are
thread-safe.</li>
<li><code>#[track_caller]</code> has been added to all relevant
methods.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>The minimum supported Rust version is now 1.81.0.</li>
<li>The dependency on <code>itoa</code> has been removed, as the
standard library now has similar functionality
by default.</li>
<li>Formatting a component that involves a floating point number is now
guaranteed to be
deterministic, avoiding any subtle differences between platforms or
compiler versions.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Serializing timestamps with nanosecond precision <em>should</em>
always emit the correct value.
Previously, it could be off by one nanosecond due to floating point
imprecision.</li>
<li>A previously unknown bug in <code>OffsetDateTime::to_offset</code>
and <code>UtcDateTime::to_offset</code> has been
fixed. The bug could result in a value that was invalid. It was unlikely
to ever occur in
real-world code, as it involved passing a UTC offset that has never been
used in any location.</li>
</ul>
<h3>Miscellaneous</h3>
<ul>
<li>The amount of code generated by macros has been massively reduced,
on the order of 65-70% for
typical use cases of <code>format_description!</code>.</li>
<li>Significant performance gains for comparisons of <code>Time</code>,
<code>PrimitiveDateTime</code>, <code>UtcDateTime</code>, and
<code>OffsetDateTime</code>. The first three have gains of approximately
85% (i.e. 6× faster).</li>
<li>Nearly all methods are <code>#[inline]</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ed2852e3b2"><code>ed2852e</code></a>
v0.3.42 release</li>
<li><a
href="1067543c7f"><code>1067543</code></a>
Fix copied comment</li>
<li><a
href="f45bff514c"><code>f45bff5</code></a>
Use <code>const</code> block for readability</li>
<li><a
href="b38c118d3d"><code>b38c118</code></a>
Add <code>#[inline]</code> to most methods</li>
<li><a
href="f410951557"><code>f410951</code></a>
Add <code>#[track_caller]</code> to numerous methods</li>
<li><a
href="d30f3d0f12"><code>d30f3d0</code></a>
Optimize <code>Time::sub</code></li>
<li><a
href="e807ad35ec"><code>e807ad3</code></a>
Add tests, benchmarks</li>
<li><a
href="3fcb83d65f"><code>3fcb83d</code></a>
Optimize <code>OffsetDateTime</code> comparisons</li>
<li><a
href="95db5c3613"><code>95db5c3</code></a>
Optimize UTC offset conversions</li>
<li><a
href="998b26fba5"><code>998b26f</code></a>
Optimize <code>Time::duration_until</code></li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.41...v0.3.42">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
[compression-codecs](https://github.com/Nullus157/async-compression)
from 0.4.29 to 0.4.30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Nullus157/async-compression/releases">compression-codecs's
releases</a>.</em></p>
<blockquote>
<h2>compression-codecs-v0.4.30</h2>
<h3>Other</h3>
<ul>
<li>rm unused dep from async-compression and compression-codecs (<a
href="https://redirect.github.com/Nullus157/async-compression/pull/381">#381</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="74f5eb11ac"><code>74f5eb1</code></a>
chore: release (<a
href="https://redirect.github.com/Nullus157/async-compression/issues/382">#382</a>)</li>
<li><a
href="5072f4a6e3"><code>5072f4a</code></a>
rm unused dep from async-compression and compression-codecs (<a
href="https://redirect.github.com/Nullus157/async-compression/issues/381">#381</a>)</li>
<li>See full diff in <a
href="https://github.com/Nullus157/async-compression/compare/compression-codecs-v0.4.29...compression-codecs-v0.4.30">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
[async-compression](https://github.com/Nullus157/async-compression) from
0.4.29 to 0.4.30.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="74f5eb11ac"><code>74f5eb1</code></a>
chore: release (<a
href="https://redirect.github.com/Nullus157/async-compression/issues/382">#382</a>)</li>
<li><a
href="5072f4a6e3"><code>5072f4a</code></a>
rm unused dep from async-compression and compression-codecs (<a
href="https://redirect.github.com/Nullus157/async-compression/issues/381">#381</a>)</li>
<li>See full diff in <a
href="https://github.com/Nullus157/async-compression/compare/async-compression-v0.4.29...async-compression-v0.4.30">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>
Autoincrementedness was previously being reported as always false. This
PR makes the state become queried from the backend, as the spec
specifies. Additionally this PR ensures the backend correctly handles an
object store which autoincrements.
Testing: WPT
Fixes: None
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This method could iterate all the items in the inline formatting context
that was being created. This patch turns it into a field, replacing
`has_uncollapsible_text_content` (so this doesn't increase memory).
Testing: Not needed, no behavior change
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This output doesn't matter to most developers and testers, and it breaks
`./mach test-speedometer`. Let's hide it by default and add a flag to
opt in.
Testing: No testing for debug output.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This doesn't appear to make a big difference in speedometer results, but
this removes some code from the hot path of creating DomRoot values.
Before: `Score: 30.381097406624708 ± 2.0393225244958018`
After: `Score: 30.344639420871395 ± 1.9359337921154696`
Testing: Existing WPT coverage
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Update x11rb and dedupe windows-targets 0.48.
Testing: No tests for dependency updates.
Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
One commonly encountered mechanism in servo is using ipc channels
together with the router, to register a custom callback to run in the
current process, when receiving a reply.
The new `GenericCallback` abstracts over this, and allows executing an
arbitrary callback in the process of the `GenericCallback` creator. In
multiprocess mode, this internally uses ipc channels and follows the
existing pattern.
In single process mode, we execute the callback directly, which avoids
one call to the router.
Executing the callback still incurs synchronization, since we need to
support cloning the abstraction, and the callback closure may be
`FnMut`. Future work could provide more optimized abstractions for
callbacks that don't have these requirements.
This PR allows applying #38782 again, which was previously reverted in
#38940 due to the lack of custom callback support.
See also the module documentation in `generic_channel/callback.rs`.
Testing: This PR adds unit tests. Also passes the manual testcase from
#38939
Part of #38912
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
These changes add a custom servo:preferences URL that allows modifying
selected preferences at runtime. The goal of this work is to make it
easy to test pages while toggling experimental web platform features,
and support quickly changing the User-Agent header.
Testing: Manually verified that spacex.com loads correctly after
changing the user agent, and that https://polygon.io/ displays grid
elements correctly and no console errors with the experimental prefs
enabled.
Fixes: #35862
<img width="1136" height="880" alt="Screenshot 2025-07-18 at 1 06 23 AM"
src="https://github.com/user-attachments/assets/2d27c321-6ca0-43c3-a347-7bc4b55272df"
/>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
We store a pointer to the ScriptThread singleton for a thread in
thread-local storage. While we don't have yet have profiles pointing to
this TLS access as a hot spot, we can remove a potential performance
footgun without a lot of effort by passing around small pieces of data
that we otherwise need to fetch from the ScriptThread.
Testing: Existing WPT is sufficient
Fixes: part of #37969
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Fixes an issue where clicking to close a dialog didn't redraw the screen
until a key was pressed or the mouse was moved.
Testing: Manual testing.
Fixes: #38968
---------
Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from
0.3.19 to 0.3.20.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tracing/releases">tracing-subscriber's
releases</a>.</em></p>
<blockquote>
<h2>tracing-subscriber 0.3.20</h2>
<p><strong>Security Fix</strong>: ANSI Escape Sequence Injection
(CVE-TBD)</p>
<h2>Impact</h2>
<p>Previous versions of tracing-subscriber were vulnerable to ANSI
escape sequence injection attacks. Untrusted user input containing ANSI
escape sequences could be injected into terminal output when logged,
potentially allowing attackers to:</p>
<ul>
<li>Manipulate terminal title bars</li>
<li>Clear screens or modify terminal display</li>
<li>Potentially mislead users through terminal manipulation</li>
</ul>
<p>In isolation, impact is minimal, however security issues have been
found in terminal emulators that enabled an attacker to use ANSI escape
sequences via logs to exploit vulnerabilities in the terminal
emulator.</p>
<h2>Solution</h2>
<p>Version 0.3.20 fixes this vulnerability by escaping ANSI control
characters in when writing events to destinations that may be printed to
the terminal.</p>
<h2>Affected Versions</h2>
<p>All versions of tracing-subscriber prior to 0.3.20 are affected by
this vulnerability.</p>
<h2>Recommendations</h2>
<p>Immediate Action Required: We recommend upgrading to
tracing-subscriber 0.3.20 immediately, especially if your
application:</p>
<ul>
<li>Logs user-provided input (form data, HTTP headers, query parameters,
etc.)</li>
<li>Runs in environments where terminal output is displayed to
users</li>
</ul>
<h2>Migration</h2>
<p>This is a patch release with no breaking API changes. Simply update
your Cargo.toml:</p>
<pre lang="toml"><code>[dependencies]
tracing-subscriber = "0.3.20"
</code></pre>
<h2>Acknowledgments</h2>
<p>We would like to thank <a href="http://github.com/zefr0x">zefr0x</a>
who responsibly reported the issue at
<code>security@tokio.rs</code>.</p>
<p>If you believe you have found a security vulnerability in any
tokio-rs project, please email us at <code>security@tokio.rs</code>.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4c52ca5266"><code>4c52ca5</code></a>
fmt: fix ANSI escape sequence injection vulnerability (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3368">#3368</a>)</li>
<li><a
href="f71cebe41e"><code>f71cebe</code></a>
subscriber: impl Clone for EnvFilter (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3360">#3360</a>)</li>
<li><a
href="3a1f571102"><code>3a1f571</code></a>
Fix CI (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3361">#3361</a>)</li>
<li><a
href="e63ef57f3d"><code>e63ef57</code></a>
chore: prepare tracing-attributes 0.1.30 (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3316">#3316</a>)</li>
<li><a
href="6e59a13b1a"><code>6e59a13</code></a>
attributes: fix tracing::instrument regression around shadowing (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3311">#3311</a>)</li>
<li><a
href="e4df761275"><code>e4df761</code></a>
tracing: update core to 0.1.34 and attributes to 0.1.29 (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3305">#3305</a>)</li>
<li><a
href="643f392ebb"><code>643f392</code></a>
chore: prepare tracing-attributes 0.1.29 (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3304">#3304</a>)</li>
<li><a
href="d08e7a6eea"><code>d08e7a6</code></a>
chore: prepare tracing-core 0.1.34 (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3302">#3302</a>)</li>
<li><a
href="6e70c571d3"><code>6e70c57</code></a>
tracing-subscriber: count numbers of enters in <code>Timings</code> (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/2944">#2944</a>)</li>
<li><a
href="c01d4fd9de"><code>c01d4fd</code></a>
fix docs and enable CI on <code>main</code> branch (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3295">#3295</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.19...tracing-subscriber-0.3.20">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/servo/servo/network/alerts).
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
According to the WebGPU specification there are the dedicated task
source
which is used to queue a global task for a GPUDevice on content
timeline.
https://gpuweb.github.io/gpuweb/#-webgpu-task-source
Tasks on content timeline:
- to fire "uncaptureevent" event
- to resolve GPUDevice.lost promise
Also fixed the "isTrusted" attribute status (false -> true) of the
"uncaptureevent" event by using non JS version of event dispatching.
Testing: No changes in WebGPU CTS expectations
- webgpu:api,operation,uncapturederror:*
- webgpu:api,operation,device,lost:*
- webgpu:api,validation,state,device_lost,destroy:*
Signed-off-by: Andrei Volykhin <volykhin.andrei@huawei.com>
Co-authored-by: Andrei Volykhin <volykhin.andrei@huawei.com>