Compare commits

...

886 Commits

Author SHA1 Message Date
Nico Burns
bfd90c9f7d Implement HarfRust shaping backend
Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-22 20:00:18 +01:00
Martin Robinson
bf5da330e1 fonts: Stop using deprecated functions in dwrote (#38856)
The new version of the functions return `Result` types.

Testing: No tests because this should not change behavior.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 16:28:54 +00:00
Martin Robinson
777373054f fonts: Use fontations to read the OS/2 table of DirectWrite fonts (#38851)
Instead of copying the font table data in memory and parsing it with the
`truetype` crate, use a non-copying API from DirectWrite to implement a
`fontations` `TableProvider`. This has two benefits:

- We remove the dependency on the `truetype` crate finally.
- We do not have to make an in-memory copy of the table data when
  parsing the table.

The hope is that the `TableProvider` will be more generally useful in
the future.

Testing: There are no automated tests for Windows, but I manually
verified
that the data retrived via `fontations` matched that retrived by
`truetype`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 16:23:35 +00:00
Abdelrahman Hossam
176e42d36d script: Add FocusOptions argument to Element.focus and implement FocusOptions.preventScroll (#38495)
This is an implementation of the `prevent_scroll` feature in the focus
transaction system. It allows to control whether focusing an element
should prevent scrolling or not.

Spec:
https://html.spec.whatwg.org/multipage/interaction.html#dom-focusoptions-preventscroll
Testing: Existing WPT tests

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
2025-08-22 14:05:32 +00:00
Martin Robinson
2ac8665e03 fonts: Add font variations support for Windows (#38831)
Unlike other platforms where we read the default axis values and combine
it with variations from style to make the font face, we set the
variations from the style when creating the font face and then read the
final variations from the face. It seems that DirectWrite does the
normalization of variation values internally.

This depends on servo/dwrote-rs#68.

Testing: We currently don't have tests for Windows, but variation
support is
covered by the WPT tests.
Fixes: This is part of #38800.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 11:10:17 +00:00
Martin Robinson
16ba172ba8 fonts: Add support for format(*-variations) to @font-face (#38832)
This is necessary to fully support font variations.

Testing: This will be tested once variations are enabled.
Fixes: This is part of #38800.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 09:25:19 +00:00
Shubham Gupta
09db6b8669 layout: Remove workaround for body while building overflow frame for StackingContextTree construction. (#38825)
While building the stacking context tree we were assuming that `<body>`
would have propagated its `overflow` value to the viewport, and thus its
used `overflow` would be `visible`.

However, the element that propagates `overflow` can be the root element
instead. Since #38598 we are correctly taking this into account in
`effective_overflow()`, so we no longer need to do anything special in
the stacking context logic.

Testing: `css/css-overflow/overflow-body-propagation-012.html`

Fixes: #38799

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-08-22 07:59:02 +00:00
Martin Robinson
4784ff0375 script: Ensure that leaving the WebView sets the cursor back to the default cursor (#38759)
This changes makes a variety of changes to ensure that the cursor is set
back to the default cursor when it leaves the `WebView`:

1. Display list updates can come after a mouse leaves the `WebView`, so
   when refreshing the cursor after the update, base the updated cursor
   on the last hovered location in the `DocumentEventHandler`, rather
   than the compositor. This allows us to catch when the last hovered
   position is `None` (ie the cursor has left the `WebView`).
2. When handling `MouseLeftViewport` events for the cursor leaving the
   entire WebView, properly set the
   MouseLeftViewport::focus_moving_to_another_iframe` on the input event
   passed to the script thread.
3. When moving out of the `WebView` entirely, explicitly ask the
   embedder to set the cursor back to the default.

Testing: This change adds a unit test verifying this behavior.
Fixes: #38710.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 07:49:56 +00:00
Euclid Ye
66adf2bf9f webdriver: Consider shadow including descendant when computing "obscured" step of “element click” (#38841)
Testing: WebDriver Conformance test. In addition to fixing all "Element
Intercepted" errors in
https://github.com/yezhizhen/servo/actions/runs/17142506541, we are able
to fix many other tests.
Fixes: #38837

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-22 07:22:00 +00:00
Kenzie Raditya Tirtarahardja
cae8d22823 webdriver: Element Send keys use dispatch actions for KeyboardEvent (#38444)
Previously we immediately passed the KeyboardEvent to embedder. Now we
make element send keys go through the dispatch action which required by
spec. CompositionEvent still immediately passed through embedder

Testing: Should make
`./tests/wpt/tests/webdriver/tests/classic/element_send_keys/` more
stable.
Fixes: https://github.com/servo/servo/issues/38354
Fixes: https://github.com/servo/servo/issues/38442

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-22 05:20:54 +00:00
criskell
56ce19511c Make transaction field non-null in IDBObjectStore (#38834)
In the `IDBObjectStore::new` constructor, the `transaction` field is
initialized to null, but when using this constructor, we always execute
`set_transaction` immediately afterward. Therefore, we refactored to
require the `transaction` field to be specified during construction and
thereby also removed some no longer necessary assertions.

We also updated the `transaction` field in WebIDL to remove the nullable
capability.

Testing: WPT
Fixes: #38814

---------

Signed-off-by: criskell <96352451+criskell@users.noreply.github.com>
2025-08-22 05:10:13 +00:00
Gregory Terzian
ede9db2e18 script: abort planned form navigations (#38676)
Servo shows a behavior unlike FF and Safari(I don't have Chrome), where
stopping a window does not cancel planned form navigation, resulting in
an infinite navigation loop. The current behavior of Servo does seem to
follow the wording of the spec, so I will open a [companion issue at the
spec](https://github.com/whatwg/html/issues/11562), and I have also
written a WPT tests for the non-standard but widely followed behavior.
This PR also adds a beginning of an implementation of the "ongoing
navigation" concept, which is used by the spec to cancel navigations,
and which is used in this PR only to cancel planned form navigations.
The generation id concept, which corresponds to the planned navigation
concept in the spec, is turned into a simple struct private cell, and is
documented per the spec.

Testing: A new WPT test is added
Fixes: Only one part of https://github.com/servo/servo/issues/36747

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 05:02:53 +00:00
Jo Steven Novaryo
0026213799 dom: Implement textual <input> lazy initialized placeholder (#38821)
Following #37527, every textual input is constructing the containers for
value and placeholder. However not all of textual `<input>` element
require the initialization of such placeholder container. This is
apparent with JS UI framework that defines its own placeholder
management.

This PR add lazy initialization for placeholder which construct the
relevant HTML elements for placeholder container whenever it is
necessary.

Testing: Existing WPT coverage

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-08-22 04:43:38 +00:00
Euclid Ye
66b0eb2687 webdriver: Simplify deserialize window_handles: Vec<String> (#38838)
We don't need to serialize internal String and then serialize the Result
type.

Testing: Tested. No behaviour change.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-22 04:34:43 +00:00
Ashwin Naren
cd5226adc2 net: Fix initial indexeddb version storage (#38836)
#38819 made a step in the right direction. Unfortunately sqlite doesn't
support unsigned integers, so I've been storing them as i64s internally,
but deserializing the bytes to u64s. This allows for an extra bit of
information, but by inserting 0 into the table, it was interpreted
`u64::from_ne_bytes([1,0,0,0....,0])` (or whatever the internal bit
representation of `0_i64` is on the platform), which is not intended.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-22 04:12:41 +00:00
lumiscosity
39f3ce7a2e Make DOM geometry structs serializable (#38828)
Makes the following DOM geometry structs serializable:
- `DOMRect`
- `DOMRectReadOnly`
- `DOMQuad`
- `DOMMatrix`
- `DOMMatrixReadOnly`

Testing: Covered by WPT (`css/geometry/structured-serialization.html`).

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-21 23:19:42 +00:00
Rahul Menon
e00f39d827 opts: Add a --force-ipc option (#38833)
Testing: servo.org loads properly with `./mach run -- -I`
Fixes: https://github.com/servo/servo/issues/38823

Signed-off-by: Rahul Menon <menonrahul02@gmail.com>
2025-08-21 22:55:14 +00:00
Ashwin Naren
f30be4e1ab Stub out IDBIndex (#38813)
Stubs the IDBIndex interface.

Testing: Mostly stubbing. Eventually covered by WPT.
Fixes: Partially #38100

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-21 22:54:19 +00:00
Josh Matthews
18230e9630 indexeddb: Initialize DB version to zero. (#38819)
None of our automated tests were executing the initial DB setup code
because the requested version always matched.

Testing: Existing WPT coverage.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-21 22:49:57 +00:00
batu_hoang
bce9f06cf8 webdriver: Refactor webdriver session and improve window handles (#38745)
This PR contains 2 parts:

1. Refactor webdriver session.
2. Improve webdriver window handles:
- Webdriver always get window handles from script thread by default.
- If script thread is blocked by user prompt, embedder stores the window
handle before user prompt appears, then webdriver can get window handle
from embedder.

Testing: Clear timeout cause by user prompt blocking script thread:
https://github.com/longvatrong111/servo/actions/runs/17033900026

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-21 22:46:13 +00:00
Nico Burns
b18a65ed70 Shaper abstraction setup (#38755)
# Objective

- Reorganise Servo's shaper code in preparation for multiple shaping
backends
- Make it possible to keep https://github.com/servo/servo/pull/38707
up-to-date with `main` with minimal conflicts

## Changes made

- Split `components/fonts/shaper.rs` into
`components/fonts/shapers/mod.rs` and
`components/fonts/shapers/harfbuzz.rs`
- Add traits for generic shapers
- `ShapedGlyphData` now takes ownership of the HarfBuzz buffer
(`hb_buffer_t`). This allows it to be returned from
the`THarfShaper::shape_text` function. The buffer is now deallocated in
the `ShapedGlyphData`s `Drop` impl.
- Add traits for HarfBuzz-like shapers and move code from
`save_glyph_results` function to be generic over those traits so that it
can be shared by a future `HarfRust` backend.

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-21 20:44:39 +00:00
Martin Robinson
d4757c9e9f compositor: Remove IOCompositor::pipeline_to_webview_map (#38827)
This data structure is now unused after changes to the way that hit
testing works.

Testing: This is just removing dead code so no tests are necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-21 15:16:41 +00:00
Jerens Lensun
48c2152f61 script_bindings(python): Add type to a function for codegen.py (#38771)
This PR focuses on adding type annotations to utility functions,
PropertyDefiner, and its child classes.

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-21 14:45:45 +00:00
shuppy
4ba34b038c devtools: Fix available breakpoint positions with nested scripts (#38826)
in the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), there is a
separate
[Debugger.Script](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html)
object for each function in a script, forming a tree of Script objects.
since we were only issuing
[getPossibleBreakpoints()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getpossiblebreakpoints-query)
queries to the [root Script
object](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewscript-script-global)
for each script, we were failing to report locations inside functions as
available for setting breakpoints.

this patch fixes that by recursively issuing the
getPossibleBreakpoints() requests over the
[getChildScripts()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getchildscripts)
tree.

Testing: this patch adds a new devtools test

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-21 11:00:32 +00:00
Jonathan Schwender
7b4032e972 mozjs: Remove vendored icu crates (#38803)
Instead of vendoring a copy of icu_capi, mozjs now instead determines
the location of the provided c header files by parsing the cargo
metadata output.
This will allow vendoring mozjs and is a step towards publishing mozjs
and thus servo again.
Corresponding mozjs PR: https://github.com/servo/mozjs/pull/596

Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-21 10:13:03 +00:00
Jo Steven Novaryo
5cb1f37843 layout: Stretch <input> inner container to its containing block (#38775)
The `<input>` element inner container should be stretch to its
containing block. This would allow the alignment of the text. This is
done by adding `min-width: 100%`. It is required because we are not
using a custom layout contrary to Firefox and Chrome.

Testing: New Servo specific WPT.

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-08-21 07:26:32 +00:00
Rahul Menon
9cd019403f layout: Measure stacking context tree in layout thread memory report (#38762)
Measures the memory usage of the stacking context tree in the memory
report of the layout thread by adding `MallocSizeOf` to
`StackingContextTree` and all the types required for that. Also requires
adding `MallocSizeOf` to some webrender types.

Testing: Manually looked at about:memory
<img width="636" height="241" alt="image"
src="https://github.com/user-attachments/assets/6bf9d65a-0bf0-4a99-99b5-ddedba3269c1"
/>

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

---------

Signed-off-by: Rahul Menon <menonrahul02@gmail.com>
2025-08-21 07:21:59 +00:00
atbrakhi
634c1897cf devtools: Handle removeBreakpoint on breakpoint-list actor (#38797)
The breakpoint-list actor did not implement a handler for the
`removeBreakpoint` request, causing the client to receive
`unrecognizedPacketType` error. This patch adds `removeBreakpoint`
handler


Fixes: Part of #36027

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-08-21 07:21:22 +00:00
lumiscosity
913066d2e5 Add legacy window aliases SVGMatrix/SVGPoint for DOMMatrix/DOMPoint (#38810)
Adds the legacy window aliases `SVGMatrix`/`SVGPoint` for
`DOMMatrix`/`DOMPoint`.

Testing: Covered by WPT (`css/geometry`).

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-21 07:19:25 +00:00
Tim van der Lippe
3c89763b77 Implement trusted types for remaining attribute sinks (#38784)
Additionally, several methods were updated with
spec comments. That's because the "adopt the document
from the element document" step was missing.

By adding these spec comments, I also restructured
some code to avoid duplication of mutation records
and custom element reaction queueing.

Node.textContent doesn't propagate the error yet,
as that method has a lot of separate callers of
elements that wouldn't fail. I will refactor those
in a follow-up PR to keep things manageable.

This implements part of the DOM integration from
https://github.com/whatwg/dom/pull/1268

Part of #36258

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2025-08-21 05:37:34 +00:00
Ashwin Naren
dd7b2a5ee2 Enable access to transaction from idbobjectstore (#38737)
Adds the transaction property to IDBObjectStore, as per spec.

Testing: WPT
Fixes: None

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-21 02:26:40 +00:00
Sebastian C
b869b7eb96 script: initial CookieStore implementation (#37968)
This is a first draft at implementing the required infrastructure for
CookieStore, which requires setting up IPC between script and the
resource thread to allow for async/"in parallel" handling of cookie
changes that have a promise API.

Cookie Store also will need to receive change events when cookies for a
url are changed so the architecture needs to support that.

Expect this PR to be reworked once the architecture becomes more
settled, cookie change events will be implemented in follow up PRs

Testing: WPT tests exist for this API
Part of #37674

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-08-21 01:00:24 +00:00
Kenzie Raditya Tirtarahardja
a75f3fd09b script(webdriver): Element send keys append to the end of filelist if Multiple (#38407)
Step 8.6 of [Element Send
Keys](https://w3c.github.io/webdriver/#dfn-element-send-keys) remote
end's implementation.
> 6. Complete implementation specific steps equivalent to setting the
[selected files](https://w3c.github.io/webdriver/#dfn-selected-files) on
the [input](https://w3c.github.io/webdriver/#dfn-input) element. **If
multiple is true files are be appended to element's [selected
files](https://w3c.github.io/webdriver/#dfn-selected-files).**

Testing: `webdriver/tests/classic/element_send_keys/file_upload.py`
Fixes: https://github.com/servo/servo/issues/38190

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-20 19:10:07 +00:00
Narfinger
011b314478 compostor: Move duplicated code for generating a batch of FontKeys into a function (#38804)
The code was duplicated for handling in normal messages and handling
while shutting down messages.
This cleans it up and puts them into a function.

Testing: Does not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-08-20 18:33:57 +00:00
Alex Touchet
8778f2d1f2 Update user agent strings to match Firefox 140 (#38802)
Update user agent strings to match Firefox 140 now that #38563 is
merged.

Testing: No tests for user agent string update.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-08-20 18:16:36 +00:00
dependabot[bot]
75d5e0fcc7 build(deps): bump taffy from 0.9.0 to 0.9.1 (#38805)
Bumps [taffy](https://github.com/DioxusLabs/taffy) from 0.9.0 to 0.9.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/DioxusLabs/taffy/blob/main/CHANGELOG.md">taffy's
changelog</a>.</em></p>
<blockquote>
<h2>0.9.1</h2>
<h3>Fixed</h3>
<ul>
<li>Flexbox: don't apply cross-axis stretch alignment to children with
auto margins (<a
href="https://redirect.github.com/DioxusLabs/taffy/issues/861">#861</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DioxusLabs/taffy/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=taffy&package-manager=cargo&previous-version=0.9.0&new-version=0.9.1)](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-08-20 17:47:03 +00:00
lumiscosity
8e2f65bd16 Add matrixTransform for DOMPointReadOnly (#38801)
Adds the `matrixTransform` function for `DOMPointReadOnly`.

Testing: Covered by WPT tests (`css/geometry`)

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-20 16:36:59 +00:00
Shubham Gupta
d8ff9c7a08 layout: Use overflow: visible if overflow was propagated to viewport (#38598)
The `overflow-*` values of either the root element or the `<body>` get
propagated to the viewport. However, we were missing this part:
> The element from which the value is propagated must then have a used
`overflow` value of `visible`.

See https://drafts.csswg.org/css-overflow/#overflow-propagation

Testing:
 - `css/cssom-view/scrolling-quirks-vs-nonquirks.html`
 - `css/css-overflow/overflow-body-propagation-007.html`
 - `css/css-overflow/overflow-body-propagation-008.html`
 - `css/css-overflow/overflow-body-propagation-009.html`
 - `css/css-overflow/scrollable-overflow-with-nested-elements-001.html` 
 - `css/css-overflow/scrollable-overflow-with-nested-elements-002.html` 
 - `css/css-overflow/scrollable-overflow-with-nested-elements-003.html`
 - `css/css-overflow/scrollable-overflow-with-nested-elements-004.html`
 - `css/css-overflow/scrollbar-gutter-scroll-into-view.html`

Failures:
 - `css/css-overflow/overflow-body-propagation-010.html`
   Failing because of missing support for `contain: paint`.
- `css/css-overflow/scrollable-overflow-with-nested-elements-005.html`
Failing because of wrong `data-expected-height`, but correct
`data-expected-scroll-height` which is core of this PR.
`data-expected-height` can be dealt separately.


Fixes: #38248

---------

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-20 14:21:51 +00:00
Kenzie Raditya Tirtarahardja
37088aa4c3 wpt: Set servo window size and open blank page for wdspec (#38793)
On `ServoWdSpecBrowser`, we set the window size to `800x600` and open
`about:blank`. This will unify the behavior of servo and servodriver.


604b6ea26d/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servodriver.py (L101-L102)

Testing: Unify the behavior of servo and servodriver for wdspec

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-20 13:26:59 +00:00
JoeDow
6e6ef513a9 Reuse StylesheetContent for inline style sheets with identical content (#38540)
For duplicate style sheets with identical content, `StylesheetContents`
can be reused to avoid redundant parsing of the inline style sheets.
Since duplicate stylesheets is a common case with web components, this
change will significantly improve performance. Additionally, the cache
hit rate of stylo's `CascadeDataCache` can now be significantly
improved.

When shared `StylesheetContents` is modified, copy-on-write will occur
to avoid affecting other sharers. And then updates the references to
`CssRule` or `PropertyDeclarationBlock` stored in the CSSOMs to ensure
that modifications are made only on the new copy.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-08-20 12:31:49 +00:00
dependabot[bot]
f6b77f94e2 build(deps): bump sea-query from 1.0.0-rc.9 to 1.0.0-rc.10 (#38796)
Bumps [sea-query](https://github.com/SeaQL/sea-query) from 1.0.0-rc.9 to
1.0.0-rc.10.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/SeaQL/sea-query/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sea-query&package-manager=cargo&previous-version=1.0.0-rc.9&new-version=1.0.0-rc.10)](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-08-20 11:33:02 +00:00
dependabot[bot]
a14095c3e3 build(deps): bump winapi-util from 0.1.9 to 0.1.10 (#38795)
Bumps [winapi-util](https://github.com/BurntSushi/winapi-util) from
0.1.9 to 0.1.10.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="29a804c1a0"><code>29a804c</code></a>
0.1.10</li>
<li><a
href="740518024e"><code>7405180</code></a>
cargo: support <code>windows-sys</code> v0.60.0</li>
<li><a
href="b0e2eed9fc"><code>b0e2eed</code></a>
github: add FUNDING</li>
<li>See full diff in <a
href="https://github.com/BurntSushi/winapi-util/compare/0.1.9...0.1.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=winapi-util&package-manager=cargo&previous-version=0.1.9&new-version=0.1.10)](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-08-20 10:04:41 +00:00
dependabot[bot]
a597cd5ed4 build(deps): bump cfg-if from 1.0.1 to 1.0.3 (#38794)
Bumps [cfg-if](https://github.com/rust-lang/cfg-if) from 1.0.1 to 1.0.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cfg-if/releases">cfg-if's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.3</h2>
<ul>
<li>Revert &quot;Remove <code>@__identity</code> rule.&quot;</li>
</ul>
<h2>v1.0.2</h2>
<ul>
<li>Remove <code>@__identity</code> rule.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cfg-if/blob/main/CHANGELOG.md">cfg-if's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/cfg-if/compare/v1.0.2...v1.0.3">1.0.3</a>
- 2025-08-19</h2>
<ul>
<li>Revert &quot;Remove <code>@__identity</code> rule.&quot;</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cfg-if/compare/v1.0.1...v1.0.2">1.0.2</a>
- 2025-08-19</h2>
<ul>
<li>Remove <code>@__identity</code> rule.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9c7bb0bf71"><code>9c7bb0b</code></a>
chore: release v1.0.3 (<a
href="https://redirect.github.com/rust-lang/cfg-if/issues/93">#93</a>)</li>
<li><a
href="145894c77e"><code>145894c</code></a>
Revert &quot;Remove <code>@__identity</code> rule.&quot;</li>
<li><a
href="9f747fecdd"><code>9f747fe</code></a>
chore: release v1.0.2 (<a
href="https://redirect.github.com/rust-lang/cfg-if/issues/88">#88</a>)</li>
<li><a
href="97739b8388"><code>97739b8</code></a>
Fix some ugly and inconsistent formatting.</li>
<li><a
href="4d7a585e4d"><code>4d7a585</code></a>
Remove <code>@__identity</code> rule.</li>
<li><a
href="527acbdbd4"><code>527acbd</code></a>
Bump actions/checkout from 4 to 5</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cfg-if/compare/v1.0.1...v1.0.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cfg-if&package-manager=cargo&previous-version=1.0.1&new-version=1.0.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 09:51:01 +00:00
Josh Matthews
636e7211e0 script: Measure heap usage of various ignored fields (#38791)
These changes allow using MallocSizeOf/`#[conditional_malloc_size_of]`
on WebIDL callback values, and then fix a grab bag of places in the
script crate that previously ignored those values. There are also some
commits removing ignored fields that involved Arc/Rc that are not WebIDL
callbacks, since they are now easier to support with the
`#[conditional_malloc_size_of]` attribute.

Testing: Manual testing on about:memory for servo.org.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-20 08:43:58 +00:00
Josh Matthews
604b6ea26d Upgrade to SpiderMonkey 140. (#38563)
Upgrade to use the latest mozjs upgrade.

Testing: Covered by existing WPT.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-20 07:35:35 +00:00
Martin Robinson
b6cb57287f dependabot: Exclude two testing directories to depndabot scanning (#38790)
According to dependabot/dependabot-core#4364, dependabot now supports
excluding certain directories from upgrade scanning. This change adds
two problematic directories to the exclusion list.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-20 07:17:13 +00:00
Josh Matthews
ed6bf196c9 constellation: Broadcast preference changes to all content processes (#38716)
Building on the preference observer work from #38649, we now
automatically install an observer when multiprocess mode is enabled.
This observer notifies the constellation of updated preferences, which
in turn notifies each content process so the changes will be reflected
into script/layout as expected. There's a unit test that verifies this
works correctly by checking a preference-gated WebIDL property before
and after the preference is toggled.

Testing: New unit test added.
Fixes: #35966

Depends on #38649.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-20 06:43:16 +00:00
sagudev
61692b26c2 dependabot: Add egui-file-dialog and accesskit_winit to egui group (#38121)
https://github.com/servo/servo/pull/38119#issuecomment-3079653012

Testing: None, just dependabot config.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-20 06:36:42 +00:00
dependabot[bot]
a28c394495 build(deps): bump tinyvec from 1.9.0 to 1.10.0 (#38785)
Bumps [tinyvec](https://github.com/Lokathor/tinyvec) from 1.9.0 to
1.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Lokathor/tinyvec/blob/main/CHANGELOG.md">tinyvec's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>1.10</h2>
<ul>
<li>Minimum rust version is now 1.55, and the non-const-generic impls
are removed.
This reduces build times by over a second on average, which is
significant enough for a library crate.</li>
</ul>
<h2>1.9</h2>
<ul>
<li>Adds a <code>latest_stable_rust</code> cargo feature, which will
automatically pull in
other cargo features related to the latest Stable version of rust.</li>
<li>Adds <code>ArrayVec::try_from_array_len</code></li>
<li>Adds <code>TinyVec::into_vec</code> and
<code>TinyVec::into_boxed_slice</code></li>
<li>Adds support for <code>generic-array</code> crate</li>
<li>Adds support for the <code>borsh</code> crate</li>
</ul>
<h2>1.8.1</h2>
<ul>
<li><a href="https://github.com/e00E">e00E</a> updated the rustc
features so that they all
correctly depend on the lower version feature.
<a href="https://redirect.github.com/Lokathor/tinyvec/pull/199">pr
199</a></li>
</ul>
<h2>1.8</h2>
<ul>
<li><a href="https://github.com/Fuuzetsu">Fuuzetsu</a> added the
<code>ArrayVec::as_inner</code> method.
<a href="https://redirect.github.com/Lokathor/tinyvec/pull/197">pr
197</a></li>
</ul>
<h2>1.7</h2>
<ul>
<li><a href="https://github.com/Fuuzetsu">Fuuzetsu</a> added the
<code>rustc_1_61</code> cargo feature, which adds the
<code>retain_mut</code> method.
<a href="https://redirect.github.com/Lokathor/tinyvec/pull/198">pr
198</a></li>
</ul>
<h2>1.6.1</h2>
<ul>
<li><a href="https://github.com/e00E">e00E</a> fixed the Arbitrary impl
to work on Stable
without using a feature gate.
<a href="https://redirect.github.com/Lokathor/tinyvec/pull/180">pr
180</a></li>
</ul>
<h2>1.6.0</h2>
<ul>
<li><a href="https://github.com/i509VCB">i509VCB</a> added the
<code>try_</code> functions for fallable reallocation.
<a href="https://redirect.github.com/Lokathor/tinyvec/pull/158">pr
158</a></li>
<li><a href="https://github.com/ajtribick">ajtribick</a> added more
error impls to <code>TryFromSliceError</code>.
<a href="https://redirect.github.com/Lokathor/tinyvec/pull/160">pr
160</a></li>
<li>The <code>std</code> feature now automatically enables the
<code>alloc</code> feature as well.</li>
</ul>
<h2>1.5.1</h2>
<ul>
<li><a href="https://github.com/madsmtm">madsmtm</a> fixed an error with
the <code>alloc</code> feature on very old rustc versions.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3c613ad020"><code>3c613ad</code></a>
chore: Release</li>
<li><a
href="2c5f2f6bb6"><code>2c5f2f6</code></a>
changelog</li>
<li><a
href="a44fb04088"><code>a44fb04</code></a>
bump MSRV to 1.55, drop generated Array impls (<a
href="https://redirect.github.com/Lokathor/tinyvec/issues/209">#209</a>)</li>
<li>See full diff in <a
href="https://github.com/Lokathor/tinyvec/compare/v1.9.0...v1.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tinyvec&package-manager=cargo&previous-version=1.9.0&new-version=1.10.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-08-20 06:36:26 +00:00
dependabot[bot]
25c289e915 build(deps): bump serde_json from 1.0.142 to 1.0.143 (#38787)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.142 to
1.0.143.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.143</h2>
<ul>
<li>Implement Clone and Debug for serde_json::Map iterators (<a
href="https://redirect.github.com/serde-rs/json/issues/1264">#1264</a>,
thanks <a
href="https://github.com/xlambein"><code>@​xlambein</code></a>)</li>
<li>Implement Default for CompactFormatter (<a
href="https://redirect.github.com/serde-rs/json/issues/1268">#1268</a>,
thanks <a href="https://github.com/SOF3"><code>@​SOF3</code></a>)</li>
<li>Implement FromStr for serde_json::Map (<a
href="https://redirect.github.com/serde-rs/json/issues/1271">#1271</a>,
thanks <a
href="https://github.com/mickvangelderen"><code>@​mickvangelderen</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="10102c49bf"><code>10102c4</code></a>
Release 1.0.143</li>
<li><a
href="2a5b85312c"><code>2a5b853</code></a>
Replace super::super with absolute path within crate</li>
<li><a
href="447170bd38"><code>447170b</code></a>
Merge pull request 1271 from
mickvangelderen/mick/impl-from-str-for-map</li>
<li><a
href="ec190d6dfd"><code>ec190d6</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1264">#1264</a>
from xlambein/master</li>
<li><a
href="8be664752f"><code>8be6647</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1268">#1268</a>
from SOF3/compact-default</li>
<li><a
href="ba5b3cccea"><code>ba5b3cc</code></a>
Revert &quot;Pin nightly toolchain used for miri job&quot;</li>
<li><a
href="fd35a02901"><code>fd35a02</code></a>
Implement FromStr for Map&lt;String, Value&gt;</li>
<li><a
href="bea0fe6b3e"><code>bea0fe6</code></a>
Implement Default for CompactFormatter</li>
<li><a
href="0c0e9f6bfa"><code>0c0e9f6</code></a>
Add Clone and Debug impls to map iterators</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.142...v1.0.143">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.142&new-version=1.0.143)](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-08-20 01:15:30 +00:00
dependabot[bot]
79de227448 build(deps): bump prettyplease from 0.2.36 to 0.2.37 (#38786)
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from
0.2.36 to 0.2.37.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/prettyplease/releases">prettyplease's
releases</a>.</em></p>
<blockquote>
<h2>0.2.37</h2>
<ul>
<li>Replace <code>~const</code> syntax with <code>[const]</code>
conditionally const syntax (<a
href="https://redirect.github.com/dtolnay/prettyplease/issues/123">#123</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c971184fa8"><code>c971184</code></a>
Release 0.2.37</li>
<li><a
href="484e06077c"><code>484e060</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/prettyplease/issues/123">#123</a>
from dtolnay/conditionallyconst</li>
<li><a
href="38d93c76ae"><code>38d93c7</code></a>
Replace ~const syntax with [const] conditionally const syntax</li>
<li><a
href="e1c92b1bef"><code>e1c92b1</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/prettyplease/issues/122">#122</a>
from dtolnay/negativeinherent</li>
<li><a
href="1f74d4724d"><code>1f74d47</code></a>
Reject negative inherent impls</li>
<li>See full diff in <a
href="https://github.com/dtolnay/prettyplease/compare/0.2.36...0.2.37">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettyplease&package-manager=cargo&previous-version=0.2.36&new-version=0.2.37)](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-08-19 23:34:58 +00:00
Ashwin Naren
d0a8f27241 net: fix indexeddb backend bugs (#38744)
Fix a large number of backend issues that were masking everything else.
There probably is still more, but it'll take more integration/unit
testing to find it.

Testing: WPT
Fixes: #38743

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-19 20:44:49 +00:00
Usman Yahaya Baba
f2294db95b Split devtools network event logic for creating/retrieving network event actors (#38409)
`DevtoolsInstance::find_network_event_actor` silently creates a new
actor if there is not one already known for a given ID. This is
confusing; this PR separates logic for handling network requests (create
a new actor) and network responses (retrieve an existing actor).

Fixes: (https://github.com/servo/servo/issues/37841)

---------

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
2025-08-19 19:13:54 +00:00
Josh Matthews
f1a9ceed4f allocator: Add optional heap allocation measurement tracking. (#38727)
Add an off-by-default allocator mode that tracks all live allocations
with sizes and associated stack traces. We also track if each allocation
is visited as part of a measuring heap usage in `about:memory`, allowing
us to report on allocations that are not tracked yet. Right now the list
of untracked allocations is dumped to stdout; I have a python script
coming in a separate PR which makes it easier to perform analysis on the
massive output.

Testing: Manually tested with `./mach build -d --features
servo_allocator/allocation-tracking` and visiting about:memory.
Part of: #11559

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-19 18:49:27 +00:00
Martin Robinson
2022831e4f fonts: Add font variation support for macOS (#38760)
This change adds font variation support for macOS. The main bulk of the
change is reading the default, min, and max values for each variation
axis from the font and instantiating a new CoreText font with the
appropriate values. 

In addition, fonts with variations are now properly cached in the
CoreText font cache.

Testing: There are no tests for this change as we do not run WPT tests
for
macOS and font variations are currently turned off by default.
Eventually,
when the feature is turned on there will be test for it. These changes
are just laying the groundwork for the full implementation.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-19 15:12:48 +00:00
Euclid Ye
ad3018a921 webxr: Fix compile warning for Windows after upgrade to rustc 1.89 (#38780)
This is a follow up to
https://github.com/servo/servo/pull/36818#issuecomment-3135078567. Since
openxr is a feature only available on Windows, it was omitted.

Testing: Fixes
```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> components\webxr\openxr\input.rs:366:9
    |
366 |         &self,
    |         ^^^^^ the lifetime is elided here
...
371 |     ) -> Vec<Binding> {
    |              ------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
371 |     ) -> Vec<Binding<'_>> {
```

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-19 14:23:39 +00:00
Oriol Brufau
b4589134c9 layout: Fix mix-ups between physical and logical aspect ratios (#38778)
`ComputedValuesExt::preferred_aspect_ratio()` was getting the natural
aspect ratio expressed logically as inline over block, but then it was
mixing it with the value of the `aspect-ratio` CSS property, which is
expressed physically as width over height.

Therefore, this changes `ComputedValuesExt::preferred_aspect_ratio()` to
expect the physical natural ratio, and then it takes care to convert the
resulting ratio logically.

Testing: Unneeded. This has no effect in practice because we don't
support `writing-mode` yet.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-19 14:09:17 +00:00
Oriol Brufau
f31edc5d6a layout: Stop making <video> fall back to a preferred aspect ratio of 2 (#38705)
This is simpler, and has been successfully shipped in Blink.
See https://github.com/w3c/csswg-drafts/issues/12053 for more
information.

Testing: Improves WPT tests.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-19 12:09:36 +00:00
Nico Burns
39629560c8 Fix loading raw data from .ttc files on macos (#38753)
# Objective

Ensure that functionality which uses the raw font data (such as
rendering text to canvas) works correctly on macOS when the specified
font is a system font that lives in an OpenType Collection (`.ttc`)
file.

## Changes made

- The `read_data_from_file` in each backend now returns a `index: u32`
in addition to `data: Vec<u8>`
- The `data` field on the `Font` type has been renamed to `raw` and the
`data` method on the `Font` type has been renamed to `raw_font`. This
allows the index to be cached as computing is moderately expensive on
macOS (on the order of 100 microseconds).
- Both of the above now store/return a `struct RawFont` instead of a
`FontData` where `RawFont` is defined as `struct RawFont { data:
FontData, index: u32 }`.
- The users of the `data` method have been updated to use the cached
index from `data` rather than calling `.index()` each time.

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-19 11:57:48 +00:00
webbeef
3225d19907 cargo: Bump rustc to 1.89 (#36818)
Update Rustc to 1.89.

Reviewable by commit.

Leftover work:
- #37330 
- #38777

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-19 11:07:53 +00:00
Jonathan Schwender
8587536755 Use GenericChannel for script_chan (#38645)
Motivation: 
Using our GenericChannel abstraction allows us to optimize IPC in
single-process mode to just use cross-beam channel.
To keep the diff low, and get early feedback, this PR only tackles a
single channel, but the intention is to port all ipc channels to the
generic channel, which allows us to skip serializing and deserializing
messages in single process mode.

Based on: 
- https://github.com/servo/servo/pull/38638
- https://github.com/servo/servo/pull/38636

Testing: Covered by existing tests

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-19 09:59:20 +00:00
Jonathan Schwender
73e0f2f7e6 uv: Fix warning by adding project table to pyproject.toml (#38774)
`uv` logs a warning if the pyproject.toml does not contain a project
table.
There is not really much point in adding the table, but no downsides
either,
so lets just add the table to make `uv` happy.

Testing: Manual run of `RUST_LOG=warn ./mach run`
Fixes: #38761

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-19 06:38:00 +00:00
Kenzie Raditya Tirtarahardja
60e6fe8cb5 webdriver: Change TickActions to vector rather than hashmap (#38747)
Based on
[spec](https://w3c.github.io/webdriver/#dfn-extract-an-action-sequence),
`TickActions` should be a list. Previously we used Hashmap, which when
iterated has arbitrary order. This causes some tests to be unstable
previously (see the linked issue).

Testing:
`./webdriver/tests/classic/perform_actions/{pointer_contextmenu,
pointer_modifier_click}.py` consistently pass now.
Fixes: https://github.com/servo/servo/issues/38387

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-19 06:25:56 +00:00
dependabot[bot]
ea506140c8 build(deps): bump bitflags from 2.9.1 to 2.9.2 (#38767)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.9.1 to
2.9.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/bitflags/bitflags/releases">bitflags's
releases</a>.</em></p>
<blockquote>
<h2>2.9.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix difference in the spec by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/446">bitflags/bitflags#446</a></li>
<li>Fix up inaccurate docs on bitflags_match by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/453">bitflags/bitflags#453</a></li>
<li>Remove rustc internal crate feature by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/454">bitflags/bitflags#454</a></li>
<li>Prepare for 2.9.2 release by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/456">bitflags/bitflags#456</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bitflags/bitflags/compare/2.9.1...2.9.2">https://github.com/bitflags/bitflags/compare/2.9.1...2.9.2</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md">bitflags's
changelog</a>.</em></p>
<blockquote>
<h1>2.9.2</h1>
<h2>What's Changed</h2>
<ul>
<li>Fix difference in the spec by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/446">bitflags/bitflags#446</a></li>
<li>Fix up inaccurate docs on bitflags_match by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/453">bitflags/bitflags#453</a></li>
<li>Remove rustc internal crate feature by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/bitflags/bitflags/pull/454">bitflags/bitflags#454</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/bitflags/bitflags/compare/2.9.1...2.9.2">https://github.com/bitflags/bitflags/compare/2.9.1...2.9.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="85b5e603ea"><code>85b5e60</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/456">#456</a>
from KodrAus/cargo/2.9.2</li>
<li><a
href="d185ca57b0"><code>d185ca5</code></a>
remove reference to std internal features</li>
<li><a
href="82a365fc54"><code>82a365f</code></a>
prepare for 2.9.2 release</li>
<li><a
href="f1beb28eb3"><code>f1beb28</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/454">#454</a>
from KodrAus/fix/rustc-dep-of-std</li>
<li><a
href="ef247c5046"><code>ef247c5</code></a>
update more error messages</li>
<li><a
href="c8e235463c"><code>c8e2354</code></a>
update compiler errors</li>
<li><a
href="fe4c49da68"><code>fe4c49d</code></a>
remove rustc internal crate feature</li>
<li><a
href="2b786c963b"><code>2b786c9</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/453">#453</a>
from bitflags/fix/match-docs</li>
<li><a
href="15519b01b8"><code>15519b0</code></a>
fix up inaccurate docs on bitflags_match</li>
<li><a
href="80684fdce6"><code>80684fd</code></a>
Merge pull request <a
href="https://redirect.github.com/bitflags/bitflags/issues/446">#446</a>
from bitflags/KodrAus-patch-1</li>
<li>Additional commits viewable in <a
href="https://github.com/bitflags/bitflags/compare/2.9.1...2.9.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bitflags&package-manager=cargo&previous-version=2.9.1&new-version=2.9.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 05:14:57 +00:00
dependabot[bot]
40ac1dad8a build(deps): bump brotli from 8.0.1 to 8.0.2 (#38770)
Bumps [brotli](https://github.com/dropbox/rust-brotli) from 8.0.1 to
8.0.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/dropbox/rust-brotli/commits/8.0.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=brotli&package-manager=cargo&previous-version=8.0.1&new-version=8.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 05:14:47 +00:00
dependabot[bot]
97c762ec7c build(deps): bump syn from 2.0.105 to 2.0.106 (#38768)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.105 to 2.0.106.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.106</h2>
<ul>
<li>Replace <code>~const</code> syntax with <code>[const]</code>
conditionally const syntax in trait bounds (<a
href="https://redirect.github.com/dtolnay/syn/issues/1896">#1896</a>, <a
href="https://redirect.github.com/rust-lang/rust/pull/139858">rust-lang/rust#139858</a>)</li>
<li>Support conditionally const impl Trait types (<a
href="https://redirect.github.com/dtolnay/syn/issues/1897">#1897</a>)</li>
<li>Reject polarity modifier and lifetime binder used in the same trait
bound (<a
href="https://redirect.github.com/dtolnay/syn/issues/1899">#1899</a>, <a
href="https://redirect.github.com/rust-lang/rust/pull/127054">rust-lang/rust#127054</a>)</li>
<li>Parse const trait bounds with bound lifetimes (<a
href="https://redirect.github.com/dtolnay/syn/issues/1902">#1902</a>)</li>
<li>Parse bound lifetimes with lifetime bounds (<a
href="https://redirect.github.com/dtolnay/syn/issues/1903">#1903</a>)</li>
<li>Allow type parameters and const parameters in trait bounds and
generic closures (<a
href="https://redirect.github.com/dtolnay/syn/issues/1904">#1904</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1907">#1907</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1908">#1908</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1909">#1909</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0e4bc64fe1"><code>0e4bc64</code></a>
Release 2.0.106</li>
<li><a
href="4fb776a12e"><code>4fb776a</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1910">#1910</a>
from dtolnay/traitboundissue</li>
<li><a
href="41b24a588b"><code>41b24a5</code></a>
Fix duplicated async trait bound issue</li>
<li><a
href="a64f024cf8"><code>a64f024</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1909">#1909</a>
from dtolnay/fortype</li>
<li><a
href="176099e868"><code>176099e</code></a>
Parse type parameter introducer on closures</li>
<li><a
href="b790b39351"><code>b790b39</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1908">#1908</a>
from dtolnay/genericvsqpath</li>
<li><a
href="96496390a3"><code>9649639</code></a>
Synchronize generics-vs-qpath heuristic with rust parser</li>
<li><a
href="60de3318e0"><code>60de331</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1907">#1907</a>
from dtolnay/forconst</li>
<li><a
href="2aac6d7607"><code>2aac6d7</code></a>
Allow const parameters in for&lt;&gt;</li>
<li><a
href="11934e5365"><code>11934e5</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1905">#1905</a>
from dtolnay/unsafestatic</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/syn/compare/2.0.105...2.0.106">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=syn&package-manager=cargo&previous-version=2.0.105&new-version=2.0.106)](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-08-19 00:28:53 +00:00
dependabot[bot]
d321d8a13d build(deps): bump proc-macro2 from 1.0.97 to 1.0.101 (#38766)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.97
to 1.0.101.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/proc-macro2/releases">proc-macro2's
releases</a>.</em></p>
<blockquote>
<h2>1.0.101</h2>
<ul>
<li>Optimize Span location accessors (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/519">#519</a>)</li>
</ul>
<h2>1.0.100</h2>
<ul>
<li>Stabilize <code>Span</code> methods on Rust 1.88+:
<code>start</code>, <code>end</code>, <code>line</code>,
<code>column</code>, <code>file</code>, <code>local_file</code> (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/517">#517</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/518">#518</a>)</li>
</ul>
<h2>1.0.99</h2>
<ul>
<li>Prevent Span's unstable API becoming unavailable from a future new
compiler lint (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/515">#515</a>)</li>
</ul>
<h2>1.0.98</h2>
<ul>
<li>Disallow prefixed identifier as name of lifetime:
<code>'prefix#lifetime</code> (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/514">#514</a>,
<a
href="https://redirect.github.com/rust-lang/rust/pull/126452">rust-lang/rust#126452</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d3188ea889"><code>d3188ea</code></a>
Release 1.0.101</li>
<li><a
href="cbd1286d36"><code>cbd1286</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/519">#519</a>
from dtolnay/binarysearch</li>
<li><a
href="fab4cb6df2"><code>fab4cb6</code></a>
Convert SourceMap scan to binary search</li>
<li><a
href="f4708a855b"><code>f4708a8</code></a>
Factor out SourceMap linear search to method</li>
<li><a
href="fdc853a4af"><code>fdc853a</code></a>
Release 1.0.100</li>
<li><a
href="848ed0b742"><code>848ed0b</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/518">#518</a>
from dtolnay/spanfile</li>
<li><a
href="76ce1a35a3"><code>76ce1a3</code></a>
Stabilize Span::file and Span::local_file</li>
<li><a
href="b5dd3c6baf"><code>b5dd3c6</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/517">#517</a>
from dtolnay/startend</li>
<li><a
href="1d0ffc026c"><code>1d0ffc0</code></a>
Use Span's start, end, line, column methods on stable 1.88+</li>
<li><a
href="4f5845e1ee"><code>4f5845e</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/516">#516</a>
from dtolnay/probe</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/proc-macro2/compare/1.0.97...1.0.101">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=proc-macro2&package-manager=cargo&previous-version=1.0.97&new-version=1.0.101)](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-08-19 00:17:20 +00:00
dependabot[bot]
efd0926c63 build(deps): bump hyper from 1.6.0 to 1.7.0 (#38765)
Bumps [hyper](https://github.com/hyperium/hyper) from 1.6.0 to 1.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/hyper/releases">hyper's
releases</a>.</em></p>
<blockquote>
<h2>v1.7.0</h2>
<h2>Highlights</h2>
<h3>Features</h3>
<ul>
<li><strong>client:</strong>
<ul>
<li>add a <code>TrySendError::error()</code> method (<a
href="https://redirect.github.com/hyperium/hyper/issues/3885">#3885</a>)
(<a
href="efa0b26958">efa0b269</a>)</li>
<li>add a <code>TrySendError::message()</code> method (<a
href="https://redirect.github.com/hyperium/hyper/issues/3884">#3884</a>)
(<a
href="03fd6aff88">03fd6aff</a>)</li>
</ul>
</li>
<li><strong>error:</strong> add <code>Error::is_shutdown()</code> (<a
href="https://redirect.github.com/hyperium/hyper/issues/3863">#3863</a>)
(<a
href="b8affd8a2e">b8affd8a</a>,
closes <a
href="https://redirect.github.com/hyperium/hyper/issues/2745">#2745</a>)</li>
<li><strong>server:</strong> add
<code>allow_multiple_spaces_in_request_line_delimiters</code> http1
builder method (<a
href="https://redirect.github.com/hyperium/hyper/issues/3929">#3929</a>)
(<a
href="9749184f8a">9749184f</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>server:</strong> improve caching accuracy of Date header (<a
href="https://redirect.github.com/hyperium/hyper/issues/3887">#3887</a>)
(<a
href="436cadd1ac">436cadd1</a>)</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>chore: remove redundant backticks by <a
href="https://github.com/jimmycathy"><code>@​jimmycathy</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3855">hyperium/hyper#3855</a></li>
<li>Gate tests with features they test by <a
href="https://github.com/WhyNotHugo"><code>@​WhyNotHugo</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3864">hyperium/hyper#3864</a></li>
<li>docs(service): add <code>HttpService</code> documentation by <a
href="https://github.com/cratelyn"><code>@​cratelyn</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3869">hyperium/hyper#3869</a></li>
<li>docs(examples): alias Builder for clarity by <a
href="https://github.com/Muffeter"><code>@​Muffeter</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3873">hyperium/hyper#3873</a></li>
<li>docs(MAINTAINERS): add katelyn martin as collaborator by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper/pull/3878">hyperium/hyper#3878</a></li>
<li>chore(proto/h2): fix module-level documentation by <a
href="https://github.com/cratelyn"><code>@​cratelyn</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3881">hyperium/hyper#3881</a></li>
<li>feat(client): add a <code>TrySendError::message()</code> method by
<a href="https://github.com/cratelyn"><code>@​cratelyn</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3884">hyperium/hyper#3884</a></li>
<li>feat(client): add a <code>TrySendError::error()</code> method by <a
href="https://github.com/cratelyn"><code>@​cratelyn</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3885">hyperium/hyper#3885</a></li>
<li>fix(http2): add decriptive error for non-zero connect request by <a
href="https://github.com/samp5"><code>@​samp5</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3886">hyperium/hyper#3886</a></li>
<li>refactor(lib): drop futures-util except in ffi by <a
href="https://github.com/hanna-kruppe"><code>@​hanna-kruppe</code></a>
in <a
href="https://redirect.github.com/hyperium/hyper/pull/3890">hyperium/hyper#3890</a></li>
<li>fix(date): improve caching accuracy by <a
href="https://github.com/Patryk27"><code>@​Patryk27</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3887">hyperium/hyper#3887</a></li>
<li>docs(SECURITY): update policy to use GSA drafts when reporting
vulnerabilities by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper/pull/3894">hyperium/hyper#3894</a></li>
<li>feat: add Error::is_shutdown() by <a
href="https://github.com/joshka"><code>@​joshka</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3863">hyperium/hyper#3863</a></li>
<li>docs: improve ext module overview by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper/pull/3921">hyperium/hyper#3921</a></li>
<li>docs(rt): improve rt module overview by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper/pull/3920">hyperium/hyper#3920</a></li>
<li>chore(ci): update to cargo-check-external-types-0.3.0 by <a
href="https://github.com/tottoto"><code>@​tottoto</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3928">hyperium/hyper#3928</a></li>
<li>test(common): add missing assertion in full_rewind test by <a
href="https://github.com/1911860538"><code>@​1911860538</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3926">hyperium/hyper#3926</a></li>
<li>fix(lib): avoid implicit cargo feature by <a
href="https://github.com/hanna-kruppe"><code>@​hanna-kruppe</code></a>
in <a
href="https://redirect.github.com/hyperium/hyper/pull/3931">hyperium/hyper#3931</a></li>
<li>feat(http1): add allow_multiple_spaces_in_request_line_delimiters h1
builder config method by <a
href="https://github.com/mccordryan"><code>@​mccordryan</code></a> in <a
href="https://redirect.github.com/hyperium/hyper/pull/3929">hyperium/hyper#3929</a></li>
<li>Prepare v1.7.0 by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper/pull/3933">hyperium/hyper#3933</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/jimmycathy"><code>@​jimmycathy</code></a> made
their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3855">hyperium/hyper#3855</a></li>
<li><a href="https://github.com/Muffeter"><code>@​Muffeter</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3873">hyperium/hyper#3873</a></li>
<li><a href="https://github.com/samp5"><code>@​samp5</code></a> made
their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3886">hyperium/hyper#3886</a></li>
<li><a
href="https://github.com/hanna-kruppe"><code>@​hanna-kruppe</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3890">hyperium/hyper#3890</a></li>
<li><a href="https://github.com/Patryk27"><code>@​Patryk27</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3887">hyperium/hyper#3887</a></li>
<li><a href="https://github.com/joshka"><code>@​joshka</code></a> made
their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3863">hyperium/hyper#3863</a></li>
<li><a
href="https://github.com/1911860538"><code>@​1911860538</code></a> made
their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3926">hyperium/hyper#3926</a></li>
<li><a
href="https://github.com/mccordryan"><code>@​mccordryan</code></a> made
their first contribution in <a
href="https://redirect.github.com/hyperium/hyper/pull/3929">hyperium/hyper#3929</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/hyper/blob/master/CHANGELOG.md">hyper's
changelog</a>.</em></p>
<blockquote>
<h2>v1.7.0 (2025-08-18)</h2>
<h4>Bug Fixes</h4>
<ul>
<li><strong>server:</strong> improve caching accuracy of Date header (<a
href="https://redirect.github.com/hyperium/hyper/issues/3887">#3887</a>)
(<a
href="436cadd1ac">436cadd1</a>)</li>
</ul>
<h4>Features</h4>
<ul>
<li><strong>client:</strong>
<ul>
<li>add a <code>TrySendError::error()</code> method (<a
href="https://redirect.github.com/hyperium/hyper/issues/3885">#3885</a>)
(<a
href="efa0b26958">efa0b269</a>)</li>
<li>add a <code>TrySendError::message()</code> method (<a
href="https://redirect.github.com/hyperium/hyper/issues/3884">#3884</a>)
(<a
href="03fd6aff88">03fd6aff</a>)</li>
</ul>
</li>
<li><strong>error:</strong> add <code>Error::is_shutdown()</code> (<a
href="https://redirect.github.com/hyperium/hyper/issues/3863">#3863</a>)
(<a
href="b8affd8a2e">b8affd8a</a>,
closes <a
href="https://redirect.github.com/hyperium/hyper/issues/2745">#2745</a>)</li>
<li><strong>server:</strong> add
<code>allow_multiple_spaces_in_request_line_delimiters</code> http1
builder method (<a
href="https://redirect.github.com/hyperium/hyper/issues/3929">#3929</a>)
(<a
href="9749184f8a">9749184f</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="400bdfdace"><code>400bdfd</code></a>
v1.7.0</li>
<li><a
href="9749184f8a"><code>9749184</code></a>
feat(server): add
<code>allow_multiple_spaces_in_request_line_delimiters</code> http1
bu...</li>
<li><a
href="caa166c756"><code>caa166c</code></a>
chore(dependencies): avoid implicit cargo feature of futures-util (<a
href="https://redirect.github.com/hyperium/hyper/issues/3931">#3931</a>)</li>
<li><a
href="8ad2595c03"><code>8ad2595</code></a>
test(common): add missing assertion in full_rewind test (<a
href="https://redirect.github.com/hyperium/hyper/issues/3926">#3926</a>)</li>
<li><a
href="24f0da8636"><code>24f0da8</code></a>
chore(ci): update to cargo-check-external-types-0.3.0 (<a
href="https://redirect.github.com/hyperium/hyper/issues/3928">#3928</a>)</li>
<li><a
href="974289fb3d"><code>974289f</code></a>
docs(rt): improve <code>rt</code> module overview (<a
href="https://redirect.github.com/hyperium/hyper/issues/3920">#3920</a>)</li>
<li><a
href="283fd2381d"><code>283fd23</code></a>
docs: improve <code>ext</code> module overview and <code>Protocol</code>
docs (<a
href="https://redirect.github.com/hyperium/hyper/issues/3921">#3921</a>)</li>
<li><a
href="b8affd8a2e"><code>b8affd8</code></a>
feat(error): add <code>Error::is_shutdown()</code> (<a
href="https://redirect.github.com/hyperium/hyper/issues/3863">#3863</a>)</li>
<li><a
href="c88df7886c"><code>c88df78</code></a>
docs(SECURITY): update policy to use GSA drafts when reporting
vulnerabilitie...</li>
<li><a
href="436cadd1ac"><code>436cadd</code></a>
fix(server): improve caching accuracy of Date header (<a
href="https://redirect.github.com/hyperium/hyper/issues/3887">#3887</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/hyperium/hyper/compare/v1.6.0...v1.7.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hyper&package-manager=cargo&previous-version=1.6.0&new-version=1.7.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-08-18 23:53:21 +00:00
dependabot[bot]
688ef9e64a build(deps): bump cc from 1.2.32 to 1.2.33 (#38764)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.32 to 1.2.33.
<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.32...cc-v1.2.33">1.2.33</a>
- 2025-08-15</h2>
<h3>Other</h3>
<ul>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1521">#1521</a>)</li>
<li>[win][arm64ec] Add testing for Arm64EC Windows (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1512">#1512</a>)</li>
<li>Fix parsing of nigthly targets (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1517">#1517</a>)</li>
<li>[win][arm64ec] Fix finding assembler and setting is_arm for Arm64EC
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1511">#1511</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a92892393c"><code>a928923</code></a>
chore: release v1.2.33 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1522">#1522</a>)</li>
<li><a
href="9c33178e20"><code>9c33178</code></a>
Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1521">#1521</a>)</li>
<li><a
href="220d772624"><code>220d772</code></a>
Bump actions/checkout from 4 to 5 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1520">#1520</a>)</li>
<li><a
href="9de267d18b"><code>9de267d</code></a>
[win][arm64ec] Add testing for Arm64EC Windows (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1512">#1512</a>)</li>
<li><a
href="37fc899632"><code>37fc899</code></a>
Fix gen-windows-sys-binding (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1518">#1518</a>)</li>
<li><a
href="de7e8d5f32"><code>de7e8d5</code></a>
Fix parsing of nigthly targets (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1517">#1517</a>)</li>
<li><a
href="ca81dcc1a7"><code>ca81dcc</code></a>
[win][arm64ec] Fix finding assembler and setting is_arm for Arm64EC (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1511">#1511</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.32...cc-v1.2.33">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.32&new-version=1.2.33)](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-08-18 23:47:12 +00:00
Taym Haddadi
c4d2b63ef1 Implement AbortSignal static abort(reason) (#38746)
Implement AbortSignal static abort(reason)

part of #36936

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-08-18 21:32:39 +00:00
Jonathan Schwender
25fea1e086 Fix ./mach build --no-default-features (#35922)
Fix build failures when building without default features.

Testing: This was manually tested, but this PR does not add automated
tests of `--no-default-features` to CI.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-18 18:40:08 +00:00
Euclid Ye
ec5872992b webdriver: Reuse JSValue as WebDriverJSValue (#38751)
After #38748, `WebDriverJSValue` is almost same as `JSValue`. Now we
turn "potentially merge into one in the future" into reality. The only
thing we should be cautious is to properly serialize `WebFrame`,
`WebWindow`, `WebElement` for WebDriver.

Testing: No regression. Some error is fixed previously by #38709 which
didn't update test :)
Binary size reduced by 134KB.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-18 17:38:48 +00:00
Simon Wülker
7471ad7730 fonts: Implement CSS font-variation-settings property for FreeType platforms (#38642)
This change adds support for variable fonts via the
[`font-variation-settings`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variation-settings)
property.

There are three areas where we need to set the variation values:
* Webrender (`compositor.rs`), for drawing the glyphs
* Harfbuzz (`shaper.rs`), for most shaping tasks
* PlatformFont (`fonts/platform/`), for horizontal advances and kerning

For now, freetype is the only platform shaper that supports variable
fonts. I can't easily test the fonts with non-freetype shapers. Thats
why variable fonts are behind the `layout_variable_fonts_enabled` pref,
which is disabled by default.

<img width="1250" height="710" alt="image"
src="https://github.com/user-attachments/assets/1aee1407-f3a2-42f6-a106-af0443fcd588"
/>

<details><summary>HTML test file</summary>

```html
<style>
@font-face {
  font-family: "Amstelvar VF";
  src: url("https://mdn.github.io/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.woff2")
    format("woff2-variations");
  font-weight: 300 900;
  font-stretch: 35% 100%;
  font-style: normal;
  font-display: swap;
}

p {
  font:
    1.2em "Amstelvar VF",
    Georgia,
    serif;
  font-size: 4rem;
  margin: 1rem;
  display: inline-block;
}

.p1 {
  font-variation-settings: "wght" 300;
}

.p2 {
  font-variation-settings: "wght" 625;
}

.p3 {
  font-variation-settings: "wght" 900;
}

</style>
<div>
  <p class="p1">Weight</p>
  <span>(font-variation-settings: "wght" 300)</span>
</div>
<div>
  <p class="p2">Weight</p>
  <span>(font-variation-settings: "wght" 625)</span>
</div>
<div>
  <p class="p3">Weight</p>
  <span>(font-variation-settings: "wght" 900)</span>
</div>
</div>
```
</details>



https://github.com/user-attachments/assets/9e21101a-796a-49fe-b82c-8999d8fa9ee1


Testing: Needs decision on whether we want to enable the pref in CI
Works towards https://github.com/servo/servo/issues/37236

Depends on https://github.com/servo/stylo/pull/230

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-18 16:30:14 +00:00
JoeDow
ce16fbce75 script: Mark the entire shadow tree for restyle when its stylesheet is invalidated (#38529)
This change fix this bugs: modify stylesheet of shadow tree does not
take effect if there is no other Dom change within the shadow tree
happens.

Fixes: This change fix some bugs reported by this issue #38211. 
Testing: This fixes some subtests in
`/css/cssom/CSSStyleSheet-constructable.html` and
`/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html`,
and make some subtest failed in
`/css/cssom/CSSStyleSheet-constructable-baseURL.html`, because the
`BaseUrl` is not yet supported for `CSSStylesheet`.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-08-18 12:48:35 +00:00
Martin Robinson
5c885d61ad fonts: Have CoreTextFontCache::core_text_font return a PlatformFont (#38758)
This will make it easier in a followup to include the normalized font
variations in the return value. This also make
`PlatformFont::ensure_h_kern_subtable` work on the instance instead of
being a struct method. Finally, all `PlatformFont` methods are combined
into a single impl block.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-18 12:32:20 +00:00
Martin Robinson
6fdf40dce7 layout: Always build Tag and BaseFragmentInfo with ServoThreadSafeLayoutNode (#38680)
This cleanup makes the interface a bit simpler and prevents problems
where the pseudo-element information is not passed by accident.

Testing: This should not change behavior, so is covered by existing
tests.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-18 12:19:09 +00:00
Martin Robinson
8743a11ba4 tidy: Add a rule ensuring that // comments are followed by a space in Rust (#38698)
This shows up sometimes in code reviews, so it makes sense that tidy
enforces it. `rustfmt` supports this via comment normalization, but it
does many other things and is still an unstable feature (with bugs).

Testing: There are new tidy tests for this change.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-18 12:09:09 +00:00
Simon Wülker
8ca00a3b0c Add missing backtick in README.md (#38757)
The build instructions for OHOS were missing a backtick.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-18 11:53:08 +00:00
Jo Steven Novaryo
7489a0349f layout: Do not include position:fixed children when calculating scrollable overflow for root element (#38618)
Reimplementation of: #35931

For a `FragmentTree` we define a scrollable overflow calculation that
includes the overflow all of it's children `Fragments`. In practice we
are using this calculation for scrolling area of the viewport and
defining the root scroll frames. However, since uncontained fixed
positioned element is located outside of the document and should not be
scrolled, and therefore it would make no sense to include them in the
calculation of its scrollable overflow as well.

Testing: New and existing WPT tests
Fixes: #38617
Fixes: #38182

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-08-18 11:25:31 +00:00
Nico Burns
7dcd89a6f9 Use built-in conversion function from unicode_script to convert script for harfbuzz (#38704)
Replaces a big match statement with a call to `unicode_script`'s
`Script::short_name` method which has the same big match statement. We
special case `Script::Unknown` because the `short_name` method returns
empty string for that variant, but harfbuzz represents it with `Zzzz`.

EDIT: `Zzzz` seems to be in the spec so I've sent a PR to
`unicode_script` to use it:
https://github.com/unicode-rs/unicode-script/pull/23
EDIT: And https://github.com/unicode-rs/unicode-script/pull/24 which
would allow us to remove this method entirely.

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-18 08:16:29 +00:00
Jerens Lensun
788d6db94d script_bindings(python): Add ruff rule for strict typing in function (#38694)
This is part of introducing the Ruff rule [flake8-annotations
(ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) into
the script_bindings folder.

Since `codegen.py` has 10k lines of code, the strategy is to introduce
the rule first while ignoring the `ANN` Ruff rule for `codegen.py`. We
will then gradually add type annotations slice by slice to ensure no new
errors occur outside of `ANN`.

Testing: `./mach test-wpt webidl`

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-18 07:26:30 +00:00
Josh Matthews
27dededa65 Enable dom_abort_controller_enabled for AbortController test subdirectory (#38749)
Since we don't enable the preference as part of
`--enable-experimental-web-platform-features` yet, we don't run any
automated tests for the AbortController feature. This change means that
we at least explicitly test the interface.

Testing: Just enabling new tests.
Part of: https://github.com/servo/servo/issues/34866

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-18 07:25:04 +00:00
Jonathan Schwender
2e6219b52d CI: Bump setup-ohos-sdk to 0.2.3 (#38741)
Includes a fix, which deletes the SDK for ohos-native hosts, saving some
disk and cache space, since we only need the version for linux hosts.

Testing: [mach try
ohos](https://github.com/jschwe/servo/actions/runs/17024914816)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-18 05:54:31 +00:00
Euclid Ye
ce9425f3e8 embedder: Remove Int variant from WebDriverJSValue (#38748)
According to
[spec](https://w3c.github.io/webdriver/#dfn-json-deserialize), we should
only care about
[Number](https://262.ecma-international.org/5.1/#sec-4.3.19) that is
f64.

This change also closes the gap between `JSValue` and `WebDriverJSValue`
and potentially merge into one in the future.

Testing: No regression. However, we have lots of TIMEOUT due to
https://github.com/servo/servo/pull/38622.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-18 04:39:52 +00:00
Simon Wülker
e19fade481 Replace FreeTypeFaceHelpers with a safe wrapper struct (#38634)
Testing: only safety annotations change, no tests are required.
Fixes: https://github.com/servo/servo/issues/38627

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-17 21:46:16 +00:00
Tim van der Lippe
4de9a9d100 Implement trusted types for setTimeout/setInterval (#38736)
I had a difficult time figuring out where the relevant steps had to be
added. Therefore, I aggressively commented the spec steps so eventually
I discovered where I should add them.

Part of #36258

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-08-17 20:53:16 +00:00
Tim van der Lippe
a31235e52b Add trusted type checks for global event handler attributes (#38718)
This only covers the global event handlers for now, while I figure out
which others we are missing. We don't seem to be missing the
WindowEventHandlers, but not sure where the others coming from.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-17 19:44:22 +00:00
Josh Matthews
9da8142e2a fonts: Measure more FontContext heap usage. (#38733)
Replace a hand-written MallocSizeOf implementation with an automatically
derived one. This exposes more than 1MB of previously-untracked heap
data on servo.org.

Testing: Compared about:memory output for servo.org before and after.
Part of: #11559

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-17 18:59:30 +00:00
Kingsley Yung
d490c5c06b script: Throw error when lower is greater than upper in IDBKeyRange (#38735)
IDBKeyRange::Bound doesn't check if the lower bound is greater than the
upper bound. When this happens, it should throw DataError.

Reference: Step 5 of
<https://www.w3.org/TR/IndexedDB-2/#dom-idbkeyrange-bound>

Testing: Passing WPT tests that were expected to fail before.

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-08-17 15:21:45 +00:00
Jonathan Schwender
ee781b71b4 tests: Vendor blink perf tests (#38654)
Vendors the [blink perf
tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/).
These perf tests are useful to evaluate the performance of servo. 
The license that governs the perf tests is included in the folder. 
Running benchmark cases automatically is left to future work.

The update.py script is taken from mozjs and slightly adapted, so we can
easily filter
(and patch if this should be necessary in the future.

Testing: This PR just adds the perf_tests, but does not use or modify
them in any way.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-17 09:54:04 +00:00
Ashwin Naren
7621332824 tests: Turn on IndexedDB tests and update results (#38722)
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-17 08:32:29 +00:00
Servo WPT Sync
fbf0eb11a2 Sync WPT with upstream (17-08-2025) (#38721)
Automated downstream sync of changes from upstream as of 17-08-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-08-17 01:49:38 +00:00
Rahul Menon
389277fa72 content: Make QuotaExceededError serializable (#38720)
Implements (de)serialization behavior for QuotaExceededError and enables
the annotation on the WebIDL spec.

Testing: Adds its own WPT tests
Fixes: https://github.com/servo/servo/issues/38685

---------

Signed-off-by: Rahul Menon <menonrahul02@gmail.com>
2025-08-16 20:33:37 +00:00
Josh Matthews
e80d36783a script: Ensure JS->webdriver conversions have a non-empty settings stack (#38709)
JS scripts that are evaluated already run with an [entry
script](https://html.spec.whatwg.org/#entry) on the script settings
stack. The codepaths that do something with the return value (eg.
WebDriver and embedder JS evaluation) have the potential to run
additional JS, since they can trigger getters for arbitrary properties
of objects, so they also need an entry script present in case code like
e649b9b91d/components/script/dom/location.rs (L182)
is executed.

Testing: Added a regression unit test.
Fixes: #38692

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-16 17:14:56 +00:00
Josh Matthews
f19b2f6e84 Add preference observer API for runtime webxr preference changes (#38649)
Adds a global preference observer that is notified whenever any
preference value is updated. This is used to support runtime
configuration of WebXR automated testing, which is a prerequisite for
running multiple WPT tests in a single browser session.

Testing: Ran `./mach test-wpt /webxr --product=servodriver`
Fixes: #38647

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-16 08:49:13 +00:00
Ashwin Naren
fc3feceee5 Switch indexeddb backend to sqlite and improve IPC messaging (#38187)
- Use sqlite instead of heed. (one indexed database = one sqlite
database)
- Implement the backend for indexes
- Use keyranges where needed (as specified by the spec)
- Implement `getKey`
- Fix channel error messaging (led to a bunch of changes to how async
requests are handled)

Note: `components/net/indexeddb/engines/sqlite/serialize.rs` is unused;
I can delete it if needed.

Testing: Switching to sqlite eliminated many panics (exposing some new
failures).
Fixes: #38040

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-16 07:27:17 +00:00
Ashwin Naren
f4bbdf8010 net: Fix possible indexeddb key range singleton related panic (#38281)
If `.as_singleton()` was called on a range that had both lower and upper
set as `None`, it would have panicked.

Testing: Nothing seems to have changed
Fixes: #37647

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-16 03:19:01 +00:00
Servo WPT Sync
e649b9b91d Sync WPT with upstream (16-08-2025) (#38706)
Automated downstream sync of changes from upstream as of 16-08-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-08-16 00:46:10 +00:00
sagudev
85588fada0 compositing: Use webrender_api::ExternalImageSource instead of WebRenderImageSource (#38703)
There is no reason to roll our own type.

Motivation: I need `ExternalImageSource::Invalid`.

Testing: Covered by existing WPT tests, but it's just refactor

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-15 19:39:07 +00:00
Tim van der Lippe
18e05d3aab Implement trusted types for setAttribute (#38700)
Callers now call `set_attribute` directly, to avoid the trusted types
machinery, as well as skip validation. That's not required by spec as
well.

This implements part of the DOM integration from
https://github.com/whatwg/dom/pull/1268

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-15 19:18:19 +00:00
dependabot[bot]
8290761066 build(deps): bump async-trait from 0.1.88 to 0.1.89 (#38702)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.88
to 0.1.89.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/async-trait/releases">async-trait's
releases</a>.</em></p>
<blockquote>
<h2>0.1.89</h2>
<ul>
<li>Improve IDE functionality (<a
href="https://redirect.github.com/dtolnay/async-trait/issues/293">#293</a>,
thanks <a
href="https://github.com/Veykril"><code>@​Veykril</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a7e91e98a5"><code>a7e91e9</code></a>
Release 0.1.89</li>
<li><a
href="fbcfcaca02"><code>fbcfcac</code></a>
Merge pull request 293 from Veykril/lw/quote_spanned</li>
<li><a
href="fd93990620"><code>fd93990</code></a>
Improve use of spans in <code>quote_spanned</code></li>
<li><a
href="a5093fe762"><code>a5093fe</code></a>
Add type-mismatch ui test</li>
<li><a
href="6d12b44116"><code>6d12b44</code></a>
Revert &quot;Pin nightly toolchain used for miri job&quot;</li>
<li><a
href="dd9e4bad1b"><code>dd9e4ba</code></a>
Hide unused_variables warning in consider-restricting.rs ui test</li>
<li><a
href="b454fc869a"><code>b454fc8</code></a>
Update ui test suite to nightly-2025-08-03</li>
<li><a
href="9c880e85d8"><code>9c880e8</code></a>
Update ui test suite to nightly-2025-07-30</li>
<li><a
href="7ca751d0b3"><code>7ca751d</code></a>
Ignore unused_parens warning in test</li>
<li><a
href="2bccfeb461"><code>2bccfeb</code></a>
Update ui test suite to nightly-2025-05-28</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/async-trait/compare/0.1.88...0.1.89">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-trait&package-manager=cargo&previous-version=0.1.88&new-version=0.1.89)](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-08-15 17:25:36 +00:00
dependabot[bot]
3f2bb0eda3 build(deps): bump the egui-related group with 7 updates (#38701)
Bumps the egui-related group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [egui](https://github.com/emilk/egui) | `0.32.0` | `0.32.1` |
| [egui-winit](https://github.com/emilk/egui) | `0.32.0` | `0.32.1` |
| [egui_glow](https://github.com/emilk/egui) | `0.32.0` | `0.32.1` |
| [ecolor](https://github.com/emilk/egui) | `0.32.0` | `0.32.1` |
| [emath](https://github.com/emilk/egui) | `0.32.0` | `0.32.1` |
| [epaint](https://github.com/emilk/egui) | `0.32.0` | `0.32.1` |
| [epaint_default_fonts](https://github.com/emilk/egui) | `0.32.0` |
`0.32.1` |

Updates `egui` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">egui's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">egui's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="707a339047"><code>707a339</code></a>
Bump version numbers to 0.32.1</li>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="4fcd1d13e3"><code>4fcd1d1</code></a>
Update to winit 0.30.12 (<a
href="https://redirect.github.com/emilk/egui/issues/7420">#7420</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `egui-winit` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">egui-winit's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">egui-winit's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li><a
href="85c4b1dce7"><code>85c4b1d</code></a>
Fix glyph rendering: clamp coverage to [0, 1] (<a
href="https://redirect.github.com/emilk/egui/issues/7415">#7415</a>)</li>
<li><a
href="2f7bcf26f2"><code>2f7bcf2</code></a>
Fix multi-line <code>TextShape</code> rotation (<a
href="https://redirect.github.com/emilk/egui/issues/7404">#7404</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `egui_glow` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">egui_glow's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">egui_glow's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li><a
href="85c4b1dce7"><code>85c4b1d</code></a>
Fix glyph rendering: clamp coverage to [0, 1] (<a
href="https://redirect.github.com/emilk/egui/issues/7415">#7415</a>)</li>
<li><a
href="2f7bcf26f2"><code>2f7bcf2</code></a>
Fix multi-line <code>TextShape</code> rotation (<a
href="https://redirect.github.com/emilk/egui/issues/7404">#7404</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `ecolor` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">ecolor's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">ecolor's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="707a339047"><code>707a339</code></a>
Bump version numbers to 0.32.1</li>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="4fcd1d13e3"><code>4fcd1d1</code></a>
Update to winit 0.30.12 (<a
href="https://redirect.github.com/emilk/egui/issues/7420">#7420</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `emath` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">emath's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">emath's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li><a
href="85c4b1dce7"><code>85c4b1d</code></a>
Fix glyph rendering: clamp coverage to [0, 1] (<a
href="https://redirect.github.com/emilk/egui/issues/7415">#7415</a>)</li>
<li><a
href="2f7bcf26f2"><code>2f7bcf2</code></a>
Fix multi-line <code>TextShape</code> rotation (<a
href="https://redirect.github.com/emilk/egui/issues/7404">#7404</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `epaint` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">epaint's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">epaint's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li><a
href="85c4b1dce7"><code>85c4b1d</code></a>
Fix glyph rendering: clamp coverage to [0, 1] (<a
href="https://redirect.github.com/emilk/egui/issues/7415">#7415</a>)</li>
<li><a
href="2f7bcf26f2"><code>2f7bcf2</code></a>
Fix multi-line <code>TextShape</code> rotation (<a
href="https://redirect.github.com/emilk/egui/issues/7404">#7404</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `epaint_default_fonts` from 0.32.0 to 0.32.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/releases">epaint_default_fonts's
releases</a>.</em></p>
<blockquote>
<h2>0.32.1 - Misc bug fixes</h2>
<p>egui is an easy-to-use immediate mode GUI for Rust that runs on both
web and native.</p>
<p>Try it now: <a
href="https://www.egui.rs/">https://www.egui.rs/</a></p>
<p>egui development is sponsored by <a
href="https://www.rerun.io/">Rerun</a>, a startup building an SDK for
visualizing streams of multimodal data.</p>
<h1>egui changelog</h1>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
<h1>eframe changelog</h1>
<ul>
<li>Enable wgpu default features in eframe / egui_wgpu default features
<a href="https://redirect.github.com/emilk/egui/pull/7344">#7344</a> by
<a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Request a redraw when the url change through the
<code>popstate</code> event listener <a
href="https://redirect.github.com/emilk/egui/pull/7403">#7403</a> by <a
href="https://github.com/irevoire"><code>@​irevoire</code></a></li>
</ul>
<h1>egui_kittest changelog</h1>
<ul>
<li>Fix <code>UPDATE_SNAPSHOTS</code>: only update if we didn't pass the
test <a
href="https://redirect.github.com/emilk/egui/pull/7455">#7455</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/emilk/egui/blob/main/CHANGELOG.md">epaint_default_fonts's
changelog</a>.</em></p>
<blockquote>
<h2>0.32.1 - 2025-08-15 - Misc bug fixes</h2>
<h3> Added</h3>
<ul>
<li>Add <code>ComboBox::popup_style</code> <a
href="https://redirect.github.com/emilk/egui/pull/7360">#7360</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
</ul>
<h3>🐛 Fixed</h3>
<ul>
<li>Fix glyph rendering: clamp coverage to [0, 1] <a
href="https://redirect.github.com/emilk/egui/pull/7415">#7415</a> by <a
href="https://github.com/emilk"><code>@​emilk</code></a></li>
<li>Fix manual <code>Popup</code> not closing <a
href="https://redirect.github.com/emilk/egui/pull/7383">#7383</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>WidgetText::Text</code> ignoring fallback font and
overrides <a
href="https://redirect.github.com/emilk/egui/pull/7361">#7361</a> by <a
href="https://github.com/lucasmerlin"><code>@​lucasmerlin</code></a></li>
<li>Fix <code>override_text_color</code> priority <a
href="https://redirect.github.com/emilk/egui/pull/7439">#7439</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
<li>Fix debug-panic in ScrollArea if contents fit without scrolling <a
href="https://redirect.github.com/emilk/egui/pull/7440">#7440</a> by <a
href="https://github.com/YgorSouza"><code>@​YgorSouza</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ead6926895"><code>ead6926</code></a>
Update changelogs</li>
<li><a
href="03fb443669"><code>03fb443</code></a>
Only update snapshot if we didn't pass (<a
href="https://redirect.github.com/emilk/egui/issues/7455">#7455</a>)</li>
<li><a
href="d739a4b880"><code>d739a4b</code></a>
Request a redraw when the url change through the <code>popstate</code>
event listener (#...</li>
<li><a
href="b732992f69"><code>b732992</code></a>
Fix debug-panic in ScrollArea if contents fit without scrolling (<a
href="https://redirect.github.com/emilk/egui/issues/7440">#7440</a>)</li>
<li><a
href="7036d6a982"><code>7036d6a</code></a>
Fix <code>override_text_color</code> priority (<a
href="https://redirect.github.com/emilk/egui/issues/7439">#7439</a>)</li>
<li><a
href="97fe124443"><code>97fe124</code></a>
Fix <code>WidgetText::Text</code> ignoring fallback font and overrides
(<a
href="https://redirect.github.com/emilk/egui/issues/7361">#7361</a>)</li>
<li><a
href="1ad374f255"><code>1ad374f</code></a>
Fix manual <code>Popup</code> not closing (<a
href="https://redirect.github.com/emilk/egui/issues/7383">#7383</a>)</li>
<li><a
href="1afbb9791a"><code>1afbb97</code></a>
Add <code>ComboBox::popup_style</code> (<a
href="https://redirect.github.com/emilk/egui/issues/7360">#7360</a>)</li>
<li><a
href="85c4b1dce7"><code>85c4b1d</code></a>
Fix glyph rendering: clamp coverage to [0, 1] (<a
href="https://redirect.github.com/emilk/egui/issues/7415">#7415</a>)</li>
<li><a
href="2f7bcf26f2"><code>2f7bcf2</code></a>
Fix multi-line <code>TextShape</code> rotation (<a
href="https://redirect.github.com/emilk/egui/issues/7404">#7404</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/emilk/egui/compare/0.32.0...0.32.1">compare
view</a></li>
</ul>
</details>
<br />


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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-15 17:13:58 +00:00
Martin Robinson
8d60353d14 script: Add presentation attributes as part of a single PropertyDeclarationBlock (#38684)
Instead of making a block for each attribute, use a single block as
described in a `FIXME` comment by @emilio. This also switch to using
`map` and `and_then` in more places to make the code a bit more concise.

Testing: This should not change behavior other than to incraese
efficiency a
bit and is thus covered by existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-15 16:26:00 +00:00
Nico Burns
046dbd86a1 fonts: Use skrifa to get raw font table data on Linux (#38690)
Use skrifa instead of freetype for extracting raw table data. Allows us
to replace unsafe Freetype code with safe Skrifa code. Also allows us to
avoid copying the table data. Instead we return Arc'd data.

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-15 11:30:29 +00:00
Jerens Lensun
a4fdbe8be3 mach: add type annotation in function for 'python/servo' folder (#38592)
This part of function strictly typed in python by adding ANN rule in
ruff, similiar to #38531.

Testing: `./mach test-tidy`
Fixes: Not related to any issues

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-15 10:37:24 +00:00
Euclid Ye
494493ceb7 Rename InputEvent::MouseLeave to InputEvent::MouseLeftViewport (#38695)
1. `InputEvent::MouseLeave` indicates that mouse has left the viewport
(fired by embedder) or iframe (synthesized in Constellation
f24f225db8/components/constellation/constellation_webview.rs (L119-L122)).
Its handler in script is named as `handle_mouse_leave_event`, which is
very misleading as we have DOM event
[mouseleave](https://w3c.github.io/uievents/#event-type-mouseleave). I
rename it to `MouseLeftViewport` to be consistent with
`WindowEvent::CursorLeft`:
f24f225db8/ports/servoshell/desktop/headed_window.rs (L632-L638)
2. Add doc and rename function, such as `handle_mouse_move_event` to
`handle_native_mouse_move_event` to be closer to
[spec](https://w3c.github.io/uievents/#handle-native-mouse-move).

Testing: Just renaming + skipping unnecessary hit-test in simple case.
Fixes: Nothing but preparing for #38670 and #38435.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-15 09:54:54 +00:00
JoeDow
8b574539d1 script: Ensure notify_invalidations() is always called when modifying stylesheets (#38530)
This change supplements the missing stylesheet invalidation
notifications to fix some bugs that the modification of stylesheet does
not take effect. Additionally, this PR add a RAII thing to mark the
modification scope of stylesheet rules, which will facilitate to add
extra logic before the modification happens.

Fixes: there is relevant issue #38211 , but it can't be fixed by this
PR.
Testing: This fixes some subtests in
`/css/cssom/CSSStyleSheet-constructable.html`.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-08-15 09:14:34 +00:00
Euclid Ye
aca4bde93d servoshell: Do not send mouse button events to Servo that happen outside the WebView (#38696)
`webview_relative_mouse_point` can have negative y-coordinate when at
toolbar, but we still would notify compositor the native mousebutton
event to do hit-test.

Testing: This fixes the way that mouse events are passed from servoshell
to Servo,
but there is currently no way to test those kind of interactions.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-15 08:55:25 +00:00
Usman Yahaya Baba
02dca0fb21 net: Send ResponseContentObj to Devtools (#38625)
Currently, the response tab for a request's detail in devtools does not
show the available data, this was due to how the content is being
structured (not the way firefox's devtools client expects it) and also
the body being discarded and not stored in the actor.
This PR stores the body in the actor , which is then retrieved in
`getResponseContent` and then use it to instantiate the new struct
`ResponseContentObj` which matches the format firefox's expects

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

---------

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-08-15 08:26:24 +00:00
minghuaw
d409137e4c Script: Implement TextEncoderStream (#38466)
This implements the `TextEncoderStream` WebIDL interface. 

Testing: Existing WPT tests should be sufficient
Fixes: #37724

---------

Signed-off-by: minghuaw <wuminghua7@huawei.com>
2025-08-15 07:57:00 +00:00
batu_hoang
f24f225db8 webdriver: Implement the "Get Window Handles" command (#38622)
Implment get window handles according to
[spec](https://w3c.github.io/webdriver/#dfn-window-handles).
- Window handles are supposed to identify `browsing context`. However,
based on `get window handle command` and `get window handles command`,
we only need to care about top level browsing context.
- Back then, we use a random generated uuid for eacch webview id, it is
not correct but still work because all commands depend on `webview id`
and `browsing context id`. The only case we need window handle is is
when webdriver gets window object with js script. Since the object is
converted to the id of window's document node, `get window handle`
should return the same thing.

Action run (with updated expectation):
https://github.com/longvatrong111/servo/actions/runs/16957610535
https://github.com/longvatrong111/servo/actions/runs/16957612027

Some tests may sporadically timeout due to unstable hit test.

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-08-15 03:30:56 +00:00
Euclid Ye
dafb0abf31 script: Stop handling native mousedown and mouseup for disabled elements (#38671)
According to spec of
[hit-test](https://w3c.github.io/uievents/#hit-test) for native mouse
event, mousedown/mouseup should also be excluded when interacting with
disabled element, even tho it may be the frontmost of
[elementFromPoint](https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint).

Testing: Now it matches the behaviour of other browsers in #38670 for
disabled element. Also testdriver test:
`tests\wpt\tests\html\semantics\disabled-elements\disabled-event-dispatch.tentative.html`
has 4 more passing tests.
Fixes: Part of #38670.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-15 01:24:47 +00:00
dependabot[bot]
89bd01a3b4 build(deps): bump rayon from 1.10.0 to 1.11.0 (#38686)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.10.0 to 1.11.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rayon-rs/rayon/blob/main/RELEASES.md">rayon's
changelog</a>.</em></p>
<blockquote>
<h1>Release rayon 1.11.0 / rayon-core 1.13.0 (2025-08-12)</h1>
<ul>
<li>The minimum supported <code>rustc</code> is now 1.80.</li>
<li><code>iter::repeatn</code> has been renamed to
<code>iter::repeat_n</code> to match the name
stabilized in the standard library. The old name still exists as a
deprecated
function for compatibility.</li>
<li>Fixed a bug in <code>in_place_scope</code> when the default global
registry uses the
current thread, like on WebAssembly without threading support.</li>
<li><code>binary_heap::Iter</code> no longer requires a temporary
allocation.</li>
<li>Relaxed trait bounds on many of the public structs.</li>
<li>Implemented <code>IntoParallelIterator for Box&lt;[T]&gt;</code> and
its references.</li>
<li>Implemented <code>FromParallelIterator&lt;_&gt; for
Box&lt;str&gt;</code> via <code>String</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6236214d71"><code>6236214</code></a>
Merge <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1031">#1031</a></li>
<li><a
href="652f11176a"><code>652f111</code></a>
Release rayon 1.7.0 and rayon-core 1.11.0</li>
<li><a
href="7df001da1b"><code>7df001d</code></a>
Tweak plumbing consumer description</li>
<li><a
href="322dfe87e4"><code>322dfe8</code></a>
Merge <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1026">#1026</a></li>
<li><a
href="099241d410"><code>099241d</code></a>
Merge <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1030">#1030</a></li>
<li><a
href="a17bcb90aa"><code>a17bcb9</code></a>
Fix inappropriate use of slice::as_mut_ptr</li>
<li><a
href="98077fe07c"><code>98077fe</code></a>
Be more cautious about drain drops</li>
<li><a
href="706969515c"><code>7069695</code></a>
Merge <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1028">#1028</a></li>
<li><a
href="874ff73125"><code>874ff73</code></a>
Fix docs for the yield <code>None</code> case on
<code>ThreadPool</code></li>
<li><a
href="58f7b7ec9d"><code>58f7b7e</code></a>
Be careful comparing <code>job_ref.execute_fn</code></li>
<li>Additional commits viewable in <a
href="https://github.com/rayon-rs/rayon/compare/rayon-core-v1.10.0...rayon-core-v1.11.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rayon&package-manager=cargo&previous-version=1.10.0&new-version=1.11.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-08-14 23:11:20 +00:00
Sebastian C
027da6580e tests: Reintroduce CookieStore WPT test expectations (#38689)
CookieStore spec graduated from WICG and the test suite in WPT got
renamed to `cookiestore` from `cookie-store`. This readds the baseline
CookieStore expectations in preparation for landing an implementation.

Testing: Reenables tests and readds expectations that were removed.

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-08-14 20:57:11 +00:00
Jonathan Schwender
40e57e95b2 base: Remove last usage of static_assertions crate (#38687)
Replace static_assertions in the `size_of_test` macro with `const
assert`s. The error message is still informative.
Additionally also remove the `cfg` guard, which caused the assertion to
only be enabled on 64 bit platforms, which is something one would not
expect given the name `size_of_test` of the macro.
`cargo tree -i static_assertions` now points to only `stylo` using
`static_assertions`, so we should be able to remove this dependency
fairly easy, since the macro doesn't seem to be used there either at
first glance.

Testing: Covered by existing tests.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-14 19:02:37 +00:00
Jonathan Schwender
f492cbf8c1 base: Allow sending GenericReceiver (#38636)
Implement Serialize and Deserialize for GenericReceiver to also allow
the Receiver to be sent across
ipc channels.
This is necessary to allow using the GenericChannel in more places.

Testing: Manually tested on follow-up feature branch. Does not require
new tests.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-14 18:28:58 +00:00
Rahul Menon
b5932e5abf script: Implement QuotaExceededError WebIDL interface (#38507)
Implements the new WebIDL interface for QuotaExceededError and uses it
in appropriate places.

Testing: WPT tests. Now passing many more in
`tests/wpt/tests/WebCryptoAPI/getRandomValues.any.js` and
`tests/wpt/tests/webstorage/storage_session_setitem_quotaexceedederr.window.js`.
Fixes: #38489

---------

Signed-off-by: Rahul Menon <menonrahul02@gmail.com>
2025-08-14 17:58:50 +00:00
Jonathan Schwender
fad247c802 mozjs: Remove unneeded icu_capi features (#38666)
Reduces the binary size by around 16 MiB (ohos-production-stripped, 74M
vs 100M).

Testing: try run:
https://github.com/jschwe/servo/actions/runs/16968926330/job/48103382790

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-14 16:55:32 +00:00
Simon Wülker
6e7226961b layout: Set color and text decoration on <select> elements by default (#38570)
This makes the default style for `<select>` elements match that of gecko
(https://searchfox.org/mozilla-central/rev/a1f4cb9fc03d81be41ca2ba81294592df784364d/layout/style/res/forms.css#217-243),
with some small modifications because servo does not have fancy things
like `color: -moz-ComboboxText;`.

Testing: Includes a new web platform test
Fixes: https://github.com/servo/servo/issues/37895

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-14 14:17:48 +00:00
Martin Robinson
99ce81cf64 layout: Support storing layout data for two-level nested pseudo-elements (#38678)
Add basic support for storing layout data for pseudo-elements nested to
up to two levels. This removes the last unstored layout result and fixes
a double-borrow issue. This change does not add properly parsing nor
styling of these element types, but does prepare for those changes which
must come from stylo.

Testing: This fixes a intermittent panic in
`tests/wpt/tests/css/css-lists/nested-marker-styling.html`
Fixes: #38177. 
Closes: #38183.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-14 13:41:34 +00:00
Simon Wülker
43da933247 script: Implement CSS.registerProperty (#38682)
The implementation is mostly equivalent to
https://searchfox.org/mozilla-central/source/servo/ports/geckolib/glue.rs#9480.

Testing: New web platform tests start to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-14 13:34:02 +00:00
Simon Wülker
3a0e8fefde script: Always throw when trying to setProperty on a readonly style CSSStyleDeclaration (#38677)
Previously,
[`SetProperty`](https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty)
implemented step 3 before calling into the inner `set_property` method,
which implements step 1. Therefore if step 3 returned then step 1 never
runs, and can't throw an exception.


Testing: A new web platform test starts to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-14 13:27:39 +00:00
lumiscosity
b747589286 script: Strip javascript URL scheme using Position::AfterScheme rather than Position::BeforePath (#38599)
This makes the initial split match step 2 of
https://html.spec.whatwg.org/multipage/browsing-the-web.html#evaluate-a-javascript%3A-url.

Testing: Covered by WPT tests.
Fixes: #38547

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-14 12:49:07 +00:00
Gregory Terzian
be5e7a982b script: check if the canvas is paintable before measuring text (#38664)
The `Canvas2dMsg::MeasureText` is dropped inside `send_canvas_2d_msg` if
the canvas is not paintable,
leading to a panic on the receiving end. Checking the paint-ability
before sending the message prevents this panic, and if the canvas is not
pain-table, a default text metrics is used.

Testing: Manual testing of the minimal test case in the associated
issue, and crash test added.
Fixes: https://github.com/servo/servo/issues/36845

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-14 12:48:56 +00:00
sagudev
cf866d12b4 chore: Pin cargo-deny to 0.18.3 (#38681)
cargo-deny@0.18.4 requires Rust 1.88

Testing: Fixes CI.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-14 12:15:15 +00:00
Jerens Lensun
797db25c4e mach: Enable ANN rules (type annotations) for ruff Python linter (#38531)
This changes will introduce [flake8-annotations
(ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) for
python type annotation, this will make all thing related to function
strictly typed in python

This rule will start to affected this directory from now:
- /python -> Root directory
- /python/tidy
- /python/wpt

Testing: `./mach test-tidy`
Fixes: Not related to any issues

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-14 10:36:17 +00:00
Timothy Elems
9c1ee4be83 bencher cli flags rename (#38661)
Renames `--branch-start-point`, `--branch-start-point-hash`, and
`--branch-reset`, in favor of `--start-point`, `--start-point-hash`, and
`--start-point-reset`, according to [Bencher's
Docs](https://bencher.dev/docs/reference/changelog/#v0421).

Fixes: #38501

---------

Signed-off-by: Timmy <timmy@Timmys-Mac-mini.local>
Signed-off-by: Timothy Elems <timmy@Timmys-Mac-mini.local>
Signed-off-by: elemstimothy@protonmail.com <timmy@Timmys-Mac-mini.local>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Timmy <timmy@Timmys-Mac-mini.local>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-08-14 07:25:55 +00:00
Jonathan Schwender
d2ccce6052 opts: Use OnceLock for Options (#38638)
Currently, the options are only initialized once and then never changed.
Making this explicit allows optimizing accesses, e.g. caching opt
values.
For some options like `multiprocess` it is obvious that we would never
want to support changing the value at runtime, however there are other
options where it could be conceivable that we want to change them at
runtime. However, imho such options might be better suited to put into a
different datastructure, so that it is explicit which options can be
changed at runtime, and which are fixed.

Testing: Covered by existing tests (and manually running servo in
multiprocess mode).

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-14 07:05:11 +00:00
Euclid Ye
cd3d982a2a script: Remove duplicate context menu trigger (#38669)
#38584 moves input event handling to new `DocumentEventHandler`, but
probably reintroduced some removed code when resolving conflict with
#38589.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-14 03:47:15 +00:00
lumiscosity
97a114b248 mach: remove ubuntu version warning (#38656)
Removes the unsupported ubuntu version warning from mach. Also removes
the related version values on the Linux object, as they're not used
anywhere else nor are they maintained.

Testing: Only removes a warning, no test necessary.
Fixes: #38505.

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-13 18:56:38 +00:00
Josh Matthews
f3f981030f Enable experimental features in servodriver. (#38648)
Applies the change from https://github.com/servo/servo/pull/36335 to the
non-default servodriver WPT executor as well.

Testing: Tested manually with `--product=servodriver` on the webxr
directory.
Part of #34683

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-13 18:55:52 +00:00
Simon Wülker
dac34c0dfd fonts: Unify letter-spacing/word-spacing implementations for harfbuzz and fast path (#38657)
Servo two shapers: harfbuzz and a "fast path" for simple cases that
don't have kerning or substitution tables. Both currently implement
`letter-spacing` and `word-spacing` seperately. Theres also a slight
difference, harfbuzz will apply word spacing to preserved newlines and
the fast path won't.

This change unifies the two implementations.

Testing: Covered by existing tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-13 18:55:28 +00:00
dependabot[bot]
c741e45b21 build(deps): bump clap from 4.5.44 to 4.5.45 (#38662)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.44 to 4.5.45.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.45</h2>
<h2>[4.5.45] - 2025-08-12</h2>
<h3>Fixes</h3>
<ul>
<li><em>(unstable-v5)</em> <code>ValueEnum</code> variants now use the
full doc comment, not summary, for <code>PossibleValue::help</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.45] - 2025-08-12</h2>
<h3>Fixes</h3>
<ul>
<li><em>(unstable-v5)</em> <code>ValueEnum</code> variants now use the
full doc comment, not summary, for <code>PossibleValue::help</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="246d972a6c"><code>246d972</code></a>
chore: Release</li>
<li><a
href="a35a0761ae"><code>a35a076</code></a>
docs: Update changelog</li>
<li><a
href="9b985a3c17"><code>9b985a3</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5912">#5912</a>
from epage/takes</li>
<li><a
href="389fbe87d2"><code>389fbe8</code></a>
feat(builder): Allow flags to take num_args=0..=1</li>
<li><a
href="c395d02703"><code>c395d02</code></a>
test(parser): Show flag behavior</li>
<li><a
href="32c119efa6"><code>32c119e</code></a>
refactor(assert): Be more specific than action.takes_values</li>
<li><a
href="80ea3e7c24"><code>80ea3e7</code></a>
fix(assert): Clean up num_args/action assert</li>
<li><a
href="2bc0f45fe5"><code>2bc0f45</code></a>
fix(builder): Make ValueRange display independent of usize::MAX</li>
<li><a
href="a0187c6f3b"><code>a0187c6</code></a>
test(assert): Verify num_args/action compat</li>
<li><a
href="a8f9885250"><code>a8f9885</code></a>
refactor(builder): Be more explicit in how takes_values is used</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.44...clap_complete-v4.5.45">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.44&new-version=4.5.45)](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-08-13 18:22:35 +00:00
dependabot[bot]
591b107b3a build(deps): bump rayon-core from 1.12.1 to 1.13.0 (#38663)
Bumps [rayon-core](https://github.com/rayon-rs/rayon) from 1.12.1 to
1.13.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rayon-rs/rayon/blob/main/RELEASES.md">rayon-core's
changelog</a>.</em></p>
<blockquote>
<h1>Release rayon 1.11.0 / rayon-core 1.13.0 (2025-08-12)</h1>
<ul>
<li>The minimum supported <code>rustc</code> is now 1.80.</li>
<li><code>iter::repeatn</code> has been renamed to
<code>iter::repeat_n</code> to match the name
stabilized in the standard library. The old name still exists as a
deprecated
function for compatibility.</li>
<li>Fixed a bug in <code>in_place_scope</code> when the default global
registry uses the
current thread, like on WebAssembly without threading support.</li>
<li><code>binary_heap::Iter</code> no longer requires a temporary
allocation.</li>
<li>Relaxed trait bounds on many of the public structs.</li>
<li>Implemented <code>IntoParallelIterator for Box&lt;[T]&gt;</code> and
its references.</li>
<li>Implemented <code>FromParallelIterator&lt;_&gt; for
Box&lt;str&gt;</code> via <code>String</code>.</li>
</ul>
<h1>Release rayon 1.10.0 (2024-03-23)</h1>
<ul>
<li>The new methods <code>ParallelSlice::par_chunk_by</code> and
<code>ParallelSliceMut::par_chunk_by_mut</code> work like the slice
methods <code>chunk_by</code>
and <code>chunk_by_mut</code> added in Rust 1.77.</li>
</ul>
<h1>Release rayon 1.9.0 (2024-02-27)</h1>
<ul>
<li>The new methods
<code>IndexedParallelIterator::by_exponential_blocks</code> and
<code>by_uniform_blocks</code> allow processing items in smaller groups
at a time.</li>
<li>The new <code>iter::walk_tree</code>, <code>walk_tree_prefix</code>,
and <code>walk_tree_postfix</code>
functions enable custom parallel iteration over tree-like
structures.</li>
<li>The new method <code>ParallelIterator::collect_vec_list</code>
returns items as a linked
list of vectors, which is an efficient mode of parallel collection used
by
many of the internal implementations of <code>collect</code>.</li>
<li>The new methods
<code>ParallelSliceMut::par_split_inclusive_mut</code>,
<code>ParallelSlice::par_split_inclusive</code>, and
<code>ParallelString::par_split_inclusive</code> all work like a normal
split but
keeping the separator as part of the left slice.</li>
<li>The new <code>ParallelString::par_split_ascii_whitespace</code>
splits only on ASCII
whitespace, which is faster than including Unicode multi-byte
whitespace.</li>
<li><code>OsString</code> now implements
<code>FromParallelIterator&lt;_&gt;</code> and
<code>ParallelExtend&lt;_&gt;</code>
for a few item types similar to the standard <code>FromIterator</code>
and <code>Extend</code>.</li>
<li>The internal <code>Pattern</code> trait for string methods is now
implemented for
<code>[char; N]</code> and <code>&amp;[char; N]</code>, matching any of
the given characters.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7af20d7692"><code>7af20d7</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1265">#1265</a>
from cuviper/release-1.11.0</li>
<li><a
href="c86161af76"><code>c86161a</code></a>
Release rayon 1.11.0 / rayon-core 1.13.0</li>
<li><a
href="72345cbfdc"><code>72345cb</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1264">#1264</a>
from cuviper/mem-prelude</li>
<li><a
href="b4c58afc5a"><code>b4c58af</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1263">#1263</a>
from cuviper/boxed</li>
<li><a
href="8fdeaf34aa"><code>8fdeaf3</code></a>
Use <code>size_of</code>/<code>size_of_val</code> from the prelude</li>
<li><a
href="2a85fbf8f8"><code>2a85fbf</code></a>
<code>impl FromParallelIterator\&lt;_&gt; for Box\&lt;str&gt;</code> via
<code>String</code></li>
<li><a
href="760a97c624"><code>760a97c</code></a>
<code>impl\&lt;T&gt; IntoParallelIterator for Box\&lt;[T]&gt;</code> and
its refs</li>
<li><a
href="dcea6644cf"><code>dcea664</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1262">#1262</a>
from cuviper/relax-bounds</li>
<li><a
href="3d63a8715a"><code>3d63a87</code></a>
Relax trait bounds on many structs</li>
<li><a
href="0baaff5072"><code>0baaff5</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/rayon/issues/1261">#1261</a>
from cuviper/compounds</li>
<li>Additional commits viewable in <a
href="https://github.com/rayon-rs/rayon/compare/rayon-core-v1.12.1...rayon-core-v1.13.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rayon-core&package-manager=cargo&previous-version=1.12.1&new-version=1.13.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-08-13 18:12:01 +00:00
dependabot[bot]
026f00f027 build(deps): bump syn from 2.0.104 to 2.0.105 (#38660)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.104 to 2.0.105.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.105</h2>
<ul>
<li>Disallow &quot;negative&quot; inherent impls like <code>impl !T
{}</code> (<a
href="https://redirect.github.com/dtolnay/syn/issues/1881">#1881</a>, <a
href="https://redirect.github.com/rust-lang/rust/pull/144386">rust-lang/rust#144386</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9a8cc49b7b"><code>9a8cc49</code></a>
Release 2.0.105</li>
<li><a
href="0f8962b2e9"><code>0f8962b</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1881">#1881</a>
from dtolnay/negativeinherent</li>
<li><a
href="337aeac6d7"><code>337aeac</code></a>
Reject negative inherent impls</li>
<li><a
href="95c5e5a51f"><code>95c5e5a</code></a>
Update test suite to nightly-2025-08-13</li>
<li><a
href="20e155af00"><code>20e155a</code></a>
Revert &quot;Pin nightly toolchain used for miri job&quot;</li>
<li><a
href="bef1da9f56"><code>bef1da9</code></a>
Resolve implicit_clone pedantic clippy lint</li>
<li><a
href="aa9d9924a9"><code>aa9d992</code></a>
Update test suite to nightly-2025-07-24</li>
<li><a
href="3a2005c22d"><code>3a2005c</code></a>
Update test suite to nightly-2025-07-18</li>
<li><a
href="7ee23a7bed"><code>7ee23a7</code></a>
Update to toml 0.9</li>
<li><a
href="6b30c4b035"><code>6b30c4b</code></a>
Sort tests/common/eq.rs imports</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/syn/compare/2.0.104...2.0.105">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=syn&package-manager=cargo&previous-version=2.0.104&new-version=2.0.105)](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-08-13 17:41:37 +00:00
Gregory Terzian
70be996a29 net: Remove CoreResourceThread from FetchThread state (#38422)
In single process mode, there is a race condition on the initialization
of the global fetch thread: once initialized the global fetch thread
will always use a given core resource thread, and this will be
determined by the component who first initializes it. For example, if
the canvas paint thread first does an async fetch, then this will set
the public core resource as used for all future fetches, including those
coming from a pipeline in private mode.

In multi-process mode, there is a race condition per window event-loop:
the first pipeline to use the fetch will set the core resource thread
for all others.

To ensure the fetch thread uses the correct core resource thread(private
vs public), we need to
pass the core resource thread to each fetch thread operation for which
is it needed.

Testing: It should not break existing fetch WPT tests. The race
condition is not something that can be tested reliably, but it seems to
be based on solid logic.
Fixes: follow-up from
https://github.com/servo/servo/pull/38421/files#r2248950924

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-13 17:40:10 +00:00
Martin Robinson
5ff084a688 layout: Use the PseudoElement from ServoThreadSafeLayoutNode in NodeAndStyleInfo (#38630)
Instead of storing the non-pseudo version of the node in
`NodeAndStyleInfo`, store the pseudo version and use that to query the
`PseudoElement` that a `NodeAndStyleInfo` refers to.

This is a step on the way toward fixing nested pseudo-elements in Servo.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-13 17:31:57 +00:00
Martin Robinson
ee7c1d9109 layout: Use ServoThreadSafeLayoutNode in more places (#38626)
Use `ServoThreadSafeLayoutNode` in more places in layout rather than
`ServoLayoutNode`. The former is meant to be used during layout, but
layout 2020 was written against the latter. In general, this reduces the
amount of conversion to the thread-safe version in many places in
layout.

In addition, an unused iterator from the `script` crate
`ServoThreadSafeLayoutNodeChildrenIterator` is replaced with the child
iterator from `layout`. The `layout` version must be directly in
`script` now as it uses the dangerous variants of `next_sibling` and
`first_child`, which allow encapsulating the unsafe bits into one
module.

This will ultimately be useful for storing the layout data of
pseudo-element children of pseudo-elements properly.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-13 14:55:19 +00:00
Martin Robinson
20ad1ce84e Revert "ci: Run devtools tests whenever we run unit tests (#38614)"
This reverts commit 47aa9ea8cf.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-13 07:53:20 -07:00
dependabot[bot]
18f0d92e99 build(deps): bump the napi-ohos-related group with 4 updates (#38555)
Bumps the napi-ohos-related group with 4 updates:
[napi-derive-ohos](https://github.com/ohos-rs/ohos-rs),
[napi-ohos](https://github.com/ohos-rs/ohos-rs),
[napi-derive-backend-ohos](https://github.com/ohos-rs/ohos-rs) and
[napi-sys-ohos](https://github.com/ohos-rs/ohos-rs).

Updates `napi-derive-ohos` from 1.0.4 to 1.1.0
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eaba5da8af"><code>eaba5da</code></a>
Merge pull request <a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/139">#139</a>
from ohos-rs/feat-0719</li>
<li><a
href="165538b516"><code>165538b</code></a>
fix: lint warning</li>
<li><a
href="19530e3598"><code>19530e3</code></a>
Bump version</li>
<li><a
href="ed8d46d825"><code>ed8d46d</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="7c3dc968c1"><code>7c3dc96</code></a>
perf(napi): optimize HashMap allocation in FromNapiValue implementation
for H...</li>
<li><a
href="06a48c5e18"><code>06a48c5</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="9f0dc581be"><code>9f0dc58</code></a>
chore(release): publish</li>
<li><a
href="cf6d8b0334"><code>cf6d8b0</code></a>
fix(cli): rename options (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2804">#2804</a>)</li>
<li><a
href="5816924e6e"><code>5816924</code></a>
chore(release): publish</li>
<li><a
href="c6cf127e7e"><code>c6cf127</code></a>
chore(cli): upgrade all NAPI-RS projects (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2803">#2803</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ohos-rs/ohos-rs/compare/ohrs@1.0.4...ohrs@1.1.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `napi-ohos` from 1.0.4 to 1.1.0
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eaba5da8af"><code>eaba5da</code></a>
Merge pull request <a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/139">#139</a>
from ohos-rs/feat-0719</li>
<li><a
href="165538b516"><code>165538b</code></a>
fix: lint warning</li>
<li><a
href="19530e3598"><code>19530e3</code></a>
Bump version</li>
<li><a
href="ed8d46d825"><code>ed8d46d</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="7c3dc968c1"><code>7c3dc96</code></a>
perf(napi): optimize HashMap allocation in FromNapiValue implementation
for H...</li>
<li><a
href="06a48c5e18"><code>06a48c5</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="9f0dc581be"><code>9f0dc58</code></a>
chore(release): publish</li>
<li><a
href="cf6d8b0334"><code>cf6d8b0</code></a>
fix(cli): rename options (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2804">#2804</a>)</li>
<li><a
href="5816924e6e"><code>5816924</code></a>
chore(release): publish</li>
<li><a
href="c6cf127e7e"><code>c6cf127</code></a>
chore(cli): upgrade all NAPI-RS projects (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2803">#2803</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ohos-rs/ohos-rs/compare/ohrs@1.0.4...ohrs@1.1.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `napi-derive-backend-ohos` from 1.0.4 to 1.1.0
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eaba5da8af"><code>eaba5da</code></a>
Merge pull request <a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/139">#139</a>
from ohos-rs/feat-0719</li>
<li><a
href="165538b516"><code>165538b</code></a>
fix: lint warning</li>
<li><a
href="19530e3598"><code>19530e3</code></a>
Bump version</li>
<li><a
href="ed8d46d825"><code>ed8d46d</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="7c3dc968c1"><code>7c3dc96</code></a>
perf(napi): optimize HashMap allocation in FromNapiValue implementation
for H...</li>
<li><a
href="06a48c5e18"><code>06a48c5</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="9f0dc581be"><code>9f0dc58</code></a>
chore(release): publish</li>
<li><a
href="cf6d8b0334"><code>cf6d8b0</code></a>
fix(cli): rename options (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2804">#2804</a>)</li>
<li><a
href="5816924e6e"><code>5816924</code></a>
chore(release): publish</li>
<li><a
href="c6cf127e7e"><code>c6cf127</code></a>
chore(cli): upgrade all NAPI-RS projects (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2803">#2803</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ohos-rs/ohos-rs/compare/ohrs@1.0.4...ohrs@1.1.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `napi-sys-ohos` from 1.0.4 to 1.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ohos-rs/ohos-rs/releases">napi-sys-ohos's
releases</a>.</em></p>
<blockquote>
<h2>ohrs@1.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>feat: allow build and artifact skip libs logic by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/119">ohos-rs/ohos-rs#119</a></li>
<li>fix: remove ArkRuntime Send and Sync implenment by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/120">ohos-rs/ohos-rs#120</a></li>
<li>feat 0306 by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/121">ohos-rs/ohos-rs#121</a></li>
<li>feat: add export default for template by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/128">ohos-rs/ohos-rs#128</a></li>
<li>fix: should ignore some path and convert path to absolute path by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/129">ohos-rs/ohos-rs#129</a></li>
<li>Merge code by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/133">ohos-rs/ohos-rs#133</a></li>
<li>feat: add vscode setting by default by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/134">ohos-rs/ohos-rs#134</a></li>
<li>feat(cli): support dtsCache flag by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/135">ohos-rs/ohos-rs#135</a></li>
<li>feat: Sync napi-rs by <a
href="https://github.com/richerfu"><code>@​richerfu</code></a> in <a
href="https://redirect.github.com/ohos-rs/ohos-rs/pull/139">ohos-rs/ohos-rs#139</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/ohos-rs/ohos-rs/compare/ohrs@1.0.4...ohrs@1.1.0">https://github.com/ohos-rs/ohos-rs/compare/ohrs@1.0.4...ohrs@1.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eaba5da8af"><code>eaba5da</code></a>
Merge pull request <a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/139">#139</a>
from ohos-rs/feat-0719</li>
<li><a
href="165538b516"><code>165538b</code></a>
fix: lint warning</li>
<li><a
href="19530e3598"><code>19530e3</code></a>
Bump version</li>
<li><a
href="ed8d46d825"><code>ed8d46d</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="7c3dc968c1"><code>7c3dc96</code></a>
perf(napi): optimize HashMap allocation in FromNapiValue implementation
for H...</li>
<li><a
href="06a48c5e18"><code>06a48c5</code></a>
Merge branch 'main' into feat-0719</li>
<li><a
href="9f0dc581be"><code>9f0dc58</code></a>
chore(release): publish</li>
<li><a
href="cf6d8b0334"><code>cf6d8b0</code></a>
fix(cli): rename options (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2804">#2804</a>)</li>
<li><a
href="5816924e6e"><code>5816924</code></a>
chore(release): publish</li>
<li><a
href="c6cf127e7e"><code>c6cf127</code></a>
chore(cli): upgrade all NAPI-RS projects (<a
href="https://redirect.github.com/ohos-rs/ohos-rs/issues/2803">#2803</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/ohos-rs/ohos-rs/compare/ohrs@1.0.4...ohrs@1.1.0">compare
view</a></li>
</ul>
</details>
<br />


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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-13 12:52:00 +00:00
Jonathan Schwender
d0d952d1fa build(deps): bump nix from 0.29.0 to 0.30.1 (#38650)
Bumps [nix](https://github.com/nix-rust/nix) from 0.29.0 to 0.30.1.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.29.0...v0.30.1)

Closes: #38145
Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-13 09:51:40 +00:00
Martin Robinson
069ad40872 script: Move the majority of the input event handling code to DocumentEventHandler (#38584)
This moves the majority of the input event handler code to the
`DocumentEventHandler` helper structure. It better encapsulates event
handling, hiding most of the details from both `ScriptThread` and
`Document`. The benefit here is that the majority of the functions can
become private and `Document` is over 1000 lines shorter.

Testing: This should not change any behavior so is covered by existing
WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-13 09:38:58 +00:00
Josh Matthews
bd9bb77295 script_bindings: Assert that serializable/transferable types have accurate WebIDL annotations (#38615)
These changes add compile-time assertions that:
* any type that implements the Serializable/Transferable trait has a
`[Serializable]` or `[Transferable]` annotation in the interface WebIDL
* any WebIDL interface with the `[Serializable]` or `[Transferable]`
annotation implements the corresponding trait

This is useful because it means that WebIDL definitions will be less
confusing if you're trying to figure out whether Servo supports
serializing/transferring a particular interface type. It also makes
fixing #21715 in the future a little bit easier, because the annotations
will remain up to date.

Testing: compile-time only; no point in writing tests for this since it
involves webidl codegen.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-13 08:36:04 +00:00
dependabot[bot]
0d6d434e59 build(deps): bump anyhow from 1.0.98 to 1.0.99 (#38635)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.98 to 1.0.99.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f2b963a759"><code>f2b963a</code></a>
Release 1.0.99</li>
<li><a
href="2c64c15e75"><code>2c64c15</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/anyhow/issues/420">#420</a>
from dtolnay/enotempty</li>
<li><a
href="8cf66f7936"><code>8cf66f7</code></a>
Allow build-script cleanup failure with NFSv3 output directory to be
non-fatal</li>
<li><a
href="f5e145c683"><code>f5e145c</code></a>
Revert &quot;Pin nightly toolchain used for miri job&quot;</li>
<li><a
href="1d7ef1db54"><code>1d7ef1d</code></a>
Update ui test suite to nightly-2025-06-30</li>
<li><a
href="69295727ce"><code>6929572</code></a>
Update ui test suite to nightly-2025-06-18</li>
<li><a
href="37224e3142"><code>37224e3</code></a>
Ignore mismatched_lifetime_syntaxes lint</li>
<li><a
href="11f0e81aaf"><code>11f0e81</code></a>
Pin nightly toolchain used for miri job</li>
<li><a
href="d04c999d63"><code>d04c999</code></a>
Raise required compiler for backtrace feature to rust 1.82</li>
<li><a
href="219d16330d"><code>219d163</code></a>
Update test suite to nightly-2025-05-01</li>
<li>See full diff in <a
href="https://github.com/dtolnay/anyhow/compare/1.0.98...1.0.99">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=anyhow&package-manager=cargo&previous-version=1.0.98&new-version=1.0.99)](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-08-13 06:58:27 +00:00
Euclid Ye
6029976365 webdriver: Synchronize "close window" command & Return correct error type (#38620)
1. Synchronize [Close
Window](https://w3c.github.io/webdriver/#dfn-close-window) command to
reduce intermittency
2. There was a update last month exposing that we are not returning
correct error type for Session getter.
https://github.com/web-platform-tests/wpt/pull/53735
3. Other trivial fix

Testing: 
- `/webdriver/tests/classic/close_window/close.py` can now fully pass.
- `/webdriver/tests/classic/delete_session/*` can now fully pass.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-13 04:06:39 +00:00
dependabot[bot]
7fc2f31309 build(deps): bump clap from 4.5.43 to 4.5.44 (#38641)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [clap](https://github.com/clap-rs/clap) from 4.5.43 to 4.5.44.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.44</h2>
<h2>[4.5.44] - 2025-08-11</h2>
<h3>Features</h3>
<ul>
<li>Add <code>Command::mut_subcommands</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.44] - 2025-08-11</h2>
<h3>Features</h3>
<ul>
<li>Add <code>Command::mut_subcommands</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8e2c2c5678"><code>8e2c2c5</code></a>
chore: Release</li>
<li><a
href="427d4fc0ea"><code>427d4fc</code></a>
docs: Update changelog</li>
<li><a
href="3b99593a1e"><code>3b99593</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5896">#5896</a>
from epage/env</li>
<li><a
href="f5fc7651ee"><code>f5fc765</code></a>
feat(complete): Provide a way to disable env completions</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.43...clap_complete-v4.5.44">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.43&new-version=4.5.44)](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-08-13 00:47:45 +00:00
dependabot[bot]
6381c76f64 build(deps): bump proc-macro2 from 1.0.96 to 1.0.97 (#38639)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.96
to 1.0.97.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/proc-macro2/releases">proc-macro2's
releases</a>.</em></p>
<blockquote>
<h2>1.0.97</h2>
<ul>
<li>Allow build-script cleanup failure with NFSv3 output directory to be
non-fatal (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/505">#505</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/512">#512</a>,
thanks <a
href="https://github.com/davvid"><code>@​davvid</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b61379bb76"><code>b61379b</code></a>
Release 1.0.97</li>
<li><a
href="50fc51474b"><code>50fc514</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/512">#512</a>
from dtolnay/enotempty</li>
<li><a
href="7cc389b769"><code>7cc389b</code></a>
Restore support for rustc older than 1.83</li>
<li><a
href="ad5915822d"><code>ad59158</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/505">#505</a>
from davvid/ignore-cleanup</li>
<li><a
href="19cf120b83"><code>19cf120</code></a>
build: allow the cleanup step to be non-fatal</li>
<li>See full diff in <a
href="https://github.com/dtolnay/proc-macro2/compare/1.0.96...1.0.97">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=proc-macro2&package-manager=cargo&previous-version=1.0.96&new-version=1.0.97)](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-08-13 00:11:50 +00:00
dependabot[bot]
319909782c build(deps): bump the servo-media-related group with 12 updates (#38640)
Bumps the servo-media-related group with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [servo-media](https://github.com/servo/media) | ``4f36494`` |
``a57b0e6`` |
| [servo-media-dummy](https://github.com/servo/media) | ``4f36494`` |
``a57b0e6`` |
| [servo-media-gstreamer](https://github.com/servo/media) | ``4f36494``
| ``a57b0e6`` |
| servo-media-audio | ``4f36494`` | ``a57b0e6`` |
| servo-media-derive | ``4f36494`` | ``a57b0e6`` |
| servo-media-gstreamer-render | ``4f36494`` | ``a57b0e6`` |
| servo-media-gstreamer-render-android | ``4f36494`` | ``a57b0e6`` |
| servo-media-gstreamer-render-unix | ``4f36494`` | ``a57b0e6`` |
| servo-media-player | ``4f36494`` | ``a57b0e6`` |
| servo-media-streams | ``4f36494`` | ``a57b0e6`` |
| servo-media-traits | ``4f36494`` | ``a57b0e6`` |
| servo-media-webrtc | ``4f36494`` | ``a57b0e6`` |

Updates `servo-media` from `4f36494` to `a57b0e6`
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a57b0e67b3"><code>a57b0e6</code></a>
initial stub for ohos backend (<a
href="https://redirect.github.com/servo/media/issues/444">#444</a>)</li>
<li>See full diff in <a
href="4f36494e4d...a57b0e67b3">compare
view</a></li>
</ul>
</details>
<br />

Updates `servo-media-dummy` from `4f36494` to `a57b0e6`
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a57b0e67b3"><code>a57b0e6</code></a>
initial stub for ohos backend (<a
href="https://redirect.github.com/servo/media/issues/444">#444</a>)</li>
<li>See full diff in <a
href="4f36494e4d...a57b0e67b3">compare
view</a></li>
</ul>
</details>
<br />

Updates `servo-media-gstreamer` from `4f36494` to `a57b0e6`
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a57b0e67b3"><code>a57b0e6</code></a>
initial stub for ohos backend (<a
href="https://redirect.github.com/servo/media/issues/444">#444</a>)</li>
<li>See full diff in <a
href="4f36494e4d...a57b0e67b3">compare
view</a></li>
</ul>
</details>
<br />

Updates `servo-media-audio` from `4f36494` to `a57b0e6`

Updates `servo-media-derive` from `4f36494` to `a57b0e6`

Updates `servo-media-gstreamer-render` from `4f36494` to `a57b0e6`

Updates `servo-media-gstreamer-render-android` from `4f36494` to
`a57b0e6`

Updates `servo-media-gstreamer-render-unix` from `4f36494` to `a57b0e6`

Updates `servo-media-player` from `4f36494` to `a57b0e6`

Updates `servo-media-streams` from `4f36494` to `a57b0e6`

Updates `servo-media-traits` from `4f36494` to `a57b0e6`

Updates `servo-media-webrtc` from `4f36494` to `a57b0e6`


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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 23:02:12 +00:00
dependabot[bot]
c0eb999dbe build(deps): bump ab_glyph_rasterizer from 0.1.9 to 0.1.10 (#38637)
Bumps [ab_glyph_rasterizer](https://github.com/alexheretic/ab-glyph)
from 0.1.9 to 0.1.10.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="971e5a9b33"><code>971e5a9</code></a>
Release ab_glyph_rasterizer 0.1.10</li>
<li><a
href="f2e376ac04"><code>f2e376a</code></a>
Fix remaining <code>draw_line_scalar</code> index oob panic scenarios
(<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/120">#120</a>)</li>
<li><a
href="c476792ab6"><code>c476792</code></a>
Fix 1.89 clippy lints</li>
<li><a
href="727737fbe9"><code>727737f</code></a>
Update dev-dependencies</li>
<li><a
href="f963bcaf08"><code>f963bca</code></a>
Release ab_glyph 0.2.31</li>
<li><a
href="a216ede621"><code>a216ede</code></a>
Add &quot;gvar-alloc&quot; feature enabled by default (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/118">#118</a>)</li>
<li>See full diff in <a
href="https://github.com/alexheretic/ab-glyph/compare/ab-glyph-rasterizer-0.1.9...ab-glyph-rasterizer-0.1.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ab_glyph_rasterizer&package-manager=cargo&previous-version=0.1.9&new-version=0.1.10)](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-08-12 20:53:33 +00:00
Kenzie Raditya Tirtarahardja
bcd569f116 webdriver: Add handle user prompt for some command (#38591)
- When taking element screenshot, we should handle the user prompt
before getting the element bounding rectangle
- Handle user prompt for `is element enabled` and `is element selected`

Testing:
`./tests/wpt/tests/webdriver/tests/classic/{take_element_screenshot,
is_element_enabled, is_element_selected}/user_prompts.py`

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-12 20:31:43 +00:00
Jonathan Schwender
4b91dc6d82 CI: Check MSRV in CI (#37152)
As previously proposed on zulip and discussed in the coordination
meeting, add a check to CI to see if
servo still compiles with our minimum supported Rust version.
To avoid requiring changes, we define our MSRV as the current version we
are using now (1.85.0).

This does not prevent us from updating the default compiler version,
which we should still do, to
get benefits like faster compile times, newer lints and making sure
crown stays up-to-date.

We simply test that libservo compiles in CI, since libservo (and
dependencies) is what embedders would care about. We also don't need
mach (or bootstrap!) for this, so we just use cargo build.

Testing: This PR adds a CI test. [`./mach try windows-build-libservo
linux-build-libservo
mac-build-libservo`](https://github.com/jschwe/servo/actions/runs/16901171766)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-12 19:19:45 +00:00
Martin Robinson
6ff5c4ef99 tidy: Remove dead and redundant code from Servo Rust tidy check (#38632)
- Remove all handling of comments and attributes. This was not affecting
  the checks in any way.
- Remove `is_associated_type()` as it was unused.
- Remove the check for `&String`, `&Vec`, operators at the end of the
  line, and the unit return type as clippy already checks these (and
  handles the mutable variants).

Testing: This is covered by tidy script tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-12 17:57:35 +00:00
Jonathan Schwender
2ea251117a script: Remove unnecessary Arc<Mutex> (#38631)
The `Arc<Mutex<>>` wrapper around the IpcSender does not appear to be
needed anymore.

Testing: No functional changes. Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-12 17:48:28 +00:00
shuppy
47aa9ea8cf ci: Run devtools tests whenever we run unit tests (#38614)
this patch updates linux.yml, mac.yml, and windows.yml to run the
devtools test suite (#36325), whenever unit tests are enabled in those
workflows. plus three changes that speed up the tests from 73 → 65 → 56
→ 51 seconds:

- we replace the hardcoded sleep(1) after starting servoshell with a
loop that waits until the devtools port is open (this also fixes
intermittent failures when servoshell starts too slowly, especially on
macOS)
- we start the internal web servers once, and reuse them across all
tests
- we run servoshell in headless mode (this is also required because most
CI runners have no GUI)

finally we fix two bugs that cause very noisy but not very interesting
error messages:

- in the test code, we use a [context
manager](https://docs.python.org/3/reference/datamodel.html#context-managers)
to ensure the devtools client is disconnected unconditionally, even if
test methods or assert helper methods raise exceptions (this was causing
errors on all platforms)
- in the devtools server, we treat “connection reset” errors when
reading from the client like a normal EOF, rather than as a failure
(this was causing errors on Windows)

on self-hosted linux builds, there are still spurious error messages
like the following, but we can fix them later:

```
error: XDG_RUNTIME_DIR not set in the environment.
libEGL warning: egl: failed to create dri2 screen
```

Testing: this patch effectively adds 44 tests to CI
Fixes: #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-12 15:10:45 +00:00
Oriol Brufau
141413d52e layout: Improve sizing for inline SVG (#38603)
The metadata provided by usvg has unreliable sizes. Ignore it, and rely
on the `width`, `height` and `viewBox` attributes instead.

Note that inline SVG with a natural aspect ratio but no natural sizes
should stretch to the containing block. This is left for a follow-up.

Bumps Stylo to https://github.com/servo/stylo/pull/229

Testing: Improves several WPT.

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-12 12:45:15 +00:00
shuppy
319f4f0e38 devtools: Fix getBreakpointListActor handler in watcher actor (#38624)
the Firefox devtools client often sends multiple
`getBreakpointListActor` requests to the watcher actor when connecting,
and the Firefox devtools server returns the same breakpoint list actor
every time, but Servo returns a new breakpoint list actor each time.
this patch aligns Servo’s behaviour with Firefox.

Testing: this patch adds a devtools test

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-12 12:26:59 +00:00
Euclid Ye
b3978439ad test config: Add escape character (#38619)
Add escape character for config. Otherwise cannot run webdriver test.

Fixes: `wptrunner.wptmanifest.parser.ParseError: Junk before EOL ]`

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-12 08:43:15 +00:00
Rodion Borovyk
e5a73ede17 script: Send JS evaluation errors to constellation (#38602)
Send JS evaluation errors to constellation in
`script_thread::handle_evaluate_javascript` instead of silently
swallowing.

Testing: New test cases in `tests/webview.rs`: one for compilation
failure, another for evaluation failure.
Fixes: #37810

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-08-12 07:19:39 +00:00
batu_hoang
9effdce5a1 Implement webdriver extract script arguments (#38357)
Fix script parsing step.
Implement webdriver `extract script arguments`.
Implement `deserialize_web_element` and `deserialize_shadow_root` from
script command argument.

Testing:
`/tests/wpt/tests/webdriver/tests/classic/execute_script/`
`/tests/wpt/tests/webdriver/tests/classic/execute_async_script/`

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-08-12 06:57:19 +00:00
Kenzie Raditya Tirtarahardja
c0d884ddb2 script: Implement getModifierState for mouse event (#38535)
Implement missing idl function `getModifierState` for mouse event. The
implementation is exactly the same as in keyboard event
https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate.


6651f37c05/components/script/dom/keyboardevent.rs (L267-L283)

Testing: Fix
`./tests/wpt/tests/infrastructure/testdriver/actions/actionsWithKeyPressed.html`

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-12 06:33:15 +00:00
Abdelrahman Hossam
2e2bfc6067 Basic webdriver support to servoshell on ohos (#38386)
Adding basic webdriver support to servoshell on ohos and basic
communication between the ohos device and script.

Testing: Manual testing and tracing logs

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
2025-08-12 06:26:53 +00:00
shuppy
f5b631e270 devtools: Show clients where they can set breakpoints (#37667)
devtools clients query source actors to determine where the user can set
breakpoints in a source. there are two relevant requests here:
`getBreakableLines` controls which line numbers can be clicked in the
margin, and once a line number is clicked,
`getBreakpointPositionsCompressed` controls where to show breakpoint
buttons within that line.

this patch handles those requests by querying the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/) for that
information:
- devtools sends its script thread a GetPossibleBreakpoints message for
the source’s
[`spidermonkey_id`](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Source.html#id)
- the script thread fires a `getPossibleBreakpoints` event into its
debugger global
- the debugger script looks up the
[root](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewscript-script-global)
[Debugger.Script](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getpossiblebreakpoints-query)
for that source, calls
[getPossibleBreakpoints()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Script.html#getpossiblebreakpoints-query),
and returns the result via
DebuggerGlobalScope#getPossibleBreakpointsResult()
- that method takes the pending result sender, and sends the result back
to devtools
- devtools massages the result into the format required by the request,
and replies to the client

as a result, users of the Firefox devtools client can now set
breakpoints, though they don’t have any effect.

Testing: this patch adds new devtools tests
Fixes: part of #36027

<img width="1433" height="1328" alt="image"
src="https://github.com/user-attachments/assets/f0cd31e0-742f-44d3-8c5d-ceedd9a2706d"
/>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-12 04:53:53 +00:00
Usman Yahaya Baba
1995e22e19 net: Send Cookies to Devtools (#38601)
The current behaviour in dev tools network monitor is missing cookies in
the cookies tab in Request Details, displaying "No cookies for this
request" even for requests with cookies.
The changes in this PR refactors the `request_cookies` and
`response_cookies` to check and retrieve the cookies if available
Also, the structure in which the cookies is sent to devtools is been
refactored to match the format firefox's devtools client expects.
With these changes, we now have the cookies displayed for requests that
have one.

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

---------

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
2025-08-12 04:42:28 +00:00
dependabot[bot]
122069cf43 build(deps): bump libc from 0.2.174 to 0.2.175 (#38608)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.174 to 0.2.175.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/releases">libc's
releases</a>.</em></p>
<blockquote>
<h2>0.2.175</h2>
<h3>Added</h3>
<ul>
<li>AIX: Add <code>getpeereid</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4524">#4524</a>)</li>
<li>AIX: Add <code>struct ld_info</code> and friends (<a
href="https://redirect.github.com/rust-lang/libc/pull/4578">#4578</a>)</li>
<li>AIX: Retore <code>struct winsize</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4577">#4577</a>)</li>
<li>Android: Add UDP socket option constants (<a
href="https://redirect.github.com/rust-lang/libc/pull/4619">#4619</a>)</li>
<li>Android: Add <code>CLONE_CLEAR_SIGHAND</code> and
<code>CLONE_INTO_CGROUP</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4502">#4502</a>)</li>
<li>Android: Add more <code>prctl</code> constants (<a
href="https://redirect.github.com/rust-lang/libc/pull/4531">#4531</a>)</li>
<li>FreeBSD Add further TCP stack-related constants (<a
href="https://redirect.github.com/rust-lang/libc/pull/4196">#4196</a>)</li>
<li>FreeBSD x86-64: Add <code>mcontext_t.mc_tlsbase </code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4503">#4503</a>)</li>
<li>FreeBSD15: Add <code>kinfo_proc.ki_uerrmsg</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4552">#4552</a>)</li>
<li>FreeBSD: Add <code>in_conninfo</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4482">#4482</a>)</li>
<li>FreeBSD: Add <code>xinpgen</code> and related types (<a
href="https://redirect.github.com/rust-lang/libc/pull/4482">#4482</a>)</li>
<li>FreeBSD: Add <code>xktls_session</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4482">#4482</a>)</li>
<li>Haiku: Add functionality from <code>libbsd</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4221">#4221</a>)</li>
<li>Linux: Add <code>SECBIT_*</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4480">#4480</a>)</li>
<li>NetBSD, OpenBSD: Export <code>ioctl</code> request generator macros
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4460">#4460</a>)</li>
<li>NetBSD: Add <code>ptsname_r</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4608">#4608</a>)</li>
<li>RISCV32: Add time-related syscalls (<a
href="https://redirect.github.com/rust-lang/libc/pull/4612">#4612</a>)</li>
<li>Solarish: Add <code>strftime*</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4453">#4453</a>)</li>
<li>linux: Add <code>EXEC_RESTRICT_*</code> and <code>EXEC_DENY_*</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4545">#4545</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>AIX: Add <code>const</code> to signatures to be consistent with
other platforms (<a
href="https://redirect.github.com/rust-lang/libc/pull/4563">#4563</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>AIX: Fix the type of <code>struct statvfs.f_fsid</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4576">#4576</a>)</li>
<li>AIX: Fix the type of constants for the <code>ioctl</code>
<code>request</code> argument (<a
href="https://redirect.github.com/rust-lang/libc/pull/4582">#4582</a>)</li>
<li>AIX: Fix the types of <code>stat{,64}.st_*tim</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4597">#4597</a>)</li>
<li>AIX: Use unique <code>errno</code> values (<a
href="https://redirect.github.com/rust-lang/libc/pull/4507">#4507</a>)</li>
<li>Build: Fix an incorrect <code>target_os</code> -&gt;
<code>target_arch</code> check (<a
href="https://redirect.github.com/rust-lang/libc/pull/4550">#4550</a>)</li>
<li>FreeBSD: Fix the type of <code>xktls_session_onedir.ifnet</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4552">#4552</a>)</li>
<li>Mips64 musl: Fix the type of <code>nlink_t</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4509">#4509</a>)</li>
<li>Mips64 musl: Use a special MIPS definition of <code>stack_t</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4528">#4528</a>)</li>
<li>Mips64: Fix <code>SI_TIMER</code>, <code>SI_MESGQ</code> and
<code>SI_ASYNCIO</code> definitions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4529">#4529</a>)</li>
<li>Musl Mips64: Swap the order of <code>si_errno</code> and
<code>si_code</code> in <code>siginfo_t</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4530">#4530</a>)</li>
<li>Musl Mips64: Use a special MIPS definition of <code>statfs</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4527">#4527</a>)</li>
<li>Musl: Fix the definition of <code>fanotify_event_metadata</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4510">#4510</a>)</li>
<li>NetBSD: Correct <code>enum fae_action</code> to be
<code>#[repr(C)]</code> (<a
href="60a8cfd564">#60a8cfd5</a>)</li>
<li>PSP: Correct <code>char</code> -&gt; <code>c_char</code> (<a
href="eaab4fc3f0">eaab4fc3</a>)</li>
<li>PowerPC musl: Fix <code>termios</code> definitions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4518">#4518</a>)</li>
<li>PowerPC musl: Fix the definition of <code>EDEADLK</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4517">#4517</a>)</li>
<li>PowerPC musl: Fix the definition of <code>NCCS</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4513">#4513</a>)</li>
<li>PowerPC musl: Fix the definitions of <code>MAP_LOCKED</code> and
<code>MAP_NORESERVE</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4516">#4516</a>)</li>
<li>PowerPC64 musl: Fix the definition of <code>shmid_ds</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4519">#4519</a>)</li>
</ul>
<h3>Deprecated</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/blob/0.2.175/CHANGELOG.md">libc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/libc/compare/0.2.174...0.2.175">0.2.175</a>
- 2025-08-10</h2>
<h3>Added</h3>
<ul>
<li>AIX: Add <code>getpeereid</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4524">#4524</a>)</li>
<li>AIX: Add <code>struct ld_info</code> and friends (<a
href="https://redirect.github.com/rust-lang/libc/pull/4578">#4578</a>)</li>
<li>AIX: Retore <code>struct winsize</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4577">#4577</a>)</li>
<li>Android: Add UDP socket option constants (<a
href="https://redirect.github.com/rust-lang/libc/pull/4619">#4619</a>)</li>
<li>Android: Add <code>CLONE_CLEAR_SIGHAND</code> and
<code>CLONE_INTO_CGROUP</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4502">#4502</a>)</li>
<li>Android: Add more <code>prctl</code> constants (<a
href="https://redirect.github.com/rust-lang/libc/pull/4531">#4531</a>)</li>
<li>FreeBSD Add further TCP stack-related constants (<a
href="https://redirect.github.com/rust-lang/libc/pull/4196">#4196</a>)</li>
<li>FreeBSD x86-64: Add <code>mcontext_t.mc_tlsbase </code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4503">#4503</a>)</li>
<li>FreeBSD15: Add <code>kinfo_proc.ki_uerrmsg</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4552">#4552</a>)</li>
<li>FreeBSD: Add <code>in_conninfo</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4482">#4482</a>)</li>
<li>FreeBSD: Add <code>xinpgen</code> and related types (<a
href="https://redirect.github.com/rust-lang/libc/pull/4482">#4482</a>)</li>
<li>FreeBSD: Add <code>xktls_session</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4482">#4482</a>)</li>
<li>Haiku: Add functionality from <code>libbsd</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4221">#4221</a>)</li>
<li>Linux: Add <code>SECBIT_*</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4480">#4480</a>)</li>
<li>NetBSD, OpenBSD: Export <code>ioctl</code> request generator macros
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4460">#4460</a>)</li>
<li>NetBSD: Add <code>ptsname_r</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4608">#4608</a>)</li>
<li>RISCV32: Add time-related syscalls (<a
href="https://redirect.github.com/rust-lang/libc/pull/4612">#4612</a>)</li>
<li>Solarish: Add <code>strftime*</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4453">#4453</a>)</li>
<li>linux: Add <code>EXEC_RESTRICT_*</code> and <code>EXEC_DENY_*</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4545">#4545</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>AIX: Add <code>const</code> to signatures to be consistent with
other platforms (<a
href="https://redirect.github.com/rust-lang/libc/pull/4563">#4563</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>AIX: Fix the type of <code>struct statvfs.f_fsid</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4576">#4576</a>)</li>
<li>AIX: Fix the type of constants for the <code>ioctl</code>
<code>request</code> argument (<a
href="https://redirect.github.com/rust-lang/libc/pull/4582">#4582</a>)</li>
<li>AIX: Fix the types of <code>stat{,64}.st_*tim</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4597">#4597</a>)</li>
<li>AIX: Use unique <code>errno</code> values (<a
href="https://redirect.github.com/rust-lang/libc/pull/4507">#4507</a>)</li>
<li>Build: Fix an incorrect <code>target_os</code> -&gt;
<code>target_arch</code> check (<a
href="https://redirect.github.com/rust-lang/libc/pull/4550">#4550</a>)</li>
<li>FreeBSD: Fix the type of <code>xktls_session_onedir.ifnet</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4552">#4552</a>)</li>
<li>Mips64 musl: Fix the type of <code>nlink_t</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4509">#4509</a>)</li>
<li>Mips64 musl: Use a special MIPS definition of <code>stack_t</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4528">#4528</a>)</li>
<li>Mips64: Fix <code>SI_TIMER</code>, <code>SI_MESGQ</code> and
<code>SI_ASYNCIO</code> definitions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4529">#4529</a>)</li>
<li>Musl Mips64: Swap the order of <code>si_errno</code> and
<code>si_code</code> in <code>siginfo_t</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4530">#4530</a>)</li>
<li>Musl Mips64: Use a special MIPS definition of <code>statfs</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4527">#4527</a>)</li>
<li>Musl: Fix the definition of <code>fanotify_event_metadata</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4510">#4510</a>)</li>
<li>NetBSD: Correct <code>enum fae_action</code> to be
<code>#[repr(C)]</code> (<a
href="60a8cfd564">#60a8cfd5</a>)</li>
<li>PSP: Correct <code>char</code> -&gt; <code>c_char</code> (<a
href="eaab4fc3f0">eaab4fc3</a>)</li>
<li>PowerPC musl: Fix <code>termios</code> definitions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4518">#4518</a>)</li>
<li>PowerPC musl: Fix the definition of <code>EDEADLK</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4517">#4517</a>)</li>
<li>PowerPC musl: Fix the definition of <code>NCCS</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4513">#4513</a>)</li>
<li>PowerPC musl: Fix the definitions of <code>MAP_LOCKED</code> and
<code>MAP_NORESERVE</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4516">#4516</a>)</li>
<li>PowerPC64 musl: Fix the definition of <code>shmid_ds</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4519">#4519</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="84e26e6b16"><code>84e26e6</code></a>
Update the lockfile</li>
<li><a
href="4d04aee906"><code>4d04aee</code></a>
chore: release libc 0.2.175</li>
<li><a
href="94a7f32972"><code>94a7f32</code></a>
cleanup: Format a file that was missed</li>
<li><a
href="172527344a"><code>1725273</code></a>
Rename the ctest file from <code>main</code> to <code>ctest</code></li>
<li><a
href="e9b021b7cd"><code>e9b021b</code></a>
freebsd adding further TCP stack related constants.</li>
<li><a
href="9606a2918b"><code>9606a29</code></a>
freebsd15: Add ki_uerrmsg to struct kinfo_proc</li>
<li><a
href="2816bc2f66"><code>2816bc2</code></a>
libc-test: include sys/ktls.h on freebsd</li>
<li><a
href="adfe283365"><code>adfe283</code></a>
libc-test: Account for xktls_session_onedir::gen (freebsd)</li>
<li><a
href="4cc1bf4331"><code>4cc1bf4</code></a>
freebsd: Document avoidance of reserved name <code>gen</code></li>
<li><a
href="7cdcaa6239"><code>7cdcaa6</code></a>
freebsd: Fix type of struct xktls_session_onedir, field ifnet</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/libc/compare/0.2.174...0.2.175">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.174&new-version=0.2.175)](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-08-12 03:14:29 +00:00
dependabot[bot]
b8f160c85b build(deps): bump webrender_api from ae2477d to 15318d6 (#38604)
Bumps [webrender_api](https://github.com/servo/webrender) from `ae2477d`
to `15318d6`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="15318d6627"><code>15318d6</code></a>
Expose FastTransform so that it can be used in Servo</li>
<li>See full diff in <a
href="ae2477d9a6...15318d6627">compare
view</a></li>
</ul>
</details>
<br />


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-08-12 02:45:07 +00:00
Euclid Ye
5d21234872 script: Focus on mousedown instead of mouse click according to spec (#38589)
- Focus on mousedown instead of mouse click according to
[spec](https://w3c.github.io/uievents/#handle-native-mouse-down)
- Refactor to follow spec closer and make things more clear.
- Add some spec link.
- Remove some dead spec link.

Still some preparation before implementing #38435.
Testing: No regression in WebDriver & WPT. But update some outdated
test.
Fixes: #38588

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-12 02:40:21 +00:00
dependabot[bot]
d2122c8bd8 build(deps): bump uuid from 1.17.0 to 1.18.0 (#38611)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.17.0 to 1.18.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/uuid-rs/uuid/releases">uuid's
releases</a>.</em></p>
<blockquote>
<h2>v1.18.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix up mismatched_lifetime_syntaxes lint by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/837">uuid-rs/uuid#837</a></li>
<li>Conversions between <code>Timestamp</code> and
<code>std::time::SystemTime</code> by <a
href="https://github.com/dcormier"><code>@​dcormier</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/835">uuid-rs/uuid#835</a></li>
<li>Wrap the error type used in time conversions by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/838">uuid-rs/uuid#838</a></li>
<li>Prepare for 1.18.0 release by <a
href="https://github.com/KodrAus"><code>@​KodrAus</code></a> in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/839">uuid-rs/uuid#839</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/dcormier"><code>@​dcormier</code></a>
made their first contribution in <a
href="https://redirect.github.com/uuid-rs/uuid/pull/835">uuid-rs/uuid#835</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/uuid-rs/uuid/compare/v1.17.0...v1.18.0">https://github.com/uuid-rs/uuid/compare/v1.17.0...v1.18.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="60a49eb94f"><code>60a49eb</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/839">#839</a> from
uuid-rs/cargo/v1.18.0</li>
<li><a
href="eb8c697083"><code>eb8c697</code></a>
prepare for 1.18.0 release</li>
<li><a
href="281f26fcd9"><code>281f26f</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/838">#838</a> from
uuid-rs/chore/time-conversion</li>
<li><a
href="2d67ab2b5e"><code>2d67ab2</code></a>
don't use allocated values in errors</li>
<li><a
href="c284ed562f"><code>c284ed5</code></a>
wrap the error type used in time conversions</li>
<li><a
href="87a4359f25"><code>87a4359</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/835">#835</a> from
dcormier/main</li>
<li><a
href="8927396625"><code>8927396</code></a>
Merge pull request <a
href="https://redirect.github.com/uuid-rs/uuid/issues/837">#837</a> from
uuid-rs/fix/lifetime-syntaxes</li>
<li><a
href="6dfb4b135c"><code>6dfb4b1</code></a>
Conversions between <code>Timestamp</code> and
<code>std::time::SystemTime</code></li>
<li><a
href="b508383aff"><code>b508383</code></a>
fix up mismatched_lifetime_syntaxes lint</li>
<li>See full diff in <a
href="https://github.com/uuid-rs/uuid/compare/v1.17.0...v1.18.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uuid&package-manager=cargo&previous-version=1.17.0&new-version=1.18.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-08-12 02:06:23 +00:00
dependabot[bot]
faa50bcba4 build(deps): bump glob from 0.3.2 to 0.3.3 (#38610)
Bumps [glob](https://github.com/rust-lang/glob) from 0.3.2 to 0.3.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/glob/releases">glob's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.3</h2>
<ul>
<li>Optimize memory allocations (<a
href="https://redirect.github.com/rust-lang/glob/pull/147">#147</a>)</li>
<li>Bump the MSRV to 1.63 (<a
href="https://redirect.github.com/rust-lang/glob/pull/172">#172</a>)</li>
<li>Fix spelling in pattern documentation (<a
href="https://redirect.github.com/rust-lang/glob/pull/164">#164</a>)</li>
<li>Fix version numbers and some formatting (<a
href="https://redirect.github.com/rust-lang/glob/pull/157">#157</a>)</li>
<li>Style fixes (<a
href="https://redirect.github.com/rust-lang/glob/pull/137">#137</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/glob/blob/master/CHANGELOG.md">glob's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/glob/compare/v0.3.2...v0.3.3">0.3.3</a>
- 2025-08-11</h2>
<ul>
<li>Optimize memory allocations (<a
href="https://redirect.github.com/rust-lang/glob/pull/147">#147</a>)</li>
<li>Bump the MSRV to 1.63 (<a
href="https://redirect.github.com/rust-lang/glob/pull/172">#172</a>)</li>
<li>Fix spelling in pattern documentation (<a
href="https://redirect.github.com/rust-lang/glob/pull/164">#164</a>)</li>
<li>Fix version numbers and some formatting (<a
href="https://redirect.github.com/rust-lang/glob/pull/157">#157</a>)</li>
<li>Style fixes (<a
href="https://redirect.github.com/rust-lang/glob/pull/137">#137</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="952da299a3"><code>952da29</code></a>
chore: release v0.3.3 (<a
href="https://redirect.github.com/rust-lang/glob/issues/155">#155</a>)</li>
<li><a
href="bfcd9a4760"><code>bfcd9a4</code></a>
Optimize memory allocations (<a
href="https://redirect.github.com/rust-lang/glob/issues/147">#147</a>)</li>
<li><a
href="e78862d913"><code>e78862d</code></a>
Bump the MSRV to 1.63 (<a
href="https://redirect.github.com/rust-lang/glob/issues/172">#172</a>)</li>
<li><a
href="97e5ee935a"><code>97e5ee9</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/glob/issues/164">#164</a>
from jonboulle/patch-1</li>
<li><a
href="4da20e6a0c"><code>4da20e6</code></a>
Fix spelling in pattern documentation</li>
<li><a
href="1cf0f30d25"><code>1cf0f30</code></a>
Fix version numbers and some formatting</li>
<li><a
href="7a17f11fcd"><code>7a17f11</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/glob/issues/153">#153</a>
from tgross35/clippy-ci</li>
<li><a
href="56619abe82"><code>56619ab</code></a>
Run clippy checks in CI</li>
<li><a
href="51363fa53c"><code>51363fa</code></a>
Disallow warnings in CI</li>
<li><a
href="1649a9a940"><code>1649a9a</code></a>
Apply remaining clippy suggestions</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/glob/compare/v0.3.2...v0.3.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=glob&package-manager=cargo&previous-version=0.3.2&new-version=0.3.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 01:44:18 +00:00
dependabot[bot]
ab66c087c0 build(deps): bump rustversion from 1.0.21 to 1.0.22 (#38609)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.21
to 1.0.22.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/rustversion/releases">rustversion's
releases</a>.</em></p>
<blockquote>
<h2>1.0.22</h2>
<ul>
<li>Turn off clippy incompatible_msrv in rustversion-conditional code
(<a
href="https://redirect.github.com/dtolnay/rustversion/issues/63">#63</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9e86f839b6"><code>9e86f83</code></a>
Release 1.0.22</li>
<li><a
href="a27fffdbb7"><code>a27fffd</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/rustversion/issues/64">#64</a>
from dtolnay/incompatiblemsrv</li>
<li><a
href="935837211f"><code>9358372</code></a>
Allow clippy incompatible_msrv</li>
<li><a
href="0379843c3c"><code>0379843</code></a>
Revert &quot;Pin nightly toolchain used for miri job&quot;</li>
<li><a
href="1491c256c8"><code>1491c25</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/rustversion/issues/62">#62</a>
from dtolnay/ci</li>
<li><a
href="49ad7c5242"><code>49ad7c5</code></a>
Add -Zfmt-debug=none test in CI</li>
<li>See full diff in <a
href="https://github.com/dtolnay/rustversion/compare/1.0.21...1.0.22">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustversion&package-manager=cargo&previous-version=1.0.21&new-version=1.0.22)](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-08-12 01:41:58 +00:00
dependabot[bot]
dd1da149d9 build(deps): bump webrender from ae2477d to 15318d6 (#38607)
Bumps [webrender](https://github.com/servo/webrender) from `ae2477d` to
`15318d6`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="15318d6627"><code>15318d6</code></a>
Expose FastTransform so that it can be used in Servo</li>
<li>See full diff in <a
href="ae2477d9a6...15318d6627">compare
view</a></li>
</ul>
</details>
<br />


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-08-12 00:00:42 +00:00
dependabot[bot]
6bd1564280 build(deps): bump wr_malloc_size_of from ae2477d to 15318d6 (#38606)
Bumps [wr_malloc_size_of](https://github.com/servo/webrender) from
`ae2477d` to `15318d6`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="15318d6627"><code>15318d6</code></a>
Expose FastTransform so that it can be used in Servo</li>
<li>See full diff in <a
href="ae2477d9a6...15318d6627">compare
view</a></li>
</ul>
</details>
<br />


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-08-11 23:50:51 +00:00
dependabot[bot]
340a2ecc39 build(deps): bump proc-macro2 from 1.0.95 to 1.0.96 (#38605)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.95
to 1.0.96.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/proc-macro2/releases">proc-macro2's
releases</a>.</em></p>
<blockquote>
<h2>1.0.96</h2>
<ul>
<li>Simplify how rustdoc flags are decided during docs.rs builds (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/511">#511</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="21f89e7dcf"><code>21f89e7</code></a>
Release 1.0.96</li>
<li><a
href="fe7d2faa1c"><code>fe7d2fa</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/511">#511</a>
from dtolnay/docsrs</li>
<li><a
href="7be6983e35"><code>7be6983</code></a>
Revert &quot;Work around doc build failure due to docs.rs flags
change&quot;</li>
<li><a
href="6f40165f9f"><code>6f40165</code></a>
Revert &quot;Pin nightly toolchain used for miri job&quot;</li>
<li><a
href="fc2ae0f869"><code>fc2ae0f</code></a>
Update ui test suite to nightly-2025-06-18</li>
<li><a
href="1ccc5a28e5"><code>1ccc5a2</code></a>
Ignore mismatched_lifetime_syntaxes lint</li>
<li><a
href="1091cc2218"><code>1091cc2</code></a>
Pin nightly toolchain used for miri job</li>
<li><a
href="0e82beadfb"><code>0e82bea</code></a>
Ignore ignore_without_reason pedantic clippy lint in test</li>
<li>See full diff in <a
href="https://github.com/dtolnay/proc-macro2/compare/1.0.95...1.0.96">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=proc-macro2&package-manager=cargo&previous-version=1.0.95&new-version=1.0.96)](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-08-11 23:43:31 +00:00
sagudev
68ad03c40a canvas: trace/instrument canvas messages processing (#38600)
Add some tracing/instrumenting for canvas messages processing.

Testing: We have not tests for tracing code.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-11 18:21:49 +00:00
Narfinger
3f7f9ba6cd canvas: Use Transform2D<f64> instead of Transform2D<f32> (#38316)
I mostly did dumb replacement so please check that this is correct. In
addition, `canvas_data::draw_with_shadow` needs some a bit of a closer
look.

Testing: This is covered by existing tests, and it is likely that WPT
tests are unaffected by the precision of the transform, even though it
is technically more correct.
Fixes: #38256

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-08-11 16:46:25 +00:00
Oriol Brufau
4ff1e8dbd9 layout: Use FastTransform for hit testing (#38554)
`FastTransform` provides faster matrix operations when the involved
transforms are just translations.

Testing: Not needed (no change in behavior)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-11 16:23:17 +00:00
Narfinger
0d40547bec Update mozjs dependency. (#38596)
Dependency update for mozjs which includes the faster latin1 decoding.

Testing: Dependency updates have no tests.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-08-11 13:58:23 +00:00
Tim van der Lippe
3976fa77bc Implement Trusted Types for ShadowRoot (#38595)
Also make TrustedHTML work the same as TrustedScript by
only taking 1 `&str` to make things easier.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-11 13:39:55 +00:00
Simon Wülker
abc549eff7 Reduce the size of some unsafe blocks in shaper.rs (#38597)
This change ensures that safe operations are done outside of unsafe
blocks as often as possible.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-11 13:39:07 +00:00
Martin Robinson
b75c3feb97 script/compositor: Send mouseleave events when cursor moves between <iframe>s (#38539)
Properly send `mouseleave` events when the cursor moves between
`<iframe>`s. This allows a better handling of cursor changes and status
text updates. Specifically, we do not need to continuously update the
cursor and the value can be cached in the `Document`. In addition,
status updates can now be sent properly when moving focus between
`<iframe>`s.

Note that style updates for `:hover` values are still broken, but less
so than before. Now the hover state on the `Node` is updated, but for
some
reason the restyle isn't taking place properly. This maintains the
status quo as far as behavior goes when hover moves between `<iframe>`s.

This change also adds a helper data structure to `Document` which will
eventually be responsible for event handling.

Testing: Cursor and status change are currently very hard to test as
the API test harness makes this difficult at the moment.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-11 12:31:54 +00:00
Tim van der Lippe
82ca2b92cd Implement Trusted Type eval checks (#37834)
It implements the new codeForEvalGets callback to retrieve the
value for a trusted script object. Additionally, it implements
the new logic in can-compile-strings to call the policy
factory if required.

Note that parameter and argument checks aren't implemented yet,
as they require updates to binding generation (see TODO in
script_runtime).

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-11 12:26:56 +00:00
Mukilan Thiyagarajan
4c05758ded script: support inline SVG by serializing the subtree (#38188)
This patch adds support for rendering static inline SVG documents in the
DOM tree by serializing the SVGElement's subtree and leveraging the
existing resvg based SVG stack for rendering. Serialiing the subtree is
necessary as resvg's tree representation (roxmltree) is immutable, so we
can't construct the tree incrementally.

Few other design choices here:
1. The `SVGSVGElement` is now treated as a replaced element and the
   layout code is responsible for plumbing the serialized SVG source
   (encoded as a base64 data: url) into the image cache, much like how
   background images are handled.
2. The serialization is done on the script thread after an initial
   layout pass. This is necessary because the serialization code asserts
that it is invoked from script thread i.e we can't call it from layout
   workers.
3. The serialized SVG data: url is cached to avoid recomputing it on
   subsequent layouts. The cache is invalidated when the SVGSVGElement's
   subtree is mutated.

The original SVGSVGElement code was behind the `dom_svg_enabled` pref.
This patch also removes the preference and make SVG support using resvg
available unconditionally.

Below is the analysis of the new test failures:

These tests use inline SVG but used to pass by accident.
They now fail because they contain SVG with no intrinsic
sizing which is not handled by resvg in a way that would
allows us to distinguish it from the sized case. The same
limitation applies to non-inline SVG.

 - /css/CSS2/positioning/absolute-replaced-width-003a.xht
 - /css/CSS2/positioning/absolute-replaced-width-003b.xht
 - /css/CSS2/positioning/absolute-replaced-width-003c.xht

These tests employ CSS styles in the HTML that
target the elements in inline SVG, which is not currently
supported.

-
/css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter-svg-basic.html
 - /css/compositing/mix-blend-mode/mix-blend-mode-plus-lighter-svg.html

This is a tentative test that uses the unsupported 'border-shape' CSS
property. The ref uses SVG, so it used to pass accidentally. The ref
still doesn't render correctly since it also relies on styling SVG
elements using CSS classes in the HTML (instead of inline in SVG).

 - /css/css-borders/tentative/border-shape/border-shape-stroke.html

These tests use the attribute 'clip-path=circle(...)' in the
test, but this doesn't seem to work in resvg.

 - /css/css-masking/clip-path/clip-path-borderBox-1b.html
 - /css/css-masking/clip-path/clip-path-contentBox-1b.html
 - /css/css-masking/clip-path/clip-path-contentBox-1c.html
 - /css/css-masking/clip-path/clip-path-fillBox-1b.html
 - /css/css-masking/clip-path/clip-path-marginBox-1a.html
 - /css/css-masking/clip-path/clip-path-paddingBox-1b.html
 - /css/css-masking/clip-path/clip-path-strokeBox-1b.html
 - /css/css-masking/clip-path/clip-path-strokeBox-1c.html
 - /css/css-masking/clip-path/clip-path-viewBox-1a.html
 - /css/css-masking/clip-path/clip-path-viewBox-1b.html
 - /css/css-masking/clip-path/clip-path-viewBox-1d.html
 - /css/css-masking/clip-path/svg-clip-path-circle-offset.html
 - /css/css-masking/clip-path/svg-clip-path-ellipse-offset.html

Additionally, the below two tests use a `foreignObject` SVG element
which
embeds a html div fragment. This is also not supported by resvg.

 - /css/css-masking/clip-path/clip-path-viewBox-1d.html
 - /css/css-masking/clip-path/clip-path-fillBox-1b.html

The following test fails because of apparent pixel differences
between a circle rendered purely using CSS clip-path vs a circle
rendered in SVG using resvg.

 - /css/css-masking/clip-path/clip-path-contentBox-1c.html

These tests style the inline SVG elements using CSS in the HTML or
separate stylesheet. This is not supported by this implementation.

 - /css-transforms/document-styles/svg-document-styles-{001..004}.html
 - /css-transforms/document-styles/svg-document-styles-012.html
 - /css-transforms/external-styles/svg-external-styles-{001..004}.html
 - /css-transforms/external-styles/svg-external-styles-014.html

These tests seem like they should pass, but they fail because of what
seems like an anti-aliasing issue in the rendering engine. The
transformed element has a thin outline which is causing pixel difference
with the ref:

 - /css/css-transforms/group/svg-transform-group-008.html
 - /css/css-transforms/group/svg-transform-group-009.html
 - /css/css-transforms/group/svg-transform-nested-009.html
 - /css/css-transforms/group/svg-transform-nested-013.html
 - /css/css-transforms/group/svg-transform-nested-014.html
 - /css/css-transforms/group/svg-transform-nested-018.html
 - /css/css-transforms/group/svg-transform-nested-019.html
 - /css/css-transforms/group/svg-transform-nested-008.html

The below tests fail because resvg is calculating the wrong size for the
'rect' inside the SVG. The dimensions of the SVG are established via the
CSS in the HTML, so it seems resvg is using incorrect coordinates for
the children of the svg when explict width/height are not specified in
the root svg element.

 - /css/css-transforms/group/svg-transform-group-011.html
 - /css/css-transforms/group/svg-transform-nested-021.html
 - /css/css-transforms/group/svg-transform-nested-029.html

All these tests use an SVG that doesn't have width nor height attributes
and this causes resvg to use incorrect coordinates for the SVG's
children. In addition, the following tests use the CSS syntax for
transforms inside the SVG (using style attribute) which is not supported
by resvg (it only supports the SVG 1.1 transform syntax).

 - /css/css-transforms/inline-styles/svg-inline-styles-{001..004}.html
 - /css/css-transforms/inline-styles/svg-inline-styles-012.html

In the case of these four tests, the `style` attribute specifies an
invalid transform, but resvg doesn't fallback to the transform specified
via the `transform`  attribute on the same element.

 - /css/css-transforms/inline-styles/svg-inline-styles-005.html
 - /css/css-transforms/inline-styles/svg-inline-styles-006.html
 - /css/css-transforms/inline-styles/svg-inline-styles-010.html
 - /css/css-transforms/inline-styles/svg-inline-styles-013.html

The following test fails because of the lack of width/height in SVG as
described above but it also exposes gaps in our CSS tranform
implementation.

 - /css/css-transforms/preserve3d-and-filter-with-perspective.html

These tests failure because resvg doesn't handle the SVG without
explicit width and height, but specified via CSS in the HTML. In
addition, there are pixel differences between the ref due to
antialiasing issues.

 - /css/css-transforms/matrix/svg-matrix-{005...008}.html
 - /css/css-transforms/matrix/svg-matrix-010.html
 - /css/css-transforms/matrix/svg-matrix-012.html
 - /css/css-transforms/matrix/svg-matrix-{015..069}.html
 - /css/css-transforms/rotate/svg-rotate-angle-45-001.html
 - /css/css-transforms/rotate/svg-rotate-angle-45-011.html
 - /css/css-transforms/rotate/svg-rotate-angle-45-022.html
 - /css/css-transforms/scale/svg-scale-006.html
 - /css/css-transforms/scale/svg-scale-007.html

These tests seem to be failing due to some sort of antialiasing issue,
where a transformed SVG element has a thin border that causes pixel
differences compared to the solid colored reference.

 - /css/css-transforms/skewX/svg-skewx-001.html
 - /css/css-transforms/skewX/svg-skewx-006.html
 - /css/css-transforms/skewX/svg-skewx-011.html
 - /css/css-transforms/skewX/svg-skewx-016.html
 - /css/css-transforms/skewX/svg-skewx-021.html
 - /css/css-transforms/skewX/svg-skewxy-001.html
 - /css/css-transforms/skewY/svg-skewy-001.html
 - /css/css-transforms/skewY/svg-skewy-006.html
 - /css/css-transforms/skewY/svg-skewy-011.html
 - /css/css-transforms/skewY/svg-skewy-016.html
 - /css/css-transforms/skewY/svg-skewy-021.html

These tests specify several SVG attributes such as transform,
vector-effect etc via CSS in the HTML (rather than inline in SVG). The
current implementation doesn't support this.

 - /css/css-transforms/transform-box/stroke-box-mutation-001.html
 - /css/css-transforms/transform-box/stroke-box-mutation-002.html
 - /css/css-transforms/transform-box/stroke-box-mutation-003.html
 - /css/css-transforms/transform-box/stroke-box-mutation-004.html
 - /css/css-transforms/transform-box/svgbox-stroke-box-002.html
 - /css/css-transforms/transform-box/svgbox-stroke-box-003.html
 - /css/css-transforms/transform-box/svgbox-stroke-box-004.html
 - /css/css-transforms/transform-box/svgbox-stroke-box-005.html

These tests depend on 'transform-origin' specified on an element inside
an SVG, but this transform is influenced by the 'tranform-box' set via
CSS in the HTML itself (not the SVG). The current implementation doesn't
support styling the SVG using document styles, so these tests just fail.

- /css/css-transforms/transform-origin/svg-origin-relative-length-*.html

These tests check the fallback behaviour when invalid syntax is
encountered in the 'transform-origin' value. resvg doesn't correctly
fallback to 0,0 causing the tests to fail.

-
/css/css-transforms/transform-origin/svg-origin-relative-length-invalid-001.html
-
/css/css-transforms/transform-origin/svg-origin-relative-length-invalid-002.html
-
/css/css-transforms/transform-origin/svg-origin-relative-length-invalid-003.html
-
/css/css-transforms/transform-origin/svg-origin-relative-length-invalid-004.html

These tests use unimplemented Canvas APIs like 'beginLayer' and
the 'CanvasFilter' constructor and hence fail at runtime.

-
/html/canvas/element/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.html
-
/html/canvas/element/filters/2d.filter.layers.gaussianBlur.tentative.html
-
/html/canvas/element/layers/2d.layer.anisotropic-blur.isotropic.tentative.html
-
/html/canvas/element/layers/2d.layer.anisotropic-blur.mostly-x.tentative.html
-
/html/canvas/element/layers/2d.layer.anisotropic-blur.mostly-y.tentative.html
-
/html/canvas/element/layers/2d.layer.anisotropic-blur.x-only.tentative.html
-
/html/canvas/element/layers/2d.layer.anisotropic-blur.y-only.tentative.html
-
/html/canvas/element/layers/2d.layer.css-filters.blur-and-shadow.tentative.html
 - /html/canvas/element/layers/2d.layer.css-filters.blur.tentative.html
- /html/canvas/element/layers/2d.layer.css-filters.shadow.tentative.html
 - /html/canvas/element/layers/2d.layer.ctm.layer-filter.tentative.html
-
/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html
-
/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.html
-
/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.tentative.html
-
/html/canvas/offscreen/filters/2d.filter.layers.gaussianBlur.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.tentative.html
- /html/canvas/offscreen/layers/2d.layer.css-filters.blur.tentative.html
-
/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.tentative.html
- /html/canvas/offscreen/layers/2d.layer.ctm.layer-filter.tentative.html

These tests fail because resvg doesn't seem to honour the 'translate'
CSS property specified on an SVG element using an inline 'style'
attribute.

 - /css/css-transforms/translate/svg-translate-with-units.html
-
/css/css-transforms/translate/translate-and-transform-attribute-in-svg.html
-
/css/css-transforms/translate/translate-and-transform-css-property-in-svg.html
 - /css/css-transforms/translate/translate-in-svg.html

These tests seem to fail due to the filter effect implementation in
resvg either not being complete or spec compliant.

 - /css/filter-effects/feconvolve-divisor.html
 - /css/filter-effects/feconvolve-region-001.html
 - /css/filter-effects/feconvolve-region-002.html
 - /css/filter-effects/filter-subregion-01.html
 - /css/filter-effects/svg-feimage-002.html
 - /css/filter-effects/svg-feimage-003.html
 - /css/filter-effects/svg-feimage-004.html
 - /css/filter-effects/svg-feoffset-001.html

The test /css/filter-effects/svg-feimage-004.html should ideally PASS
but currently fails because we don't propagate height/width set using
CSS in HTML element to the root SVG, so resvg uses the wrong dimensions
when rendering the children of the SVG.

These failures are due to deficienies in our current implementation
i.e we don't support styling SVG elements using CSS in HTML.

-
/css/css-transforms/gradientTransform/svg-gradientTransform-combination-001.html
 - /css/selectors/sharing-in-svg-use.html

The below test fails as our current implementation relies on resvg to
tell us the intrinsic ratio of the SVG, but this doesn't always work
correctly.

 - /css/css-sizing/svg-intrinsic-size-005.html

This failure is due to lack of proper fallback to no-op transform in
resvg when the `rotate()` syntax is specified with an invalid list e.g
`rotate(90,)`.

 - /css/css-transforms/rotate/svg-rotate-3args-invalid-002.html

This test only passes in CI and based on the raw log output, it seems
that no text inside the SVG is rendered in the CI. This could be an font
stack related issue.

 - /css/css-display/display-contents-svg-elements.html

This test asserts that the CSP blocks loads triggered using `use`
elements in SVG. It used to TIMEOUT as without inline SVG support, no
CSP violation event was triggered. It fails now since the event is now
triggered for the load of the SVG itself (our current implementation
loads inline SVGs as serialized base64 data: urls). This doesn't match
the blocked URL in the use element though.

 - /content-security-policy/img-src/svg-use-blocked.tentative.html

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-11 11:07:59 +00:00
Martin Robinson
be7625fc1e tidy: Replace custom panic/unwrap lint with clippy lint (#38593)
This change replaces our custom `panic` / `unwrap` lint with the one
from clippy. This rule as not properly applied in servoshell, so this
change fixes some clippy errors raised by the new configuration.

Testing: This change removes the tidy tests for the custom lints, but
otherwise the behavior is tested as part of clippy itself.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-11 11:04:11 +00:00
Martin Robinson
005164df4a script: Move point_in_initial_containing_block calculation to script (#38520)
Instead of calculating this value in the compositor, calculate it in
`ScriptThread` now that it is straightforward to get this value from the
layout spatial tree. This allows removing some tricky callback code in
the Compositor.

Testing: This shouldn't change any observable behavior so is covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-11 09:32:38 +00:00
Martin Robinson
9d4004135b script: Properly fire input events for clipboard use in input elements (#37100)
When using the clipboard to paste or modify the contents of an input
element the specification says says[^1] to

> Queue tasks to fire any events that should fire due to the
> modification, see § 5.3 Integration with other scripts and events for
> details.

This change does that, by turning `handle_text_clipboard_action` into
`TextInput::handle_clipboard_event` and having the caller responsible
for executing events. In addition, when content is changed, the node is
dirtied, forcing a relayout.

[^1]: https://www.w3.org/TR/clipboard-apis/#paste-action

Testing: This is difficult to test because we do not have test harness
support for input events currently. There is a manual test for this in
the linked bug which is now passing.
Fixes: #37074.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-11 09:23:58 +00:00
Adam
6ddcce4889 Replace Rc<RefCell<Option<RootedTraceableBox<Heap<JSVal>>>>> with Rc<RefCell<Option<Heap<JSVal>>>> in PipeTo::shutdown_error (#38562)
#38024 adds a rooted box around the Heap for safety, but this is not
necessary anymore after #38385. The solution is to replace
`Rc<RefCell<Option<RootedTraceableBox<Heap<JSVal>>>>>` with
`Rc<RefCell<Option<Heap<JSVal>>>>`. This changes replaces this type.

Signed-off-by: amotaouakkil123 <adam.motaouakkil@mail.mcgill.ca>
2025-08-11 08:58:54 +00:00
Jerens Lensun
3ab56b16de mach(test-tidy): Remove alphabetical order and line length rule from tidy (#38538)
As we plan to adopt more rules from Ruff and rustfmt, we would like to
retire the following rules:

1. `Line length check`, as this is already handled by Ruff and rustfmt
configurations.
2. `Alphabetical order`


Testing: `./mach test-tidy --no-progress --all`
Fixes: #37121

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-11 08:54:50 +00:00
shuppy
4784668fa9 devtools: Create source actors from Debugger API notifications (#38334)
currently our devtools impl creates source actors in script, when
executing scripts in HTMLScriptElement or DedicatedWorkerGlobalScope.
this approach is cumbersome, and it means that many pathways to running
scripts are missed, such as imported ES modules.

with the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we can pick
up all of the scripts and all of their sources without any extra code,
as long as we tell it about every global we create (#38333, #38551).
this patch adds a [Debugger#onNewScript()
hook](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewscript-script-global)
to the debugger script, which calls
DebuggerGlobalScope#notifyNewSource() to notify our script system when a
new script runs. if the source is relevant to the file tree in the
Sources tab, script tells devtools to create a source actor.

Testing: adds several new automated devtools tests
Fixes: part of #36027

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-11 06:04:51 +00:00
Kenzie Raditya Tirtarahardja
de73d4a25c script(webdriver): Check if element is disabled based on WebDriver specification (#38490)
Checking if an element is disabled based on
[spec](https://w3c.github.io/webdriver/#dfn-disabled). Fix the command
`Is Element Enabled`.

Testing: Covered in WPT
(`./tests/wpt/tests/webdriver/tests/classic/is_element_enabled/enabled.py`)

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-11 04:41:04 +00:00
Tim van der Lippe
2e5f5e7d1c Update Nom to 8.0.0 (#38585)
There are two relevant breaking changes:
* instead of `)(input)`, we now need to call `).parse(input)`
* tuples are no longer a call, but a `()` call.

There is one other usage of nom 7, however that's in the build
dependencies list of mozangle via bindgen. Therefore, we won't have
duplicate nom versions in Servo binary.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-10 21:25:37 +00:00
Rodion Borovyk
4f8731d562 script: Return a Result from GlobalScope::evaluate_script_on_global_with_result (#38549)
Make GlobalScope::evaluate_script_on_global_with_result return a Result
instead of a boolean. This is the first step to resolve issue #37810.

Testing: Should not break or fix any existing tests

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-08-10 16:51:46 +00:00
Servo WPT Sync
86c37a380b Sync WPT with upstream (10-08-2025) (#38583)
Automated downstream sync of changes from upstream as of 10-08-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-08-10 11:09:48 +00:00
sagudev
2f0afb0ec0 python: Update pyOpenSSL to 24 (#38582)
WPT updated something and we need to update pyOpenSSL to 24 to make deps
resolvable.
This fixes WPT Imports:
https://github.com/servo/servo/actions/runs/16855379913/job/47753105229

Testing: WPT import run:
https://github.com/servo/servo/actions/runs/16859665646

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-10 10:31:01 +00:00
Simon Wülker
a60b53eded script: Convert CSS from a IDL interface with static methods to a namespace (#38579)
This change updates our implementation to match the spec. Per
https://drafts.csswg.org/cssom/#issue-24739c22 this is observable.

Testing: Covered by existing web platform tests.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-10 03:35:25 +00:00
Oriol Brufau
7ff8724eaf layout: Move sizing logic from geom.rs to sizing.rs (#38568)
Moves `Size`, `SizeConstraint`, `Sizes` and `LazySizeData`.

Testing: Not needed, no change in behavior.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-09 20:43:40 +00:00
Martin Robinson
d5d3ad6949 script: Replace allow(unused_imports) with conditional use statements (#38576)
A few places in the code are using a blanket `allow(unused_imports)`
compiler directive to silence errors about unused imports when the
`webxr` feature is disabled. Since this can hide other kinds of unused
imports, replace these directives with conditional `use` statements.

Testing: No behavior change, so existing tests suffice.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-09 20:19:12 +00:00
Simon Wülker
4d7a0d3863 script: Tell devtools whether a node is displayed or not (#38575)
Doing so makes the devtools inspector display the nodes in gray, as it
is the case in firefox.
The relevant node parameter already exists but is hardcoded.

Before:
<img width="1108" height="408" alt="image"
src="https://github.com/user-attachments/assets/4a442fc9-92db-4a97-9e70-3b02f994a9d1"
/>


After:
<img width="1169" height="404" alt="image"
src="https://github.com/user-attachments/assets/ec1674a4-c025-4ceb-93c8-0cc3f695ddc7"
/>


Testing: We don't have tests for the devtools inspector.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-09 18:12:20 +00:00
shuppy
c4044e17bb script: Rename DebuggerEvent to DebuggerAddDebuggeeEvent (#38571)
the next debugger script event, `getPossibleBreakpoints` (#37667), will
contain a single attribute `unsigned long spidermonkeyId`, so it will
have nothing in common with `addDebuggee`. this patch renames the latter
accordingly.

Testing: no behaviour changes other than the rename, so no tests needed
Fixes: part of #36027

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-08-09 18:01:00 +00:00
Oriol Brufau
c49d53b8dd layout: Paint flex and grid items like inline blocks (#38574)
As specified in https://drafts.csswg.org/css-flexbox-1/#painting and
https://drafts.csswg.org/css-grid/#z-order

Testing: Makes some WPT pass.
Fixes: #38573

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-09 17:42:12 +00:00
Labros
7b057be780 script: Replace usage of IntersectionObserverRootMargin with Stylo'sIntersectionObserverMargin (#38519)
@stevennovaryo 
Created wrapper for Stylo's IntersectionObserverMargin and cleaned up
repeated code.
Testing: Code compiles and `./mach test-unit tests/unit/style/` doesn't
have any errors. intersectionobserver.rs is able to utilize the struct.
Fixes: https://github.com/servo/servo/issues/35907

---------------------------
Signed-off-by: samir <samir.khan720a@gmail.com>

---------

Signed-off-by: samir <samir.khan720a@gmail.com>
2025-08-09 17:31:44 +00:00
sagudev
0b2c0cd055 chore: Update vello(_cpu) (#38569)
I need this to properly evaluate multi threading in vello_cpu.

Testing: Existing WPT tests, but it's just dep bump.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-09 17:00:30 +00:00
minghuaw
ad18638534 script_bindings: Remove jsstring_to_str (#38527)
This PR removes `jsstring_to_str`, which is replaced with
`jsstr_to_string`, and updates `mozjs` to
6f3dcb99a7.

Given that servo now always replaces unpaired surrogate since
https://github.com/servo/servo/pull/35381, the internal conversion
function `jsstring_to_str` is functionally the same as `jsstr_to_string`
from `mozjs`. This PR removes `jsstring_to_str` and replaces with
`jsstr_to_string` with conversions to `DOMString` where necessary.

Testing: Passes all unit test. No regression was found in WPT test (see
try run: https://github.com/minghuaw/servo/actions/runs/16821156583)

---------

Signed-off-by: minghuaw <wuminghua7@huawei.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-09 11:50:14 +00:00
shuppy
a3e0a34802 script: Add new worker globals as debuggees (#38551)
to debug workers in a page with the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to
pass the worker’s global object to
[Debugger.prototype.**addDebuggee()**](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#adddebuggee-global).
we could pick up the global via the [onNewGlobalObject()
hook](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewglobalobject-global),
but if our script system passes the global to the debugger script
instead, we can later add details like the PipelineId that will help
servo identify debuggees that the API is notifying us about (#38334).

this patch creates a debugger global in worker threads, runs the
debugger script in those new globals, and plumbs new worker globals from
those threads into addDebuggee() via the debugger script. since worker
threads can’t generate PipelineId values, but they only ever run workers
on behalf of one pipeline, we use that pipeline’s PipelineId as the
PipelineId of the debugger global, rather than generating a unique
PipelineId like we do in script threads.

Testing: will undergo many automated tests in #38334
Fixes: part of #36027

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-09 11:28:06 +00:00
Euclid Ye
d50f02fa73 script: Cleanup unused import in htmlscriptelement.rs (#38567)
Testing: No behaviour change.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-09 08:12:48 +00:00
Euclid Ye
589d188a3f script: Change signature of Event::dispatch to match the spec and simplify things (#38566)
- [Dispatch Event](https://dom.spec.whatwg.org/#concept-event-dispatch)
should return a Boolean. This function is used frequently in spec and
the change makes things easier to follow.
- Remove `enum EventStatus` and related functions.
- Update some dead spec link.
- Update some steps.

This is intended as cleanup before working on #38435 and reduces binary
size by 488KB in Release profile.

Testing: No behaviour change.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-09 08:04:31 +00:00
Mukilan Thiyagarajan
21717158eb script: mark innerHTML as fallible in ShadowRoot (#38565)
This is a follow-up to #38532 which simply defaulted to an empty string
as the spec's WebIDL doesn't mark `innerHTML` as `Throws`. However,
since the absence of `Throws` in the spec doesn't imply no-throw, we can
mark this as fallible in our WebIDL. This makes the `ShadowRoot`'s
implementation match `Element`'s `innerHTML`.

Testing: Same as #38532.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-09 06:45:52 +00:00
arthmis
86d7f4c793 add implementation for Path2D addPath method (#37838)
Add implementation for Path2D addPath method
Spec:
https://html.spec.whatwg.org/multipage/canvas.html#dom-path2d-addpath

Testing: WPT test -
`tests/wpt/tests/css/geometry/DOMMatrix2DInit-validate-fixup.html`
Fixes: #37695

---------

Signed-off-by: Lloyd Massiah <artmis9@protonmail.com>
Signed-off-by: arthmis <artmis9@protonmail.com>
2025-08-09 05:06:20 +00:00
shuppy
6471587fb4 script: Set correct introductionType values in more places (#38550)
to use the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/) as the single
source of truth about scripts and their sources for devtools purposes
(servo/servo#38334), we need to keep track of whether scripts come from
an actual file or from things like setTimeout(), because for some
[introductionType](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Source.html#introductiontype)
[values](https://firefox-source-docs.mozilla.org/devtools-user/debugger-api/debugger.source/#accessor-properties-of-the-debugger-source-prototype-object),
we want to disregard the script unless it has a [`//# sourceURL=`
override](https://tc39.es/ecma426/#sec-linking-eval)
([displayURL](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Source.html#displayurl)).

this patch builds on #38363, setting the correct introductionType value
in several more cases.

Testing: will undergo many automated tests in #38334
Fixes: part of #36027

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-09 05:05:54 +00:00
Jonathan Schwender
ff4971012f bump mozjs to 137.0-1 (#38561)
This bump downgrades icu_capi to 1.5.0, to match the version vendored in
spidermonkey.

Previous mozjs PRs:
- https://github.com/servo/mozjs/pull/606
- https://github.com/servo/mozjs/pull/605


Testing: Covered by existing tests

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-08 20:19:45 +00:00
Kenzie Raditya Tirtarahardja
d33ae1549d script(webdriver): Fix element clear for file (#38536)
When clearing input file with WebDriver, we should set input's filelist
with empty list instead of setting it with None.

Testing:
`./tests/wpt/tests/webdriver/tests/classic/element_send_keys/file_upload.py`

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-08 18:38:35 +00:00
dependabot[bot]
29222c2770 build(deps): bump slab from 0.4.10 to 0.4.11 (#38559)
Bumps [slab](https://github.com/tokio-rs/slab) from 0.4.10 to 0.4.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/slab/releases">slab's
releases</a>.</em></p>
<blockquote>
<h2>v0.4.11</h2>
<ul>
<li>Fix <code>Slab::get_disjoint_mut</code> out of bounds (<a
href="https://redirect.github.com/tokio-rs/slab/issues/152">#152</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/slab/blob/master/CHANGELOG.md">slab's
changelog</a>.</em></p>
<blockquote>
<h1>0.4.11 (August 8, 2025)</h1>
<ul>
<li>Fix <code>Slab::get_disjoint_mut</code> out of bounds (<a
href="https://redirect.github.com/tokio-rs/slab/issues/152">#152</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2e5779f8eb"><code>2e5779f</code></a>
Release v0.4.11 (<a
href="https://redirect.github.com/tokio-rs/slab/issues/153">#153</a>)</li>
<li><a
href="2d65c514bc"><code>2d65c51</code></a>
Fix get_disjoint_mut error condition (<a
href="https://redirect.github.com/tokio-rs/slab/issues/152">#152</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/slab/compare/v0.4.10...v0.4.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=slab&package-manager=cargo&previous-version=0.4.10&new-version=0.4.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 17:20:16 +00:00
dependabot[bot]
4eafb9837b build(deps): bump cfg-expr from 0.20.1 to 0.20.2 (#38560)
Bumps [cfg-expr](https://github.com/EmbarkStudios/cfg-expr) from 0.20.1
to 0.20.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/EmbarkStudios/cfg-expr/releases">cfg-expr's
releases</a>.</em></p>
<blockquote>
<h2>0.20.2</h2>
<h3>Changed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cfg-expr/pull/81">PR#81</a>
updated the builtin target list to 1.89.0.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/EmbarkStudios/cfg-expr/blob/main/CHANGELOG.md">cfg-expr's
changelog</a>.</em></p>
<blockquote>
<h2>[0.20.2] - 2025-08-07</h2>
<h3>Changed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cfg-expr/pull/81">PR#81</a>
updated the builtin target list to 1.89.0.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6be48f7e40"><code>6be48f7</code></a>
Release 0.20.2</li>
<li><a
href="319b059f17"><code>319b059</code></a>
Update to 1.89 (<a
href="https://redirect.github.com/EmbarkStudios/cfg-expr/issues/81">#81</a>)</li>
<li>See full diff in <a
href="https://github.com/EmbarkStudios/cfg-expr/compare/0.20.1...0.20.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cfg-expr&package-manager=cargo&previous-version=0.20.1&new-version=0.20.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 17:19:28 +00:00
Martin Robinson
931025c16e script: Wrap unsafe code in components/script/bindings in unsafe {} (#38544)
Clippy now checks to see if unsafe code is wrapped in unsafe blocks. We
have this lint disabled for `script` and `script_bindings` because of a
lot of legacy code that doesn't do this. The lint is useful though as it
makes it more obvious what code is unsafe. This is an incremental step
toward being able to turn this lint on for `script`.

This has the benefit of silencing warnings that show up in some IDEs
that use rust-analyzer.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-08 17:18:30 +00:00
dependabot[bot]
fef104cff7 build(deps): bump cc from 1.2.31 to 1.2.32 (#38558)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.31 to 1.2.32.
<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.31...cc-v1.2.32">1.2.32</a>
- 2025-08-08</h2>
<h3>Fixed</h3>
<ul>
<li>fix new clippy lint introduced in rust 1.89.0 (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1509">#1509</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>clarify cargo default if no rerun emitted (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1508">#1508</a>)</li>
<li>extract compile_objects_sequential (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1507">#1507</a>)</li>
<li>Windows <code>find_tools</code>: add support for finding Clang (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1506">#1506</a>)</li>
<li>Add m68k-unknown-linux-gnu cross-compile target (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1505">#1505</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="94a7cc349e"><code>94a7cc3</code></a>
chore: release v1.2.32 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1510">#1510</a>)</li>
<li><a
href="33b616dcf7"><code>33b616d</code></a>
doc: clarify cargo default if no rerun emitted (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1508">#1508</a>)</li>
<li><a
href="3046b0af8d"><code>3046b0a</code></a>
fix new clippy lint introduced in rust 1.89.0 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1509">#1509</a>)</li>
<li><a
href="b8959a21ad"><code>b8959a2</code></a>
Refactor: extract compile_objects_sequential (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1507">#1507</a>)</li>
<li><a
href="3f62db136f"><code>3f62db1</code></a>
Windows <code>find_tools</code>: add support for finding Clang (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1506">#1506</a>)</li>
<li><a
href="5e210bd8fb"><code>5e210bd</code></a>
Add m68k-unknown-linux-gnu cross-compile target (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1505">#1505</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.31...cc-v1.2.32">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.31&new-version=1.2.32)](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-08-08 17:14:49 +00:00
dependabot[bot]
405cc2d073 build(deps): bump bytemuck from 1.23.1 to 1.23.2 (#38557)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.23.1 to
1.23.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Lokathor/bytemuck/blob/main/changelog.md">bytemuck's
changelog</a>.</em></p>
<blockquote>
<h2>1.23.2</h2>
<ul>
<li>bump <code>derive</code> minimum version.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c069a2f6a4"><code>c069a2f</code></a>
chore: Release bytemuck version 1.23.2</li>
<li><a
href="8b48ef35bf"><code>8b48ef3</code></a>
.</li>
<li><a
href="7fef8d93ba"><code>7fef8d9</code></a>
bump derive minimum version. should be a semver patch effect.</li>
<li><a
href="2524f62b76"><code>2524f62</code></a>
chore: Release bytemuck_derive version 1.10.1</li>
<li><a
href="c4873c9634"><code>c4873c9</code></a>
.</li>
<li><a
href="374df78558"><code>374df78</code></a>
Make the <code>Pod</code>/<code>NoUninit</code> derive macros use
<code>assert!</code> to check size equality,...</li>
<li><a
href="6633a5113f"><code>6633a51</code></a>
Fix a typo (<a
href="https://redirect.github.com/Lokathor/bytemuck/issues/319">#319</a>)</li>
<li><a
href="1c9e7ba196"><code>1c9e7ba</code></a>
chore: Release bytemuck_derive version 1.10.0</li>
<li><a
href="5e58cf7182"><code>5e58cf7</code></a>
changelog</li>
<li><a
href="0e11472150"><code>0e11472</code></a>
add support for deriving NoUninit on enums with fields (<a
href="https://redirect.github.com/Lokathor/bytemuck/issues/292">#292</a>)</li>
<li>See full diff in <a
href="https://github.com/Lokathor/bytemuck/compare/v1.23.1...v1.23.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bytemuck&package-manager=cargo&previous-version=1.23.1&new-version=1.23.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 16:59:44 +00:00
dependabot[bot]
11f6a424e0 build(deps): bump hashbrown from 0.15.4 to 0.15.5 (#38556)
Bumps [hashbrown](https://github.com/rust-lang/hashbrown) from 0.15.4 to
0.15.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/hashbrown/releases">hashbrown's
releases</a>.</em></p>
<blockquote>
<h2>v0.15.5</h2>
<h3>Added</h3>
<ul>
<li>Added <code>Entry::or_default_entry</code> and
<code>Entry::or_insert_entry</code>.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Re-implemented likely/unlikely with <code>#[cold]</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md">hashbrown's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/hashbrown/compare/v0.15.4...v0.15.5">0.15.5</a>
- 2025-08-07</h2>
<h3>Added</h3>
<ul>
<li>Added <code>Entry::or_default_entry</code> and
<code>Entry::or_insert_entry</code>.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Re-implemented likely/unlikely with <code>#[cold]</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="b751eef8e9"><code>b751eef</code></a>
Update CHANGELOG.md</li>
<li><a
href="da4c80e8e0"><code>da4c80e</code></a>
chore: release v0.15.5</li>
<li><a
href="43584833e6"><code>4358483</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/hashbrown/issues/631">#631</a>
from DaniPopes/readd-likely</li>
<li><a
href="64bd7db1d1"><code>64bd7db</code></a>
Re-implement likely/unlikely with <code>#[cold]</code></li>
<li><a
href="670213fb32"><code>670213f</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/hashbrown/issues/601">#601</a>
from braddunbar/or-default-entry</li>
<li><a
href="99761e4817"><code>99761e4</code></a>
fix clippy issues</li>
<li><a
href="e44ee2d34c"><code>e44ee2d</code></a>
Merge branch 'master' of <a
href="https://github.com/rust-lang/hashbrown">https://github.com/rust-lang/hashbrown</a>
into or-defau...</li>
<li><a
href="e514afefa9"><code>e514afe</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/hashbrown/issues/624">#624</a>
from rust-lang/release-plz-2025-05-28T15-42-25Z</li>
<li>See full diff in <a
href="https://github.com/rust-lang/hashbrown/compare/v0.15.4...v0.15.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hashbrown&package-manager=cargo&previous-version=0.15.4&new-version=0.15.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 16:56:22 +00:00
Oriol Brufau
93c9fc14f1 layout: Let stretch on flex item cross size stretch to the line (#38526)
We were instead stretching to the containing block, which implied that
the behaviors of a `stretch` size and `stretch` alignment weren't
consistent.

As resolved by the CSSWG, the behavior will now be:
 - If the cross size of the line is known, stretch to the line.
 - Otherwise, stretch to the containing block.

See https://github.com/w3c/csswg-drafts/issues/11784

This aligns us with Blink, which has already shipped this new behavior.

Testing: Improves existing WPT and adds a new test.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-08 15:45:30 +00:00
shuppy
9866ca7e59 devtools: Warn when sending common protocol errors (#38548)
#37686 fixed an entire class of devtools protocol bugs that led to
protocol desyncs with warnings in the Servo log, but it also removed the
warnings, making it harder to spot where our devtools impl is
incomplete.

this patch reintroduces a warning whenever some Actor::handle_message()
returns Err(ActorError).

Testing: debug logging only, so not really worth testing

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-08 14:11:23 +00:00
Martin Robinson
4257db643b Revert "Include the scrollable overflow of a child box if either its parent or child has overflow: visible (#38443)" (#38546)
This reverts commit dcb90bb85e.

This broke scrollable overflow calculation in the following case:

```
<div id="foo" style="width: 200px; height: 200px; outline: solid; overflow: auto;">
    <div style="height: 5000px; background: pink;">hello</div>
</div>
```

In this case the overflow is propagating through the `overflow: auto`
`<div>` and into the parents. When dumping the flow tree I see the root
node being 5000 pixels tall. It's unclear why this change didn't break
any tests, so it's likely that we need to add a test for this case.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-08 13:37:14 +00:00
Martin Robinson
5c307a38df script_bindings Start wrapping unsafe code in unsafe {} (#38545)
This is useful to better isolate `unsafe` code. Once all unsafe calls
are wrapped we can enable the Rust warning.  This also explicitly
disables the warning for generated code, which is a much more difficult
task. After this change there are 211 warnings left in
`script_bindings`.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-08 12:21:31 +00:00
shuppy
c9541f2906 devtools: Expose introductionType to devtools clients (#38541)
in the devtools protocol, [source
forms](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#loading-script-sources)
announced in `resources-available-array` messages can include the
`introductionType`, which more or less mirrors the field of the same
name in SpiderMonkey’s CompileOptions.

this patch exposes `introductionType` accordingly, allowing us to check
for the correct values in automated tests.

Testing: new coverage in devtools tests
Fixes: part of #36027

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-08 12:20:30 +00:00
Mukilan Thiyagarajan
23c0947072 script: make Node::xml_serialize fallible. (#38532)
Testing: [Try run][1] did not reveal any test failures. There doesn't
seem to be any straightforward failure scenarios that can be triggered
in `xml5ever` that are not IO errors and the xml_serialize method simply
serializes to a String buffer.

[1]:
https://github.com/servo/servo/actions/runs/16824267959/job/47657275606l

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-08 11:52:59 +00:00
Jerens Lensun
8f52e28225 mach(test-tidy): Make wpt lint logic servo-tidy.toml and optimize checking for changed files (#38511)
Fix wpt lint logic to respect servo-tidy.toml ignores and --all flag

Testing: Should be covered on CI
Fixes: #38510  #37991

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-08 10:34:42 +00:00
Euclid Ye
31acac316d webdriver: Rename wait_for_script_response to wait_for_ipc_response (#38537)
As titled. Initially I want to include this as part of another PR but
looks so messy..
The motivation is that we are no longer just waiting for script
response.

Testing: No behaviour change.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-08 09:49:57 +00:00
Martin Robinson
6651f37c05 script/compositor: Handle cursor updates from script (#38518)
Instead of using WebRender hit testing to update the cursor, base it on
layout hit tests. This allows removing the majority of WebRender hit
test items and finally opens up the possibility of adding support for
custom cursors. In addition, this change fixes an issue where cursors
were not set properly on areas of the viewport that extended past the
page content.

Testing: This is difficult to test as verifying that the cursor changed
properly is beyond the capabilities of Servo's test harnesses.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-07 18:49:38 +00:00
Oriol Brufau
87538282db layout: Floor content-box size by zero when stretching flex item (#38521)
When stretching the cross size of a flex item to its flex line, we were
computing the stretch size by subtracting padding, border and margin
from the line size. However, this could result in a negative amount for
the content-box cross size. Therefore, this floors it by zero.

Testing: Adding new tests
Fixes: #38517

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-07 18:19:22 +00:00
Oriol Brufau
cf99d437fb layout: Refactor FlexItemLayoutResult (#38515)
This performs various refactorings:

- Turns `content_size` into `content_block_size`, losing the inline
component, since it was the same as `containing_block_inline_size`.
- Merges `containing_block_inline_size` and
`containing_block_block_size` into `containing_block_size`.
- Removes `has_child_which_depends_on_block_constraints` since this
information should already be in `depends_on_block_constraints`.
- `FlexItem::layout()` is no longer responsible for trying to reuse the
previous result. Therefore it no longer returns an `Option`, and no
longer accepts the previous result as a parameter.
- `FlexItemLayoutResult::compatible_with_containing_block_size()` is
removed, and a simplified version is inlined into the relevant caller of
`FlexItem::layout()`.

Testing: Not needed (no change in behavior)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-07 18:18:46 +00:00
dependabot[bot]
e40be635bd build(deps): bump keyboard-types from 0.8.0 to 0.8.1 (#38523)
Bumps [keyboard-types](https://github.com/pyfisch/keyboard-types) from
0.8.0 to 0.8.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pyfisch/keyboard-types/releases">keyboard-types's
releases</a>.</em></p>
<blockquote>
<h2>v0.8.1</h2>
<h2>Added</h2>
<ul>
<li>Added <code>impl From&lt;NamedKey&gt; for Key</code>: <a
href="https://redirect.github.com/rust-windowing/keyboard-types/pull/81">rust-windowing/keyboard-types#81</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-windowing/keyboard-types/compare/v0.8.0...v0.8.1">https://github.com/rust-windowing/keyboard-types/compare/v0.8.0...v0.8.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f82b9e4a8a"><code>f82b9e4</code></a>
Release v0.8.1</li>
<li><a
href="6b939e28b3"><code>6b939e2</code></a>
Make it clear in the docs that space is not a named key</li>
<li><a
href="25d8e98baa"><code>25d8e98</code></a>
Add <code>impl From\&lt;NamedKey&gt; for Key</code></li>
<li><a
href="763483400d"><code>7634834</code></a>
Doc tweaks / improvements</li>
<li><a
href="29852c9eca"><code>29852c9</code></a>
no_std: Don't use the <code>std</code> prelude</li>
<li>See full diff in <a
href="https://github.com/pyfisch/keyboard-types/compare/v0.8.0...v0.8.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=keyboard-types&package-manager=cargo&previous-version=0.8.0&new-version=0.8.1)](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-08-07 18:07:47 +00:00
dependabot[bot]
71de910c8c build(deps): bump bytemuck_derive from 1.10.0 to 1.10.1 (#38522)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from
1.10.0 to 1.10.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2524f62b76"><code>2524f62</code></a>
chore: Release bytemuck_derive version 1.10.1</li>
<li><a
href="c4873c9634"><code>c4873c9</code></a>
.</li>
<li><a
href="374df78558"><code>374df78</code></a>
Make the <code>Pod</code>/<code>NoUninit</code> derive macros use
<code>assert!</code> to check size equality,...</li>
<li><a
href="6633a5113f"><code>6633a51</code></a>
Fix a typo (<a
href="https://redirect.github.com/Lokathor/bytemuck/issues/319">#319</a>)</li>
<li>See full diff in <a
href="https://github.com/Lokathor/bytemuck/compare/bytemuck_derive-v1.10.0...bytemuck_derive-v1.10.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bytemuck_derive&package-manager=cargo&previous-version=1.10.0&new-version=1.10.1)](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-08-07 18:07:16 +00:00
dependabot[bot]
f7fd913b19 build(deps): bump clap from 4.5.42 to 4.5.43 (#38524)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.42 to 4.5.43.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.43</h2>
<h2>[4.5.43] - 2025-08-06</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> In long help, list Possible Values before defaults,
rather than after, for a more consistent look</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.43] - 2025-08-06</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> In long help, list Possible Values before defaults,
rather than after, for a more consistent look</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c4105bd90c"><code>c4105bd</code></a>
chore: Release</li>
<li><a
href="a029b20be6"><code>a029b20</code></a>
docs: Update changelog</li>
<li><a
href="cf15d48b59"><code>cf15d48</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5893">#5893</a>
from 8LWXpg/patch-2</li>
<li><a
href="7e54542de9"><code>7e54542</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5892">#5892</a>
from 8LWXpg/patch-1</li>
<li><a
href="6ffc88f8c9"><code>6ffc88f</code></a>
fix(complete): Check if help string is empty</li>
<li><a
href="7d8470ed9c"><code>7d8470e</code></a>
fix(complete): Fix single quote escaping in PowerShell</li>
<li><a
href="eadcc8f66c"><code>eadcc8f</code></a>
chore: Release</li>
<li><a
href="7ce0f7bea3"><code>7ce0f7b</code></a>
docs: Update changelog</li>
<li><a
href="fea7c5487b"><code>fea7c54</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5888">#5888</a>
from epage/tut</li>
<li><a
href="c297ddd56e"><code>c297ddd</code></a>
docs(tutorial): Experiment with a flat layout</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.42...clap_complete-v4.5.43">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.42&new-version=4.5.43)](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-08-07 18:06:04 +00:00
Josh Matthews
842dd99698 Update to SpiderMonkey 137. (#37077)
Incorporates the updates from https://github.com/servo/mozjs/pull/584.

Testing: Existing WPT coverage is enough.
Fixes: Part of #36258

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-07 16:47:27 +00:00
Nico Burns
fd20a5df42 layout(grid): implement named grid lines and areas (#38306)
### Changes made

This implements named grid lines (line names in `grid-template-*`),
named grid areas (`grid-template-areas`), and the ability to target
those using `grid-{row,column}-{start,end}`. It also includes a bunch of
miscelaneous fixes for `repeat(auto-fill | auto-fit, ...)` syntax as
that interacts with the specification of line names.

The actual layout implementation is in Taffy. The bulk of this PR is
updating Servo to translate (CSS Grid-related) Stylo types into Taffy
types using a new iterator-based API which uses iterators and lazy
translation for efficiency (which is more important now that we're
dealing with string data, even though they're `Atom`s).

### Testing

This functionality has lots of WPT tests. It fixes some seemingly random
CSS Grid tests that use named lines/areas even though that's not what
they're testing.

### Screenshots

wikipedia.org

<img width="1624" height="1056" alt="Screenshot 2025-07-27 at 20 03 16"
src="https://github.com/user-attachments/assets/2c50b96f-ae36-4405-ac48-b771bfdcb515"
/>

bbc.co.uk:

<img width="1624" height="1056" alt="Screenshot 2025-07-27 at 20 32 57"
src="https://github.com/user-attachments/assets/ba84e211-65d2-4411-95fb-7b9b91bea31c"
/>

theguardian.com:

<img width="1624" height="1056" alt="Screenshot 2025-07-27 at 20 33 29"
src="https://github.com/user-attachments/assets/e85daaa6-5fb0-45d4-b9ec-b22b38b087ec"
/>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-07 14:41:19 +00:00
shuppy
a9664c4199 devtools: Reland devtools test fixes missing from #38359 (#38516)
in #38359, we intended to land some fixes to the devtools tests, but we
failed to actually include those fixes in the patch. this patch adds a
second internal web server, then reworks test_sources_list() to load
scripts from the two distinct origins of our internal web servers:
<http://127.0.0.1:10000> and <http://127.0.0.1:10001>.

Testing: covered by existing devtools tests, which now actually pass
Fixes: part of #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-07 13:38:48 +00:00
shuppy
8cfd82f55c mach: Allow filtering tests in mach test-devtools (#38514)
`mach test-devtools` uses
[unittest](https://docs.python.org/3/library/unittest.html) without
[unittest.main()](https://docs.python.org/3/library/unittest.html#unittest.main),
so we can parse arguments and set up the test runner how we want, but
this means there’s currently no way to filter tests on the command line.

this patch plumbs the positional arguments (if any) into the
TestLoader’s
[testNamePatterns](https://docs.python.org/3/library/unittest.html#unittest.TestLoader.testNamePatterns),
with extra logic to treat any pattern `pattern` not containing `*` like
`*pattern*`. this is the same behaviour as unittest.main()
[`-k`](https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k):

```
$ ./mach test-devtools domparser responsexml
Running devtools tests...
Running 2 tests:
- test_source_content_inline_script_with_domparser (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_domparser)
- test_source_content_inline_script_with_responsexml (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_responsexml)

test_source_content_inline_script_with_domparser (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_domparser) ... ok
test_source_content_inline_script_with_responsexml (servo.devtools_tests.DevtoolsTests.test_source_content_inline_script_with_responsexml) ... ok

----------------------------------------------------------------------
Ran 2 tests in 4.055s

OK
```

Testing: not really worth automated testing, but tested manually above
Fixes: part of #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-08-07 13:23:53 +00:00
Nico Burns
52ba8facc2 stylo: use simplified restyle damage macros (#38465)
Servo PR for https://github.com/servo/stylo/pull/222

Fixes: #38506
Testing: adding new tests

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-07 10:41:22 +00:00
Euclid Ye
616b86fb6d webdriver: Check if container is obscured for "Element Click" (#38497)
Implement step 7 of [Element
Click](https://w3c.github.io/webdriver/#element-click): check whether
container is obscured.

Testing: `/webdriver/tests/classic/element_click/interactability.py` can
now fully pass. Other changes are combined effect with
17a269a8ad due to script execution, and
exposes new problem:
https://github.com/servo/servo/pull/38497#discussion_r2257866612

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-07 09:16:50 +00:00
Gregory Terzian
b23cf9c6cd net: clean shutdown of fetch thread (#38421)
The fetch thread is currently not shut down, meaning it is one of the
threads counted in the "threads are still running after shutdown (bad)"
counter shown when Servo has shut-down.

This PR introduces a mechanism to start, and shut-down, one fetch thread
per process that requires one.

Testing: WPT tests and unit tests(for font context). Also manually
tested loading and closing "about:blank": this change indeed brings down
the count of threads still running after shutdown by one.

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

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-07 09:01:30 +00:00
Martin Robinson
ad805e3110 compositor/layout: Rely on layout for fine-grained input event hit testing (#38480)
Before, the compositor was responsible for doing the hit testing during
input events within a page. This change moves that hit testing to
layout.  With this change, epoch mismatches are no longer a bit deal and
we can simply ignore them, as the Constellation and Script will take
care of ignoring hit tests against scroll nodes and browsing contexts
that no longer exist. This means that hit testing retry support can be
removed.

Add the concept of a Script `HitTest` that transforms the coarse-grained
renderer hit test into one that hit tests against the actual layout
items.

Testing: Currently we do not have good tests for verifying the behavior
of
input events, but WebDriver tests should cover this.
Fixes: This is part of #37932.
Fixes: #26608.
Fixes: #25282.
Fixes: #38090.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: kongbai1996 <1782765876@qq.com>
2025-08-07 08:38:43 +00:00
sagudev
c0cc8484f8 canvas: pop many clips on restore (#38496)
When restoring context/state we need to pop all clips from current
state, before we just poped one (even if there was none).

Testing: Added new WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-07 08:23:09 +00:00
Jonathan Schwender
c055e8b456 ci: Move runner-timeout to composite action (#38503)
We are hitting the limit of 20 workflow references in servo. To help
mitigate this somewhat, we migrate the timeout job to a composite
action, which should be able to support our needs just as well.

Testing: [try run of this
PR](https://github.com/servo/servo/actions/runs/16783916103/job/47529580725).
[try run with unconditional
cancel](https://github.com/servo/servo/actions/runs/16784074213/job/47530099654).

This reduces our workflow count by one, slightly helping to address
#36143

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-07 05:13:36 +00:00
Jonathan Schwender
edf80576d5 ci: Don't give lint job secrets (#38504)
The lint workflow doesn't seem to use any secrets, so we shouldn't pass
them.

Testing: [mach
try](https://github.com/servo/servo/actions/runs/16784528217/job/47531648483)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-07 03:45:14 +00:00
Gregory Terzian
a99ad240a0 constellation: join on script-threads (#38424)
We currently send exit signals to script-threads, and we also join on
the BHM worker. This ensure the constellation shuts-down only after
script has dropped it's sender to the BHM worker. By joining on the
script-threads, we have a guarantee that they have exited(which is
stronger than having dropped their senders) by the time the
constellation exits.

Testing: Manually opened many tabs and closed the window, both in
single- and multi-process modes.
Fixes: Part of - https://github.com/servo/servo/issues/30849

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-06 18:05:18 +00:00
dependabot[bot]
b23adab8a5 build(deps): bump anstream from 0.6.19 to 0.6.20 (#38502)
Bumps [anstream](https://github.com/rust-cli/anstyle) from 0.6.19 to
0.6.20.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="550de4dbb5"><code>550de4d</code></a>
chore: Release</li>
<li><a
href="094640c272"><code>094640c</code></a>
docs: Update changelog</li>
<li><a
href="6aec7d7101"><code>6aec7d7</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/anstyle/issues/265">#265</a>
from aschey/main</li>
<li><a
href="96dbb44f26"><code>96dbb44</code></a>
fix(crossterm): fix color conversion</li>
<li><a
href="e4e2347393"><code>e4e2347</code></a>
chore: Release</li>
<li><a
href="03f5d6a0b1"><code>03f5d6a</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-cli/anstyle/issues/264">#264</a>
from epage/alloc</li>
<li><a
href="3f497444fe"><code>3f49744</code></a>
perf(roff): Remove extra allocations</li>
<li><a
href="d5351f4bf4"><code>d5351f4</code></a>
chore: Release</li>
<li><a
href="44e1d1d745"><code>44e1d1d</code></a>
fix(roff): Minimize size of output (<a
href="https://redirect.github.com/rust-cli/anstyle/issues/263">#263</a>)</li>
<li><a
href="9c2b802041"><code>9c2b802</code></a>
fix(roff): Minimize size of output</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-cli/anstyle/compare/anstream-v0.6.19...anstream-v0.6.20">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=anstream&package-manager=cargo&previous-version=0.6.19&new-version=0.6.20)](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-08-06 18:02:34 +00:00
Euclid Ye
56033d844a script: Rename some parent to child (#38498)
I believe there was some code migration but name's not been changed.

Testing: No behaviour change.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-06 17:39:38 +00:00
Jonathan Schwender
0233ad5e40 bencher: Clone thresholds from main (#38220)
When running bencher on pull requests or try, we want to clone any
thresholds we setup for main to detect regressions.
Note: The thresholds we are actually interested in are defined on the
production profile, while in PRs we currently test release. Probably we
should reconsider that, but perhaps that could be a different PR with
seperate discussion.

Testing: ./mach try
([ohos](https://github.com/servo/servo/actions/runs/16779272577))

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-06 17:34:40 +00:00
Nico Burns
e31dcc95f9 Use cached layout in grid layout (#38493)
This makes grid layout make use of Servo's layout caching system.

Testing: No behavior change. Existing WPT coverage

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-06 14:15:12 +00:00
Martin Robinson
44a11a7c6c script/layout: Ensure a StackingContextTree before IntersectionObserver geometry queries (#38473)
IntersectionObserver needs to be able to query node geometry without
forcing a layout. A previous layout could have run without needing a
`StackingContextTree`. In that case the layout-less query should finish
building the `StackingContextTree` before doing the query.  Add a new
type of layout API which requests that layout finishes building the
StackingContextTree.

This change also slightly simplifies and corrects the naming of
`Element` APIs around client box queries.

Testing: This should fix intermittent failures in WPT tests.
Fixes: #38380.
Fixes: #38390.
Closes: #38400.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-06 13:46:43 +00:00
lumiscosity
757dbc0eda servoshell: make the color picker and select picker closeable (#38373)
Addresses the first half of #38347 by making it possible to close the
select picker and the color picker by pressing ESC or clicking off the
modal. Marking this as draft since I need some help with squashing a bug
- the "clicking off" part only triggers after moving the mouse or
pressing any key, and I'm not sure why.

Testing: Manual.
Fixes: First half of #38347.

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-08-06 11:49:47 +00:00
Euclid Ye
98522db8be webdriver: Search ancestors instead of preceding nodes when computing container for option&optgroup (#38491)
Fix the bug from 6 years ago https://github.com/servo/servo/pull/24090.

According to [spec](https://w3c.github.io/webdriver/#dfn-container), we
should search ancestor instead of preceding nodes (which is reverse
order of pre-order DFS and can end up weird places) when computing
container for `option`&`optgroup`.


Testing: Update WPT.
Fixes: https://github.com/servo/servo/pull/36467#discussion_r2255834497.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-06 08:54:45 +00:00
Abdelrahman Hossam
17a269a8ad script: Implement scrollIntoView (#38230)
This is an implementation for `scrollIntoView`. For now, it is called
when a certain element gains focus.

Testing: Existing WPT tests
Fixes: #24059

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
2025-08-06 08:08:25 +00:00
Shubham Gupta
dcb90bb85e Include the scrollable overflow of a child box if either its parent or child has overflow: visible (#38443)
Include the scrollable overflow of a child box if either its parent or
child has `overflow: visible`

**Issue**: For the blocks having property `overflow:hidden`, their
scroll overflow is not added to parent's scroll overflow.
Causing unable to scroll the parent block aka `Root` block in our Issue
#38248 .

**Testing**: css/cssom-view/scrolling-quirks-vs-nonquirks.html
**Fixes**: #38248

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-08-06 07:46:54 +00:00
Jerens Lensun
5b148cf5de script_bindings: Add type definitions for configuration.py (#38450)
*Describe the changes that this pull request makes here. This will be
the commit message.*

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

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-06 05:44:05 +00:00
Euclid Ye
62b181dc85 webdriver: Simplify get_element_pointer_interactable_paint_tree (#38469)
Add step 1 and simplify step 2 - 5 to remove duplicate `GetClientRects`
call.

There is some issue with spec to be updated later.

Testing: No behaviour change.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-06 05:36:34 +00:00
dependabot[bot]
4b7d659cf6 build(deps): bump tokio-util from 0.7.15 to 0.7.16 (#38488)
Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.15 to
0.7.16.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cf6b50a3fd"><code>cf6b50a</code></a>
chore: prepare tokio-util v0.7.16 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7507">#7507</a>)</li>
<li><a
href="416e36b0df"><code>416e36b</code></a>
task: stabilise <code>JoinMap</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7075">#7075</a>)</li>
<li><a
href="9741c90f9f"><code>9741c90</code></a>
sync: document cancel safety on <code>SetOnce::wait</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7506">#7506</a>)</li>
<li><a
href="4e3f17bce3"><code>4e3f17b</code></a>
codec: also apply capacity to read buffer in
<code>Framed::with_capacity</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7500">#7500</a>)</li>
<li><a
href="86cbf81e15"><code>86cbf81</code></a>
Merge 'tokio-1.47.1' into 'master'</li>
<li><a
href="be8ee45b3f"><code>be8ee45</code></a>
chore: prepare Tokio v1.47.1 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7504">#7504</a>)</li>
<li><a
href="d9b19166cd"><code>d9b1916</code></a>
Merge 'tokio-1.43.2' into 'tokio-1.47.x' (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7503">#7503</a>)</li>
<li><a
href="db8edc620f"><code>db8edc6</code></a>
chore: prepare Tokio v1.43.2 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7502">#7502</a>)</li>
<li><a
href="e47565b086"><code>e47565b</code></a>
blocking: clarify that spawn_blocking is aborted if not yet started (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7501">#7501</a>)</li>
<li><a
href="4730984d66"><code>4730984</code></a>
readme: add 1.47 as LTS release (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7497">#7497</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.15...tokio-util-0.7.16">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tokio-util&package-manager=cargo&previous-version=0.7.15&new-version=0.7.16)](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-08-05 20:28:35 +00:00
dependabot[bot]
90dd034070 build(deps): bump async-lock from 3.4.0 to 3.4.1 (#38486)
Bumps [async-lock](https://github.com/smol-rs/async-lock) from 3.4.0 to
3.4.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/async-lock/releases">async-lock's
releases</a>.</em></p>
<blockquote>
<h2>v3.4.1</h2>
<ul>
<li>Fix typos in docs. (<a
href="https://redirect.github.com/smol-rs/async-lock/issues/89">#89</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/async-lock/blob/master/CHANGELOG.md">async-lock's
changelog</a>.</em></p>
<blockquote>
<h1>Version 3.4.1</h1>
<ul>
<li>Fix typos in docs. (<a
href="https://redirect.github.com/smol-rs/async-lock/issues/89">#89</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="82283a2e1b"><code>82283a2</code></a>
v3.4.1</li>
<li><a
href="cd0937d70a"><code>cd0937d</code></a>
Fix clippy::empty_line_after_doc_comments and
clippy::empty_line_after_outer_...</li>
<li><a
href="7819a20973"><code>7819a20</code></a>
Fix clippy::needless_lifetimes warning</li>
<li><a
href="efcc3d8b32"><code>efcc3d8</code></a>
ci: Use reusable workflows for fmt and security_audit</li>
<li><a
href="6bece6e513"><code>6bece6e</code></a>
ci: Use &quot;v2.0.0&quot; branch for security check</li>
<li><a
href="9963923bad"><code>9963923</code></a>
chore: Fix typos (<a
href="https://redirect.github.com/smol-rs/async-lock/issues/89">#89</a>)</li>
<li><a
href="8717b76b68"><code>8717b76</code></a>
chore: Fix lints (<a
href="https://redirect.github.com/smol-rs/async-lock/issues/92">#92</a>)</li>
<li>See full diff in <a
href="https://github.com/smol-rs/async-lock/compare/v3.4.0...v3.4.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-lock&package-manager=cargo&previous-version=3.4.0&new-version=3.4.1)](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-08-05 19:38:52 +00:00
dependabot[bot]
fe2c901498 build(deps): bump futures-lite from 2.6.0 to 2.6.1 (#38485)
Bumps [futures-lite](https://github.com/smol-rs/futures-lite) from 2.6.0
to 2.6.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/futures-lite/releases">futures-lite's
releases</a>.</em></p>
<blockquote>
<h2>v2.6.1</h2>
<ul>
<li>Fix docs for <code>once_future</code> and
<code>stop_after_future</code>. (<a
href="https://redirect.github.com/smol-rs/futures-lite/issues/131">#131</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md">futures-lite's
changelog</a>.</em></p>
<blockquote>
<h1>Version 2.6.1</h1>
<ul>
<li>Fix docs for <code>once_future</code> and
<code>stop_after_future</code>. (<a
href="https://redirect.github.com/smol-rs/futures-lite/issues/131">#131</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="226ce18976"><code>226ce18</code></a>
v2.6.1</li>
<li><a
href="3444c7a2f8"><code>3444c7a</code></a>
docs: Fix <code>stop_after_future</code> link and
<code>once_future</code> description (<a
href="https://redirect.github.com/smol-rs/futures-lite/issues/131">#131</a>)</li>
<li><a
href="d608d08310"><code>d608d08</code></a>
Some alloc-related cleanup (<a
href="https://redirect.github.com/smol-rs/futures-lite/issues/130">#130</a>)</li>
<li><a
href="077e1c1a5e"><code>077e1c1</code></a>
Switch to unconditional no_std attribute (<a
href="https://redirect.github.com/smol-rs/futures-lite/issues/128">#128</a>)</li>
<li><a
href="5c196b9516"><code>5c196b9</code></a>
docs: Enable doc_auto_cfg on docs.rs (<a
href="https://redirect.github.com/smol-rs/futures-lite/issues/125">#125</a>)</li>
<li><a
href="64dbe9e4ec"><code>64dbe9e</code></a>
ci: Use reusable workflows for fmt and security_audit</li>
<li>See full diff in <a
href="https://github.com/smol-rs/futures-lite/compare/v2.6.0...v2.6.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=futures-lite&package-manager=cargo&previous-version=2.6.0&new-version=2.6.1)](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-08-05 19:36:19 +00:00
dependabot[bot]
961a83c905 build(deps): bump event-listener from 5.4.0 to 5.4.1 (#38483)
Bumps [event-listener](https://github.com/smol-rs/event-listener) from
5.4.0 to 5.4.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/event-listener/releases">event-listener's
releases</a>.</em></p>
<blockquote>
<h2>v5.4.1</h2>
<ul>
<li>Fix a copy-paste error in <code>wait_timeout</code> docs (<a
href="https://redirect.github.com/smol-rs/event-listener/issues/152">#152</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/event-listener/blob/master/CHANGELOG.md">event-listener's
changelog</a>.</em></p>
<blockquote>
<h1>Version 5.4.1</h1>
<ul>
<li>Fix a copy-paste error in <code>wait_timeout</code> docs (<a
href="https://redirect.github.com/smol-rs/event-listener/issues/152">#152</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0c18ca2308"><code>0c18ca2</code></a>
v5.4.1</li>
<li><a
href="56d87b45d6"><code>56d87b4</code></a>
Update criterion requirement from 0.6 to 0.7 (<a
href="https://redirect.github.com/smol-rs/event-listener/issues/156">#156</a>)</li>
<li><a
href="810a6db63c"><code>810a6db</code></a>
Update criterion requirement from 0.5 to 0.6 (<a
href="https://redirect.github.com/smol-rs/event-listener/issues/153">#153</a>)</li>
<li><a
href="91a936e66e"><code>91a936e</code></a>
Fix doctest on WASM</li>
<li><a
href="323da40de2"><code>323da40</code></a>
Fix clippy::mem_replace_option_with_some warning</li>
<li><a
href="29e15c0fcb"><code>29e15c0</code></a>
ci: Re-enable WASM test</li>
<li><a
href="a8aefba5e9"><code>a8aefba</code></a>
Merge pull request <a
href="https://redirect.github.com/smol-rs/event-listener/issues/152">#152</a>
from JamesHallowell/fix-wait-timeout-docs</li>
<li><a
href="9870df3f63"><code>9870df3</code></a>
Minor amendment to <code>wait_timeout</code> docs</li>
<li><a
href="51ae1404dc"><code>51ae140</code></a>
ci: Use reusable workflows for fmt and security_audit</li>
<li>See full diff in <a
href="https://github.com/smol-rs/event-listener/compare/v5.4.0...v5.4.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=event-listener&package-manager=cargo&previous-version=5.4.0&new-version=5.4.1)](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-08-05 19:15:27 +00:00
dependabot[bot]
46e71fc30b build(deps): bump signal-hook-registry from 1.4.5 to 1.4.6 (#38481)
Bumps [signal-hook-registry](https://github.com/vorner/signal-hook) from
1.4.5 to 1.4.6.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md">signal-hook-registry's
changelog</a>.</em></p>
<blockquote>
<h1>signal-hook-registry-1.4.6</h1>
<ul>
<li>Reword/improve the safety requirements docs for register (<a
href="https://redirect.github.com/vorner/signal-hook/issues/178">#178</a>).</li>
</ul>
<h1>signal-hook-1.3.18</h1>
<ul>
<li>Release the special-case removal of AIX for top-level signal-hook
too (<a
href="https://redirect.github.com/vorner/signal-hook/issues/169">#169</a>,
<a
href="https://redirect.github.com/vorner/signal-hook/issues/176">#176</a>).</li>
</ul>
<h1>signal-hook-async-std-0.3.0</h1>
<ul>
<li>Bump async-std to 0.2 (<a
href="https://redirect.github.com/vorner/signal-hook/issues/172">#172</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4c5d0a0d3b"><code>4c5d0a0</code></a>
Release registry v1.4.6</li>
<li><a
href="b299a05459"><code>b299a05</code></a>
Merge pull request <a
href="https://redirect.github.com/vorner/signal-hook/issues/179">#179</a>
from vorner/safety-docs</li>
<li><a
href="164d58b924"><code>164d58b</code></a>
Clarify safety requirements for register.</li>
<li><a
href="1ff235c739"><code>1ff235c</code></a>
Merge pull request <a
href="https://redirect.github.com/vorner/signal-hook/issues/177">#177</a>
from tomstokes/master</li>
<li><a
href="9ffea0fd11"><code>9ffea0f</code></a>
docs: Fix MIO feature name</li>
<li><a
href="e343491fa5"><code>e343491</code></a>
Version 0.3.18</li>
<li><a
href="dfdec81944"><code>dfdec81</code></a>
signal-hook-async-std 0.3.0</li>
<li><a
href="dcc5da2f30"><code>dcc5da2</code></a>
Merge pull request <a
href="https://redirect.github.com/vorner/signal-hook/issues/175">#175</a>
from gaykitty/update-async-std</li>
<li><a
href="171da9cf95"><code>171da9c</code></a>
Update async-io and futures-lite to v2</li>
<li>See full diff in <a
href="https://github.com/vorner/signal-hook/compare/registry-v1.4.5...registry-v1.4.6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=signal-hook-registry&package-manager=cargo&previous-version=1.4.5&new-version=1.4.6)](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-08-05 19:05:30 +00:00
sagudev
f3644422c4 layout: Separate LayoutDamage bit patterns nibbles with _ (#38476)
Using `_` on such long bit patterns makes them easier to read.

Testing: Just formatting.
Fixes: #38474

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-05 12:43:16 +00:00
shuppy
3eddfeaee2 script: Tell SpiderMonkey whether scripts are inline (#38363)
to use the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/) as the single
source of truth about scripts and their sources for devtools purposes
(servo/servo#38334), the debugger script needs to be able to distinguish
inline scripts from other scripts, because inline scripts are a special
case where the source contents need to come from the Servo parser.

the mechanism for this is
[Debugger.Script.prototype.**introductionType**](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Source.html#introductiontype),
which is `inlineScript` for inline scripts or a variety of other values
for other kinds of scripts, but only the embedder can provide this
information.

this patch bumps mozjs to servo/mozjs#603, which expands on
CompileOptionsWrapper, making it a safe wrapper around CompileOptions.
to construct one from safe code, use Runtime::new_compile_options().
then you can call `set_introduction_type(&'static CStr)` on the new
instance. we also make Runtime::evaluate_script() take a
CompileOptionsWrapper from the caller, instead of constructing one
internally.

in this patch, we set the introductionType to `c"inlineScript"` when
calling run_a_classic_script() and compile_module_script() for inline
scripts, and leave it unset all other cases.

Testing: will undergo automated tests in #38334
Fixes: part of #36027, part of servo/servo#38378

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-05 12:41:14 +00:00
Martin Robinson
0bf8676345 layout: Cache projected point in spatial node when hit testing (#38464)
Implement a simple one element cache for projected points in spatial
nodes. This should reduce the amount matrix math done during hit
testing.

Testing: This should not change test results, but should improve
performance a bit. Thus, tests are not necessary beyond existing
performance tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-05 11:07:42 +00:00
shuppy
ec99e7a8b0 script: Remove logging in debugger script (#38475)
#38333 adds new code to the debugger script containing some
console.log() calls, which unlike native rust log messages can’t be
turned off. this patch removes them for now, until we find a better
approach.

Testing: no testable changes in this patch
Fixes: noisy logging as of #38333

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-05 11:01:35 +00:00
Martin Robinson
11844ca5af layout: Add a layout hit test and use it for document.elementsFromPoint (#38463)
In #18933, hit testing was moved from layout to WebRender. This presents
some issues. For instance, the DOM can change at the same time that hit
test is happening. This can mean that hit test returns references to
defunct DOM nodes, introducing memory safety issues. Currently, Servo
will try to ensure that the epochs used for testing and those recorded
in the DOM match, but this is not very reliable and has led to code that
retries failed hit tests.

This change reintroduces (8 years later) a layout hit tester and turns
it on for `document.elementFromPoint` and `document.elementsFromPoint`.
The idea is that this hit tester will gradually replace the majority of
the WebRender hit testing happening in the renderer.

Testing: This shouldn't really change the behavior hit testing, but it
seems to improve one WPT test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: kongbai1996 <1782765876@qq.com>
2025-08-05 09:48:21 +00:00
Martin Robinson
3e856cbf11 layout: Introduce ReflowPhasesRun (#38467)
There were various booleans on `ReflowResults` that represented various
actions that might have been taken during a reflow request. Replace
those with a bitflags that better represents what reflow phases have
actually been run. Update variable names to reflect what they mean.

In addition, run some post-layout tasks unconditionally. They are
already contingent on the results returned from layout.

This simplifies and clarifies the code a good deal.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-05 08:39:42 +00:00
shuppy
92a9d24a13 script: Add new Window globals as debuggees (#38333)
to debug the scripts in a page with the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to
pass the page’s global object to
[Debugger.prototype.**addDebuggee()**](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#adddebuggee-global).
we could pick up the global via the [onNewGlobalObject()
hook](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewglobalobject-global),
but if our script system passes the global to the debugger script
instead, we can later add details like the PipelineId that will help
servo identify debuggees that the API is notifying us about (#38334).

this patch plumbs new Window globals from script into addDebuggee() via
the debugger script. to call into the debugger script with structured
input, we create a new DOM event type, DebuggerEvent, that the debugger
script listens for as the “addDebuggee” event.

Testing: no testable effects yet, but will be used in #37667
Fixes: part of #36027

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-05 05:48:53 +00:00
Gregory Terzian
77ff351cde net: clean shutdown of the async runtime (#38425)
The previous use of a static variable for the runtime prevented it from
shutting down cleanly, because shutdown requires dropping or taking
ownership of it. This PR switches the static variable to a handle only,
and introduces a new trait to pass a handle to the async runtime to the
constellation, where it can be shut-down along with other components and
help reduce our count of still running threads after shutdown.

Testing: manual testing, and covered by unit-test in net, and wpt tests.
Fixes: part of - https://github.com/servo/servo/issues/30849

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-04 21:42:47 +00:00
Gregory Terzian
7ad32f944f script: allow for undefined chunks in stream piping (#38470)
Current code uses `undefined` as chunk value to identify the closing of
a stream, but this breaks once you start streaming a chunk that is
actually `undefined`, as shown in
https://github.com/servo/servo/pull/38466. This PR re-implement the
logic in a way that allows for chunks to be `undefined`.

Testing: Should maintain `streams/piping` WPT pass rates. Also makes the
`undefined` case of
[`/encoding/streams/encode-bad-chunks.any.js`](c59ee57b5d/tests/wpt/tests/encoding/streams/encode-bad-chunks.any.js (L29)),
but that is only noticeable in https://github.com/servo/servo/pull/38466
Fixes: None, but noted in https://github.com/servo/servo/pull/38466

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-04 21:42:25 +00:00
TIN TUN AUNG
778dc70181 script: fix set muted on html video element creation (#38462)
Set muted on html video element creation. On `video` element creation,
the `set_mute` function will be called before the media player is
created, hence the player will still act as not being muted. This PR fix
this behaviour by passing `muted` info after player is created as part
of `setup_media_player` process.

Testing: Locally test on Windows11
Fixes: https://github.com/servo/servo/issues/38448

---------

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-08-04 18:57:20 +00:00
Oriol Brufau
391bf5d605 build(deps): bump Stylo to servo/stylo#221 (#38449)
Bumps Stylo to "Drop obsolete `layout.css.transition-behavior.enabled`
flag".

Testing: Not needed (no behavior change).

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-04 17:37:45 +00:00
Oriol Brufau
b01bb462b6 layout: Recreate lazy block size when re-doing layout to avoid floats (#38366)
Block-level boxes that establish an independent formatting context need
to avoid overlapping floats. If their inline size stretches, then we may
need to lay out multiple times.

The problem was that when trying with a different inline size, the
intrinsic block size can change, but we were using the cached final
block size from the previous attempt.

Testing: Adding new test
Fixes: #38365

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-04 17:07:10 +00:00
Taym Haddadi
04ec710e60 Add AsHandleValue trait to Heap<Value> and make Heap values rooted (#38024)
Encapsulates the unsafe conversion from Heap<Value> to HandleValue<'a>,
and reducing repetitive unsafe code at call.

fix #37258
2025-08-04 16:42:53 +00:00
Martin Robinson
9416251cab script: Unify script-based "update the rendering" and throttle it to 60 FPS (#38431)
Instead of running "update the rendering" at every IPC message, only run
it when a timeout has occured in script. In addition, avoid updating the
rendering if a rendering update isn't necessary. This should greatly
reduce the amount of processing that has to happen in script.

Because we are running many fewer calls to "update the rendering" it is
reasonable now to ensure that these always work the same way. In
particular, we always run rAF and update the animation timeline when
updating the ernder

In addition, pull the following things out of reflow:

 - Code dealing with informing the Constellation that a Pipeline has
   become Idle when waiting for a screenshot.
 - Detecting when it is time to fulfill the `document.fonts.ready`
   promise.

The latter means that reflow can never cause a garbage collection,
making timing of reflows more consistent and simplifying many callsites
that need to do script queries.

Followup changes will seek to simplify the way that ScriptThread-driven
animation timeouts happen even simpler.

Testing: In general, this should not change testable behavior so much,
though it
does seem to fix one test.  The main improvement here should be that
the ScriptThread does less work.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-08-04 16:27:00 +00:00
Leo Ring
bcc8314dd5 Servoshell: Update Window::inner_size on WindowEvent::Resized (fix resize bug) (#38461)
Just adds back a line that was omitted when a different commit was
reverted, see the issue for details, I've tested on Gnome Wayland with
Fedora 42 and the bug is fixed

Fixes: https://github.com/servo/servo/issues/38441
cc @yezhizhen

Signed-off-by: Leo Ring <leoring03@gmail.com>
2025-08-04 13:56:54 +00:00
Leo Ring
26d2d0f7d8 Add can_gc to HTMLDocument NamedGetter (#38455)
Just fixing something missed on my last PR
https://github.com/servo/servo/pull/38433#discussion_r2250744925

Signed-off-by: Leo Ring <leoring03@gmail.com>
2025-08-04 11:41:53 +00:00
Euclid Ye
c59ee57b5d webdriver: Improve "element click" by using container + Upgrade outdated test (#38436)
- According to
[spec](https://w3c.github.io/webdriver/#ref-for-dfn-in-view-3), we
should use container instead of element itself to determine "in-view".
- Updated `test_element_intercepted_no_pointer_events` in
`element_click/interactability.py` to expect "element not interactable".
This was outdated with spec as original test was written 7 years ago
https://github.com/web-platform-tests/wpt/pull/11453.


Testing: new passing cases for `<option>`, `<select>`.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-04 08:12:50 +00:00
Leo Ring
79a45c7da3 Implement HTMLDocument API (#38433)
This updates the pull request from here
https://github.com/servo/servo/pull/32553 that looks to be dormant. The
main change is that I've switched out `reflector` with `document` based
off this suggestion
https://github.com/servo/servo/pull/32553#issuecomment-2179568743, and
the `GetLocation` and `SupportedPropertyNames` methods pass through the
values from `Document`.

The implementation details are otherwise the same as the original PR

Testing: I don't see any WPT tests for this feature, I could make a
custom test if desired
Fixes: https://github.com/servo/servo/issues/32536

---------

Signed-off-by: Leo Ring <leoring03@gmail.com>
2025-08-04 03:42:54 +00:00
Euclid Ye
f0eb6c2b97 servoshell: Sync window toolbar height with minibrowser (#38328)
Toolbar size can be changed if resized, such as entering fullscreen.
Hit-test had wrong offsets after fullscreen/resize as
`WindowEvent::CursorMoved` set wrong coordinates for
`webview_relative_mouse_point` due to outdated toolbar height.

Testing: #38297 now works properly.
Fixes: #38297

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-03 19:16:15 +00:00
sagudev
874645ae86 canvas: Do not use vello layers for opacity or default composition (#38440)
In this PR we moved global alpha handling using temporary layers to
mutation of paint in vello_cpu (we were already doing this in vello
classic). This + not using temporary layer for SrcOver (default and most
common composition operation) allows us to remove most temporary layers
from `with_composition`.

This slightly improves performance of vello backend, but drastically
improves performance of vello_cpu. We are now able to render bunnymark
(100 bunnies) with 60 FPS.

In the future we could cache current layer and change it when
compositing operation changes, although that would complicate clips, so
improvement is questionable.

Testing: Existing WPT tests for functionality, but we do not have any
performance tests.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-03 16:00:46 +00:00
sagudev
fe9341dd46 canvas: Use OptimizeSpeed in vello_cpu (#38437)
According to my tests `OptimizeSpeed` slight improves performance and it
does NOT affect WPT results in negative way.

Testing: Tested by existing WPT tests.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-03 12:12:08 +00:00
Servo WPT Sync
fed1953198 Sync WPT with upstream (03-08-2025) (#38434)
Automated downstream sync of changes from upstream as of 03-08-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-08-03 01:48:15 +00:00
Oriol Brufau
76e5758ab9 Upgrade Stylo to 2025-08-01 (#38429)
This continues #37822

Changelog:
- Upstream:
fe9eadf47b...ec21cec41c
- Servo fixups:
29052e550f...7f8df16fdd

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

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-08-02 21:48:33 +00:00
Martin Robinson
a7b232ef4c layout: Limit visibility of some types and removed unused enum variants / data (#38428)
Testing: This change mainly removes dead code, so no tests necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-02 16:52:00 +00:00
Alex Touchet
e78d8818a0 deps: Update rand to 0.9.2 (#38430)
Update rand.

Testing: No tests for dependency update.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-08-02 16:25:50 +00:00
Tim van der Lippe
dbb886fad2 Implement initial version of navigator.sendBeacon (#38301)
Gated behind the feature flag `dom_navigator_sendbeacon_enabled` as the
`keep-alive` fetch parameter is crucial for real-life use cases such as
analytics requests.

Part of #4577
Part of #38302

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-02 15:14:07 +00:00
Martin Robinson
181f97879d wpt: Ensure that faulty JSON testharness output does not crash the Python test harness (#38420)
When a testharness test also prints debugging output, sometimes the
output can be mixed with the JSON output printed via an alert. This
causes a JSON decoding error in the output. Instead of crashing the
harness and printing many lines of Python stack trace output, print a
nice error. This makes the test output easier to read.

Testing: This is a change to the test harness itself, so no tests
necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-02 13:04:17 +00:00
Euclid Ye
58425f6ae2 Replace all sort with unstable sort (#38427)
["When applicable, unstable sorting is preferred because it is generally
faster than stable sorting and it doesn’t allocate auxiliary
memory."](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.sort)

Binary also reduced by 1KB in Release.

Testing: No behaviour change as semantically all current usage does not
have any pair with `std::cmp::Ordering::Equal`.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-02 12:41:03 +00:00
Alex Touchet
7c70d811a6 Cargo.toml cleanup (#38426)
Cargo.toml cleanup.

Testing: No tests for Cargo.toml edit.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-08-02 10:16:09 +00:00
Euclid Ye
ee1bfa61ce script: Lazy init and reuse const BOOLEAN_ATTRIBUTES (#38423)
Follow up of  #38401.
- The constant String array was recreated for every invocation. Chromium
store this as a global const.
https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/element_commands.cc;l=48-94?q=chrome%2Ftest%2Fchromedriver%2Felement_commands.cc
We now use static `LazyLock` to lazy init and avoid recreation.
- Clean up some comments

Testing: Just refactor.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-02 02:45:52 +00:00
Usman Yahaya Baba
a27715a5a8 Calculate and send the missing transferred_size and content_size to dev tools (#38216)
The current behaviour in dev tools network monitor is missing data for
the `Transferred` size and `Content` size.
We currently have a fn `response_content` that constructs the
`ResponseContentMsg` struct where the two missing data fields are
defined and set to zero values.
These current changes calculates the data in the `response_content` fn
and sends a `NetworkEvent::HttpResponse` to the client when the final
body is done.
Currently, we have data appearing in the `Transferred` column of the
network panel
fixes: https://github.com/servo/servo/issues/38126

---------

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
2025-08-02 02:41:53 +00:00
Usman Yahaya Baba
52b04c9fd3 net: Make devtools test resistant to event reordering (#38412)
This PR makes the `test_redirected_request_to_devtools` collect all the
network events from the channel into a vector, and then asserting that
the expected requests/responses are present in the vector, this aims to
remove the ordering issues that cause intermittent failures.

Testing: ran `./mach test-unit -p net` with the changes in this PR
applied to
https://github.com/servo/servo/actions/runs/16644510716/job/47101866693?pr=38216
getting all tests passing
Fixes: (https://github.com/servo/servo/issues/38411)

---------

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
2025-08-01 22:58:01 +00:00
lumiscosity
5e89f79abe layout: Fix negative outline offset (#38418)
Properly caps the minimum offset on each side as recommended by the
standards: https://drafts.csswg.org/css-ui-3/#outline-offset

Testing: Covered by WPT tests. (3 new passing!)
Fixes: #19508

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-01 20:43:04 +00:00
dependabot[bot]
f70d30cf1c build(deps): bump serde_json from 1.0.141 to 1.0.142 (#38417)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.141 to
1.0.142.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.142</h2>
<ul>
<li>impl Default for &amp;Value (<a
href="https://redirect.github.com/serde-rs/json/issues/1265">#1265</a>,
thanks <a
href="https://github.com/aatifsyed"><code>@​aatifsyed</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1731167cd5"><code>1731167</code></a>
Release 1.0.142</li>
<li><a
href="e51c81450a"><code>e51c814</code></a>
Touch up PR 1265</li>
<li><a
href="84abbdb613"><code>84abbdb</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1265">#1265</a>
from aatifsyed/master</li>
<li><a
href="9206cc0150"><code>9206cc0</code></a>
feat: impl Default for &amp;Value</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.141...v1.0.142">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.141&new-version=1.0.142)](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-08-01 17:50:05 +00:00
dependabot[bot]
fdf180d814 build(deps): bump wayland-protocols-wlr from 0.3.8 to 0.3.9 (#38416)
Bumps [wayland-protocols-wlr](https://github.com/smithay/wayland-rs)
from 0.3.8 to 0.3.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-protocols-wlr&package-manager=cargo&previous-version=0.3.8&new-version=0.3.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-01 17:43:52 +00:00
dependabot[bot]
1e01acd4d5 build(deps): bump wayland-protocols-plasma from 0.3.8 to 0.3.9 (#38415)
Bumps [wayland-protocols-plasma](https://github.com/smithay/wayland-rs)
from 0.3.8 to 0.3.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-protocols-plasma&package-manager=cargo&previous-version=0.3.8&new-version=0.3.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-01 17:35:18 +00:00
dependabot[bot]
4e682cff90 build(deps): bump cc from 1.2.30 to 1.2.31 (#38414)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.30 to 1.2.31.
<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.30...cc-v1.2.31">1.2.31</a>
- 2025-08-01</h2>
<h3>Other</h3>
<ul>
<li>Add doc for using sccache/ccache etc (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1502">#1502</a>)</li>
<li>ability to statically link against C++ stdlib (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1497">#1497</a>)</li>
<li>Add instructions on using sccache (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1503">#1503</a>)</li>
<li>Add support for recognizing some architectures supported by GCC, but
not LLVM. (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1500">#1500</a>)</li>
</ul>
<h1>Changelog</h1>
<p>All notable changes to this project will be documented in this
file.</p>
<p>The format is based on <a
href="https://keepachangelog.com/en/1.0.0/">Keep a Changelog</a>,
and this project adheres to <a
href="https://semver.org/spec/v2.0.0.html">Semantic Versioning</a>.</p>
<h2>[Unreleased]</h2>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bb6cd84d14"><code>bb6cd84</code></a>
chore: release v1.2.31 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1504">#1504</a>)</li>
<li><a
href="02c0952d06"><code>02c0952</code></a>
Add doc for using sccache/ccache etc (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1502">#1502</a>)</li>
<li><a
href="20c06cfd75"><code>20c06cf</code></a>
Proposal: ability to statically link against C++ stdlib (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1497">#1497</a>)</li>
<li><a
href="e435ac9640"><code>e435ac9</code></a>
doc: Add instructions on using sccache (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1503">#1503</a>)</li>
<li><a
href="fcc7fc47d5"><code>fcc7fc4</code></a>
Add support for recognizing some architectures supported by GCC, but not
LLVM...</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.30...cc-v1.2.31">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.30&new-version=1.2.31)](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-08-01 17:26:42 +00:00
sagudev
413fd15264 canvas: prune vello scene on each render and make rendering cacheable (#38406)
As noted in #38345, vello scenes only grow. While we can reset them when
clearing viewport (#38356) that is not enough. We need to reset scene on
each render (~each frame) and providing old frame as backdrop to new
scene. Be do this lazily so multiple rendering without any changes
should be cheaper, we still do GPUBuffer mapping, because that would
require more complex work.

Testing: Code functionality is covered by existing WPT tests, but we do
not have any performance test.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-01 13:48:44 +00:00
Gregory Terzian
5ac9f40625 script: in stream piping, ensure the heap is set only after it has been moved (#38385)
Setting a value on a `Heap` requires the heap to not be moved after the
call to `set`, the current code sets the value first, then moves it into
the `shutdown_error` refcell. It should be the other way around.

Testing: the core logic is covered by WPT tests, which should remain
unchanged.
 
Fixes: [38299](https://github.com/servo/servo/issues/38299)

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-01 10:55:17 +00:00
Euclid Ye
625d636b04 compositor: Add more doc for size of different RenderingContext implementation (#38399)
For more details, see
https://github.com/servo/servo/issues/38369#issuecomment-3138378527.

Fixes:
https://github.com/servo/servo/issues/38369#issuecomment-3138458772
Testing: Just adding docs.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-01 09:07:32 +00:00
Kingsley Yung
5e8754bb1d webdriver: consider boolean attribute when get element attribute (#38401)
The function handle_get_attribute should act differently when the
attribute is a boolean attribute.

The full list of attributes can be found in [1]. All attributes marked
as "Boolean attribute" in the "Value" column are boolean attributes.
Note that "hidden" is effectively treated as a boolean attribute,
according to WPT test "test_global_boolean_attributes" in
webdriver/tests/classic/get_element_attribute/get.py

[1] https://html.spec.whatwg.org/multipage/#attributes-3

Testing: Updated WPT test expectation
Fixes: #38353

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-08-01 08:44:26 +00:00
Kenzie Raditya Tirtarahardja
05ad9026f5 cargo: Upgrade keyboard-types to 0.8.0 and xcomponent-sys to 0.3.4 (#38375)
With some adjustment for `NamedKey`. The two crates need to be bumped
together to avoid duplicate of `keyboard-types` action.

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-01 08:14:38 +00:00
Jo Steven Novaryo
a063b5e78a script: Fire scroll event whenever JS scrolled (#38321)
Implement JS scroll event firing compliant to
https://drafts.csswg.org/cssom-view/#scrolling-events. Basically
whenever, the an element or the viewport is scrolled, we will fire a
scroll event. The changes push a scroll event whenever an API causes a
scroll position to change.

Testing: New WPT tests for basic APIs.
Part of: https://github.com/servo/servo/issues/31665

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-08-01 07:30:22 +00:00
Euclid Ye
372e5eae59 webdriver: Fix "element in view" by correctly computing resolved PointerEvents style (#38383)
Testing: `element_click/interactability.py`. For some other tests in
headed window, even tho the target is in view it falsely claim not in
view previously.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-01 07:08:28 +00:00
batu_hoang
929fd0aa3c webdriver: improve session commands (#38397)
Add timeout and strictFileInteractability capabilities to response of
new session command.
Allow delete session command to run without a session.

Testing: Clear some unexpected results of session tests in webdriver CI
and
`tests/wpt/meta/webdriver/tests/classic/delete_session/delete.py.ini`

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-08-01 06:39:03 +00:00
Kenzie Raditya Tirtarahardja
c836ed374c Suppress warning in webview unit test (#38398)
`webview.focus` return `Result<(),()>`, hence it gives warning if the
result is not handled.

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-08-01 05:42:16 +00:00
Jo Steven Novaryo
a8886c1222 layout: Add BoxFragment rare data (#38325)
Introduce `BoxFragmentRareData`, rare data for `BoxFragment`, which
would store the specific data that is relevant to several fragments.
This would reduce the `BoxFragment` size to 256 from 264 and add 8 bytes
for fragment that have rare data (due to the additional pointer to the
rare data).

Testing: Existing WPT coverage

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-08-01 05:17:39 +00:00
sagudev
09f0e20e29 canvas: Clear vello scene if possible (#38356)
Vello scene only ever grows, so we need to clear it as soon as it's
possible (in clear rect). This PR also adds ignore_clips to
vello_backend (already exists in vello_cpu_backend).

Testing: Behavior is verified by existing tests, as this is mainly a
change for performance. There are currently no performance tests. This
makes bunnymark actually playable (from 3 FPS to 20 FPS on vello_cpu).

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-08-01 05:05:15 +00:00
Jerens Lensun
b05d265de5 script_binding: Add type check on servo script bindings (#38161)
Introduce type checking with Pyrefly in `components/script_bindings`

This commit adds Pyrefly-based type checking to the
`components/script_bindings` directory. The primary goal is to catch
type inconsistencies early and reduce the likelihood of unexpected
runtime errors.

This change affects the `webidl` component, as these script bindings are
responsible for connecting WebIDL specifications to the Rust codebase.

Testing: `./mach test-wpt webidl`
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-08-01 04:34:24 +00:00
dependabot[bot]
4ce5b17605 build(deps): bump libredox from 0.1.8 to 0.1.9 (#38396)
Bumps libredox from 0.1.8 to 0.1.9.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libredox&package-manager=cargo&previous-version=0.1.8&new-version=0.1.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 18:04:06 +00:00
dependabot[bot]
b5aaf49d66 build(deps): bump wayland-protocols from 0.32.8 to 0.32.9 (#38394)
Bumps [wayland-protocols](https://github.com/smithay/wayland-rs) from
0.32.8 to 0.32.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-protocols&package-manager=cargo&previous-version=0.32.8&new-version=0.32.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 17:49:56 +00:00
dependabot[bot]
ea9d56b92d build(deps): bump wayland-cursor from 0.31.10 to 0.31.11 (#38392)
Bumps [wayland-cursor](https://github.com/smithay/wayland-rs) from
0.31.10 to 0.31.11.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-cursor&package-manager=cargo&previous-version=0.31.10&new-version=0.31.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 17:41:15 +00:00
dependabot[bot]
fd3fc30609 build(deps): bump redox_users from 0.5.0 to 0.5.2 (#38393)
Bumps redox_users from 0.5.0 to 0.5.2.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=redox_users&package-manager=cargo&previous-version=0.5.0&new-version=0.5.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 17:40:31 +00:00
Martin Robinson
5da55adfd3 layout: Account for sticky nodes in ScrollTree transforms and cache transforms (#38391)
When calculating the node to world transform for use in bounding box
queries, cache the values of the transform. In addition, when scroll
offsets change, ensure that the cached values are invalided properly.
This change necessitated the storage of children for each node in the
tree, so that we can walk both up and down the tree. The purpose of this
part of the change is to increase performance when doing multiple
queries and prepare the tree for hit testing.

In addition, this change also tries to take into account sticky offsets,
using the algorithm from WebRender to calculate sticky offsets. This is
also going to be important for hit testing.

Testing: Newly passing tests:
 - /css/css-position/position-sticky-dynamic-ancestor-001.html
 - /css/css-tables/tentative/position-sticky-container.html

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-31 13:36:32 +00:00
Jerens Lensun
fca94336d3 mach: Add comment to ignore type on geteuid as it only available on unix (#38388)
Currently pyrefly have an issues with top level assertion on platform
gating, so we decide to ignore it for now.

https://github.com/facebook/pyrefly/issues/795

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-31 10:25:02 +00:00
Euclid Ye
d38781d71d servoshell: Revert #38307 to fix resize bug (#38381)
Also added some comments to make things clear.
For details, see
https://github.com/servo/servo/issues/38369#issuecomment-3138378527

Testing: Tested on X11 Ubuntu, Wayland Ubuntu, macOS, Windows.
Fixes: #38369

Co-authored-by: minghuaw <michael.wu1107@gmail.com>

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: minghuaw <michael.wu1107@gmail.com>
2025-07-31 08:55:00 +00:00
Jerens Lensun
36f1a373e3 ci: Automatically cancel bootstrap step after 1 hour in wpt linux/mach (#38358)
Introduces a timeout for each WPT run chunk job, set to 1 hour, after
which it will be automatically canceled.

Testing: 
Fixes: #38348

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-31 07:24:23 +00:00
shuppy
c09e117bfe script: Create a debugger script for the SpiderMonkey Debugger API (#38331)
to use the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to
call it from an internal debugger script that we will supply. this
script must run in the same runtime as the debuggee(s), but in a
separate
[compartment](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Compartments)
([more
details](https://hacks.mozilla.org/2020/03/future-proofing-firefoxs-javascript-debugger-implementation/)).

this patch defines a new DebuggerGlobalScope type and a new debugger
script resource. when creating each script thread, we create a debugger
global, load the debugger script from resources/debugger.js, and run
that script in the global to initialise the Debugger API.

subsequent patches will use the debugger script as an RPC mechanism for
the Debugger API.

Testing: no testable effects yet, but will be used in #37667
Fixes: part of #36027

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-31 06:17:23 +00:00
batu_hoang
8e27fd48cc Implement webdriver element in view (#38329)
Implement step 6 of `ElementClick`:
https://w3c.github.io/webdriver/#dfn-element-click

Tests:
`tests/wpt/tests/webdriver/tests/classic/element_click/interactability.py`

cc: @xiaochengh

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-07-31 04:27:02 +00:00
Sebastian C
8008d5aa85 net: Add expiry limit to cookies and prevent panics from max-age (#38376)
Based on RFC6256 expiration must be limited to 400 days. This also
solves a bug I found where large max-age values could cause an overflow
panic when adding.

Testing: New unit test added. There doesn't appear to be a WPT test that
relies on this under cookies/ but cookiestore/ does.

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-07-31 02:52:50 +00:00
shuppy
8194aa7c1e script: Implement jsglue trap for runJobs() (#38265)
in the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), hooks like
[onNewGlobalObject()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewglobalobject-global)
use an AutoDebuggerJobQueueInterruption to [switch to a new microtask
queue](b14aebff23/mozjs-sys/mozjs/js/src/debugger/Debugger.cpp (L2834-L2841))
and avoid clobbering the debuggee’s microtask queue. this in turn relies
on JobQueue::runJobs(), which is [not yet implemented in
RustJobQueue](b14aebff23/mozjs-sys/src/jsglue.cpp (L76-L78)).

this patch bumps mozjs to servo/mozjs#597, which implements
[runJobs()](b14aebff23/mozjs-sys/mozjs/js/public/Promise.h (L61-L76))
for RustJobQueue by calling into Servo’s MicrotaskQueue::checkpoint()
via a new function in JobQueueTraps.

SpiderMonkey [does not own external job
queues](b14aebff23/mozjs-sys/mozjs/js/public/Promise.h (L117-L123)),
so the lifetime of these queues is managed in Servo, where they are
stored in a Vec-based stack. stack-like behaviour is adequate for
SpiderMonkey’s save and restore patterns, as far as we can tell, but
we’ve added an assertion just in case.

Testing: manually tested working in devtools debugger patch (#37667),
where it will undergo automated tests

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-31 02:46:37 +00:00
dependabot[bot]
b40d73de38 build(deps): bump rustls from 0.23.29 to 0.23.31 (#38372)
Bumps [rustls](https://github.com/rustls/rustls) from 0.23.29 to
0.23.31.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="647ece1346"><code>647ece1</code></a>
Prepare 0.23.31</li>
<li><a
href="b2831e7490"><code>b2831e7</code></a>
rustls-bench: short circuit single threaded tests</li>
<li><a
href="668231f573"><code>668231f</code></a>
Improve testing of non-blocking <code>complete_io()</code></li>
<li><a
href="5e5d629611"><code>5e5d629</code></a>
<code>complete_io</code>: make non-blocking error return reachable</li>
<li><a
href="2a852c0244"><code>2a852c0</code></a>
Exit <code>complete_io</code> loop as soon as no progress is made</li>
<li><a
href="2f487cfc5a"><code>2f487cf</code></a>
rustls-test: withdraw <code>FailsReads</code> helper</li>
<li><a
href="41bfb22d5b"><code>41bfb22</code></a>
rustls-test: add helper for non-blocking IO tests</li>
<li><a
href="0ccbc63df3"><code>0ccbc63</code></a>
Cargo: rustls version 0.23.29 -&gt; 0.23.30</li>
<li><a
href="4c16f03443"><code>4c16f03</code></a>
Fix: Do not try to call deframer on junk data</li>
<li><a
href="6b9df65bb9"><code>6b9df65</code></a>
sign: make public_key_to_spki() public</li>
<li>Additional commits viewable in <a
href="https://github.com/rustls/rustls/compare/v/0.23.29...v/0.23.31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls&package-manager=cargo&previous-version=0.23.29&new-version=0.23.31)](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-30 18:13:29 +00:00
dependabot[bot]
c6eb18d02e build(deps): bump zune-jpeg from 0.4.19 to 0.4.20 (#38371)
Bumps [zune-jpeg](https://github.com/etemesi254/zune-image) from 0.4.19
to 0.4.20.
<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.19&new-version=0.4.20)](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-30 18:12:16 +00:00
dependabot[bot]
32f1497095 build(deps): bump clap from 4.5.41 to 4.5.42 (#38370)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.41 to 4.5.42.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.42</h2>
<h2>[4.5.42] - 2025-07-30</h2>
<h3>Fixes</h3>
<ul>
<li>Include subcommand visible long aliases in <code>--help</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.5.42] - 2025-07-30</h2>
<h3>Fixes</h3>
<ul>
<li>Include subcommand visible long aliases in <code>--help</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="27cc4b7f59"><code>27cc4b7</code></a>
chore: Release</li>
<li><a
href="16a4fc7190"><code>16a4fc7</code></a>
docs: Update changelog</li>
<li><a
href="07f9f15eda"><code>07f9f15</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5874">#5874</a>
from tetzng/fix-fish-completions</li>
<li><a
href="721deab943"><code>721deab</code></a>
chore: Release</li>
<li><a
href="a4be55bf64"><code>a4be55b</code></a>
docs: Update changelog</li>
<li><a
href="fd5e6915f0"><code>fd5e691</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/5877">#5877</a>
from therealprof/features/use-btreemap-instead-of-so...</li>
<li><a
href="6604e79ee7"><code>6604e79</code></a>
Use BTreeMap instead of a sorted Vec</li>
<li><a
href="28e163a8e7"><code>28e163a</code></a>
fix(complete): Remove {} and replace commas with newlines</li>
<li><a
href="b5a47c46ac"><code>b5a47c4</code></a>
chore: Release</li>
<li><a
href="b154a7a114"><code>b154a7a</code></a>
docs: Update changelog</li>
<li>Additional commits viewable in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.5.41...clap_complete-v4.5.42">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.41&new-version=4.5.42)](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-30 18:11:24 +00:00
dependabot[bot]
e3268dc742 build(deps): bump wayland-client from 0.31.10 to 0.31.11 (#38368)
Bumps [wayland-client](https://github.com/smithay/wayland-rs) from
0.31.10 to 0.31.11.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-client&package-manager=cargo&previous-version=0.31.10&new-version=0.31.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-30 18:08:16 +00:00
sagudev
5c42a113bd chore: Update vello to fix radials in vello_cpu (#38338)
This update includes a fix for
https://github.com/linebender/vello/issues/1124.

Testing: Existing WPT tests
try run: https://github.com/sagudev/servo/actions/runs/16599834725

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-30 17:49:41 +00:00
Gregory Terzian
815ed10b5f background_hang_monitor: ensure workers run until monitored components do (#38322)
Shut-down of the background hang monitor(bhm) is currently  problematic:

- it does not always run until the monitored script-thread does(see
"BackgroundHangMonitor has gone away" mentioned in
https://github.com/servo/servo/issues/34158).
- it shuts-down before the constellation(good, so actually
https://github.com/servo/servo/issues/24850 was "fixed" but in a way
that introduced a new problem), but using a mechanism that allows it to
shutdown before script(the problem above).
- there are various mechanism(see the doc comments removed by this PR)
in place which are meant to ensure a clean shutdown despite the above
problems; those are complicated, and become unnecessary once those
problems are fixed.

All of the above is fixed by the changes in this PR, which ensure the
bhm does not shut-down before script, and also maintains the invariant
that it must shut-down before the constellation(in single-process mode)
or before the main thread(in multi-process mode), but using a mechanism
which allows it to keep running until script shuts-down.

An unnecessary option around the exit signal is also removed.

As a positive side-effect, it also ensures that any script-thread is
shut-down before the constellation(because for the bhm worker to exit,
the monitored script must have exited first), so this should also fix a
host of other problems noted in
https://github.com/servo/servo/issues/30849, but each should be
confirmed independently(and various other improvements seem possible in
their specific contexts, such as joining on script threads, and removing
the `ScriptThreadMessage::ExitScriptThread`).

Fixes: https://github.com/servo/servo/issues/24850 and part of
https://github.com/servo/servo/issues/34158

Testing: Unit tests in `component/background_hang_monitor/tests`. Also
manually tested loading "about-blank" in single- and multi-process mode.

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-07-30 13:03:28 +00:00
lumiscosity
e5334a64c4 layout: respect image-rendering on border images (#38346)
Properly passes `image-rendering` down to border images.

Testing: Covered by WPT tests.

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-30 12:57:10 +00:00
Oriol Brufau
c7c33f5f47 layout: Make IndependentFormattingContext::contents private (again) (#38350)
This was done in #24871, but after some refactorings it became public.
This makes it private again. As said in
b2b3ea992c:

> Privacy forces the rest of the code to go through methods
> rather than matching on the enum,
> reducing accidental layout-mode-specific behavior.

It also avoids the risk of accidentally calling `layout()` on the inner
layout-mode-specific struct, bypassing caching.

Testing: Not needed (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-30 12:55:32 +00:00
Oriol Brufau
8c737a6a79 layout: Make a couple tracing reflect what they actually trace (#38349)
`IndependentFormattingContext::layout` was being traced with name
`IndependentFormattingContext::layout_with_caching`. Better use
`IndependentFormattingContext::layout` instead.

There was also a debug trace with name `NonReplaced cache miss`, but now
this code also applies to replaced boxes, so I'm renaming it to
`IndependentFormattingContext::layout cache miss`.

Testing: Not needed (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-30 12:55:25 +00:00
shuppy
a671c50bc9 devtools: Fix source contents tests and fix a race (#38359)
test_sources_list() relied on <https://servo.org/js/load-table.js> to
test scripts loaded from multiple origins, but that file was deleted a
couple of weeks ago. this patch adds a second internal web server, then
replaces that load with scripts loaded from two distinct origins:
<http://127.0.0.1:10000> and <http://127.0.0.1:10001>.

fixing that test revealed an impl bug where inline module scripts
containing `import` statements may never get their source contents
populated. this is because the logic for populating source contents for
inline scripts only applied to source actors created *before* we
finished parsing the page. we assumed that inline scripts always block
the parser, but this is not the case. this patch ensures that inline
source contents can be populated for source actors created after parse.

Testing: adds a new test,
test_source_content_with_inline_module_import_external()
Fixes: part of #36325

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-30 11:29:24 +00:00
Jo Steven Novaryo
900dd8d191 layout: Consider transform for bounding box queries (#37871)
The recent changes that cached the Scroll Tree present an opportunity to
calculate the queries that consider transform and scroll (dubbed as post
composite queries) accurately.

This PR propose a solution for this calculation by noting the lowest
scroll tree nodes that would affect a fragment. To do this, each
fragment would store a new attribute `spatial_tree_node` -- scroll tree
node id that we could use for the query. This referencing is considered
because the scroll tree node construction is managed by the fragment
itself. Therefore it would ease the managing the possibly stale
reference and future query cache invalidation considering the
development of incremental layout.

The bounding box query then could transform the bounding content rect of
a fragment using the computed current transformation matrix.

Fixes: https://github.com/servo/servo/issues/35768
Testing: Existing and new WPT

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-30 08:13:54 +00:00
batu_hoang
37ac4ffeb4 Rework on webdriver wait for navigation complete (#38234)
For current implementation, when a command may trigger a navigation,
webdriver only waits for document readiness state.
However, not all navigations make change in document.
This PR handles more cases for waiting for a navigation, and apply to
`element_click`.

- Before sending a command which may trigger a navigation, `webdriver`
sets `load status send` to `embedder`, `constelltation` and `script
thread` to listen to `navigation events`.
- Webdriver check if there is a navigation with `script thread`.
- If the navigation is loading a new url, webdriver checks if the
request is approved with `constellation`, then waits for document
readiness state.
- If the navigation is a hashchange, webdriver waits untill all new
generated dom events have been processed.

Testing: 
`tests/wpt/tests/webdriver/tests/classic/element_click/navigate.py`
`tests/wpt/tests/webdriver/tests/classic/element_click/user_prompts.py`
https://github.com/longvatrong111/servo/actions/runs/16488690749

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-07-30 07:24:07 +00:00
Euclid Ye
8b3e7b1c6a webdriver: Keep constellation alive and Open new top-level browsing context with new session request when none is open (#37410)
Keep Constellation alive even when all browsing context closed in
WebDriver mode. In this case, when creating a new session, we would open
a new top-level browsing context.

Fixes: #37408
Testing: `./mach test-wpt -r
.\tests\wpt\tests\webdriver\tests\classic\close_window\close.py
--product servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-30 06:41:58 +00:00
Oriol Brufau
0e18057863 build(deps): bump Stylo to servo/stylo#215 (#38351)
Bumps Stylo to "Vendor markupsafe; Add macOS and Windows CI jobs".

Testing: Not needed (no behavior change).

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-30 03:23:03 +00:00
dependabot[bot]
b0f57bffdc build(deps): bump wayland-backend from 0.3.10 to 0.3.11 (#38340)
Bumps [wayland-backend](https://github.com/smithay/wayland-rs) from
0.3.10 to 0.3.11.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-backend&package-manager=cargo&previous-version=0.3.10&new-version=0.3.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-29 22:32:40 +00:00
sagudev
82f5524901 canvas: Use create_similar_draw_target for recreate (#38336)
`create_similar_draw_target` is more performant then creating completely
new target (this creates new wgpu device in vello backend).

Testing: This change does not modify test results, but should increase
performance.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-29 19:45:49 +00:00
dependabot[bot]
f16e7d6daa build(deps): bump libredox from 0.1.6 to 0.1.8 (#38344)
Bumps libredox from 0.1.6 to 0.1.8.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libredox&package-manager=cargo&previous-version=0.1.6&new-version=0.1.8)](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-29 17:32:13 +00:00
dependabot[bot]
cafbb7a4bb build(deps): bump wayland-scanner from 0.31.6 to 0.31.7 (#38341)
Bumps [wayland-scanner](https://github.com/smithay/wayland-rs) from
0.31.6 to 0.31.7.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/smithay/wayland-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wayland-scanner&package-manager=cargo&previous-version=0.31.6&new-version=0.31.7)](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-29 17:29:22 +00:00
dependabot[bot]
899ce08eab build(deps): bump rustc-demangle from 0.1.25 to 0.1.26 (#38343)
Bumps [rustc-demangle](https://github.com/rust-lang/rustc-demangle) from
0.1.25 to 0.1.26.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/rustc-demangle/releases">rustc-demangle's
releases</a>.</em></p>
<blockquote>
<h2>rustc-demangle-v0.1.26</h2>
<h3>Other</h3>
<ul>
<li>Add new v0 demangling tags for pattern types</li>
<li>Do not publish the <code>native-c</code> crate</li>
<li>Use release-plz for releases</li>
<li>Add a CI workflow to publish new releases after a tag is pushed</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/rustc-demangle/blob/main/CHANGELOG.md">rustc-demangle's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/rustc-demangle/compare/rustc-demangle-v0.1.25...rustc-demangle-v0.1.26">0.1.26</a>
- 2025-07-16</h2>
<h3>Other</h3>
<ul>
<li>Add new v0 demangling tags for pattern types</li>
<li>Do not publish the <code>native-c</code> crate</li>
<li>Use release-plz for releases</li>
<li>Add a CI workflow to publish new releases after a tag is pushed</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/rust-lang/rustc-demangle/commits/rustc-demangle-v0.1.26">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustc-demangle&package-manager=cargo&previous-version=0.1.25&new-version=0.1.26)](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-29 17:23:51 +00:00
Jerens Lensun
c738bbc41c mach: Make test-tidy line length check Unicode-aware (#38335)
Currently, our implementation for each line-checking function reads the
file as bytes, so we need to properly decode each line to UTF-8 before
evaluating it. This ensures it is counted as a string and not as bytes

Testing: I tested by changing the comment like the issue above and it
not give an error
Fixes: #38237

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-29 14:46:32 +00:00
lumiscosity
eda83564f3 Losslessly optimize Android resources (#38332)
Losslessly optimizes the Android resources. These are the only non-test
PNGs remaining in the project, to my knowledge.

Testing: Unnecessary, since this only optimizes assets.

Signed-off-by: maple! <averyrudelphe@gmail.com>
2025-07-29 12:15:50 +00:00
atbrakhi
4ef15ec42f devtools: Make contentType optional in source actor source responses (#38330)
This is allowed by the [protocol
docs](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#loading-script-sources),
and eliminates an unwrap().

Testing: does not get exercised yet, but will be used in #37667 
Fixes: part of #36027

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2025-07-29 11:16:59 +00:00
sagudev
7761030250 canvas: Fix the build of the vello backend (#38326)
Multiple Into hoops cannot be resolved by compiler

Testing: Just refactor.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-29 10:14:56 +00:00
Martin Robinson
8d5faa9bf9 compositor: Request reflow when doing a page zooming (#38166)
Request a reflow when doing page zoom and only modify the scaling of the
WebView scene after the first root pipeline display list with the new
zoom is ready. In addition:

  - store zoom limits in `Scale` types
  - send `ViewportDetails` along with the display list so that we can
    detect when the root pipeline scale is ready.

Testing: This is quite hard to test as it requires verification that
contents are zoomed appropriately at the right time.
Fixes: #38091.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-29 10:04:37 +00:00
Oriol Brufau
3d2f0d1be5 layout: Fix depends_on_block_constraints logic (#38318)
The logic was wrong, sometimes we weren't setting it to true on flex
containers that needed it, and then as a workaround we were setting it
to to true on flex items that didn't need it.

For example, this testcase had 5 cache misses when stretching the items,
now we will avoid laying them out again:
```html
<div style="display: flex">
  <div></div>  <div></div>  <div></div>  <div></div>  <div></div>
</div>
```

Also, the workaround wasn't always working, e.g. it failed to stretch
the green element here:
```html
<div style="display: flex; min-height: 200px">
  <div>
    <div style="display: flex; height: 100%; background-color: red">
      <div style="width: 200px; background-color: green;"></div>
    </div>
  </div>
</div>
```

Testing: Adding new test
Fixes: #38023

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-29 09:59:54 +00:00
Euclid Ye
a5d4c49ec6 cargo: Use workspace dependency for winit and upgrade to 0.30.12 (#38261)
Use workspace dependency to sync the `winit` version between examples &
libservo.
Upgrade winit to 0.30.12.

Fixes: The hope is lost as it doesn't fix anything..

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-29 09:45:22 +00:00
Oriol Brufau
7ce5de4e2d layout: Include spanned gutters when laying out contents of table cell (#38290)
If a cell would e.g. span 2 columns, each 50px wide, separated by a 10px
gutter, then we used to lay out the contents of the cell with a 100px
wide containing block. Now we will include the size of the gutter.

Testing: Adding new test
Fixes: #38277

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-29 08:57:22 +00:00
Euclid Ye
61273a4321 servoshell: Remove redundant WindowEvent::Resized handler (#38307)
They are redundant as marked in #38174 as rendering related rect already
updated in `minibrowser::update`. As a result, we are able to remove
`window_rendering_context` and `inner_size` fields from `struct Window`.

Testing: No regression/behaviour change in all tests running with headed
window.
Fixes:
https://github.com/servo/servo/issues/38255#issuecomment-3117642340

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-29 08:44:42 +00:00
Jerens Lensun
239bdd7c1a mach: Fail on invalid argument in try_parser (#38324)
This will block the command, print an error message about an invalid
argument being passed to the ./mach try command, and return the exit
code.

Testing: `./mach try test-wpt`
Fixes: #38193

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-29 07:00:07 +00:00
minghuaw
554b2da1ad Script: Implement TextDecoderStream (#38112)
This PR implements the `TextDecoderStream`. Other than introducing the
necessary mod and webidl files corresponding to `TextDecoderStream`,
this PR also involves some changes in `TextDecoder` and
`TrasnformStream`:

- The common part that can be shared between `TextDecoder` and
`TextDecoderStream` are extracted into a separate type
`script::dom::textdecodercommon::TextDecoderCommon`. This type could
probably use a different name because there is an interface called
`TextDecoderCommon` in the spec
(https://encoding.spec.whatwg.org/#textdecodercommon) which just gets
included in `TextDecoder` and `TextDecoderStream`.
- The three algorithms in `TransformStream` (`cancel`, `flush`, and
`transform`) all have become `enum` that has a `Js` variant for a JS
function object and a `Native` variant for a rust trait object. Whether
the cancel algorithm needs this enum type is debatable as I did not find
any interface in the spec that explicitly sets the cancel algorithm.

Testing: Existing WPT tests `tests/wpt/tests/encoding/stream` should be
sufficient
Fixes: #37723

---------

Signed-off-by: minghuaw <michael.wu1107@gmail.com>
Signed-off-by: minghuaw <wuminghua7@huawei.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
2025-07-29 04:18:15 +00:00
Usman Yahaya Baba
25822920cf Make request parameter immutable in send_response_to_devtools and send_early_httprequest_to_devtools (#38319)
- Changes request parameters to immutable borrow
Testing: 
Fixes: https://github.com/servo/servo/issues/38300

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
2025-07-29 00:42:20 +00:00
sagudev
d410236c87 canvas: Send CanvasClose to canvas thread from canvas state (#38315)
Currently we only closed `CanvasRenderingContext2D` (and
`OffscreenCanvasRenderingContext2D` because it wraps
`CanvasRenderingContext2D`), but we didn't close last consumer of
`CanvasState` which is `PaintRenderingContext`. To prevent any future
leaks, let's just send `CanvasClose` in `CanvasState` drop.

Testing: Existing WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-28 20:09:47 +00:00
Euclid Ye
213b532712 cargo: Remove last traces of webdriver from libservo (#38314)
The feature which enables optional dependency & function is never used
and can be safely removed.

Testing: It can still builds.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-28 14:47:56 +00:00
Josh Matthews
02297791c8 chore: Add test for synthesized image documents with CSP headers. (#38191)
Adds a regression test for https://github.com/servo/servo/pull/38186,
verifying that the CSP header on the image is ignored when it's loaded
as a document.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-28 13:45:54 +00:00
sagudev
a67998b520 canvas: Gate raqote backend behind feature (enabled for now) (#38312)
We want to eventually remove raqote backend, but for now we can gate it
behind a feature (still enabled by default in servoshell) like the rest
of backends. `dom_canvas_backend=auto` will select first available
backend. Builds on top of https://github.com/servo/servo/pull/38310 to
support cases where no backend is available.

Testing: It compiles with or without feature

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-28 11:54:40 +00:00
shuppy
9da4c74a60 script: Implement jsglue traps for saveJobQueue() (#38232)
in the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), hooks like
[onNewGlobalObject()](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewglobalobject-global)
use an AutoDebuggerJobQueueInterruption to [switch to a new microtask
queue](b14aebff23/mozjs-sys/mozjs/js/src/debugger/Debugger.cpp (L2834-L2841))
and avoid clobbering the debuggee’s microtask queue. this in turn relies
on JobQueue::saveJobQueue(), which is [not yet implemented in
RustJobQueue](b14aebff23/mozjs-sys/src/jsglue.cpp (L83-L86)).

this patch bumps mozjs to servo/mozjs#595, which implements
[saveJobQueue() and
SavedJobQueue](b14aebff23/mozjs-sys/mozjs/js/public/Promise.h (L92-L114))
for RustJobQueue by calling into Servo via two new JobQueueTraps that
create and destroy extra “interrupt” queues for use by the debugger.

SpiderMonkey [does not own external job
queues](b14aebff23/mozjs-sys/mozjs/js/public/Promise.h (L117-L123)),
so the lifetime of these queues is managed in Servo, where they are
stored in a Vec-based stack. stack-like behaviour is adequate for
SpiderMonkey’s save and restore patterns, as far as we can tell, but
we’ve added an assertion just in case.

Testing: manually tested working in devtools debugger patch (#37667),
where it will undergo automated tests
Fixes: #38311

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-28 11:39:35 +00:00
batu_hoang
f5ee72f89a Rework webdriver session (#38225)
Reimplement webdriver session for better match to spec:

- Add `create_session`:
[spec](https://www.w3.org/TR/webdriver2/#dfn-create-a-session)
- Refactor `handle_new_session`
- Replace `PageLoadStrategy` string by enum

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-07-28 10:14:14 +00:00
sagudev
ae69646371 canvas: Make 2D context state creation failable and use dom_canvas_backend pref for backend selection (#38310)
Before script just crashed in those cases because IPCSender was dropped,
now we send `None` to tell script about the failure and fail getContext
or registerPainter accordingly.
This PR also unifies `dom_canvas_{backends}_enabled` prefs into
`dom_canvas_backend` which is more flexible in multi-backends scenarios.

Reviewable per commit.

Testing: Added servo specific WPT test.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-28 09:13:07 +00:00
Jerens Lensun
93d234d270 mach: Add type check on python/servo directory (#38085)
Introduce `python/servo` folder in pyrefly type checker

Testing: Manual testing via `./mach test-tidy` command

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-07-28 04:16:08 +00:00
sagudev
056b1538c0 canvas: Add vello_cpu backend (#38282)
vello_cpu does not have any tests timeouts, because we do not need
download stuff from GPU as all work happens on CPU. So performance wise
it's better then classic vello at least for our usecase. There are some
vello bugs, but I think we will be able to sort them out within
upstream, eventually. Interestingly enough there are no new PASS like
they were with classic vello.

Difference with raqote can be observed here:
https://github.com/sagudev/servo/actions/runs/16549241085/attempts/1#summary-46802486798

## Known vello problems:

- https://github.com/linebender/vello/issues/1119
- https://github.com/linebender/vello/issues/1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
https://github.com/linebender/vello/issues/1063
  - `/html/canvas/element/line-styles/2d.line.cross.html`
  - `/html/canvas/element/line-styles/2d.line.miter.acute.html`
- other lack of strong correct problems
(https://github.com/linebender/vello/issues/1063#issuecomment-2998084736):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- `putImageData(getImageData(...), ...)` is lossy (precision problems,
might be due to ImageData being unmultiplied)
-
`/html/canvas/element/pixel-manipulation/2d.imageData.put.unchanged.html`

Testing: Tested using vello_cpu_canvas subsuite

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-27 19:56:38 +00:00
Nico Burns
15be75f955 Disable serde feature of taffy dependency (#38303)
Disables the serde of taffy. This feature doesn't seem to be actually
being used.

Testing: This would cause build errors if it was required. So if it
builds it should be fine.

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-07-27 14:54:27 +00:00
Kingsley Yung
ab6e151c89 script_binding: wrapper of JSAutoStructuredCloneBuffer (#38284)
Instead of using raw pointer of JSAutoStructuredCloneBuffer, use its
wrapper JSAutoStructuredCloneBufferWrapper, which implements the Drop
trait that can prevent leakage when structured cloning fails.

Testing: Refactoring. Existing tests should be enough.
Fixes: #37966

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-07-27 12:41:02 +00:00
Servo WPT Sync
633d746e2f Sync WPT with upstream (27-07-2025) (#38296)
Automated downstream sync of changes from upstream as of 27-07-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-07-27 01:45:05 +00:00
Oriol Brufau
9614fb997a layout: Inline {default,natural}_{inline,block}_size methods (#38276)
They only had one caller.

Testing: Unnecessary (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-26 17:40:01 +00:00
sagudev
bc71fb8c0d canvas: Respect FillRule (#38294)
We just need to pass user provided FillRule via IPC to canvas paint
thread, then pass it all down to backend, which will handle it.

Testing: Added WPT tests.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-26 17:20:04 +00:00
Ashwin Naren
4188852963 script: Don't panic on IndexedDB put operation structured clone (#38280)
Fixes panic by rethrowing exceptions.

Testing: Covered by WPT
Fixes: #38075

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-26 16:35:10 +00:00
Ashwin Naren
e1bda86861 script: Implement converting values to indexeddb key ranges (#38278)
Implements
https://www.w3.org/TR/IndexedDB-2/#convert-a-value-to-a-key-range. Part
of #38187.

Testing: Currently unused, doesn't change anything
Fixes: None

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-26 13:20:52 +00:00
sagudev
f8d6c5646c canvas: Use bytemuck to remove unsafe from raqote backend (#38283)
This PR changes surface type from `Vec<u8>` to `Vec<u32>` as this is
native type of raqote's backend. We used unsafe for `Vec<u8>` <->
`Vec<u32>` casting that is replaced with bytemuck. Bytemuck is already
in cargo lock.

Testing: Existing WPT tests.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-26 13:16:16 +00:00
sagudev
daebb5a033 canvas: Move peniko/kurbo conversions in separate file (#38279)
This will allow reusing those conversions in vello_cpu backend.

Testing: Just refactor

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-26 13:14:25 +00:00
Kingsley Yung
4d899ecba5 webdriver: configure Expires and SameSite in handle_add_cookie (#38285)
Handler::handle_add_cookie did not configure the attributes "Expires"
and "SameSite". This patch adds them.

Testing: Passing WPT tests that were expected to fail.
Fixes: https://github.com/servo/servo/pull/37715#issuecomment-3069734014

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-07-26 12:23:24 +00:00
Euclid Ye
a3de3ffa75 webdriver: Implement maximize window for both headless&headed window (#38271)
- Implement [Maximize
Window](https://w3c.github.io/webdriver/#maximize-window)
- Previously, headless window screen size is same as inner size if not
specified in preference. We make it double as required by the test to
not have max window initially.
- Some other random cleanup.

Testing: webdriver Stress test for maximize window (headed + headless).

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-26 12:21:17 +00:00
JoeDow
9ef4d0c9d7 layout: Correctly marking box damage when text-related style changed (#38059)
This change aims to supplement the missing incremental box tree
construction when text-related styles change. Since certain text style
adjustments can alter visible text content and typography. Therefore,
the parent nodes of such text are marked as needing to re-collect their
box tree children to ensure the correct display of text.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-07-26 11:50:13 +00:00
sagudev
d678901122 canvas: Add vello backend (#36821)
Add vello backend by implementing Backend traits in canvas crate (so
this lives in canvas_paint_thread - embedded process). Current
implementation uses normal wgpu, so we block on GPU work. Vello backend
is gated behind `vello` feature and `dom_canvas_vello_enabled` pref.

Feature-wise this backend is on on par with raqote (sometimes better
sometimes worse), but performance wise it's worse.

## Known vello problems:

- image roundtrip does not work (fixed in
https://github.com/linebender/vello/pull/974)
- https://github.com/linebender/vello/issues/1066 (fixed)
- clip layers are not working properly:
https://github.com/linebender/vello/issues/1061
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
  - `/html/canvas/element/path-objects/2d.path.clip.intersect.html`
- https://github.com/linebender/vello/issues/1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
https://github.com/linebender/vello/issues/1063
  - `/html/canvas/element/line-styles/2d.line.cross.html`
  - `/html/canvas/element/line-styles/2d.line.miter.acute.html`
- other lack of strong correct problems
(https://github.com/linebender/vello/issues/1063#issuecomment-2998084736):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- There is currently no way to do put image properly in vello as we
would need to ignore all clips and other stuff (we try to work around
this on best effort basis)
https://github.com/linebender/vello/issues/1088
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
- precision problems
  - `/html/canvas/element/path-objects/2d.path.stroke.scale2.html`
  - `/html/canvas/element/path-objects/2d.path.arc.scale.1.html`

## Known servo problems

- bad performance due to blocking on GPU work
  - some get/put intensive tests `TIMEOUT`
- proper shadow support (non-blocker as we already are living without it
now)
- support for rect shadow is there but unimplemented currently as that's
the state in raqote

Testing: `mach try vello` will run normal WPT (with raqote) +
vello_canvas subsuite that runs only on `/html/canvas/element`. All
subsuite expectations are stored separately.
Fixes: #36823
Fixes: #35230

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-26 04:53:10 +00:00
Ashwin Naren
c2ed599eb1 script: implement IDBKeyRange (#38268)
#37684 provided the backend for this change. The key range interface
just wraps a `IndexedDBKeyRange` and exposes the methods from it as per
the spec.

Spec: https://www.w3.org/TR/IndexedDB-2/#keyrange
Testing: WPT tests (some regressions have been exposed, but that's fine)

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-07-26 02:59:15 +00:00
sagudev
8b2a5fca54 canvas: Make GetImageData simple and only IPC message to obtain pixels (#38274)
Currently we had `GetImageData` and `SendPixels` to obtain pixels from
script thread. This PR unifies those into single `GetImageData` that
does not need canvas size and has optional rect (for obtaining sub
image).

Testing: Existing WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-26 02:28:52 +00:00
dependabot[bot]
77f85f390e build(deps): bump litrs from 0.4.1 to 0.4.2 (#38275)
Bumps [litrs](https://github.com/LukasKalbertodt/litrs) from 0.4.1 to
0.4.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/LukasKalbertodt/litrs/releases">litrs's
releases</a>.</em></p>
<blockquote>
<h2>v0.4.2</h2>
<ul>
<li>Fix incorrect byte string value with non-ASCII <code>\xHH</code>
byte string escapes
<ul>

<li><code>ByteStringLit::parse(r#&quot;b&quot;\xff&quot;&quot;#).unwrap().value()</code>
would return <code>[0xc3, 0xbf]</code> instead of
<code>[0xff]</code>.</li>
</ul>
</li>
<li>Remove CR LF normalization to align with spec
<ul>
<li>This is technically a breaking change, but released with a minor
version bump as it just aligns with the specification. It is extremely
unlikely to affect any real world use case.</li>
</ul>
</li>
<li>Fix incorrect error span for out-of-range Unicode escapes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/LukasKalbertodt/litrs/blob/main/CHANGELOG.md">litrs's
changelog</a>.</em></p>
<blockquote>
<h2>[0.4.2] - 2025-07-25</h2>
<ul>
<li>Fix incorrect byte string value with non-ASCII <code>\xHH</code>
byte string escapes
<ul>

<li><code>ByteStringLit::parse(r#&quot;b&quot;\xff&quot;&quot;#).unwrap().value()</code>
would return <code>[0xc3, 0xbf]</code> instead of
<code>[0xff]</code>.</li>
</ul>
</li>
<li>Remove CR LF normalization to align with spec
<ul>
<li>This is technically a breaking change, but released with a minor
version bump as it just aligns with the specification. It is extremely
unlikely to affect any real world use case.</li>
</ul>
</li>
<li>Fix incorrect error span for out-of-range Unicode escapes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1dc8a3e95c"><code>1dc8a3e</code></a>
Bump version to 0.4.2</li>
<li><a
href="8c55d089c6"><code>8c55d08</code></a>
Fix incorrect error span for out-of-range Unicode escapes</li>
<li><a
href="8fe855226f"><code>8fe8552</code></a>
Fix bug with non-ASCII \xHH byte string escapes</li>
<li><a
href="ed84018240"><code>ed84018</code></a>
Refactor escape code to make it more flexible for upcoming
c-strings</li>
<li><a
href="15edbcd138"><code>15edbcd</code></a>
Remove CR LF normalization to align with spec</li>
<li><a
href="d3cf292593"><code>d3cf292</code></a>
Update CI workflow</li>
<li>See full diff in <a
href="https://github.com/LukasKalbertodt/litrs/compare/v0.4.1...v0.4.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=litrs&package-manager=cargo&previous-version=0.4.1&new-version=0.4.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-25 17:38:17 +00:00
sagudev
fc0038743d canvas: Make pixel obtaining methods take &mut GenericDrawTarget (#38264)
This will be needed for vello_cpu. While we could wrap it in RefCell for
inner mut, but that would be less ergonomic and performant.

Testing: Just refactoring, but the code is covered by WPT tests.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-25 13:22:41 +00:00
JoeDow
9d29017c0d layout: optimize the propagation and cleanup of RestyleDamage (#38199)
This change optimizes `RestyleDamage` propagation and cleanup to reduce
unnecessary box reconstruction and relayouts, while preventing damage
from the current reflow affecting subsequent ones. Improvements include:
- For box damage caused by `NodeDamage`, `RestyleDamage::RELAYOUT` is no
longer marked immediately—avoiding erroneous propagation of
`LayoutDamage::RECOLLECT_BOX_TREE_CHILDREN` to descendants during
`RestyleDamage` propagation.
- Clearing damage for nodes whose boxes will be preserved, preventing it
from carrying over to the next reflow and increasing its workload.

Testing: This should not change observable behavior and is thus covered
by existing WPT tests. Although Servo lacks performance test cases,
manual testing shows that this modification reduces reflow time by
nearly 250ms, representing a decrease of approximately 25%.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-07-25 12:10:16 +00:00
Leo Ring
87bbe0b374 servoshell: Properly set RenderingContext size after resizing (#38257)
The tab bar would disappear on resizes, this just reverts the change
which introduced the bug.

Testing: servoshell doesn't currently have tests, so this change does
not come with a test.
Fixes: https://github.com/servo/servo/issues/38255

Signed-off-by: Leo Ring <leoring03@gmail.com>
2025-07-25 12:05:50 +00:00
sagudev
420a5a64a7 canvas: Remove Backend trait (#38262)
After #38214 `Backend` trait is only used as DrawTarget builder and as
type holder. By moving types and DrawTarget creation into
`GenericDrawTarget` trait, we can completely remove `Backend` trait.

Testing: Just refactor, but code is covered by WPT tests.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-25 12:05:03 +00:00
JoeDow
5cd57f9dba layout: Add incremental box tree construction for inline boxes (#38084)
This changes extend the incremental box tree construction for inline
boxes. Since an `InlineItem` can be split into multiple `InlineItem`s by
a block element, the reason such an inline item is marked as damaged may
simply be the removal of the block element or the need to reconstruct
its box tree. Therefore, under the current LayoutDamage design,
theoretically, even damaged inline items might still have some of their
splits reusable. However, based on the principle of simplicity and
effectiveness, this PR only considers reusing undamaged inline boxes.

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-25 11:49:46 +00:00
Ashwin Naren
3f1e170410 script: Update indexeddb serialization (#38269)
- Dates are now serialized as f64s (like how firefox does it)
- Array buffers are serialized with structured cloning (this is not the
most correct/efficent way to serialize them, however it is currently
better than not supporting array buffers at all)
- Array types are still unimplemented.

Testing: WPT
Fixes: Some panicking

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-25 11:11:22 +00:00
Kenzie Raditya Tirtarahardja
165ede59cd script(webdriver): Send keys set caret at the end of content of text input (#38250)
Remote end step of [element send
keys](https://w3c.github.io/webdriver/#element-send-keys)

> Step 8.2. Set the text insertion caret using [set selection
range](https://w3c.github.io/webdriver/#dfn-set-selection-range) using
current text length for both the start and end parameters.

Also check if the element is already an active element before focusing
(Step 7.7).

Testing:
`./tests/wpt/tests/webdriver/tests/classic/element_send_keys/form_controls.py`

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja18@gmail.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-25 07:24:48 +00:00
Ashwin Naren
ab78a76da6 script: Implement IDBFactory.cmp (#38260)
Implements `IDBFactory.cmp`, most of the work was done by #38123.

Testing: Covered by WPT (lots of flaky results: the appropriate tests
are in tests/wpt/meta/IndexedDB/idlharness.any.js.ini)
Fixes: None

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-25 05:29:10 +00:00
Jo Steven Novaryo
6cd8578f8b dom: Textual Input UA Shadow Dom (#37527)
Depend on: 
- https://github.com/servo/servo/pull/37427
- https://github.com/servo/servo/pull/37483

Utilize input `type=text` for the display of all textual input. In
which, consist of
https://html.spec.whatwg.org/#the-input-element-as-a-text-entry-widget
and
https://html.spec.whatwg.org/#the-input-element-as-domain-specific-widgets
inputs.

For `password`, `url`, `tel`, and, `email` input, the appearance of
input container is exactly the same as the `text` input. Other types of
textual input simply extends `text` input by adding extra components
inside the container.

Testing: Servo textual input appearance WPT.

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-07-25 04:38:14 +00:00
Jo Steven Novaryo
1d896699a4 script: Implement CSSStyleSheet.replace (#38244)
Implement `CSSStyleSheet.replace`
[#dom-cssstylesheet-replace](https://drafts.csswg.org/cssom/#dom-cssstylesheet-replace)
with disallow modification flag
[#concept-css-style-sheet-disallow-modification-flag](https://drafts.csswg.org/cssom/#concept-css-style-sheet-disallow-modification-flag).

Basically it would behave like `replaceSync`, but we are running it
asynchronously.

Testing: Existing WPT coverage.
Part of: https://github.com/servo/servo/issues/36162

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-07-25 03:05:22 +00:00
Euclid Ye
928934d4b0 servoshell: Respond resize with authentic result and Adjust minimum window size (#38258)
- We no longer pretend that resize is always successful and simplify the
result computation.
- Adjust minimum window size to match other browsers and the test
expectation.
- Restrict some unnecessary access specifier.

Testing: ` ./mach test-wpt -r
"tests\wpt\tests\webdriver\tests\classic\set_window_rect\set.py"
--log-raw "D:\servo test log\set.txt" --product servodriver
{--headless}`
Fixes: #37804 as Task 8 is last task.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-25 02:31:18 +00:00
sagudev
d39e701b46 canvas: Fully stateless backend (#38214)
I think this simplifies canvas backends greatly. Before there were many
(needless) hoops from abstract to concrete (backend) and back, now we
can do most stuff on abstract types.

Testing: Existing WPT tests
Fixes: #38022 

try run: https://github.com/sagudev/servo/actions/runs/16450978211

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-24 18:11:29 +00:00
dependabot[bot]
86d8317460 build(deps): bump prettyplease from 0.2.35 to 0.2.36 (#38254)
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from
0.2.35 to 0.2.36.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/prettyplease/releases">prettyplease's
releases</a>.</em></p>
<blockquote>
<h2>0.2.36</h2>
<ul>
<li>Preserve braces in <code>use path::to::{self};</code> (<a
href="https://redirect.github.com/dtolnay/prettyplease/issues/121">#121</a>,
thanks <a
href="https://github.com/charlyisidore"><code>@​charlyisidore</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9ae9017fbc"><code>9ae9017</code></a>
Release 0.2.36</li>
<li><a
href="6e28f51132"><code>6e28f51</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/prettyplease/issues/121">#121</a>
from charlyisidore/use-self</li>
<li><a
href="27e359b2d3"><code>27e359b</code></a>
Preserve braces in <code>use std::fmt::{self};</code> <a
href="https://redirect.github.com/dtolnay/prettyplease/issues/120">dtolnay/prettyplease#120</a></li>
<li>See full diff in <a
href="https://github.com/dtolnay/prettyplease/compare/0.2.35...0.2.36">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettyplease&package-manager=cargo&previous-version=0.2.35&new-version=0.2.36)](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-24 18:07:14 +00:00
Euclid Ye
3bc104c8e4 servoshell: Add window position for headless window (#38249)
Add virtual `window_position` to headless window so that `moveTo` and
WebDriver window command can work properly.

Testing: `./mach test-wpt -r
"tests\wpt\tests\webdriver\tests\classic\set_window_rect\set.py"
--product servodriver --headless`
Fixes: Task 7 of #37804.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-24 17:57:58 +00:00
dependabot[bot]
4c7797a7ab build(deps): bump owned_ttf_parser from 0.25.0 to 0.25.1 (#38252)
Bumps
[owned_ttf_parser](https://github.com/alexheretic/owned-ttf-parser) from
0.25.0 to 0.25.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/alexheretic/owned-ttf-parser/releases">owned_ttf_parser's
releases</a>.</em></p>
<blockquote>
<h2>0.25.1</h2>
<ul>
<li>Reduce size of published crate archive (148 KiB -&gt; 9 KiB).</li>
<li>Update min <em>ttf-parser</em> to <code>0.25.1</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/alexheretic/owned-ttf-parser/blob/main/CHANGELOG.md">owned_ttf_parser's
changelog</a>.</em></p>
<blockquote>
<h1>0.25.1</h1>
<ul>
<li>Reduce size of published crate archive (148 KiB -&gt; 9 KiB).</li>
<li>Update min <em>ttf-parser</em> to <code>0.25.1</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3abee95150"><code>3abee95</code></a>
Release 0.25.1</li>
<li><a
href="4759b5593f"><code>4759b55</code></a>
Exclude test data and tools from published packages (<a
href="https://redirect.github.com/alexheretic/owned-ttf-parser/issues/18">#18</a>)</li>
<li>See full diff in <a
href="https://github.com/alexheretic/owned-ttf-parser/compare/0.25.0...0.25.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=owned_ttf_parser&package-manager=cargo&previous-version=0.25.0&new-version=0.25.1)](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-24 17:54:52 +00:00
dependabot[bot]
d9dee9011e build(deps): bump ipc-channel from 0.20.0 to 0.20.1 (#38253)
Bumps [ipc-channel](https://github.com/servo/ipc-channel) from 0.20.0 to
0.20.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/servo/ipc-channel/releases">ipc-channel's
releases</a>.</em></p>
<blockquote>
<h2>v0.20.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Merge thread_local declarations by <a
href="https://github.com/jschwe"><code>@​jschwe</code></a> in <a
href="https://redirect.github.com/servo/ipc-channel/pull/397">servo/ipc-channel#397</a></li>
<li>Remove receivers from Router IpcReceiverSet on channel close. by <a
href="https://github.com/jdm"><code>@​jdm</code></a> in <a
href="https://redirect.github.com/servo/ipc-channel/pull/400">servo/ipc-channel#400</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/servo/ipc-channel/compare/v0.20.0...v0.20.1">https://github.com/servo/ipc-channel/compare/v0.20.0...v0.20.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="69d1d4bf8c"><code>69d1d4b</code></a>
Publish 0.20.1. (<a
href="https://redirect.github.com/servo/ipc-channel/issues/401">#401</a>)</li>
<li><a
href="4c2cbf8cae"><code>4c2cbf8</code></a>
bug: Drop macOS receivers from OsIpcReceiverSet on channel close. (<a
href="https://redirect.github.com/servo/ipc-channel/issues/400">#400</a>)</li>
<li><a
href="59d6d8099c"><code>59d6d80</code></a>
Merge thread_local declarations (<a
href="https://redirect.github.com/servo/ipc-channel/issues/397">#397</a>)</li>
<li>See full diff in <a
href="https://github.com/servo/ipc-channel/compare/v0.20.0...v0.20.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ipc-channel&package-manager=cargo&previous-version=0.20.0&new-version=0.20.1)](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-24 17:50:43 +00:00
Kenzie Raditya Tirtarahardja
4b12ae73fe webdriver: Implement element clear (#38208)
Initial Implementation of [Element
Clear](https://w3c.github.io/webdriver/#element-clear).

Testing: `tests/wpt/tests/webdriver/tests/classic/element_clear/`

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja18@gmail.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-07-24 17:49:31 +00:00
Jo Steven Novaryo
1fb782bc38 script: Batch scroll event firing (#38222)
The user interaction triggered `scroll` event was initially implemented
in https://github.com/servo/servo/pull/36687.

In triggering the `scroll` event, the event should be batched and
triggered within update the rendering. This serves as a preparatory PR
for the JS API triggered `scroll` event.

Part of: #31665

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-07-24 17:48:12 +00:00
dependabot[bot]
eeac336518 build(deps): bump the servo-media-related group with 12 updates (#38202)
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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-24 17:29:48 +00:00
leo030303
5592061474 Add dimension source attribute to HTMLImageElement (#38152)
HTMLImageElement was missing the dimension source attribute, as step 9
from
[here](https://html.spec.whatwg.org/multipage/images.html#updating-the-source-set)
wasn't implemented. This meant that for an element like this:
```html
<picture>
  <source media="(min-width: 1000px)"
    srcset=""
    width="84" height="29">
  <img
    src=""
    width="25" height="25" alt="Wikimedia Foundation" lang="en" loading="lazy">
</picture>
```

The `width` and `height` attributes of the source tag were being
ignored. This broke stuff like these icons on the main page of
Wikipedia.

**Original:**
<img width="2252" height="229" alt="image"
src="https://github.com/user-attachments/assets/fa3fdd9d-5f91-43d4-bc9d-784b0a836d44"
/>


**Fixed:**
<img width="2252" height="229" alt="image"
src="https://github.com/user-attachments/assets/6f4ca4ae-e764-4394-ac31-9a92bbb456ab"
/>


Testing: If there isn't an existing test that covers this I'll make one,
waiting for the github runner to tell me whether this is covered and
then I'll amend the PR

---------

Signed-off-by: Leo Ring <leoring03@gmail.com>
Signed-off-by: Xiaocheng Hu <hu.xiaocheng@huawei.com>
Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
Co-authored-by: Xiaocheng Hu <hu.xiaocheng@huawei.com>
Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
2025-07-24 13:40:44 +00:00
Josh Matthews
be38bd4636 servo: Track async webview focus operations (#38243)
https://github.com/servo/servo/pull/38160 added a webdriver-specific API
to support waiting on focus operations to complete. These changes
replace that with a generalized pattern, where a unique ID is created
for each focus operation and the embedder can receive notifications
about each focus operation when it is complete, regardless of whether
the focus was actually changed.

Testing: Existing test coverage from
https://github.com/servo/servo/pull/38160/ is unchanged.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-24 06:01:11 +00:00
Euclid Ye
0b8986c8da servoshell: Consider window decorations when handling resize requests from web content (#38174)
Also fix some docs. This is used by JS `resizeTo`, `resizeBy` and
webdriver [set window
rect](https://w3c.github.io/webdriver/#set-window-rect).

Testing: Can now pass more tests for headed window.
Fixes: Well.. Originally the attempt is to address
https://github.com/servo/servo/issues/38093#issuecomment-3092284104. But
it turns out as a more general problem to be fixed in another PR.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-24 05:42:04 +00:00
Shubham Gupta
f62aa8edc2 Rename viewport_zoom to pinch_zoom (#38194)
This change is in accordance with highlighting the usage of various zoom
options.

`pinch_zoom`: `Mobile-style` zoom using pinch gesture
 `page_zoom`: `Desktop-style` zoom (`Ctrl` + `+`/`-`)

It just renames the variable `viewport_zoom` to `pinch_zoom` for better
clarity

Testing: Testing not required, as it's just renaming of variable .

---------

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
2025-07-24 05:29:18 +00:00
Kenzie Raditya Tirtarahardja
d95dd69e3c script(webdriver): Check if element is keyboard interactable in element send keys (#38235)
Step 7.6 of remote end steps of [Element Send
Keys](https://w3c.github.io/webdriver/#element-send-keys)
> If element is not
[keyboard-interactable](https://w3c.github.io/webdriver/#dfn-keyboard-interactable),
return [error](https://w3c.github.io/webdriver/#dfn-error) with [error
code](https://w3c.github.io/webdriver/#dfn-error-code) [element not
interactable](https://w3c.github.io/webdriver/#dfn-element-not-interactable).

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-24 04:32:46 +00:00
Euclid Ye
f726737f24 Reduce redundancy in servoshell webdriver message forwarding and add log for script::handle_send_keys_non_typeable (#38238)
There was a new commit for after
https://github.com/servo/servo/pull/38189#discussion_r2224805172, but
that does not seem to update/stop MQ.
Also removed `forward_webdriver_command` in servoshell according to
https://github.com/servo/servo/pull/38212#discussion_r2221854327.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-24 04:22:04 +00:00
Narfinger
6ace7ad577 OHOS: Clean up some compile warnings (#38240)
This cleans up some compile warnings about unused functions.

Testing: Does not change functionality, OHOS and Linux still compile
(hopefully the other builds too).

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-24 03:29:49 +00:00
lumiscosity
bb5cb57099 Remove unused resources (#38245)
As previously discussed in #38229. To recap: `badcert.jpg` was made
unused in 8422dac811 and `tumbeast.png`
and its associated file of `not-found.html` were superseded at some
point by a message in `neterror.html` (if it were still used, it'd
surely be
[embedded](https://github.com/servo/servo/blob/main/components/shared/embedder/resources.rs).)

This PR also removes two unnecessary spaces inside of the new tab's CSS
file, ensuring a consistent 2 space indentation in the file and saving 2
bytes.

Testing: Unnecessary, as this commit only removes unused assets (and
fixes one style nit).

Signed-off-by: maple! <averyrudelphe@gmail.com>
2025-07-24 00:34:15 +00:00
lumiscosity
067631037c Optimize PNG images in resources folder (#38229)
Losslessly optimizes the PNG images in the `resources` folder with:
```
oxipng -o max -a -s
oxipng -o max --zopfli -a -s
```

Tests are unaffected by this commit in order to avoid potential
breakages.

As an aside: shouldn't `tumbeast.png` and `badcert.jpg` be removed? For
`tumbeast.png`, the related page `resources/not-found.html` doesn't seem
to be reachable by any means (the usual dry error message is used
instead, as far as my testing goes, neither `about:not-found` nor
`servo:not-found` work), and the only use of `badcert.jpg` (in
`badcert.html`) got removed in 8422dac811.

Testing: Unnecessary. Since the optimized images haven't changed their
extension, so long as Servo's PNG parsing is correct, there should be no
change aside from reduced binary sizes.

Signed-off-by: maple! <averyrudelphe@gmail.com>
2025-07-23 18:43:09 +00:00
dependabot[bot]
1f23382d18 build(deps): bump hyper-util from 0.1.15 to 0.1.16 (#38241)
Bumps [hyper-util](https://github.com/hyperium/hyper-util) from 0.1.15
to 0.1.16.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/hyper-util/blob/master/CHANGELOG.md">hyper-util's
changelog</a>.</em></p>
<blockquote>
<h1>0.1.16 (2025-07-22)</h1>
<ul>
<li>Add <code>impl Clone</code> for <code>proxy::Tunnel</code>
service.</li>
<li>Fix <code>proxy::Matcher</code> to detect SOCKS4 schemes.</li>
<li>Fix <code>legacy::Client</code> pool idle checker to trigger less
aggresively, saving CPU.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5cefcd804e"><code>5cefcd8</code></a>
v0.1.16</li>
<li><a
href="0d4ca3f50d"><code>0d4ca3f</code></a>
chore(cargo): move tokio/net feature to client (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/218">#218</a>)</li>
<li><a
href="89b2cffaf0"><code>89b2cff</code></a>
fix(proxy): Fix SOCKS4 proxy protocol parsing and matching (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/219">#219</a>)</li>
<li><a
href="39fd779bb2"><code>39fd779</code></a>
tests(client): fix flaky pool test (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/220">#220</a>)</li>
<li><a
href="24714a39ca"><code>24714a3</code></a>
fix(client): cap pool idle interval to a minimum (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/217">#217</a>)</li>
<li><a
href="f0dcda37f8"><code>f0dcda3</code></a>
deps: allow socket2 0.6 (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/213">#213</a>)</li>
<li><a
href="dd63305975"><code>dd63305</code></a>
refactor(client): simplify pool idle task with async/await (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/216">#216</a>)</li>
<li><a
href="afd758b265"><code>afd758b</code></a>
fix(client): don't spawn pool idle interval if timeout is 0 (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/215">#215</a>)</li>
<li><a
href="9f7a5e01e3"><code>9f7a5e0</code></a>
feat(client): implement Clone for Tunnel (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/212">#212</a>)</li>
<li>See full diff in <a
href="https://github.com/hyperium/hyper-util/compare/v0.1.15...v0.1.16">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hyper-util&package-manager=cargo&previous-version=0.1.15&new-version=0.1.16)](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-23 17:29:00 +00:00
dependabot[bot]
13544ae0d2 build(deps): bump aws-lc-rs from 1.13.2 to 1.13.3 (#38242)
Bumps [aws-lc-rs](https://github.com/aws/aws-lc-rs) from 1.13.2 to
1.13.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/aws/aws-lc-rs/releases">aws-lc-rs's
releases</a>.</em></p>
<blockquote>
<h2>aws-lc-rs v1.13.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Rename ML-DSA by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/844">aws/aws-lc-rs#844</a></li>
</ul>
<h2>Other Merged PRs</h2>
<ul>
<li>Skip aws-lc-rs &quot;publish dryrun&quot; job when -sys crates not
published by <a
href="https://github.com/justsmth"><code>@​justsmth</code></a> in <a
href="https://redirect.github.com/aws/aws-lc-rs/pull/840">aws/aws-lc-rs#840</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/aws/aws-lc-rs/compare/v1.13.2...v1.13.3">https://github.com/aws/aws-lc-rs/compare/v1.13.2...v1.13.3</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="78258d2b58"><code>78258d2</code></a>
Fix publish dryrun when -sys crates update (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/840">#840</a>)</li>
<li><a
href="3efb4fa9d2"><code>3efb4fa</code></a>
Rename ML-DSA (<a
href="https://redirect.github.com/aws/aws-lc-rs/issues/844">#844</a>)</li>
<li>See full diff in <a
href="https://github.com/aws/aws-lc-rs/compare/v1.13.2...v1.13.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-lc-rs&package-manager=cargo&previous-version=1.13.2&new-version=1.13.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 17:27:15 +00:00
Euclid Ye
0e4b2bfef0 cargo: Remove unused dependency (#38239)
Remove unused `Cargo.toml` dependency to reduce binary size.

Testing: Can still compile in different platforms.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-23 13:32:50 +00:00
shuppy
52f53f61e1 script: Add support for creating globals in isolated compartments (#38236)
to use the [SpiderMonkey Debugger
API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to
call it from an internal debugger script that we will supply. this
script must run in the same runtime as the debuggee(s), but in a
separate
[compartment](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Compartments)
([more
details](https://hacks.mozilla.org/2020/03/future-proofing-firefoxs-javascript-debugger-implementation/)).

when creating two globals in the same runtime, Servo will generally try
to reuse an existing compartment for the second global, and there are
other places in script where we rely on this reuse. but for the debugger
script, we can’t do this.

this patch adds a `use_system_compartment` flag to global object
descriptors, which isolates the global in its own compartment in both
possible directions:
- it forces the global to create a new compartment, preventing the reuse
of any debuggee’s compartment
- it fails the check in select_compartment(), preventing future
debuggees from reusing the global’s compartment

Testing: manually tested working in devtools debugger patch (#37667),
where it will undergo automated tests

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-07-23 11:34:37 +00:00
Narfinger
d9f8fc505f ohos CI: Add the build profile to speedometer results (#38231)
OHOS CI now has the build profile before the test cases to distringuish
dev, release, production and similar.

Testing: Tested on CI with a run here:
https://github.com/Narfinger/servo/actions/runs/16465984131/job/46543984398
Fixes: Same name in speedometer CI will have very different speeds
because of different profiles. This will fix this behaviour.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-23 10:09:46 +00:00
Kenzie Raditya Tirtarahardja
0970a99b7c webdriver: Implement element send keys command for non-typeable form control (#38189)
Implement Step 8 of remote end steps of [Element Send
keys](https://w3c.github.io/webdriver/#element-send-keys), specifically
for non-typeable form control.

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-23 09:11:44 +00:00
Jo Steven Novaryo
3cb16eb864 Reland Input type=text Shadow DOM With Performance Improvement (#37483)
Depends on #37427.

In addition to the changes introduced by
https://github.com/servo/servo/pull/37065, there are several performance
improvements and nits as follows:
- Use the internal pseudo element for style matching, this will reduce
the performance regression by ~66%.
- Manual construction of the `Text` node inside a text container. This
is followed by the modification of the inner `Text` node instead of
using `SetTextContent` which is more expensive.
- Use `implemented_pseudo_element` instead of
`text_control_inner_editor` `NodeFlag` to handle the special cases that
these elements should follow, specifically the:
  - focus delegation workaround;
  - selections; and
  - line height resolving.
- More documentation.

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

Testing: No new unexpected WPT failure, except for the one introduced by
https://github.com/servo/servo/pull/37065/.
Fixes: #36307 #37205

---------

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-07-23 09:08:24 +00:00
Jo Steven Novaryo
f523445fc3 script: Implement DocumentOrShadowDOM.adoptedStylesheet with FrozenArray (#38163)
Spec:
https://drafts.csswg.org/cssom/#dom-documentorshadowroot-adoptedstylesheets

Implement `DocumentOrShadowDOM.adoptedStylesheet`. Due to
`ObservableArray` being a massive issue on its own, it will be as it was
a `FrozenArray` at first. This approach is similar to how Gecko
implement adopted stylesheet. See
https://phabricator.services.mozilla.com/D144547#change-IXyOzxxFn8sU.

All of the changes will be gated behind a preference
`dom_adoptedstylesheet_enabled`.

Adopted stylesheet is implemented by adding the setter and getter of it.
While the getter works like a normal attribute getter, the setter need
to consider the inner working of document and shadow root StylesheetSet,
specifically the ordering and the invalidations. Particularly for
setter, we will clear all of the adopted stylesheet within the
StylesheetSet and readd them. Possible optimization exist, but the focus
should be directed to implementing `ObservableArray`.

More context about the implementations
https://hackmd.io/vtJAn4UyS_O0Idvk5dCO_w.

Testing: Existing WPT Coverage
Fixes: https://github.com/servo/servo/issues/37561

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-07-23 08:16:01 +00:00
Euclid Ye
d2e5137201 constellation: Eliminate long-standing inactive code path for WebDriverData (#38221)
Cleaning up some dead code which has been here for 9 years. They are
never detected by Lint because we still initialize them as `None` but
never change afterwards.

Testing: No regression.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-23 06:50:20 +00:00
TIN TUN AUNG
7f6d4825cf Ohos: include build id in ohos built binary (#38215)
add link-arg for ohos to include build id in its ELF binary. This could
enable us to do debugging and size checking more easily.

Testing: No test needed.
Fixes: N/A

cc @jschwe

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
2025-07-23 04:54:21 +00:00
Jonathan Schwender
6417d3077b ohos CI: Simplify getting the model name (#38219)
Same output, but much easier and faster than sifting through the whole
output of hdc bugreport.

Testing: CI change: `./mach try`
[run](https://github.com/servo/servo/actions/runs/16460283107)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-23 04:25:53 +00:00
JoeDow
b8a1df2bc2 script: Use NodeDamage::ContentOrHeritage for slot changes (#38198)
This change aims to reduce the scope of incremental box tree
construction. Previously, when children of slot node changed, the slot
would always be marked as requiring box tree reconstruction; now, it is
adjusted to only mark the slot node as needing to recollect its box tree
children.

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-23 03:36:32 +00:00
Euclid Ye
4ff6b1d4a7 Implement setting position through webdriver for headed window (#38209)
Previously, we pretend we are able to set position in response. Now we
can really do it.

Testing: Able to set position accurately when tested locally.
Fixes: Task 5 of #37804.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-22 18:26:37 +00:00
dependabot[bot]
cff48d4910 build(deps): bump io-uring from 0.7.8 to 0.7.9 (#38217)
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.7.8 to
0.7.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/tokio-rs/io-uring/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=io-uring&package-manager=cargo&previous-version=0.7.8&new-version=0.7.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-22 18:16:40 +00:00
Kenzie Raditya Tirtarahardja
9e29ca2047 WebDriver: Will Send Keys add documentation and modularize input file (#38165)
Add comment for better documentation of `will_send_keys` and extract
file input handling to a function.

Testing: No behaviour change

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-22 17:30:22 +00:00
sagudev
cd340fa8b9 canvas: Make script/canvas thread boundry mostly stateless (#38164)
This PR removes all `Set*` commands as we will send needed options on
each request. This will allow us to remove most of state handling from
canvas paint thread (currently it's still stateful).

Testing: Existing WPT tests
work towards #38022

try run: https://github.com/sagudev/servo/actions/runs/16413823963

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-22 12:30:15 +00:00
JoeDow
8a1cc69717 Layout: minor optimizations and bugfix for non-functional details (#38197)
This change adds some minor optimizations and bugfix for non-functional
details with seperated commits:
- fix the omission that stop use `Rayon` in single-thread mode
- add trace for incremental box tree construction
- fix the bug that failed to skip reflow entirely when there is no need
for `restyle` and a fragment tree has already been built.
- add trace for stylist preparation during reflow. In certain scenarios,
this phase might take up a significant amount of time, such as when
there are a large number of shadow trees.

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-22 10:56:52 +00:00
Kenzie Raditya Tirtarahardja
19a121e829 WebDriver: Clean Up and Re-Update WPT Expectation (#38192)
Previously, we have failing many subtests in `*/user_prompt.py` with
prefix `capabilities0-*`. The name of the subtest was probably changed
before, hence the failing expectation is not removed when we do `./mach
update-wpt`. Here we reupdate the expectation.

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-22 10:28:38 +00:00
Euclid Ye
57fc569818 Remove Webdriver Server's access to Constellation (#38212)
`WebDriverCommandMsg::TakeScreenshot` was the last thing blocking us
from removing constellation access in webdriver server. Now we can
happily remove it.

Surprisingly, this reduces binary size by 185KB for release profile in
Windows. #37737 removes a net total of 300 lines, but only reduced 98KB.

Testing: No regression after testing.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-22 10:17:19 +00:00
sagudev
61df7ab127 chore: Update kurbo to 0.11.3 (#38210)
Some of the code we wrote is now also in upstream, mainly
`BezPath.current_position` and euclid types conversions.

Testing: Code is covered by existing WPT tests.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-07-22 08:23:13 +00:00
Jonathan Schwender
97f544aa20 dom: Optimize IFrameCollection::validate (#38196)
The `IFrameCollection` was previously rebuilt too often. This PR tries
to address the todo, to only rebuild the IFrameCollection when
necessary.

Testing: `CSS Selector Invalidation: :has() invalidation should not be
O(n^2)` wpt-test changed status from timeout to failed.
Fixes: #38131 (IFrameCollection::validate accounts for 30% of script
time in DOM heavy scenarios)


Co-authored-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-22 03:54:16 +00:00
dependabot[bot]
03ab419793 build(deps): bump bytemuck_derive from 1.9.3 to 1.10.0 (#38205)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from 1.9.3
to 1.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Lokathor/bytemuck/blob/main/changelog.md">bytemuck_derive's
changelog</a>.</em></p>
<blockquote>
<h1><code>bytemuck</code> changelog</h1>
<h2>1.23.1</h2>
<ul>
<li>Added a windows-only <code>ZeroableInOption</code> impl for
&quot;stdcall&quot; functions.</li>
</ul>
<h2>1.23</h2>
<ul>
<li><code>impl_core_error</code> crate feature adds
<code>core::error::Error</code> impl.</li>
<li>More <code>ZeroableInOption</code> impls.</li>
</ul>
<h2>1.22</h2>
<ul>
<li>Add the <code>pod_saturating</code> feature, which adds
<code>Pod</code> impls for <code>Saturating&lt;T&gt;</code>
when <code>T</code> is already <code>Pod</code>.</li>
<li>A bump in the minimum <code>bytemuck_derive</code> dependency from
1.4.0 to 1.4.1 to
avoid a bug if you have a truly ancient <code>cargo.lock</code> file
sitting around.</li>
<li>Adds <code>Send</code> and <code>Sync</code> impls to
<code>BoxBytes</code>.</li>
</ul>
<h2>1.21</h2>
<ul>
<li>Implement <code>Pod</code> and <code>Zeroable</code> for
<code>core::arch::{x86, x86_64}::__m512</code>, <code>__m512d</code> and
<code>__m512i</code> without nightly.
Requires Rust 1.72, and is gated through the <code>avx512_simd</code>
cargo feature.</li>
<li>Allow the use of <code>must_cast_mut</code> and
<code>must_cast_slice_mut</code> in const contexts.
Requires Rust 1.83, and is gated through the
<code>must_cast_extra</code> cargo feature.</li>
<li>internal: introduced the <code>maybe_const_fn</code> macro that
allows defining some function
to be const depending upon some <code>cfg</code> predicate.</li>
</ul>
<h2>1.20</h2>
<ul>
<li>New functions to allocate zeroed <code>Arc</code> and
<code>Rc</code>. Requires Rust 1.82</li>
<li><code>TransparentWrapper</code> impls for
<code>core::cmp::Reverse</code> and
<code>core::num::Saturating</code>.</li>
<li>internal: Simplified the library's <code>fill_zeroes</code> calls to
<code>write_bytes</code></li>
</ul>
<h2>1.19</h2>
<ul>
<li>Adds the <code>#[track_caller]</code> attribute to functions which
may panic.</li>
</ul>
<h2>1.18</h2>
<ul>
<li>Adds the <code>latest_stable_rust</code> cargo feature, which is a
blanket feature that turns all other features on that are both sound and
compatible with Stable rust.</li>
</ul>
<h2>1.17.1</h2>
<ul>
<li>Adds <code>#[repr(C)]</code> to the <code>union Transmute&lt;A,
B&gt;</code> type that's used internally
for most of the transmutations.</li>
</ul>
<h2>1.17.0</h2>
<ul>
<li>Makes the <code>must_cast</code> versions of the by-value and by-ref
casts be <code>const</code>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/Lokathor/bytemuck/commits/bytemuck_derive-v1.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bytemuck_derive&package-manager=cargo&previous-version=1.9.3&new-version=1.10.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-21 20:31:12 +00:00
dependabot[bot]
0f55aa292e build(deps): bump serde_json from 1.0.140 to 1.0.141 (#38204)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.140 to
1.0.141.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/json/releases">serde_json's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.141</h2>
<ul>
<li>Optimize string escaping during serialization (<a
href="https://redirect.github.com/serde-rs/json/issues/1273">#1273</a>,
thanks <a
href="https://github.com/conradludgate"><code>@​conradludgate</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6843c3660e"><code>6843c36</code></a>
Release 1.0.141</li>
<li><a
href="6e2c21063a"><code>6e2c210</code></a>
Touch up PR 1273</li>
<li><a
href="623d9b47cf"><code>623d9b4</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1273">#1273</a>
from conradludgate/optimise-string-escaping</li>
<li><a
href="de70b7db1f"><code>de70b7d</code></a>
use unreachable_unchecked for escape table. use a second match to
roundtrip E...</li>
<li><a
href="f2d940dd54"><code>f2d940d</code></a>
replace start index with bytes slice reference</li>
<li><a
href="cd55b5a0ff"><code>cd55b5a</code></a>
Ignore mismatched_lifetime_syntaxes lint</li>
<li><a
href="c1826ebccc"><code>c1826eb</code></a>
Pin nightly toolchain used for miri job</li>
<li><a
href="8a56cfa6d0"><code>8a56cfa</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/json/issues/1248">#1248</a>
from jimmycathy/master</li>
<li><a
href="af3d80de56"><code>af3d80d</code></a>
chore: fix typo</li>
<li>See full diff in <a
href="https://github.com/serde-rs/json/compare/v1.0.140...v1.0.141">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.140&new-version=1.0.141)](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-21 20:25:16 +00:00
dependabot[bot]
2d34a2b13c build(deps): bump async-process from 2.3.1 to 2.4.0 (#38203)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-process&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-21 20:24:19 +00:00
dependabot[bot]
50603e5074 build(deps): bump libredox from 0.1.4 to 0.1.6 (#38201)
Bumps libredox from 0.1.4 to 0.1.6.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libredox&package-manager=cargo&previous-version=0.1.4&new-version=0.1.6)](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-21 20:06:42 +00:00
Euclid Ye
b0a29393a9 WebDriver: Wait focus to complete when switching window (#38160)
Previously the webdriver do not wait for focus to complete, which can
cause some instability.

No matter interact as human or webdriver, the focus chain always goes
as: Embedder forwards -> Constellation (do some updates) -> Embedder (do
some updates).

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-21 04:18:21 +00:00
webbeef
7c96084298 Adjust CSP for top-level image documents (#38186)
Allows loading of document images even when they have a sandbox CSP rule
to align with other browsers.

Testing: No wpt failures:
https://github.com/webbeef/servo/actions/runs/16403138806
Fixes: #38180

Signed-off-by: webbeef <me@webbeef.org>
2025-07-20 21:07:47 +00:00
Tim van der Lippe
e24acc5fe5 Add warning for reporting CSP violations (#38181)
This should help debug cases like #38180

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-07-20 16:06:04 +00:00
Josh Matthews
b8a6600e9a compositing: Remove unused dependency. (#38179)
There are no uses of `net` within the `compositing` crate.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-20 16:05:31 +00:00
Tim van der Lippe
20386d9854 Forward CSP violations from load_whole_resource to parent event loop (#38048)
Any CSP violations happening when loading a worker should be reported
on the global of the document that creates the worker. Since workers
run in different threads, we can't pass in this parent global into
the worker global scope. Instead, we need to send a message to the
parent event loop to report it on the correct global.

Part of https://github.com/servo/servo/issues/4577
Fixes https://github.com/servo/servo/issues/37027

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-07-20 16:00:28 +00:00
Servo WPT Sync
772c84633e Sync WPT with upstream (20-07-2025) (#38178)
Automated downstream sync of changes from upstream as of 20-07-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-07-20 15:11:10 +00:00
Alex Touchet
7ab0d91109 Update rustc-hash and rustix (#38173)
Update rustc-hash and rustix.

Testing: No tests for dependency updates.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-18 22:43:20 +00:00
Kingsley Yung
0537c29064 devtools: Use request destination as cause_type in NetworkEventActor (#38162)
The cause_type in NetworkEventActor was derived from a hard-coded
pattern match on the request URL file extension.

This patch replaces the hard-coded pattern matching with the Destination
field of Request, to provide a better alignment with the Fetch
specification.

Testing: Updated unit tests.
Fixes: #38151

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-07-18 22:20:26 +00:00
dependabot[bot]
a52f9fd9a9 build(deps): bump webpki-roots from 1.0.1 to 1.0.2 (#38172)
Bumps [webpki-roots](https://github.com/rustls/webpki-roots) from 1.0.1
to 1.0.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rustls/webpki-roots/releases">webpki-roots's
releases</a>.</em></p>
<blockquote>
<h2>1.0.2</h2>
<ul>
<li>Add &quot;TrustAsia TLS ECC Root CA&quot; and &quot;TrustAsia TLS
RSA Root CA&quot; <a
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1972384">https://bugzilla.mozilla.org/show_bug.cgi?id=1972384</a></li>
<li>Add &quot;SwissSign RSA TLS Root CA 2022 - 1&quot; <a
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1845047">https://bugzilla.mozilla.org/show_bug.cgi?id=1845047</a></li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>Update dependencies by <a
href="https://github.com/djc"><code>@​djc</code></a> in <a
href="https://redirect.github.com/rustls/webpki-roots/pull/102">rustls/webpki-roots#102</a></li>
<li>1.0.2: track July 2025 CCADB changes by <a
href="https://github.com/ctz"><code>@​ctz</code></a> in <a
href="https://redirect.github.com/rustls/webpki-roots/pull/103">rustls/webpki-roots#103</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rustls/webpki-roots/compare/v/1.0.1...v/1.0.2">https://github.com/rustls/webpki-roots/compare/v/1.0.1...v/1.0.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="87222f0639"><code>87222f0</code></a>
1.0.2: track July 2025 CCADB changes</li>
<li><a
href="974587e439"><code>974587e</code></a>
Check MSRV in CI</li>
<li><a
href="3bd9fa51c5"><code>3bd9fa5</code></a>
Version Cargo.lock</li>
<li><a
href="769e56b014"><code>769e56b</code></a>
Replace rustls-pemfile with PemObject API</li>
<li><a
href="a6398002a2"><code>a639800</code></a>
Scope certificate generation input</li>
<li><a
href="3e19303eb0"><code>3e19303</code></a>
Upgrade to rcgen 0.14</li>
<li><a
href="f3ea6fec79"><code>f3ea6fe</code></a>
Move all dependencies into workspace</li>
<li><a
href="944d375fb3"><code>944d375</code></a>
Upgrade to webpki 0.103</li>
<li>See full diff in <a
href="https://github.com/rustls/webpki-roots/compare/v/1.0.1...v/1.0.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpki-roots&package-manager=cargo&previous-version=1.0.1&new-version=1.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-18 18:21:56 +00:00
dependabot[bot]
501bd98121 build(deps): bump clipboard-win from 5.4.0 to 5.4.1 (#38171)
Bumps [clipboard-win](https://github.com/DoumanAsh/clipboard-win) from
5.4.0 to 5.4.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DoumanAsh/clipboard-win/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clipboard-win&package-manager=cargo&previous-version=5.4.0&new-version=5.4.1)](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-18 18:01:55 +00:00
dependabot[bot]
8d9d2ee2c2 build(deps): bump sysinfo from 0.36.0 to 0.36.1 (#38170)
Bumps [sysinfo](https://github.com/GuillaumeGomez/sysinfo) from 0.36.0
to 0.36.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md">sysinfo's
changelog</a>.</em></p>
<blockquote>
<h1>0.36.1</h1>
<ul>
<li>Linux: Improve processor CPU usage computation.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fc31b411ee"><code>fc31b41</code></a>
Merge pull request <a
href="https://redirect.github.com/GuillaumeGomez/sysinfo/issues/1559">#1559</a>
from GuillaumeGomez/update</li>
<li><a
href="20d3d295f9"><code>20d3d29</code></a>
Update crate version to <code>0.36.1</code></li>
<li><a
href="400387ee1c"><code>400387e</code></a>
Update CHANGELOG for <code>0.36.1</code> version</li>
<li><a
href="d46ed5d18c"><code>d46ed5d</code></a>
Merge pull request <a
href="https://redirect.github.com/GuillaumeGomez/sysinfo/issues/1558">#1558</a>
from GuillaumeGomez/improve-processor-cpu-usage-comp...</li>
<li><a
href="44e64c54fb"><code>44e64c5</code></a>
Improve processors CPU usage computation on linux</li>
<li>See full diff in <a
href="https://github.com/GuillaumeGomez/sysinfo/compare/v0.36.0...v0.36.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sysinfo&package-manager=cargo&previous-version=0.36.0&new-version=0.36.1)](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-18 17:57:06 +00:00
dependabot[bot]
58fee976d9 build(deps): bump cc from 1.2.29 to 1.2.30 (#38169)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.29 to 1.2.30.
<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.30</h2>
<h3>Other</h3>
<ul>
<li>define _REENTRANT by default (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1496">#1496</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.29...cc-v1.2.30">1.2.30</a>
- 2025-07-18</h2>
<h3>Other</h3>
<ul>
<li>define _REENTRANT by default (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1496">#1496</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9df3cccb53"><code>9df3ccc</code></a>
chore: release v1.2.30 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1498">#1498</a>)</li>
<li><a
href="59854df166"><code>59854df</code></a>
Solarish-ish: define _REENTRANT by default (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1496">#1496</a>)</li>
<li><a
href="c3190115ac"><code>c319011</code></a>
Update rusqlite requirement from 0.36.0 to 0.37.0 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1494">#1494</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.29...cc-v1.2.30">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.29&new-version=1.2.30)](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-18 17:56:21 +00:00
Simon Wülker
329e8cfbb3 Implement allow_declarative_shadow_roots for async html parser (#38150)
This method was previously unimplemented, so attaching declarative
shadow roots was always allowed.

Testing: CI does not run with the async html parser. Try run:
https://github.com/simonwuelker/servo/actions/runs/16350173930/job/46196332473
Part of https://github.com/servo/servo/issues/37418

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-07-18 12:23:01 +00:00
Kenzie Raditya Tirtarahardja
b4b9e2c515 Webdriver: Forward ErrorStatus for take element screenshot (#38134)
Based on
[spec](tests/wpt/meta/webdriver/tests/classic/take_element_screenshot/screenshot.py.ini),
we should not expect the error to only be
`ErrorStatus::StaleElementReference`.

Testing:
`tests/wpt/meta/webdriver/tests/classic/take_element_screenshot/screenshot.py.ini`

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-18 06:42:51 +00:00
Kenzie Raditya Tirtarahardja
39144bb013 Webdriver: Allow error when selecting file at ElementSendKeys (#38158)
Based on [spec](https://w3c.github.io/webdriver/#element-send-keys),

> 5. Verify that each file given by the user exists. If any do not,
return [error](https://w3c.github.io/webdriver/#dfn-error) with [error
code](https://w3c.github.io/webdriver/#dfn-error-code) [invalid
argument](https://w3c.github.io/webdriver/#dfn-invalid-argument).

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-18 06:40:40 +00:00
Ashwin Naren
a91625a332 Proper compare implementation for IndexedDBKeyType (#38123)
This is needed by the IndexedDBKeyRange implementation.

Doesn't fix anything since it isn't used at the moment.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-18 06:26:47 +00:00
sagudev
a070f24450 canvas: Move current_default_path to script CanvasState (#38114)
This PR moves current path handling from canvas paint thread to script's
`CanvasState`. Because we used manual impl for arcto and some prechecks
for early fail before sending IPC we also needed to fix some bugs in
Path impl.

Testing: Existing WPT tests
work towards #38022
try run: https://github.com/sagudev/servo/actions/runs/16316090028

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-18 05:45:53 +00:00
Jo Steven Novaryo
bbed6cddcd css: Refactor StyleSheetInDocument owner (#38136)
Refactor `documentotshadowroot::StyleSheetInDocument`, renaming it into
`ServoStylesheetInDocument` to avoid confusion with Stylo's
`StylesheetInDocument` trait.

To support constructed stylesheet. The `ServoStylesheetInDocument.owner`
would contains enum of:
- `Dom<Element>` - for stylesheet parsed from an element.
- `Dom<CSSStylesheet>` - for constructed stylesheet.

Testing: No WPT regression.
Fixes: #38133

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-07-18 05:39:09 +00:00
Sebastian C
d671f58078 Add CookieStore pref and add baseline test expectations (#38154)
This adds a preference to control the Cookie Store feature. Also enables
the Cookie Store WPT tests with the preference and adds the expectations
as a baseline. These tests are expected to be failing because we have
not implemented the Cookie Store yet.

Testing: Enables new WPT tests.

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-07-18 02:21:34 +00:00
Alex Touchet
adb804772b Update tempfile (#38153)
Update tempfile.

Testing: No tests for dependency update.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-17 21:38:39 +00:00
batu_hoang
f0e10e63e2 webdriver: Implement send alert text (#38140)
Implement webdriver `SendAlertText` command

Tests:
https://github.com/longvatrong111/servo/actions/runs/16342669929
https://github.com/longvatrong111/servo/actions/runs/16342671477

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-17 21:24:50 +00:00
Jo Steven Novaryo
3ce95b2ba5 script: Impl safe from_jsval wrapper (#38149)
Implement `SafeFromJSValConvertible`, a safe wrapper for
`ToJSValConvertible`. And, replace unsafe `ToJSValConvertible` with
`SafeFromJSValConvertible` in `script/dom` to reduce the amount of
unsafe code in `script`.

This would support the implementation of `AdoptedStylesheet` where we
will need to have a setter/getter of sequence, that was implemented by
`any` types.

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

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-07-17 19:32:36 +00:00
dependabot[bot]
dcae2dd9fd build(deps): bump ab_glyph from 0.2.30 to 0.2.31 (#38148)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.30 to
0.2.31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/alexheretic/ab-glyph/releases">ab_glyph's
releases</a>.</em></p>
<blockquote>
<h2>ab-glyph-0.2.31</h2>
<ul>
<li>Add &quot;gvar-alloc&quot; feature enabled by default (activates
<em>ttf-parser</em> &quot;gvar-alloc&quot; feature).
Provides full gvar table support.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f963bcaf08"><code>f963bca</code></a>
Release ab_glyph 0.2.31</li>
<li><a
href="a216ede621"><code>a216ede</code></a>
Add &quot;gvar-alloc&quot; feature enabled by default (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/118">#118</a>)</li>
<li>See full diff in <a
href="https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.30...ab-glyph-0.2.31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ab_glyph&package-manager=cargo&previous-version=0.2.30&new-version=0.2.31)](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-17 18:01:02 +00:00
dependabot[bot]
c50282e390 build(deps): bump zbus_macros from 5.8.0 to 5.9.0 (#38147)
Bumps [zbus_macros](https://github.com/dbus2/zbus) from 5.8.0 to 5.9.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dbus2/zbus/releases">zbus_macros's
releases</a>.</em></p>
<blockquote>
<h2>🔖 zbus_macros 3.14.0.</h2>
<p> Allow unicast signals through the <code>dbus_interface</code>.
Fixes <a
href="https://redirect.github.com/dbus2/zbus/issues/374">#374</a>.
⬆️ Bump our MSRV. More and more dependencies are requiring Rust 1.64.0,
so let's bump our MSRV
to match.
🔥 Drop manual <code>Default</code> impl of
<code>PropertyEmitsChangedSignal</code>. After Rust 1.64, we can use the
derive for this.
️ Revert locking of <code>winnow</code> version. We've bumped our MSRV
so there is no need for this
workaround anymore.
🎨 Code comments should also adhere to 100 character limit.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="30487b8fdb"><code>30487b8</code></a>
Merge pull request <a
href="https://redirect.github.com/dbus2/zbus/issues/1434">#1434</a> from
zeenix/zb-release</li>
<li><a
href="4b7928d2f8"><code>4b7928d</code></a>
🔖 zb,zm: Release 5.9.0</li>
<li><a
href="d570c947ea"><code>d570c94</code></a>
📝 CONTRIBUTING: Link to gimoji's web interface</li>
<li><a
href="0bf6e14b54"><code>0bf6e14</code></a>
Merge pull request <a
href="https://redirect.github.com/dbus2/zbus/issues/1431">#1431</a> from
zeenix/name-request-defaults</li>
<li><a
href="ba2a40752d"><code>ba2a407</code></a>
🧵 zb: Remove deadlocks in Connection name request tasks</li>
<li><a
href="3d35496021"><code>3d35496</code></a>
🐛 zb: Allow name replacement by default</li>
<li><a
href="0ad37f317a"><code>0ad37f3</code></a>
📝 zb: Remove a bunch of unnecessary links</li>
<li><a
href="493a9943d6"><code>493a994</code></a>
Merge pull request <a
href="https://redirect.github.com/dbus2/zbus/issues/1429">#1429</a> from
valpackett/val/knrmmkqzrvyp</li>
<li><a
href="f2fb16fd18"><code>f2fb16f</code></a>
🧑‍💻 zb: add fdo::dbus::StartServiceReply type</li>
<li><a
href="f93584de1f"><code>f93584d</code></a>
⬆️ micro: Update winnow to v0.7.12 (<a
href="https://redirect.github.com/dbus2/zbus/issues/1428">#1428</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/dbus2/zbus/compare/zbus-5.8.0...zbus-5.9.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zbus_macros&package-manager=cargo&previous-version=5.8.0&new-version=5.9.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-17 17:54:24 +00:00
Euclid Ye
5911cd891f servoshell: Fix scroll speed for Desktop (#37982)
According to discussion
https://github.com/servo/servo/pull/34063#discussion_r2187147615, this
PR
1. adds `PIXEL_DELTA_FACTOR` to increase scroll speed for
`MouseScrollDelta::PixelDelta`, which is used by macOS and
high-precision mouse.
2. adds `LINE_WIDTH` to increase x-axis scroll speed for
`MouseScrollDelta::LineDelta`, which is used by Linux and Windows.
3. Increase mouse scroll speed in general to match other browsers
4. Reduce keyboard scroll offset to scroll exactly "one line", to match
other browsers.

Testing: Example in #35037 can now scroll in x-axis as fast as y-axis,
similar to other browsers.
Fixes: part of #38072.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-17 17:43:30 +00:00
dependabot[bot]
d5907a8d66 build(deps): bump zbus from 5.8.0 to 5.9.0 (#38144)
Bumps [zbus](https://github.com/dbus2/zbus) from 5.8.0 to 5.9.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dbus2/zbus/releases">zbus's
releases</a>.</em></p>
<blockquote>
<h2>🔖 zbus 5.9.0</h2>
<ul>
<li>🧵 Remove deadlocks in Connection name request tasks, resulting in
leaks under certain
circumstances.</li>
<li>🐛 When registering names, allow name replacement by default.</li>
<li> Allow setting request name flags in
<code>connection::Builder</code>.</li>
<li> Proper Default impl for <code>RequestNameFlags</code>. This change
is theoretically an API break for
users who assumed the default value to be empty.</li>
<li>🧑💻 Add <code>fdo::StartServiceReply</code> type. In 6.0 this will be
the return type of
<code>fdo::DBusProxy::start_service_by_name</code>. For now, just
provide a <code>TryFrom&lt;u32&gt;</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="30487b8fdb"><code>30487b8</code></a>
Merge pull request <a
href="https://redirect.github.com/dbus2/zbus/issues/1434">#1434</a> from
zeenix/zb-release</li>
<li><a
href="4b7928d2f8"><code>4b7928d</code></a>
🔖 zb,zm: Release 5.9.0</li>
<li><a
href="d570c947ea"><code>d570c94</code></a>
📝 CONTRIBUTING: Link to gimoji's web interface</li>
<li><a
href="0bf6e14b54"><code>0bf6e14</code></a>
Merge pull request <a
href="https://redirect.github.com/dbus2/zbus/issues/1431">#1431</a> from
zeenix/name-request-defaults</li>
<li><a
href="ba2a40752d"><code>ba2a407</code></a>
🧵 zb: Remove deadlocks in Connection name request tasks</li>
<li><a
href="3d35496021"><code>3d35496</code></a>
🐛 zb: Allow name replacement by default</li>
<li><a
href="0ad37f317a"><code>0ad37f3</code></a>
📝 zb: Remove a bunch of unnecessary links</li>
<li><a
href="493a9943d6"><code>493a994</code></a>
Merge pull request <a
href="https://redirect.github.com/dbus2/zbus/issues/1429">#1429</a> from
valpackett/val/knrmmkqzrvyp</li>
<li><a
href="f2fb16fd18"><code>f2fb16f</code></a>
🧑‍💻 zb: add fdo::dbus::StartServiceReply type</li>
<li><a
href="f93584de1f"><code>f93584d</code></a>
⬆️ micro: Update winnow to v0.7.12 (<a
href="https://redirect.github.com/dbus2/zbus/issues/1428">#1428</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/dbus2/zbus/compare/zbus-5.8.0...zbus-5.9.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=zbus&package-manager=cargo&previous-version=5.8.0&new-version=5.9.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-17 17:30:45 +00:00
Euclid Ye
f81ae1f57f webdriver chore: check browsing context existence before handling user prompt when required (#38142)
Thanks to Trong with #38035, we can finally handle user prompt. This PR
is mainly dirty work:
1. Add browsing context check before handling user prompt when required,
according to spec.
2. Reduce IPC by removing redundant context existence check.
3. Add many missing docs.

Testing: New passing cases and turn some ERROR into FAIL.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-17 17:07:05 +00:00
Simon Wülker
9a5a33190d Remove Document::set_allow_declarative_shadow_roots (#38143)
This method is unused. `rustc` didn't complain because it was marked as
`pub` (which it shouldn't have been). A few of the surrounding methods
were also `pub`, which this change fixes.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-07-17 16:43:56 +00:00
Euclid Ye
fe2c13c777 doc: Add doc for compositor/webview/embedder related to window/rect/inner_size/rendering_context (#38110)
Add docs before actually fixing #38089, #38090, #37978, #38093.

Testing: Just adding docs.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-17 13:40:28 +00:00
batu_hoang
345733a5c5 webdriver: Add handle any user prompts step for all commands (#38035)
- Add `handler any user prompt` step for all commands.
- Enable webdriver tests which were blocked by `handle any user prompt`
step.

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-07-17 09:47:47 +00:00
Tim van der Lippe
18d1a62add Inherit CSP for blob workers (#38033)
Workers created from Blobs inherit their CSP. Now we inherit the CSP and
set the correct base API url. The base API url should be used when
determining the
report-uri endpoint. Otherwise, the blob URL would be used as a base,
which is invalid and the report wouldn't be sent.

Also create a helper method to concatenate two optionals of CSPList,
which was used in several places.

Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-07-17 08:14:20 +00:00
Kenzie Raditya Tirtarahardja
439cb00e31 WebDriver: Set current browsing context for NavigateTo and Refresh command (#38107)
Previously we didn't change the current browsing context id in our
WebDriver Session after the commands `Navigate To` and `Refresh`

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-17 07:57:31 +00:00
Jerens Lensun
1c4797809a Mach: add type check on python tidy folder (#38043)
Introduce `python/tidy` folder in pyrefly type checker

Testing: Manual testing via `./mach test-tidy` command

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-07-17 07:35:11 +00:00
Jerens Lensun
2ad250de26 remove test-wpt-android from mach command (#38135)
This command is no longer work as we arleady remove
`in_android_emulator` in this PR
[37958](https://github.com/servo/servo/pull/37958) cause of
`setup_configuration_for_android_target` is no longer exist in
`python/servo` codebase

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-17 07:31:39 +00:00
Kenzie Raditya Tirtarahardja
5e8b3cc5eb CI: Run webdriver tests using one process and 2 chunks (#38052)
- Make the test more stable with setting one process only for each
chunk, while still running it concurrently with different machine for
each chunk.
- Previously, there is an issue where the log files is too big to be
uploaded to intermittent tracker. Now the log file should be smaller
even if we have many errors, since we have multiple chunk.

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-17 06:01:48 +00:00
Abdelrahman Hossam
c76c44d0fb script: Ensure that keyboard modifiers, screen point, and client point are set in WheelEvents (#37947)
- Updating the WheelEvent initialization to correctly handle keyboard
modifiers when the wheel event is triggered. The changes ensure that the
modifiers (Ctrl, Alt, Shift, Meta) are properly set based on the current
state of the keyboard when the wheel event is created. This is
particularly important for scenarios where the wheel event is influenced
by key presses, such as scrolling with the Ctrl key pressed to zoom in
or out.

- Updating the `screen_point` and `client_point` as it was always 0,0
before. Now, it shows the correct position of the mouse pointer while
triggering the wheel event.

Test: Manual Test case and existing WPT tests
(classic/perform_actions/wheel.py[test_scroll_with_key_pressed])
Fixes: #37827

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
2025-07-17 05:32:03 +00:00
Ashwin Naren
f70a4eb4ff Move common indexeddb methods out of dom implementations (#38101)
A lot of shared functions were scattered around the dom files; I moved
them into `indexed_db.rs` for clarity.

Fixes: Nothing to my knowledge, just a cleanup

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-17 04:19:03 +00:00
Ashwin Naren
e10466b4c4 net: Do not print SVG tree in Debug implementation of VectorImageData (#37846)
Manually implement Debug LoadResult so that VectorImageData doesn't get
logged.

Testing: N/A
Fixes: #37771

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-17 04:15:23 +00:00
sagudev
86ea2641f8 servoshell: Update egui to 0.32 (#38119)
We also need to bump egui-file-dialog and accesskit_winit. Changes are
done based on migration paths provided by egui.

Testing: No tests for servoshell
Fixes: #38117

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-16 19:42:16 +00:00
sagudev
9b63854cd0 CI: remove i686-linux-android (#38118)
As discussed in [#general > Help solving android bindgen failure @
💬](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Help.20solving.20android.20bindgen.20failure/near/529091066)

Testing: Not needed, becuase we just remove from CI
Will help with #37077.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-16 17:07:24 +00:00
sagudev
b799f27817 canvas: Use stored transform instead of querying canvas paint thread (#38097)
We already store transform in context state, so let's just use this when
querying instead of using IPC to ask canvas paint thread.

Testing: Existing WPT tests
work towards #38022

try run: https://github.com/sagudev/servo/actions/runs/16299182583

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-16 14:59:10 +00:00
Gregory Terzian
b821377771 script: further use of safe to jsval (#38099)
Remove size bound from safe to jsval trait, apply to script/dom, with
the exception of windowproxy.

Second part of https://github.com/servo/servo/issues/37951

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

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

Testing: *Describe how this pull request is tested or why it doesn't
require tests*
Fixes: *Link to an issue this pull requests fixes or remove this line if
there is no issue*
2025-07-16 14:46:10 +00:00
Euclid Ye
72a9f36c43 webdriver: Reduce IPC for viewport boundary check (#38113)
Testing: No behaviour change.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-16 10:06:49 +00:00
Kenzie Raditya Tirtarahardja
7dae7f9983 WebDriver: Implement some missing steps of wait for navigation to complete (#38079)
Based on
https://w3c.github.io/webdriver/#dfn-wait-for-navigation-to-complete. We
still have not implement the timer parameter, but I think it makes sense
to implement Step 8.4 of `Navigation To` first.

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-16 09:19:57 +00:00
Alex Touchet
8f9d484693 Update non-breaking dependencies (#38108)
Update non-breaking dependencies.

Testing: No tests for dependency updates.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-16 07:51:37 +00:00
sagudev
429b91da49 canvas: Store current path only in user space (#38098)
Before we stored path in user or device space and do conversions as
needed, but that complicated things.

So we got two options:
1. store path in device space: here we would need to add
`Option<Transform>` to each path command, and before each usage we need
to invert current transform (as current transform is already applied by
stroke/fill and we cannot just pass I, because we need scaling to make
lines thicker)
2. store path in user space and do transform whenever we change the
transform. There is no need to do inverse on uses.

I chose option 2. because it's less complicated and will probably
benefit performance (set transform typically called more rarely than
path building/fill/stroke).

In follow up PR I will move all of this to script, that's why
PathBuilderRef was not removed yet.

Testing: Existing WPT tests
work towards #38022
try run: https://github.com/sagudev/servo/actions/runs/16304221495

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-16 07:30:20 +00:00
Abdelrahman Hossam
2ea95c8813 servoshell: Send all button events to the WebView regardless of what button is pressed (#38053)
Sending all mouse button events (Left, Right, Middle, Back, Forward) to
the constellation for processing. Before, only left and right mouse
buttons were handled.

Testing: There is no new test for this. Manually testing was done. We
currently
do not have a good way to test user interaction in servoshell.
Fixes: #37996

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
2025-07-16 06:53:55 +00:00
Alex Touchet
cbdf72b4eb Update wasm-bindgen and associated dependencies (#38103)
Update wasm-bindgen and associated dependencies.

Testing: No tests for dependency updates.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-16 02:11:36 +00:00
Ashwin Naren
71e7019d45 [IndexedDB] Adhere better to the specification for idb object store related operations (#37682)
Many object store related operations require the transaction to be
checked: to ensure it is still active, and, if the operation is a write,
that the transaction is not read-only. I've added the
`check_transaction` method to perform these checks.

Additionally `Clear` was still half-implemented, so I went ahead and
implemented that.

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-16 02:11:06 +00:00
Euclid Ye
2e3c280f46 webdriver: improve perform pointermove & wheel actions with more accurate coordinates (#38095)
1. Create `get_origin_relative_coordinates` according to
[spec](https://w3c.github.io/webdriver/#dfn-get-coordinates-relative-to-an-origin)
to be reused
2. Add previously missing offset for PointerOrigin::Element
3. Refactor code for perform pointermove/wheel to be closer to spec.
4. Handle some issues with spec:
https://github.com/w3c/webdriver/issues/1758

Testing: Several new passing cases as we are more precise with
coordinates now.
Fixes: Part of #38042.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-16 02:03:34 +00:00
Josh Matthews
189e649222 indexeddb: Allow deleting unknown DBs. (#38076)
The current behaviour is too strict according to the spec and is the
cause of many intermittent test errors.

Testing: Existing coverage is sufficient.
Fixes: #37706

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-16 01:22:18 +00:00
webbeef
30b6e289e0 Refactor constellation broadcast channel (#38077)
- Move the 2 hash maps used to manage channels in their own struct.
- The constellation is still in charge of origin checks since it holds
the pipeline information required.
- BroadcastMsg is renamed to BroadcastChannelMsg for consistency.


Testing: covered by existing tests.
Fixes: #38060

Signed-off-by: webbeef <me@webbeef.org>
2025-07-15 13:57:05 +00:00
Shubham Gupta
34829dfce7 renderer: Have the viewport meta element establish the initial zoom of new pages (#37315)
This patch contains 2 components: 

1. Instead of passing `self.pinch_zoom_level().get()` while checking
`zoom_result`, initialize it in `combined_magnification`. Ideally, this
part shouldn't have any effect on behavior.

2. Separates the logic for PinchZoom and ViewportZoom. So, when a new
page is opened, it will start with its own viewport zoom scale (rather
than the previous scale multiples).
i.e `self.pinch_zoom_level().get() * 1.0 * magnification`
```rust
        let mut combined_magnification = 1.0;
        ... 
                ScrollZoomEvent::ViewportZoom(magnification) => {
                    combined_magnification *= magnification
                },
        ...        
        let pinch_zoom_result = match self.set_pinch_zoom_level(self.pinch_zoom_level().get() * combined_magnification)
``` 





Testing: This change adds a new WPT test.
Fixes: #37314

---------

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-07-15 13:54:05 +00:00
Euclid Ye
547ce67514 servoshell: reduce duplication for conversion between physical/logical position/size (#38082)
With helper functions introduced in #38020, this is now becoming
reality.

Testing: No behaviour change.
Fixes: #37937

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-15 11:27:11 +00:00
batu_hoang
8e2d2bde6f Webdriver GoBack and GoForward commands wait for navigation complete (#37950)
After sending `GoBack` or `GoForward` command, webdriver wait for the
navigation complete.
It can be achieved by waiting for
`WebViewDelegate::notify_history_changed`

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

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-07-15 10:41:50 +00:00
Andrei Volykhin
c817d7b9ce canvas: Add initial support of ImageBitmapRenderingContext (#37998)
Add support of the ImageBitmapRenderingContext as "bitmaprenderer"
canvas context mode to RenderingContext/OffscreenRenderingContext
https://html.spec.whatwg.org/multipage/#imagebitmaprenderingcontext

It is initial implementation with public interface API but without
any display presentation support for HTMLCanvasElement.

Testing: Improvements in the following tests:
-
html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html
- html/canvas/offscreen/manual/text/canvas.2d.offscreen*
-
html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.nocrash.html
- imagebitmap-renderingcontext/*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-15 08:03:49 +00:00
Kenzie Raditya Tirtarahardja
ccc902eb7a Chore: Merge all moved webdriver command msg in constellation (#38081)
Small clean up to shortened the code length and making it more neat.

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-07-15 06:52:35 +00:00
batu_hoang
f155c95e1b webdriver: Element click waits for navigation complete (#37935)
Step 11 in https://w3c.github.io/webdriver/#dfn-element-click

> [Try](https://w3c.github.io/webdriver/#dfn-try) to [wait for
navigation to
complete](https://w3c.github.io/webdriver/#dfn-wait-for-navigation-to-complete)
with session.

This fixes issue in which element_click triggers navigation, but
incoming commands still interact with old page.

Testing:
https://github.com/longvatrong111/servo/actions/runs/16175767947
https://github.com/longvatrong111/servo/actions/runs/16175770044

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-15 06:51:05 +00:00
Usman Yahaya Baba
ff02fdad6d Send early DevToolsHttpRequest and relocate response reporting to main_fetch (#37906)
This change refactors how we notify DevTools about network activity so
that all fetches (even those served from cache) appear correctly in the
Network panel, and so that DevTools sees request metadata as soon as
possible rather than waiting until the end of a full HTTP cycle.
- Before, we only send DevTools events inside http_network_fetch, so
cached responses (which skip that path) never show up. By emitting a
minimal HttpRequest event at the very start of main_fetch (with URL,
method, pipeline and browsing IDs), we guarantee every fetch shows up
immediately.
- Then, by moving HttpResponse notifications out of http_network_fetch
into main_fetch (right after process_response and process_response_eof),
we ensure DevTools gets status, header, and completion events for both
network and cache hits. Leveraging nullable fields in NetworkEventActor
lets us incrementally fill in timing, header, and body data later,
improving DevTools’ visibility.
Testing: Ran servo with `--devtools=6080` flag, cached responses now
appear in the network panel
Fixes: https://github.com/servo/servo/issues/37869

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-07-15 05:41:11 +00:00
Josh Matthews
0e3165da01 tests: Force a blank config directory for each WPT test run. (#38078)
This ensures a consistent state when running tests that can otherwise
leave artifacts around (eg. localStorage/IndexedDB/cookies).

Testing: Existing test coverage is sufficient.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-15 05:38:38 +00:00
batu_hoang
aa098ba2a3 webdriver: Allow script thread to fail to send response for ExecuteScript (#38054)
When script thread executes script sent from webdriver, if an alert
appears, webdriver can stop waiting for the script response and process
the next command.

This PR allows script thread to fail to send response for
`ExecuteScript` if the channel is closed.

cc: @xiaochengh

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
2025-07-15 04:14:03 +00:00
Alex Touchet
1cd249dfe9 Update jobserver (#38074)
Update jobserver.

Testing: No tests for dependency update.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-15 02:18:41 +00:00
Josh Matthews
312985faff IndexedDB: communicate transaction errors and async response data more precisely (#38027)
Digging into several crashing tests revealed that committing
transactions is a fallible operation. Propagating those errors led to
exposing many new errors caused by the IDBRequest implementation
assuming that all successful responses contained a structured clone. The
end result is a bunch of new test failures that were previously hidden.

Testing: Existing test coverage is sufficient.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-15 02:04:28 +00:00
Gregory Terzian
027954dbad script: introduce safe wrappers for js val conversions (#38004)
Introduce a safe wrapper trait for the unsafe `ToJSValConvertible`, and
use it in `script/dom` where the default `T` implementation works.

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

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-07-15 01:57:15 +00:00
Josh Matthews
9e2ee0029a script: Reduce usage of Trusted in Node::insert. (#37762)
These changes introduce a new kind of task that uses a variation of the
`task!` syntax. Existing `task!` usages create task structs that have a
`Send` bound, which requires the use of `Trusted<T>` to reference a DOM
object T inside of the task closure. The new syntax replaces the `Send`
bound with a `JSTraceable` bound, which requires explicit capture
clauses with types. This looks like:
```rust
task!(ScriptPrepare: {script: DomRoot<HTMLScriptElement>} |script| {
    script.prepare(CanGc::note());
}),
```

The capture clauses must list every value that will be referenced from
the closure's environment—these values are moved into fields in the
generated task structure, which allows them to be traced by the GC as
part of a generated JSTraceable implementation. Since the closure itself
is not a `move` closure, any attempts to reference values not explicitly
captured will generate a borrow checker error since the closure requires
the `'static` lifetime.

Testing: Existing WPT tests exercise these code paths. I also attempted
to write incorrect tasks that capture references or use values not
explicitly captured, and the compiler correctly errors out.
Fixes: part of #35517

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-07-15 01:11:12 +00:00
Alex Touchet
f5b0165e54 Update core-foundation (#38073)
Update core-foundation.

Testing: No tests for dependency update.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-15 00:15:01 +00:00
Euclid Ye
8877adccf2 script: Improve webdriver_handler::get_element_in_view_center_point (#38058)
1. Some rounding was wrongly used which can be a source of inaccuracy. 
2. Use `window.InnerWidth` instead of `body.ClientWidth` according to
spec.

Testing: Many new passing cases.
Fixes: Part of #38042.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-07-15 00:14:17 +00:00
Sebastian C
f13311a00e Refactor and document cookie-list retrieval (#38070)
This refactors some of the cookie retrieval mechanism to be less
repetitive and separates the cookie-list from the cookie-string which
will also be needed for Cookie Store.

Testing: No new behavior, should be covered by existing WPT tests.

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-07-14 22:15:27 +00:00
dependabot[bot]
6ea7638c21 build(deps): bump memmap2 from 0.9.5 to 0.9.7 (#38071)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=memmap2&package-manager=cargo&previous-version=0.9.5&new-version=0.9.7)](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-14 20:28:40 +00:00
dependabot[bot]
18699bedf5 build(deps): bump rgb from 0.8.51 to 0.8.52 (#38068)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rgb&package-manager=cargo&previous-version=0.8.51&new-version=0.8.52)](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-14 20:11:52 +00:00
dependabot[bot]
949236c559 build(deps): bump hermit-abi from 0.5.0 to 0.5.2 (#38065)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hermit-abi&package-manager=cargo&previous-version=0.5.0&new-version=0.5.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 20:10:13 +00:00
dependabot[bot]
449556d421 build(deps): bump async-compression from 0.4.25 to 0.4.27 (#38067)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-compression&package-manager=cargo&previous-version=0.4.25&new-version=0.4.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 20:07:57 +00:00
Ashwin Naren
ac2cfdb801 script: Use Pythonic file names for code generation and use functools.cache (#38047)
Renames the files to pythonic file names. Also replaces the bespoke
caching function with the functools caching function which is
functionally equivalent.

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-07-14 19:38:55 +00:00
dependabot[bot]
8a19bc9145 build(deps): bump crc32fast from 1.4.2 to 1.5.0 (#38064)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crc32fast&package-manager=cargo&previous-version=1.4.2&new-version=1.5.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-14 19:03:52 +00:00
webbeef
677184a0e6 BroadcastChannel: cleanup routers when closing tabs (#38046)
BroadcastChannel uses 2 hash maps in the constellation and they were not
kept properly in sync. Also fixed a logic error where
`Option<HashMap<...>>` was not considered empty when being `None`.

Testing: These warnings should not happen anymore:
[2025-07-14T03:54:22Z WARN constellation::constellation] No sender for
broadcast router: (4,1)

[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including ImageBitmap
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including MessagePort
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including
OffscreenCanvas (should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including ReadableStream
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including WritableStream
(should never happen).
[2025-07-14T03:33:59Z WARN constellation_traits::structured_data]
Attempt to broadcast structured serialized data including
TransformStream (should never happen).

Signed-off-by: webbeef <me@webbeef.org>
2025-07-14 15:43:45 +00:00
Martin Robinson
5bc3c3088a compositor: Do not wait for animation termination to take screenshots (#38055)
WPT tests are expected to create screenshots as soon as everything is
loaded. If an animation is happening adding the "reftest-wait" class to
the root element is appropriate way to delay the screenshot. Previously,
the
test harness was waiting for all animations to finish, but that is just
leading to many timeouts. Removing that code fixes the timeouts.

Two Servo-specific tests are also updated as they were written with
Servo's previous behavior in mind.

Testing: There are test result updates for this change. Many TIMEOUTS
now either correctly
PASS OR FAIL.
Fixes: #36931.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-14 12:18:18 +00:00
JoeDow
f6b98d5c56 layout: dirty parent node with NodeDamage::ContentOrHeritage when text content changed (#38057)
This change aims to reduce the scope of incremental box tree
construction. Previously, when text content changed, the parent node
would always be marked as requiring box tree reconstruction; now, it is
adjusted to only mark the parent node as needing to recollect its box
tree children.

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-14 11:21:45 +00:00
Andrei Volykhin
bf0e3f84d0 imagebitmap: Remove ImageBitmap from experimental web platform features (#38050)
Enable by default the DOM "ImageBitmap" interface previously gated
behind
"dom.imagebitmap.enabled" preference as experimental web platform
feature.

https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#imagebitmap

NOTE: Non blocking non supported functionality:
- vector HTMImageElement, bitmap/vector SVGImageElement
- EXIF image orientation

Testing: Covered by existing WPT tests

Fixes: #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-14 10:20:02 +00:00
Euclid Ye
54a02d5a34 Chore: Fix warnings for openxr (#38045)
These warnings have been there for quite a while and annoying.

```
   Compiling webxr v0.0.1 (D:\servo\components\webxr)
warning: variable does not need to be mutable
   --> components\webxr\openxr\mod.rs:557:17
    |
557 |             let mut context = contexts
    |                 ----^^^^^^^
    |                 |
    |                 help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: field `profile_type` is never read
  --> components\webxr\openxr\interaction_profiles.rs:50:9
   |
49 | pub struct InteractionProfile<'a> {
   |            ------------------ field in this struct
50 |     pub profile_type: InteractionProfileType,
   |         ^^^^^^^^^^^^
   |
   = note: `InteractionProfile` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default
```

Testing: No behaviour change.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-14 06:01:37 +00:00
Michael Mc Donnell
c2df8a1bf5 Add Linux .desktop file (#38038)
I'm trying to use Servo as a daily driver. I like to pin the most often
used apps to the my taskbar (Dash to Panel in Gnome). I also launch apps
from the menu (Arc Menu). Adding a .desktop file make it show up in the
menu. I could not get pinning to work until I set the name with `winit`.
This is because the name is used to match it with the icon. I used the
Gnome Looking Glass (lg) command to determine that the name was not set.

Testing: I followed the instructions that I put in the .desktop file. I
copied the .desktop file to the right folder, set up a link to the svg
icon, and adjusted the paths to point to the compiled executable.

---------

Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
2025-07-13 23:07:12 +00:00
Alex Touchet
cd1fdbbeeb Update h2 and hyper (#38039)
Update h2 and hyper.

Testing: No tests for dependency updates.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-13 19:58:25 +00:00
Alex Touchet
833484ca11 Update ahash and ppv-lite86 (#38037)
Update ahash and ppv-lite86.

Testing: No tests for dependency updates.

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-07-13 18:27:28 +00:00
leo030303
93e5b672a7 layout: Fix bug where whitespace didn't have line decorations (#38007)
This PR fixes the issue where underlines weren't appearing on
whitespaces. This was due to whitespace being ignored in the `glyphs`
function of `components/layout/display_list/mod.rs` when the fragment
didn't have a selection. I added in a check to include the whitespace if
there's a selection or if there are any line decorations. I also renamed
the field from `ignore_whitespace` to `include_whitespace` to make it a
bit clearer since it was being reversed everywhere it was used anyway.

**Before:**
<img width="1235" height="169" alt="image"
src="https://github.com/user-attachments/assets/51d47781-355f-4915-8100-f3a7db81027f"
/>

**After:**
<img width="1235" height="169" alt="image"
src="https://github.com/user-attachments/assets/9b44fe77-d600-4080-9f3a-2c9b33924f51"
/>


Testing: `/css/css-text/white-space/pre-wrap-018.html` is now passing.
Also verified manually by running
`data:text/html;base64,PGRpdiBzdHlsZT0idGV4dC1kZWNvcmF0aW9uOiB1bmRlcmxpbmU7Ij5IZWxsbyBXb3JsZCE8L2Rpdj4=
`
Fixes: https://github.com/servo/servo/issues/33463

---------

Signed-off-by: Leo Ring <leoring03@gmail.com>
Signed-off-by: leo030303 <59373587+leo030303@users.noreply.github.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-13 13:34:51 +00:00
Euclid Ye
35a145613e mach (Windows): make vswhere.exe work properly (#38028)
Previously, the args passed to `vswhere.exe` was wrong. There is no
generic component ID called
`Microsoft.VisualStudio.Component.Windows10SDK`, but always something
like `Microsoft.VisualStudio.Component.Windows10SDK.19041` /
`Microsoft.VisualStudio.Component.Windows11SDK.22621`.
That's why users always had to manually setup environment variable
`VSINSTALLDIR`, `VisualStudioVersion`.

This QoL PR also makes `mach` compatible with Windows 11 SDK, and update
README.md to be consistent with https://github.com/servo/book/pull/92.

Testing: Tested locally and working fine after removing environment
variables.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-13 12:23:55 +00:00
Alex Touchet
cd91517a27 Update polling and de-dupe hermit-abi (#38013)
Update polling and de-dupe hermit-abi.

Testing: No tests for dependency update.

---------

Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-07-13 08:31:50 +00:00
Jonathan Schwender
f7e49c788f Re-enable HOS-CI (#38019)
The self-hosted runners should be up and running again, so we can
re-enable.

Testing: If CI passes, it shows that the runners are there again.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-13 07:58:58 +00:00
Servo WPT Sync
973465a9b6 Sync WPT with upstream (13-07-2025) (#38026)
Automated downstream sync of changes from upstream as of 13-07-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-07-13 02:09:35 +00:00
Euclid Ye
d38ffb82b2 script: Get the screen metrics from the WebViewDelegate instead of via the compositor (#38020)
Similar to #37960, previously, `AvailHeight`, `AvailWidth`, `Height`,
`Width` ask compositor for screen metrics. This PR moves the request to
embedder.

This simplifies code, and reduces workload of compositor, which is
busier most of time.

Testing: No behaviour change. Updated some tests. `Width/Height` matches
other browsers.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-12 16:07:39 +00:00
Josh Matthews
d0a93a8b02 script: Minimize layout queries for window scroll offsets. (#38018)
These changes reduce the number of times we need to query layout for the
same information when creating mouse/pointer events.

Testing: No new tests required for maintaining existing behaviour.

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

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

---------

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

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

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

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

Part of #4577

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

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

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

Testing: Existing WPT tests
Fixes: #37904

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

---------

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

Testing: No testing for Dependabot file.

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

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

---------

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

Testing: Just expectation fix.

---------

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

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

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

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

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

---------

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=winnow&package-manager=cargo&previous-version=0.7.11&new-version=0.7.12)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=h2&package-manager=cargo&previous-version=0.3.26&new-version=0.3.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-lc-rs&package-manager=cargo&previous-version=1.13.1&new-version=1.13.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-07-11 16:06:40 +00:00
Mukilan Thiyagarajan
f7c7db3f71 ci: revert to non-relative import in export script (#38003)
Fixes #37999.
Testing: This has been tested on [my
fork](https://github.com/mukilan/servo/actions/runs/16224926807/job/45814509714?pr=5).

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-07-11 16:46:22 +00:00
Oriol Brufau
b7133478e1 layout: Unify layout logic for replaced and non-replaced grid items (#37985)
Laying out a grid item will now use the same logic regardless of whether
it's replaced or not.
This reduces the amount of code, and should have no observable effect
(but hard to say since and I don't understand Taffy).

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

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

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

---------

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

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

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


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

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

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

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

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

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

Part of #4577

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

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

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

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

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

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

This is also needed for vello backend.

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

---------

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

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

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

---------

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

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

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

Testing: Covered by WPT tests
Fixes: #37746

---------

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

Testing: A test is now passing.

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.5.40&new-version=4.5.41)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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

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

---------

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=xml-rs&package-manager=cargo&previous-version=0.8.26&new-version=0.8.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls&package-manager=cargo&previous-version=0.23.28&new-version=0.23.29)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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

Testing: No behaviour change.

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

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

---------

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

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

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

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

cc @xiaochengh

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Part of #37238

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

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

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

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

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

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

This is the first step toward incremental fragment tree layout.

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

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

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

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

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

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

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

Testing: No WPT regression.

---------

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

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

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

Testing: Unneeded (no behavior change)

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

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

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

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

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

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

Now Servo can run texture_2d_array and texture_3d samples!

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

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

And it can now run three.js too!

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

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-07-09 14:22:03 +00:00
batu_hoang
4499fdeb2b webdriver: Evaluate script commands via the WebView API in servoshell (#37663)
Let `WebDriverCommandMsg::ScriptCommand` goes through embedder first.
Give `embedder` the ability to release `webdriver` from waiting for a
response of `ExecuteScript`.

Tests: https://github.com/longvatrong111/servo/actions/runs/16071375821
No regression compared to CI run on main branch.

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

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-09 14:05:39 +00:00
minghuaw
562d9e4a21 Update webidl files for TextEncoder and TextDecoder (#37952)
This PR updates the webidl files for `TextEncoder` and `TextDecoder`.
For `TextDecoder.webidl`, the type `AllowSharedBufferSource`, as defined
in the latest spec, is replaced with `BufferSource` as servo currently
does not support `ShareArrayBuffer`

Testing: This update does not introduce any change to the generated rust
binding, so the existing testing would suffice

---------

Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
2025-07-09 12:42:36 +00:00
Narfinger
4cddd5fd5e OHOS: Make IME more robust against errors (#37959)
OHOS: Allow ime to be more robust against errors. For example, when a
system popup is in front, no keyboard can be displayed, hence, erroring
out. Before we panicked, now we just log the error and continue.

This should hopefully fix some of the recent ohos ci errors.

Testing: Tested on a certain CI device that shows a popup.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-09 12:24:45 +00:00
Andrei Volykhin
a5b02047f9 script: Allow to throw a custom exception on structured cloning (#37948)
The structured cloning with transfer list
https://html.spec.whatwg.org/multipage/#structuredserializewithtransfer
throws a "DataCloneError" DOM expection by default if
serialization/transferral
is not possible, but a platform object can throw a custom excepton on
its serialization/transfer steps.

One example is OffscreenCanvas, which can throw
an "InvalidStateError" exception if the context mode is not none on
transfer steps.

https://html.spec.whatwg.org/multipage/#the-offscreencanvas-interface:transfer-steps

Testing: Improvements in the following tests
-
html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable*

Fixes: #37919

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-09 11:43:09 +00:00
Jonathan Schwender
cae73341b2 Update mozjs to 128.13 (#37933)
Bump to the latest Spidermonkey 128 ESR version.
Companion PR to https://github.com/servo/mozjs/pull/590

Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-09 11:42:54 +00:00
Euclid Ye
2c52efb113 servoshell: Consider both OS decoration width and height when resizing (#37961)
Previously, we only consider OS decoration height. But when testing
#37960, I find that the decoration width is also non-zero.

Testing: Need to wait W3C spec change
https://github.com/web-platform-tests/wpt/pull/53421 related to
webdriver rectangle. When combined with #37960, this can fix at least
`window_resizeTo.html`.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-09 11:35:29 +00:00
Jerens Lensun
36e5825605 Remove test-android-startup mach command (#37958)
Remove seldomly used `mach commands:

- `test-android-startup`: This command is used for minimal testing of
Servo in Android

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-09 10:46:01 +00:00
Oriol Brufau
bcfd690374 layout: Unify layout logic for replaced and non-replaced abspos (#37943)
Laying out an absolutely or fixedly positioned box will now use the same
logic regardless of whether it's replaced or not.
This reduces the amount of code, and should have no observable effect.

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

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-09 08:44:27 +00:00
Euclid Ye
3526b7e86e servoshell: Use DeviceIndependentPixel for WebDriver Rect related requests (#37893)
[Spec](https://w3c.github.io/webdriver/#set-window-rect) expects CSS
pixel for input and output. Previously, we use Device Pixel for them
instead.

Testing: Tested manually with different screen DPR and compared with
other browsers.
Fixes: Task 4 of https://github.com/servo/servo/issues/37804

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-09 03:56:27 +00:00
Martin Robinson
0db02702e7 layout: When setting post-layout / renderer scroll offsets limit by scroll area (#37829)
Previously when scroll offsets were restored to a new scroll tree
post-layout or when receiving scroll offsets from the compositor, they
were not clamped to the available scroll area. This change fixes that.

Testing: This change fixes some WPT subtests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-08 19:27:42 +00:00
Euclid Ye
ec6ac0fced servoshell: Fix screen_geometry for headed_window (#37934)
This function is used to compute `screenLeft`, `screenTop`, `screenY`,
`screenX`. Previously, it wrongly computes viewport position instead of
window position, which didn't match
f7c86c4393/components/shared/embedder/lib.rs (L717-L720)

Testing: More webdriver test would pass once #37893 is merged.
Fixes: the position part of #37824.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-08 18:51:14 +00:00
Euclid Ye
68ec88465e WebDriver Chore: use enum instead of compile time constant for browsing_context_script_command (#37940)
This reduces unnecessary generated code and binary size. See
https://github.com/servo/servo/pull/37712#discussion_r2171957828

Testing: No Behaviour change

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-08 17:47:23 +00:00
sagudev
e64bc6d282 script: join compositor_requested_update_the_rendering into should_trigger_script_thread_animation_tick (#37889)
This will help us make "update the rendering" a proper task.

Testing: Existing WPT tests.

try run: https://github.com/sagudev/servo/actions/runs/16085256131

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-08 15:26:32 +00:00
Martin Robinson
51367c22a6 layout: Store most anonymous pseudo-elements in box slots (#37941)
Previously, anonymous boxes, such for anonymous table parts were not
associated with their non-pseudo ancestor DOM nodes. This presents a
problem when it comes time to clear layout data during incremental
layouts. This change reworks the way that pseudo-elements in general are
stored in their non-pseudo ancestor DOM nodes, allowing for any number
to be placed there.

This trades a bit of performance for space, as just adding a vector to
the node would add something like 24 bytes of storage to every node.
This change should have a neutral runtime memory usage.

Testing: This shouldn't change observable behavior and is thus covered
by
existing WPT tests. It will allow tests to pass in a subsequent PR.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-07-08 15:22:09 +00:00
Andrei Volykhin
4054f9a5a0 canvas: Make OffscreenCanvas transferable (without placeholder) (#37872)
Follow the specification and make OffscreenCanvas objects are
transferable,
but not in case if there are a weak reference to placeholder canvas
element.
To handle it properly need to implement dedicated frame
provider/dispatcher
between canvas element (script thread) and offscreen canvas (dedicated
worker thread).

https://html.spec.whatwg.org/multipage/#the-offscreencanvas-interface:transferable-objects

Testing: Improvements in the following tests
-
html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html
-
html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob*
-
html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer*
-
html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js

Part of #24276

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-08 14:47:29 +00:00
Narfinger
c3f441d7ab OHOS CI: Allow benchmarking of files and show smaps (#37881)
OHOS CI: Now we can benchmark specific files. These files need to be in
the runs.json and in the supprt/hitrace-bench folder.
A simple testcase of parsing html from string is included (taken from
https://github.com/servo/servo/issues/37223).
We copy all files in
support/hitrace-bench into the hap of the phone.
These files can use the console.log javascript command to get their
measured output.

Additionally, this now supports reporting resident-accordings-to-smaps
which is a slightly different memory than resident.

This needs update to hitrace-bench 0.7 which will be completed once the
PR is marked ready.

Testing: On action runner here:
https://github.com/Narfinger/servo/actions/runs/16118101025/job/45477031813

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-08 11:01:02 +00:00
Oriol Brufau
c00831f1ed layout: Remove clearance parameter from BoxFragment::new() (#37921)
Clearance only applies to block-level boxes, so it was unnecessary to
require it as a parameter. Instead, in block layout we can set it using
the new `.with_clearance()` method.

Testing: Unnecessary (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-08 10:04:37 +00:00
Narfinger
8d4988f288 OHOS CI: Install the required hitrace-bench version (#37915)
OHOS CI: Install the required hitrace-bench version if it is not already
installed. This allows us to see the hitrace-bench version in the commit
history without it being reinstalled on CI all the time.
This does not change the version of hitrace-bench in this PR.

This needs another update of the docker images to get the correct build
tools installed.

Succesful run:
https://github.com/Narfinger/servo/actions/runs/16115943664/job/45469959328
And here a run where it installs the given version:
https://github.com/Narfinger/servo/actions/runs/16116949656/job/45473231784
Testing: Tested on CI.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-08 08:30:07 +00:00
Kenzie Raditya Tirtarahardja
1773ea44f8 Webdriver: Keyboard Action use webview::notify_input_event instead of directly sent to constellation (#37908)
Previously, we KeyboardAction will be forwarded to constellation by the
embedder. Now we use `webview.notify_input_event`, which will send
`WebDriverCommandMsg::ForwardInputEvent` for KeyboardAction

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

---------

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-08 06:54:57 +00:00
Jonathan Schwender
11bb83d422 mach: macos: Don't let gstreamer override symbols (#37903)
Using DYLD_FALLBACK_LIBRARY_PATH means we first try to link to the
normal libraries and only fallback to looking up symbols in gstreamer if
the symbols were not found elsewhere.
This prevents some linking issues.

Testing: Covered by existing tests. Fix for issue #37811 manually
verified by the reporter.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-08 06:12:03 +00:00
Oriol Brufau
f7c86c4393 Use hyper-util with client-legacy feature (#37925)
This fixes `./mach clippy -r -p layout`.

Testing: Unneeded (no change in behavior)
Fixes: #37922

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-07 23:42:19 +00:00
dependabot[bot]
c4abfa8815 build(deps): bump content-security-policy from dc1fd32 to e8d4883 (#37924)
Bumps
[content-security-policy](https://github.com/servo/rust-content-security-policy)
from `dc1fd32` to `e8d4883`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e8d4883f9a"><code>e8d4883</code></a>
Fix display of policies</li>
<li>See full diff in <a
href="dc1fd32b2b...e8d4883f9a">compare
view</a></li>
</ul>
</details>
<br />


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-07 23:36:53 +00:00
dependabot[bot]
4ba5ea5a96 build(deps): bump cc from 1.2.28 to 1.2.29 (#37931)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.28 to 1.2.29.
<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.29</h2>
<h3>Other</h3>
<ul>
<li>Fix target parsing for powerpc (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1490">#1490</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.28...cc-v1.2.29">1.2.29</a>
- 2025-07-05</h2>
<h3>Other</h3>
<ul>
<li>Fix target parsing for powerpc (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1490">#1490</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d40950a4a8"><code>d40950a</code></a>
chore: release v1.2.29 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1493">#1493</a>)</li>
<li><a
href="72fd96518a"><code>72fd965</code></a>
Fix target parsing for powerpc (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1490">#1490</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.28...cc-v1.2.29">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.28&new-version=1.2.29)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-07 23:29:03 +00:00
dependabot[bot]
4ca9014f0f build(deps): bump cfg-expr from 0.20.0 to 0.20.1 (#37930)
Bumps [cfg-expr](https://github.com/EmbarkStudios/cfg-expr) from 0.20.0
to 0.20.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/EmbarkStudios/cfg-expr/releases">cfg-expr's
releases</a>.</em></p>
<blockquote>
<h2>0.20.1</h2>
<h3>Changed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cfg-expr/pull/80">PR#80</a>
updated the builtin target list to 1.88.0.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/EmbarkStudios/cfg-expr/blob/main/CHANGELOG.md">cfg-expr's
changelog</a>.</em></p>
<blockquote>
<h2>[0.20.1] - 2025-07-07</h2>
<h3>Changed</h3>
<ul>
<li><a
href="https://redirect.github.com/EmbarkStudios/cfg-expr/pull/80">PR#80</a>
updated the builtin target list to 1.88.0.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cdfe878c24"><code>cdfe878</code></a>
Release 0.20.1</li>
<li><a
href="16204ea979"><code>16204ea</code></a>
Update CHANGELOG</li>
<li><a
href="c881a1937e"><code>c881a19</code></a>
Update to 1.88.0 (<a
href="https://redirect.github.com/EmbarkStudios/cfg-expr/issues/80">#80</a>)</li>
<li>See full diff in <a
href="https://github.com/EmbarkStudios/cfg-expr/compare/0.20.0...0.20.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cfg-expr&package-manager=cargo&previous-version=0.20.0&new-version=0.20.1)](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-07 20:21:28 +00:00
dependabot[bot]
a4583d4a6b build(deps): bump async-channel from 2.4.0 to 2.5.0 (#37929)
Bumps [async-channel](https://github.com/smol-rs/async-channel) from
2.4.0 to 2.5.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.5.0</h2>
<ul>
<li>Add <code>Sender::closed()</code> (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/102">#102</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.5.0</h1>
<ul>
<li>Add <code>Sender::closed()</code> (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/102">#102</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="35a63c456a"><code>35a63c4</code></a>
Release 2.5.0</li>
<li><a
href="b665e043ca"><code>b665e04</code></a>
Add Sender::closed future (<a
href="https://redirect.github.com/smol-rs/async-channel/issues/102">#102</a>)</li>
<li>See full diff in <a
href="https://github.com/smol-rs/async-channel/compare/v2.4.0...v2.5.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.4.0&new-version=2.5.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-07 20:06:28 +00:00
dependabot[bot]
ae2d572f5c build(deps): bump blocking from 1.6.1 to 1.6.2 (#37928)
Bumps [blocking](https://github.com/smol-rs/blocking) from 1.6.1 to
1.6.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/blocking/releases">blocking's
releases</a>.</em></p>
<blockquote>
<h2>v1.6.2</h2>
<ul>
<li>Fix build failure with minimal-versions. (<a
href="https://redirect.github.com/smol-rs/blocking/issues/71">#71</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/smol-rs/blocking/blob/master/CHANGELOG.md">blocking's
changelog</a>.</em></p>
<blockquote>
<h1>Version 1.6.2</h1>
<ul>
<li>Fix build failure with minimal-versions. (<a
href="https://redirect.github.com/smol-rs/blocking/issues/71">#71</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6c4eddec18"><code>6c4edde</code></a>
Release 1.6.2</li>
<li><a
href="8f621a9dcc"><code>8f621a9</code></a>
Fix build failure with minimal-versions</li>
<li><a
href="588b575e47"><code>588b575</code></a>
Add minimal-versions check to CI</li>
<li><a
href="fa3854cb70"><code>fa3854c</code></a>
Fix clippy::uninlined_format_args warning</li>
<li><a
href="0af62f84bc"><code>0af62f8</code></a>
ci: Use reusable workflows for fmt and security_audit</li>
<li><a
href="34d9472076"><code>34d9472</code></a>
ci: Use &quot;v2.0.0&quot; branch for security check</li>
<li>See full diff in <a
href="https://github.com/smol-rs/blocking/compare/v1.6.1...v1.6.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=blocking&package-manager=cargo&previous-version=1.6.1&new-version=1.6.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-07 20:01:50 +00:00
dependabot[bot]
8e4dd852f3 build(deps): bump hyper-util from 0.1.14 to 0.1.15 (#37927)
Bumps [hyper-util](https://github.com/hyperium/hyper-util) from 0.1.14
to 0.1.15.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/hyper-util/releases">hyper-util's
releases</a>.</em></p>
<blockquote>
<h2>v0.1.15</h2>
<h2>tl;dr</h2>
<ul>
<li>Add header casing options to <code>auto::Builder</code>.</li>
<li>Fix <code>proxy::Socksv5</code> to check for enough bytes before
parsing ipv6 responses.</li>
<li>Fix including <code>client-proxy</code> in the <code>full</code>
feature set.</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>ci: pin tracing-core in msrv job by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper-util/pull/203">hyperium/hyper-util#203</a></li>
<li>Cleanup deadcode in <code>client</code> by <a
href="https://github.com/howardjohn"><code>@​howardjohn</code></a> in <a
href="https://redirect.github.com/hyperium/hyper-util/pull/202">hyperium/hyper-util#202</a></li>
<li>refactor(socks): deduplicate and reuse shared logic by <a
href="https://github.com/0x676e67"><code>@​0x676e67</code></a> in <a
href="https://redirect.github.com/hyperium/hyper-util/pull/205">hyperium/hyper-util#205</a></li>
<li>refactor: include client-proxy in full feature by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper-util/pull/206">hyperium/hyper-util#206</a></li>
<li>refactor(client): remove old body delay_eof code by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper-util/pull/208">hyperium/hyper-util#208</a></li>
<li>feat(builder): support header case methods by <a
href="https://github.com/AndreyErmilov"><code>@​AndreyErmilov</code></a>
in <a
href="https://redirect.github.com/hyperium/hyper-util/pull/207">hyperium/hyper-util#207</a></li>
<li>fix(socks): check for right length before parsing ProxyRes by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper-util/pull/210">hyperium/hyper-util#210</a></li>
<li>Prepare v0.1.15 by <a
href="https://github.com/seanmonstar"><code>@​seanmonstar</code></a> in
<a
href="https://redirect.github.com/hyperium/hyper-util/pull/211">hyperium/hyper-util#211</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/AndreyErmilov"><code>@​AndreyErmilov</code></a>
made their first contribution in <a
href="https://redirect.github.com/hyperium/hyper-util/pull/207">hyperium/hyper-util#207</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/hyperium/hyper-util/compare/v0.1.14...v0.1.15">https://github.com/hyperium/hyper-util/compare/v0.1.14...v0.1.15</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/hyper-util/blob/master/CHANGELOG.md">hyper-util's
changelog</a>.</em></p>
<blockquote>
<h1>0.1.15 (2025-07-07)</h1>
<ul>
<li>Add header casing options to <code>auto::Builder</code>.</li>
<li>Fix <code>proxy::Socksv5</code> to check for enough bytes before
parsing ipv6 responses.</li>
<li>Fix including <code>client-proxy</code> in the <code>full</code>
feature set.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9669ff14d1"><code>9669ff1</code></a>
v0.1.15</li>
<li><a
href="bfa1cf1b18"><code>bfa1cf1</code></a>
fix(socks): check for right length before parsing ProxyRes (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/210">#210</a>)</li>
<li><a
href="0ea2613fb3"><code>0ea2613</code></a>
feat(server): support header case methods on <code>auto::Builder</code>
(<a
href="https://redirect.github.com/hyperium/hyper-util/issues/207">#207</a>)</li>
<li><a
href="d8919313fe"><code>d891931</code></a>
refactor(client): remove old body delay_eof code (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/208">#208</a>)</li>
<li><a
href="1f11a12fa8"><code>1f11a12</code></a>
refactor: include client-proxy in full feature (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/206">#206</a>)</li>
<li><a
href="57c26fad25"><code>57c26fa</code></a>
refactor(client): deduplicate and reuse shared socks logic (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/205">#205</a>)</li>
<li><a
href="42bb42fdd1"><code>42bb42f</code></a>
refactor: cleanup deadcode in <code>client</code> (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/202">#202</a>)</li>
<li><a
href="d9107d04aa"><code>d9107d0</code></a>
ci: pin tracing-core in msrv job (<a
href="https://redirect.github.com/hyperium/hyper-util/issues/203">#203</a>)</li>
<li>See full diff in <a
href="https://github.com/hyperium/hyper-util/compare/v0.1.14...v0.1.15">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hyper-util&package-manager=cargo&previous-version=0.1.14&new-version=0.1.15)](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-07 20:00:48 +00:00
dependabot[bot]
0e27061bd9 build(deps): bump tokio from 1.46.0 to 1.46.1 (#37926)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.46.0 to 1.46.1.
<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.1</h2>
<h1>1.46.1 (July 4th, 2025)</h1>
<p>This release fixes incorrect spawn locations in runtime task hooks
for tasks spawned using <code>tokio::spawn</code> rather than
<code>Runtime::spawn</code>. This issue only effected the spawn location
in <code>TaskMeta::spawned_at</code>, and did not effect task locations
in Tracing events.</p>
<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/7440">#7440</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tokio/issues/7440">#7440</a>:
<a
href="https://redirect.github.com/tokio-rs/tokio/pull/7440">tokio-rs/tokio#7440</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ab3ff69cf2"><code>ab3ff69</code></a>
chore: prepare to release v1.46.1 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7444">#7444</a>)</li>
<li><a
href="a0d5b8ab30"><code>a0d5b8a</code></a>
runtime(unstable): fix task hook spawn locations for
<code>tokio::spawn</code> (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7440">#7440</a>)</li>
<li><a
href="a1ee3ef218"><code>a1ee3ef</code></a>
chore: fix some minor typos in the comments (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7442">#7442</a>)</li>
<li><a
href="171cd148a3"><code>171cd14</code></a>
changelog: fix typo in <code>pipe::OpenOptions</code> for 1.46.0 (<a
href="https://redirect.github.com/tokio-rs/tokio/issues/7439">#7439</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/tokio/compare/tokio-1.46.0...tokio-1.46.1">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.46.0&new-version=1.46.1)](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-07 19:58:16 +00:00
dependabot[bot]
21084f2b1b build(deps): bump rgb from 0.8.50 to 0.8.51 (#37923)
Bumps [rgb](https://github.com/kornelski/rust-rgb) from 0.8.50 to
0.8.51.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/kornelski/rust-rgb/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rgb&package-manager=cargo&previous-version=0.8.50&new-version=0.8.51)](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-07 19:31:55 +00:00
Oriol Brufau
fe9d49fccc layout: Require specific layout info in BoxFragment::new() (#37917)
It was very easy to forget about using `.with_specific_layout_info()` to
set the specific layout info, so it's better to make it a parameter.

In fact this already happened in the past: #36993 fixed the missing
specific layout info for flex items.

This patch fixes it for floats and atomic inlines. It also propagates it
in other cases where not doing so was not a big deal because the
specific layout info was None, but that was a fragile assumption.

Testing: Various WPT improvements
Fixes: #37898

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-07 15:25:15 +00:00
Euclid Ye
87f2871661 servoshell: Fix typo in window-size command-line argument help (#37916)
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-07 14:17:26 +00:00
batu_hoang
9afe027567 servoshell: Do handle prompts and other requests in headless mode when WebDriver is active (#37886)
Webdriver CI uses headless window, which skips the handling for alert
box.
It leads to unexpected `OK` in test results, which should be still
timeout.
This PR removes the skip, so test result in local and CI are
synchronized.

Testing:
7 unexpected `OK` are removed
https://github.com/longvatrong111/servo/actions/runs/16079192271
compared to CI on main:
https://github.com/longvatrong111/servo/actions/runs/16078898742

Fixes: https://github.com/servo/servo/issues/37875
Partially fixes: https://github.com/servo/servo/issues/37387

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-07-07 13:23:00 +00:00
atbrakhi
71d97bd935 Devtools: send error replies instead of ignoring messages (#37686)
Client messages, which are always requests, are dispatched to Actor
instances one at a time via Actor::handle_message. Each request must be
paired with exactly one reply from the same actor the request was sent
to, where a reply is a message with no type (if a message from the
server has a type, it’s a notification, not a reply).

Failing to reply to a request will almost always permanently break that
actor, because either the client gets stuck waiting for a reply, or the
client receives the reply for a subsequent request as if it was the
reply for the current request. If an actor fails to reply to a request,
we want the dispatcher (ActorRegistry::handle_message) to send an error
of type `unrecognizedPacketType`, to keep the conversation for that
actor in sync. Since replies come in all shapes and sizes, we want to
allow Actor types to send replies without having to return them to the
dispatcher.

This patch adds a wrapper type around a client stream that guarantees
request/reply invariants. It allows the dispatcher to check if a valid
reply was sent, and guarantees that if the actor tries to send a reply,
it’s actually a valid reply (see ClientRequest::is_valid_reply). It does
not currently guarantee anything about messages sent via the TcpStream
released via ClientRequest::try_clone_stream or the return value of
ClientRequest::reply. We also send `unrecognizedPacketType`,
`missingParameter`, `badParameterType`, and `noSuchActor` messages per
the
[protocol](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#error-packets)
[docs](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#packets).

Testing: automated tests all pass, and manual testing looks ok
Fixes: #37683 and at least six bugs, plus one with a different root
cause, plus three with zero impact

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: delan azabani <dazabani@igalia.com>
Co-authored-by: Simon Wülker <simon.wuelker@arcor.de>
Co-authored-by: the6p4c <me@doggirl.gay>
2025-07-07 12:40:44 +00:00
Tim van der Lippe
fcb2a4cd95 Implement initial version of ReportingObserver (#37905)
The specification moved around lately with how it defines its reports
and report bodies. They became dictionaries, but are currently missing
some fields [1].

Most tests won't be passing yet, since the `Reporting-Endpoints` header
isn't used yet. In fact, the specification leaves it up to the browser
to figure out when to run this task [2]. I am not sure if there some
background scheduling we can do here.

Confirmed with content-security-policy/reporting-api/
report-to-directive-allowed-in-meta.https.sub.html that the callback is
invoked. The test doesn't pass, since
the `describe_scripted_caller` is empty for HTML elements. Thus the
`source_file` is empty, whereas it should be equivalent to the current
document URL.

Part of #37328

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>

[1]: https://github.com/w3c/reporting/issues/286
[2]: https://w3c.github.io/reporting/#report-delivery
2025-07-07 10:43:30 +00:00
Abdelrahman Hossam
3d4868592a Differentiate console message behavior based on target OS (#37912)
Printing using log macro for Android and OhOS, while retaining original
stderr behavior for other platforms.

Fixes: #37877

Signed-off-by: abdelrahman1234567 <boudyalex321@gmail.com>
2025-07-07 09:14:12 +00:00
Servo WPT Sync
ee8bd14f3b Sync WPT with upstream (06-07-2025) (#37901)
Automated downstream sync of changes from upstream as of 06-07-2025
[no-wpt-sync]

---------

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-06 08:33:30 +00:00
Michael Mc Donnell
bd4e04774d Fix unused import TouchEventType warning (#37900)
I'm getting an unused import warning when I use Rust-Analyzer in VS
Code. I also fixed the license text which I think had gotten changed by
accident.

Testing: I built and ran the example with `cargo build --example
winit_minimal` in the `components/servo` folder. There were some unused
code warnings but they don't show up in Rust-Analyzer's output and I
suspect they are used by other code.

Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
2025-07-05 21:48:39 +00:00
sagudev
48cf50309f script: Also update canvas contents when laying out right after / during long parsing (#37899)
Before #37703 we were actually doing update rendering of canvases/images
as part of `allow_layout_if_necessary` so let's keep doing that until we
fix this properly as this will be much more involved and we want usable
canvases in the mean time.

Testing: Manual testing + WPT tests
Fixes: #37891

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-05 18:09:22 +00:00
Usman Yahaya Baba
2ad5b24225 Send WillNavigate earlier during navigation startup (#37778)
The will-navigate message tells the devtools client to expect a
navigation for a browsing context. This makes the network monitor clear
any previous entries and show the requests for the new page that is
loaded. In order to support this correctly, we need to send the
navigation notification from the constellation instead of the script
thread, otherwise we silently ignore navigations triggered by the
browser URL bar.




Testing: Ran servo in devtools mode , now the requests appear for new
loaded page
Fixes: https://github.com/servo/servo/issues/37334

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-07-05 11:35:37 +00:00
JoeDow
864c877be5 layout: Add incremental box tree construction for inline floats and abspos (#37892)
Layout: Add incremental box tree construction for inline floats and
abspos

Due to false positives in the memory benchmark on CI, the previous PR
[37868](https://github.com/servo/servo/pull/37868) reverted. Now it is
resubmitted.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-07-05 08:33:04 +00:00
Jonathan Schwender
c65cd1eadd Revert "layout: Add incremental box tree construction for inline floats and abspos" (#37888)
This reverts commit 19ceccc8eb due to a
significant increase in resident memory usage (See
https://github.com/servo/servo/issues/37887).

Testing: This is a revert due to a regression

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-07-05 03:45:58 +00:00
sagudev
e1a891ea96 canvas: Use snapshot in canvas backends (#37863)
This removes assumption about pixel format from backend abstraction to
actual backend implementation. This is important for vello.

Testing: WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-04 20:22:20 +00:00
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::new::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::thread::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::thread::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::new::thread_start::ha07e360225fa3528
                        at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/pal/unix/thread.rs:106
                         - <<std[cba35227022cdb8c]::thread::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]::thread::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]::thread::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]::thread::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]::thread::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]::thread::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]::thread::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
Kenzie Raditya Tirtarahardja
d5b6160119 CI: WebDriver test on try (#37498)
Add webdriver test on the workflow with `--product servodriver`. This
will make tracking progression/regression in webdriver development
easier.

However, since webdriver test is still unstable, the webdriver test is
only enabled on try.

To run try: `./mach try wd`, `./mach try webdriver`

Testing: This PR add webdriver test on try

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-02 05:43:55 +00:00
Michael Mc Donnell
b8ac9d3472 Add alt-d shortcut to select address bar text (#37794)
I usually use the alt-d in shortcut in Firefox to select the text in the
address bar. Firefox supports both alt-d and ctrl-l. This change adds
the alt-d shortcut so you can use either.

Testing: I tested it by running Servo and pressing alt-d. I don't know
if there is a way to create a test for it?

---------

Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
2025-07-02 04:31:55 +00:00
dependabot[bot]
a13f9bce62 build(deps): bump ohos-ime-sys from 0.2.0 to 0.2.2 (#37796)
Bumps [ohos-ime-sys](https://github.com/openharmony-rs/ohos-sys) from
0.2.0 to 0.2.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/openharmony-rs/ohos-sys/blob/main/CHANGELOG.md">ohos-ime-sys's
changelog</a>.</em></p>
<blockquote>
<h2>v0.2.2 (2024-08-18)</h2>
<h3>Added</h3>
<ul>
<li>Added bindings for <code>native_vsync</code> (behind the
<code>vsync</code> feature flag)</li>
</ul>
<h2>v0.2.1</h2>
<h3>Fixed</h3>
<ul>
<li><code>ohos-drawing-sys</code> is now an optional dependency. Usage
was already guarded behind the <code>drawing</code>
feature.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits/v0.2.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ohos-ime-sys&package-manager=cargo&previous-version=0.2.0&new-version=0.2.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-02 00:59:31 +00:00
Oriol Brufau
83213ac16b Fix testharnessreport-servo.js to stop polluting with global variables (#37817)
For example, if a test uses `let props = ...` then this was triggering
an exception because testharnessreport-servo.js already created a global
variable named `props`.

Testing: some wpt tests no longer result in ERROR

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 00:04:43 +00:00
Oriol Brufau
1c46e39d7a Fix typo in test name (#37821)
quiks -> quirks

Testing: just renaming a test

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 00:03:44 +00:00
Oriol Brufau
227aecad51 layout: Only include quirks-mode.css in actual quirks mode (#37814)
This stylesheet was being included both in quirks mode and in limited
quirks mode. It should only be the former.

Testing: adding new test.
Part of #37813

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-01 18:48:35 +00:00
Martin Robinson
7375d09887 layout: Remove TryFrom<Contents> for NonReplacedContents (#37815)
This implementation is quite confusing as it makes it harder to tell
that we are just looking for the case that `Contents` contains
`NonReplacedContents`.

Testing: This shouldn't have any functional change, so is covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-07-01 18:21:33 +00:00
sagudev
e0af75f265 canvas: Do not draw arc/ellipse with small sweep (#37630)
While raqote does already passes this test, but small line is still
visible and this PR will fix this. Vello will not work correctly without
this.


![slika](https://github.com/user-attachments/assets/195cd2c8-bea4-46d8-bf34-9c2d0b2e996e)


Testing: `/html/canvas/element/path-objects/2d.path.arc.twopie.1.html`

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-07-01 12:01:15 +00:00
Euclid Ye
9543482f51 webdriver: Greatly improve execution speed for all tests using SetWindowSize (#37712)
1. Remove the unnecessary new thread which use GetWindowRect command and
blocks for 500ms. Previously this is necessary because constellation
forward "resize" to embedder, and WebDriver wait for a constant
sufficient time to `GetWindowRect` in the new thread. This caused long
delay because there are many subtests and SetWindowRect is called
between each.
2. Remove `resize_timeout`
3. Return current dimension instead of 0 from embedder when it fails to
resize.
4. Do resizing as long as one of width/height is `Some`, according to
spec.

Testing: All Conformance test with new passing cases.
Fixes: https://github.com/servo/servo/pull/37663#issuecomment-2999120615

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-01 06:26:01 +00:00
dependabot[bot]
0774025d89 build(deps): bump ohos-vsync-sys from 0.1.2 to 0.1.4 (#37801)
Bumps [ohos-vsync-sys](https://github.com/openharmony-rs/ohos-sys) from
0.1.2 to 0.1.4.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ohos-vsync-sys&package-manager=cargo&previous-version=0.1.2&new-version=0.1.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 00:58:55 +00:00
dependabot[bot]
da3bf4b6cf build(deps): bump android_logger from 0.15.0 to 0.15.1 (#37800)
Bumps [android_logger](https://github.com/rust-mobile/android_logger-rs)
from 0.15.0 to 0.15.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/rust-mobile/android_logger-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=android_logger&package-manager=cargo&previous-version=0.15.0&new-version=0.15.1)](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-01 00:47:08 +00:00
dependabot[bot]
b27f60a317 build(deps): bump hilog-sys from 0.1.4 to 0.1.6 (#37798)
Bumps [hilog-sys](https://github.com/openharmony-rs/ohos-sys) from 0.1.4
to 0.1.6.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hilog-sys&package-manager=cargo&previous-version=0.1.4&new-version=0.1.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 22:52:44 +00:00
dependabot[bot]
f8708c86cf build(deps): bump ohos-window-manager-sys from 0.1.0 to 0.1.2 (#37795)
Bumps
[ohos-window-manager-sys](https://github.com/openharmony-rs/ohos-sys)
from 0.1.0 to 0.1.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ohos-window-manager-sys&package-manager=cargo&previous-version=0.1.0&new-version=0.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 22:51:47 +00:00
dependabot[bot]
951edb770b build(deps): bump hitrace-sys from 0.1.4 to 0.1.6 (#37797)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [hitrace-sys](https://github.com/openharmony-rs/ohos-sys) from
0.1.4 to 0.1.6.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hitrace-sys&package-manager=cargo&previous-version=0.1.4&new-version=0.1.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 22:11:09 +00:00
dependabot[bot]
59b543acbd build(deps): bump ohos-deviceinfo-sys from 0.1.3 to 0.1.5 (#37793)
Bumps [ohos-deviceinfo-sys](https://github.com/openharmony-rs/ohos-sys)
from 0.1.3 to 0.1.5.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ohos-deviceinfo-sys&package-manager=cargo&previous-version=0.1.3&new-version=0.1.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 20:56:16 +00:00
dependabot[bot]
ddfd877043 build(deps): bump xcomponent-sys from 0.3.1 to 0.3.3 (#37791)
Bumps [xcomponent-sys](https://github.com/openharmony-rs/ohos-sys) from
0.3.1 to 0.3.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/openharmony-rs/ohos-sys/blob/main/CHANGELOG.md">xcomponent-sys's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>v0.8.2</h2>
<ul>
<li>Update bindings up to API-18.</li>
</ul>
<h2>v0.8.1</h2>
<ul>
<li>Update bindings to API-15</li>
</ul>
<h2>v0.8.0</h2>
<ul>
<li>Bump <code>ohos-image-kit-sys</code> to 0.3.0 (Result signature
change, see 0.7.0 release notes.)</li>
</ul>
<h2>v0.7.1</h2>
<ul>
<li>Fix API level propagation for native window, native image and native
buffer.</li>
<li>Add Pasteboard (<code>ohos-pasteboard-sys</code>)</li>
</ul>
<h2>v0.7.0 (2025-06-06)</h2>
<h3>Breaking</h3>
<ul>
<li>Update the signature of functions returning Error codes with zero
representing the <code>Ok</code> value to
an equivalent <code>Result&lt;(), NonZeroErrcode&gt;</code> type. See
the changelogs of the individual crates.</li>
</ul>
<h3>Add</h3>
<ul>
<li>Abilitykit (<code>ohos-abilitykit-sys</code>)</li>
<li>Multimodal Input Kit (<code>ohos-input-sys</code>)</li>
<li>Rawfile (<code>ohos-rawfile-sys</code>)</li>
<li>Window Manager (<code>ohos-window-manager-sys</code>)</li>
</ul>
<h3>Update</h3>
<ul>
<li>Update bindings for OpenHarmony 5.0.2 (API-14)</li>
</ul>
<h2>v0.6.0 (2025-01-09)</h2>
<h3>Breaking</h3>
<ul>
<li>napi: <code>napi_property_descriptor</code>,
<code>napi_node_version</code>, <code>napi_extended_error_info</code> no
longer derive Copy/Clone.</li>
<li><code>xcomponent</code>: The constant
<code>OH_NATIVE_XCOMPONENT_OBJ</code> is now a <code>CStr</code> instead
of raw byte string</li>
<li>native_window: Duplicate bindings for <code>native_buffer</code>
types were removed. Use the bindings from <code>native_buffer</code>
instead.</li>
<li>native_buffer: <code>OH_NativeBuffer_MetadataType</code> is now a
wrapper around <code>c_int</code> instead of <code>c_uint</code>.</li>
</ul>
<h3>Add</h3>
<ul>
<li>Made vsync bindings also available as dedicated ohos-vsync-sys
crate. No user facing changes.</li>
<li>Updated all bindings for API-13.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=xcomponent-sys&package-manager=cargo&previous-version=0.3.1&new-version=0.3.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 20:46:42 +00:00
dependabot[bot]
6767000c6c build(deps): bump ab_glyph_rasterizer from 0.1.8 to 0.1.9 (#37790)
Bumps [ab_glyph_rasterizer](https://github.com/alexheretic/ab-glyph)
from 0.1.8 to 0.1.9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/alexheretic/ab-glyph/releases">ab_glyph_rasterizer's
releases</a>.</em></p>
<blockquote>
<h2>ab-glyph-rasterizer-0.1.9</h2>
<ul>
<li>Fix <code>draw_line_scalar</code> index oob panic scenario (2).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6c0b05790a"><code>6c0b057</code></a>
Release ab_glyph 0.2.30, ab_glyph_rasterizer 0.1.9</li>
<li><a
href="e85f951ea9"><code>e85f951</code></a>
Add support for reading the italic angle (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/114">#114</a>)</li>
<li><a
href="2d97b035da"><code>2d97b03</code></a>
Fix <code>draw_line_scalar</code> index oob panic scenario (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/116">#116</a>)</li>
<li><a
href="aebec121f0"><code>aebec12</code></a>
Update 1.88 lints</li>
<li><a
href="9fccd7289a"><code>9fccd72</code></a>
Update dev-dependencies</li>
<li><a
href="195deb218c"><code>195deb2</code></a>
Fix <code>clippy::needless_lifetimes</code> lint (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/113">#113</a>)</li>
<li><a
href="ff76a7eb61"><code>ff76a7e</code></a>
Fix typos (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/112">#112</a>)</li>
<li><a
href="e0c65ca255"><code>e0c65ca</code></a>
Release ab_glyph 0.2.29</li>
<li><a
href="2daf5abc90"><code>2daf5ab</code></a>
Update ttf-parser to 0.25</li>
<li><a
href="1a02ae87f6"><code>1a02ae8</code></a>
Add bench lto</li>
<li>Additional commits viewable in <a
href="https://github.com/alexheretic/ab-glyph/compare/ab-glyph-rasterizer-0.1.8...ab-glyph-rasterizer-0.1.9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ab_glyph_rasterizer&package-manager=cargo&previous-version=0.1.8&new-version=0.1.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 20:42:04 +00:00
dependabot[bot]
1be5352728 build(deps): bump ab_glyph from 0.2.29 to 0.2.30 (#37789)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.29 to
0.2.30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/alexheretic/ab-glyph/releases">ab_glyph's
releases</a>.</em></p>
<blockquote>
<h2>ab-glyph-0.2.30</h2>
<ul>
<li>Add <code>Font::italic_angle</code> for accessing the slant
angle.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6c0b05790a"><code>6c0b057</code></a>
Release ab_glyph 0.2.30, ab_glyph_rasterizer 0.1.9</li>
<li><a
href="e85f951ea9"><code>e85f951</code></a>
Add support for reading the italic angle (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/114">#114</a>)</li>
<li><a
href="2d97b035da"><code>2d97b03</code></a>
Fix <code>draw_line_scalar</code> index oob panic scenario (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/116">#116</a>)</li>
<li><a
href="aebec121f0"><code>aebec12</code></a>
Update 1.88 lints</li>
<li><a
href="9fccd7289a"><code>9fccd72</code></a>
Update dev-dependencies</li>
<li><a
href="195deb218c"><code>195deb2</code></a>
Fix <code>clippy::needless_lifetimes</code> lint (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/113">#113</a>)</li>
<li><a
href="ff76a7eb61"><code>ff76a7e</code></a>
Fix typos (<a
href="https://redirect.github.com/alexheretic/ab-glyph/issues/112">#112</a>)</li>
<li>See full diff in <a
href="https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.29...ab-glyph-0.2.30">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ab_glyph&package-manager=cargo&previous-version=0.2.29&new-version=0.2.30)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 20:34:41 +00:00
dependabot[bot]
1103f28b54 build(deps): bump ohos-abilitykit-sys from 0.1.0 to 0.1.2 (#37788)
Bumps [ohos-abilitykit-sys](https://github.com/openharmony-rs/ohos-sys)
from 0.1.0 to 0.1.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ohos-abilitykit-sys&package-manager=cargo&previous-version=0.1.0&new-version=0.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 20:31:26 +00:00
Euclid Ye
d781d1b1cb [WebDriver] Implement XPath Locator Strategy (#37783)
1. Implement XPath Locator Strategy
2. Use it for "Find Element(s)", "Find Element(s) from Element", "Find
Element(s) from Shadow Root"

Testing: `tests\wpt\tests\webdriver\tests\classic\find_element*\find.py`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-30 17:20:52 +00:00
CarePackage17
f682f9d6f5 Enable LinuxSampler to be used on Android (#37784)
This enables `background_hang_monitor` to work on Android. Relevant
Zulip thread: [#general > Android stack walking questions @
💬](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Android.20stack.20walking.20questions/near/526369883)


Testing: Manually tested on a Pixel 6a with Android 16 with following
page:
```html
<!DOCTYPE html>
<html>
    <head>
        <title>Infinite Loop Test</title>
    </head>
    <body>
        Will it print? That is the question.
    </body>
    <script>
        console.log("hello. you're about to loop infinitely.");

        while (true) {
            //do nothing, just block the thread
        }
    </script>
</html>
```
Fixes: #23136

---------

Signed-off-by: CarePackage17 <5157010+CarePackage17@users.noreply.github.com>
2025-06-30 17:17:50 +00:00
Rodion Borovyk
60c10d710d Set the placeholder canvas element of offscreenCanvas to a weak reference in transferControlToOffscreen() (#37764)
Set the placeholder canvas element of offscreenCanvas to a weak
reference in transferControlToOffscreen()

Testing: I do not understand how to test it, suggestions appreciated 
Fixes: https://github.com/servo/servo/issues/35626

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-06-30 13:30:58 +00:00
Oriol Brufau
4cd7c5196b layout: Fix block SizeConstraint for replaced elements (#37758)
#37433 didn't handle intrinsic contributions. This patch computes the
correct SizeConstraint to be used as the ConstraintSpace's block size
when computing intrinsic inline sizes.

Testing: Adding new test
Fixes: #37478

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-30 12:07:37 +00:00
Oriol Brufau
f23e3e25b8 layout: Small refactoring for replaced elements' sizing logic (#37756)
Add methods to retrieve the natural, default and fallback sizes per each
axis (inline or block), rather than computing both simultaneously.
Sometimes we only want one size, and I think it's clearer this way.

Testing: Unnecessary (no behavior change)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-30 07:07:39 +00:00
Oriol Brufau
4fe106cffc layout: Remove wrong depends_on_block_constraints logic (#37761)
`FlexContainer::layout()` was forcing `depends_on_block_constraints` to
true for `flex-direction: column`. However, it doesn't make sense to do
that only for `column` but not for `column-reverse`. Also no test is
complaining, so I'm just removing that logic.

Testing: no behavior change is intended, so just existing test coverage

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-30 07:06:44 +00:00
Euclid Ye
78cd770697 Codegen: Fix typo in doc (#37777)
Fix typo.
Testing: No.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-29 11:13:50 +00:00
Servo WPT Sync
9a0f2be162 Sync WPT with upstream (29-06-2025) (#37774)
Automated downstream sync of changes from upstream as of 29-06-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-06-29 01:47:33 +00:00
Tim van der Lippe
e1c037815c Fix skipping CSP checks for styles when cloning nodes (#37465)
Cloned nodes were re-parsing already-parsed style attributes. As such,
they were also checking CSP, which shouldn't happen as the original node
already was checked for it.

Testing: The existing WPT test now mostly passes. It had two cases which
were passing in no browsers.
Fixes: Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-28 17:31:03 +00:00
sagudev
5311beb34a Lazily initialize canvas paint thread in constellation (#37765)
This PR moves canvas paint thread initialization to constellation. This
allows us to lazily initialize it on first create canvas request (like
we do for webgpu). If we didn't started canvas paint thread we also do
not need to wait for it's teardown.

Per https://chromestatus.com/metrics/webfeature/timeline/popularity/201
~30% of websites still use 2d canvas.

Testing: Existing WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-28 17:29:11 +00:00
Oriol Brufau
ee7cb80213 Fix intermittent align-content tests (#37760)
These tests use the Ahem font, so wait until fonts have been loaded.

Testing: This is a test fix.
Fixes: #37360, #37361

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-28 12:13:47 +00:00
Narfinger
64ebde2277 OHOS: Run speedometer in CI (#37666)
OHOS: Run speedometer in CI for OHOS.
This also adds the forgotten flag to disable jit for HarmonyOs devices.

Need https://github.com/servo/servo/pull/37636 to be merged first and CI
updated which will be done when this PR is marked ready.

Testing: Custom run:
https://github.com/Narfinger/servo/actions/runs/15927927047/job/44929872906
Bencher output:
https://bencher.dev/perf/servo-ci/reports/4f778f61-699e-4e70-8994-bd526733eab1?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr%2Bcomments&utm_term=servo-ci
No other tests available because CI.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-28 11:00:53 +00:00
Jonathan Schwender
12faf09331 CI: Add commit hash to HOS bencher reports (#37757)
Since we don't checkout servo in this job, bencher can't infer the
commit hash and we need to pass it manually.
Bencher documentation for --hash:

02034b83de/services/console/src/chunks/docs-explanation/branch-selection/en/hash.mdx

Testing: No testing. This could cause the HOS CI to fail, but wouldn't
block the MQ. This kind of CI change is quite difficult to test without
a lot of setup overhead. The change itself is trivial though, and the
expected damage would also be low (merge queue would still work).

Issue with the missing commit was:
Reported by @webbeef

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-28 00:21:21 +00:00
dependabot[bot]
821e8a0d7a build(deps): bump indexmap from 2.9.0 to 2.10.0 (#37754)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.9.0 to
2.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md">indexmap's
changelog</a>.</em></p>
<blockquote>
<h2>2.10.0 (2025-06-26)</h2>
<ul>
<li>Added <code>extract_if</code> methods to <code>IndexMap</code> and
<code>IndexSet</code>, similar to the
methods for <code>HashMap</code> and <code>HashSet</code> with ranges
like <code>Vec::extract_if</code>.</li>
<li>Added more <code>#[track_caller]</code> annotations to functions
that may panic.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="91dbcc55d2"><code>91dbcc5</code></a>
Merge pull request <a
href="https://redirect.github.com/indexmap-rs/indexmap/issues/399">#399</a>
from cuviper/release-2.10.0</li>
<li><a
href="67a5a712fc"><code>67a5a71</code></a>
Release 2.10.0</li>
<li><a
href="37e519a3be"><code>37e519a</code></a>
Merge pull request <a
href="https://redirect.github.com/indexmap-rs/indexmap/issues/308">#308</a>
from cuviper/extract_if</li>
<li><a
href="4d7618fbc9"><code>4d7618f</code></a>
Merge pull request <a
href="https://redirect.github.com/indexmap-rs/indexmap/issues/398">#398</a>
from cuviper/bench-deps</li>
<li><a
href="68201eb0a3"><code>68201eb</code></a>
Drop lazy_static for LazyLock</li>
<li><a
href="eaaaa56e71"><code>eaaaa56</code></a>
Switch to fastrand for bench shuffling</li>
<li><a
href="b19d84edaf"><code>b19d84e</code></a>
Fix <code>clippy::needless_lifetimes</code></li>
<li><a
href="4f62778c86"><code>4f62778</code></a>
<code>impl FusedIterator for ExtractIf</code></li>
<li><a
href="e09eaaf8e5"><code>e09eaaf</code></a>
Document and track <code>extract_if</code> panics</li>
<li><a
href="a8d7dc50a2"><code>a8d7dc5</code></a>
Add range support to <code>extract_if</code></li>
<li>Additional commits viewable in <a
href="https://github.com/indexmap-rs/indexmap/compare/2.9.0...2.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=indexmap&package-manager=cargo&previous-version=2.9.0&new-version=2.10.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-06-27 17:57:08 +00:00
dependabot[bot]
dd07b55380 build(deps): bump ohos-sys-opaque-types from 0.1.6 to 0.1.7 (#37753)
Bumps
[ohos-sys-opaque-types](https://github.com/openharmony-rs/ohos-sys) from
0.1.6 to 0.1.7.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/ohos-sys/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ohos-sys-opaque-types&package-manager=cargo&previous-version=0.1.6&new-version=0.1.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-27 17:52:46 +00:00
Martin Robinson
9232b0f550 layout: Only create a LayoutContext if restyling (#37726)
The creation of `LayoutContext` does more work than necessary if layout
just needs to do something like make a display list and not restyle and
relayout. This change makes it so that these kind of non-restyle layouts
do not need to create a display list. In addition, the creation of
`LayoutContext` is better encapsulate

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-06-27 15:01:30 +00:00
Martin Robinson
5e44582277 script: Clean up Window::force_reflow a little (#37725)
- Move some of the image handling code to a separate function.
 - Move reflow event debugging into layout itself and use the `Debug`
   implementation to print the event.
 - A few other small cleanups

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-27 12:27:15 +00:00
CarePackage17
a93d977020 Replace unwind-sys with backtrace crate on Linux (#37728)
This PR removes `unwind-sys` usage from background_hang_monitor on
Linux, replacing it with the [backtrace
crate](https://crates.io/crates/backtrace).

Testing: `hang_monitor-tests.rs` still pass after the change (on Ubuntu
24.04).
Fixes: https://github.com/servo/servo/issues/35063

---------

Signed-off-by: CarePackage17 <5157010+CarePackage17@users.noreply.github.com>
2025-06-27 12:20:10 +00:00
Jonathan Schwender
be1ebb8ad4 deps: Update fontsan (#37743)
The new fontsan version uses the rust brotli-decompressor crate, instead
of vendoring the C brotli library.
Since we anyway already depend on rust-brotli, this should reduce our
binary size.

Testing: Covered by existing tests
Fixes: #34521

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2025-06-27 10:41:39 +00:00
Euclid Ye
0329f33520 [WebDriver] Reuse "Find Elements" handler in "Find element" (#37737)
All "Find Element ..." in
[spec](https://w3c.github.io/webdriver/#find-element-from-element) has
exactly same step has "Find Elements ...", except they extract the first
element if there is any. We now reuse the handler instead of running
numerous repetitive steps, same as what we did for ["Find Element from
Shadow
Root"](https://w3c.github.io/webdriver/#find-element-from-shadow-root)
in #37578.

This reduces binary size by 98KB for Release profile in Windows and
improves maintainability.

Testing: `./mach test-wpt -r
.\tests\wpt\tests\webdriver\tests\classic\find_element* --product
servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-27 08:45:58 +00:00
Martin Robinson
8e2ef5c248 layout: Do not require restyle information when not restyling (#37722)
This reduces the amount of work necessary when running layout, by making
restyle information optional in the `ReflowRequest`. When restyling
isn't
necessary, the option is `None`.

Testing: This shouldn't change any 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>
2025-06-27 08:08:29 +00:00
Simon Wülker
cbb0407ae6 Determine the initial state for fragment parsing using the scripting flag of the context element (#37704)
When parsing a html fragment, the initial parser state depends on
whether or not scripting is enabled. So far we've used the scripting
flag of the parser, but that is wrong - the parser's scripting flag is
always false, because the fragment document has no browsing context.
Instead we should use the scripting flag of the context element.

Testing: A new web platform test passes

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-26 20:40:13 +00:00
sagudev
4dded465a4 compositor: only UpdateImages that accepts SmallVec and add helpers for single image (#37730)
Before we only offered helper to add single image (no update or delete)
that got special IPC message, now we simplify this by offering all ops
helpers for dealing with single image (that happens most of the time),
that simply uses `update_images` under the hood. We also optimize for
this use case by using `SmallVec<[ImageUpdate; 1]>` to avoid alloc.

Testing: Just refactor, but code is covered by WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-26 14:57:15 +00:00
Andrei Volykhin
3c16db2642 canvas: Add CanvasPattern 'setTranform(transform)' method (#37731)
Follow the HTML canvas specification and add missing
'setTransform(transform)' method to CanvasPattern interface.
https://html.spec.whatwg.org/multipage/#dom-canvaspattern-settransform

Testing: Improvements in the tests
- html/canvas/element/fill-and-stroke-styles/2d.pattern.transform*
- html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-26 14:38:30 +00:00
Martin Robinson
5286869b96 layout: Start using the new extensible RestyleDamage type from Stylo (#37592)
This will allow Servo to add custom types of damage in the near future
which correspond to minor phases layout. The damage exposed by Stylo
only corresponds to the major layout phses. In the future, both phases
will likely be managed by Servo itself and implementors will need to
provide their own damage system entirely.

Testing: This shouldn't change behavior and thus is covered by existing
tests.

Stylo PR: https://github.com/servo/stylo/pull/207

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 14:10:48 +00:00
Oriol Brufau
a9dc2ac83a layout: Let align-content: stretch fall back to unsafe flex-start (#37708)
This aligns Servo with other browsers, and adopts this CSSWG resolution:
https://github.com/w3c/csswg-drafts/issues/11641#issuecomment-3005385155

Testing: adding new WPT test, and some expectation changes for existing
tests.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 13:53:28 +00:00
Narfinger
d4c0d2ecbb OHOS: Allow test-speedometer-ohos to run speedometer on the device (#37636)
Adds test-speedometer-ohos which will let it speedometer run on device.
It assumes we already have servoshell installed on device. We then grab
the log file, parse the json from it and output to bencher optionally.

Requires https://github.com/servo/servo/pull/37690 and
https://github.com/servo/servo/pull/37631 to be merged.

Testing: Tested on device.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-26 13:34:05 +00:00
Oriol Brufau
c67b0ab538 Fix scrollWidthHeight-negative-margin-002.html (#37721)
Since we don't support `writing-mode` yet, we got different testcases
with the same title, some passing and some failing. So we had to expect
both PASS and FAIL, making the test useless to detect regressions.

This changes the test to only generate testcases for supported values of
`writing-mode`.

Testing: This is just a test change.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 12:08:30 +00:00
Narfinger
4d35b69ffe Clean up unused dependencies / features and centralize more feature selection into root Cargo.toml (#37720)
- Make feature flag of smallvec global.
- Removed unused dependency of thinvec.
- Removed unused flag of hyper-util.

Reduces the binary size by an astonishing 3.352k.

Testing: Compilation 'tests' this change.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-26 11:56:48 +00:00
sagudev
c8132137cd webgpu: Use compositor_api instead of webrender_api (#37713)
webgpu currently sends updates WebRender directly via WebRender API
(same as webgl that I also plan to reform). 2D canvas uses Compositor
API for that and with this PR so does webgpu. This will be helpful for
#35733, where compositor must know state of image updates.

Testing: WebGPU CTS run:
https://github.com/sagudev/servo/actions/runs/15895299748

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-26 10:12:29 +00:00
Narfinger
6656a09f8c OHOS: Use new file logger. (#37690)
Hilog 0.2.1 allows us to additionally log to a file. This is sometimes
more convinient when
benchmarking.
Also added the new log domain of `script::dom::console`.

Testing: Tested on device.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-26 09:57:41 +00:00
Jonathan Schwender
25a5f079ff deps: Bump html5ever to 0.32.1 (#37717)
Includes SIMD optimizations on x86 and aarch64 for the data state.

Testing: Covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-26 09:53:59 +00:00
Euclid Ye
125df89836 Chore: Remove unused GetFocusTopLevelBrowsingContext from EmbedderToConstellationMessage (#37716)
This is a legacy message used only by WebDriver to focus the webview,
when session just created. Right now this is just dead_code which is not
detected by Lint.

Testing: No behaviour change.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-26 09:45:59 +00:00
Martin Robinson
3cda9f2fb2 layout: Add a ReflowPhases bitflags (#37696)
This is used to capture information about what layout phases are
necessary for a given `ReflowGoal`. It's moved closer to where these
decisions are made and it should be easier to understand what the values
mean. They had gotten a bit out of sync with how queries and layout were
implemented.

Testing: This shouldn't change observable behavior and thus should be
covered
by existing WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-26 09:31:16 +00:00
sagudev
03dbf9b6f7 webgl: Replace webrender API with compositor API for images handling (#37714)
Like in #37713, instead of updating images directly with webrender api
we use the compositor api. We still keep webrender api available in
webgl, because that's where we do shutdown, due to GL.

Testing: Existing WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-26 09:06:24 +00:00
sagudev
b9f9abee91 WPT: Handle flake detection in ServoHandler (#37540)
With this PR ServoHandler will store state of first suite and deal with
subsequent suites as they were run from `--retry-unexpected`, so it will
use results to mark unexpected from first run as flaky. Stats that are
used to display current running tests are still reset per suite. This
allows us to use `--retry-unexpected=1` for flake detection instead of
manual rerunning, which will help with proper subsuites support.

Testing: Manual CI run to ensure end results are still the same:
https://github.com/sagudev/servo/actions/runs/15886712204
Fixes: #37319

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-26 08:53:07 +00:00
Martin Robinson
3e1cdacd07 script|layout: Do not force restyle when doing script queries (#37677)
Instead of doing a restyle whenever layout is requested, only do one if
script believes that the `Document` has changed in a way that needs a
restyle. In addition, track the different reasons this might be the
case. This will be used later to provide better debugging output.

In layout, when a restyle isn't requested, provide:
 - an early return if layout is up-to-date enough for the reflow goal.
 - skipping restyle and reflow if it isn't necessary.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 08:02:15 +00:00
Euclid Ye
f9880637e9 [WebDriver] Fully implement "switch to (parent) frame" (#37685)
1. Separate the handling of ["switch to parent
frame"](https://w3c.github.io/webdriver/#switch-to-parent-frame) from
the rest as the processing is a bit different
2. Implement "Select frame by 16-bits numbered ID" for ["switch to
frame"](https://w3c.github.io/webdriver/#switch-to-frame)
3. Implement other missing steps

Testing: All WebDriver Conformance test with new passing cases

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-26 07:44:16 +00:00
Usman Yahaya Baba
253fb247f5 Add common resourceId to network events (#37707)
- Add a `resource_id` field to `EventActor` and `NetworkEventActor`
- Store a `next_resource_id` field in DevtoolsInstance
- Add `resource_id` parameter to `NetworkEventActor::new`
- Increment `next_resource_id` when
`DevtoolsInstance::find_network_event_actor` is called so each network
event has a unique id

Testing: Ran servo in devtools mode and can see the data showing in
`status`,`type`, `transferred` ,`size` and `timeline` columns of each
request, also logged the devtools instance and can see unique
`resourceId` for each request.
Fixes: https://github.com/servo/servo/issues/37661

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-06-26 07:08:16 +00:00
Martin Robinson
f745bad37d script: Consolidate step 22 of per-Document rendering update (#37703)
The parts of step 22 were a bit scattered throughout the codebase, so
this
change moves them all to a single method which does three things:

1. Update all animating images
2. Flush all dirty canvases (2D, WebGL, and WebGPU)
3. Calls reflow on the `Document`

Testing: This shouldn't change behavior in any major way so it should
be covered by existing WPT tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-26 06:11:03 +00:00
Usman Yahaya Baba
152eb63fb3 Remove duplication between request/response properties in NetworkEventActor (#37651)
- Remove request/response fields in `NetworkEventActor` which now stores
minimal request metadata needed : `URL`, `method`, `timestamps`, `raw
headers`, `body`.
- Refactor add_request and add_response: `add_request` takes the
incoming DevtoolsHttpRequest and populates
`request_url`, `request_method`, `request_started`,
`request_time_stamp`, `request_body`, `request_headers_raw`
`request_cookies`, `request_headers`,`total_time` and `event_timing`
(via a new helper that computes Timings)
While `add_response` takes the incoming DevtoolsHttpResponse and
populates `response_headers_raw`, `response_body` ,`response_cookies`,
`response_headers`, `response_start`, `response_content`
- Add a call to `resources_updated` to push initial request info in
`handle_network_event`
Testing: Run and logged servo in devtools mode and now, the request
header info isavailable as soon as the request gets initiated
Fixes: https://github.com/servo/servo/issues/37566

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-06-25 20:18:44 +00:00
dependabot[bot]
459397e1a1 build(deps): bump libredox from 0.1.3 to 0.1.4 (#37701)
Bumps libredox from 0.1.3 to 0.1.4.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libredox&package-manager=cargo&previous-version=0.1.3&new-version=0.1.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 17:54:31 +00:00
dependabot[bot]
8d588a17b0 build(deps): bump xattr from 1.4.0 to 1.5.1 (#37699)
Bumps [xattr](https://github.com/Stebalien/xattr) from 1.4.0 to 1.5.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="47dbda862e"><code>47dbda8</code></a>
chore: release 1.5.1</li>
<li><a
href="c296d8c7f2"><code>c296d8c</code></a>
Fix license specifier</li>
<li><a
href="d7b5868587"><code>d7b5868</code></a>
release v1.5.0</li>
<li><a
href="d9b16234f4"><code>d9b1623</code></a>
update rustix to 1.0.0 (<a
href="https://redirect.github.com/Stebalien/xattr/issues/71">#71</a>)</li>
<li><a
href="5ec2da4c1a"><code>5ec2da4</code></a>
Fix debug format test on systems with selinux (<a
href="https://redirect.github.com/Stebalien/xattr/issues/69">#69</a>)</li>
<li>See full diff in <a
href="https://github.com/Stebalien/xattr/compare/v1.4.0...v1.5.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=xattr&package-manager=cargo&previous-version=1.4.0&new-version=1.5.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 17:51:23 +00:00
dependabot[bot]
a4cbf82c80 build(deps): bump hilog from 0.2.0 to 0.2.1 (#37700)
Bumps [hilog](https://github.com/openharmony-rs/hilog) from 0.2.0 to
0.2.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/hilog/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hilog&package-manager=cargo&previous-version=0.2.0&new-version=0.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 17:42:44 +00:00
dependabot[bot]
453f05e269 build(deps): bump crunchy from 0.2.3 to 0.2.4 (#37697)
Bumps [crunchy](https://github.com/eira-fransham/crunchy) from 0.2.3 to
0.2.4.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/eira-fransham/crunchy/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crunchy&package-manager=cargo&previous-version=0.2.3&new-version=0.2.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 17:31:51 +00:00
dependabot[bot]
d95210033a build(deps): bump xcursor from 0.3.9 to 0.3.10 (#37698)
Bumps [xcursor](https://github.com/esposm03/xcursor-rs) from 0.3.9 to
0.3.10.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/esposm03/xcursor-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=xcursor&package-manager=cargo&previous-version=0.3.9&new-version=0.3.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 17:31:25 +00:00
sagudev
6f53d422b0 Make ImageData more spec compliant (#37620)
I updated webidl, and all changes that bring, currently we still not
support float16array (there is no support in FF either). Most notable
change is refactored new_*/Constructors methods, that should now handle
HeapBufferSource more properly (with less unsafe).

Testing: Existing WPT tests
try run: https://github.com/sagudev/servo/actions/runs/15806083404
Fixes: #37618 (although not tested)

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-25 16:48:58 +00:00
Andrei Volykhin
59b99de90a canvas: Add CanvasTransform 'setTransform(transform)' method (#37692)
Follow the HTML canvas specification and add missing
'setTransform(transform)' method to CanvasTransform interface.

https://html.spec.whatwg.org/multipage/#dom-context-2d-settransform-matrix

The third-party WebIDL doesn't support different extended attributes
on different overloads of methods, so 'Throws' attribute was added
to another 'setTransform(...)' method.
https://bugzilla.mozilla.org/show_bug.cgi?id=1020975

Testing: Improvements in the tests
- css/geometry/DOMMatrix*
-
html/canvas/element/transformations/2d.transformation.setTransform.multiple.html
-
html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple

New failing tests due to disabled 'paint worklet' feature
- css/css-paint-api/setTransform-00*.https.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-25 16:11:54 +00:00
Narfinger
64259de1f7 script: Do not run garbage collection when shutting down a Pipeline (#37691)
Removes a GC cleanup step on exit pipeline that took half a second at
the end
of the Speedmometer benchmark. As layout and script are now run serially
this
does not seem to be needed anymore. See also the very short discussion
on Zulip:
[#performance > GC in
handle_exit_pipeline](https://servo.zulipchat.com/#narrow/channel/416779-performance/topic/GC.20in.20handle_exit_pipeline/with/525697861).

Testing: Tested with Speedometer and the WPT tests should still work.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-25 15:13:54 +00:00
Martin Robinson
a66a257b38 script: Properly root nodes with animating images (#37689)
This change fixes an issue and makes a few more minor improvements to
the `ImageAnimationState`:

1. Image rooting and unrooted now happens in one step from
   `Window::update_animations_post_reflow`.
2. The `node_to_animating_image_map` is now stored as a shared `RwLock`
   so that it doesn't need to be taken and then replaced in the
`ImageAnimationState` during reflow. This should prevent a hypothetical
issue
   where image animations are restarted during empty reflows.
3. General naming and idiomatic Rust usage improvements.

Testing: This doesn't really have any obvious behavioral changes,
because all
reflows currently trigger a restyle. It becomes a serious problem with
#37677
and this change fixes the failing test there.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-25 13:52:11 +00:00
Euclid Ye
b89a44c539 servoshell: Fix typo in NewWebView (#37693)
It was wrongly typed as "auto:blank" instead of "about:blank". This
affects all default new tab as it fails to load.

Testing: `webdriver\tests\classic\new_window\new_window.py` is now
passing. Previously it has an error as it expects "about:blank"

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-25 13:42:49 +00:00
batu_hoang
62a009399f webdriver: Move navigation commands to servoshell (#37665)
- Move webdriver `GetViewportSize`, `LoadURL` and `Refresh` to
servoshell.
- Add `GoBack` and `GoFoward` commands.

Testing: Need to finish moving webdriver to servoshell then evaluate
again
Fixes: https://github.com/servo/servo/issues/37370

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-25 12:35:13 +00:00
Martin Robinson
0346a62214 script: Pass more information to the MouseEvent constructor (#37672)
- Instead of eagerly computing `pageX` and `pageY`, collect the offset
  from the content's initial containing block in the compositor and pass
  that information through to `MouseEvent`. This prevents a layout flush
  that was happening when eagerly trying to fetch `Document` scroll
  offsets.
- Pass keyboard modifiers properly to `MouseEvent`.
- Now all this information is stored and passed as `Point2D` (typed) and
  `Modifiers` which greatly reduces the amount of arguments that need to
  be passed around.

Testing: It is difficult to test input events as they require WebDriver
which
isn't completely working yet. I have manually run Speedometer 2.1 and I
have
verified that this fixes the regression from #37601.
Fixes: #37601.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-25 12:29:27 +00:00
Jonathan Schwender
50cf01cf3d script: const initialize LIVE_REFERENCES (#37688)
With Rust 1.85 it is possible to const initialize Hashmaps if the hash
algorithm does not rely on a random seed.

Testing: No functional changes, covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-25 11:27:56 +00:00
batu_hoang
d970584332 webdriver: Move NewWebView, FocusWebView, GetWindowSize, and SetWindowSize to servoshell (#37555)
Follow up to: https://github.com/servo/servo/pull/36714
Moving webdriver [context
commands](https://www.w3.org/TR/webdriver2/#contexts) to be handled in
embedder:

- [x] New Window command - `WebdriverCommandMsg::NewWebView`
- [x]  Switch To Window command - `WebdriverCommandMsg::FocusWebView`
- [x] Resizing commands

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-25 10:29:34 +00:00
Jonathan Schwender
5ea003752a Fix write_json_to_file perf regressions (#37687)
cd30b78 improved the memory efficiency of write_json_to_file, but this
causes visible (when profiling) perf regression on my mac, which can
easily be fixed by wrapping the file in a `BufWriter`. This still bounds
peak memory usage, but keeps writing efficient.

Testing: Manual profiling with samply.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-25 08:45:20 +00:00
Andrei Volykhin
4ee348a202 imagebitmap: Add 'none' image orientation option (#37634)
The 'none' image orientation option was temporarily deprecated (in 2022)
according to HTML specification with the remark about going to be reused
with
a different meaning in future as the same semantics as CSS 'none'
image-orientation.

https://html.spec.whatwg.org/multipage/#dom-imagebitmapoptions-imageorientation-none
https://www.w3.org/TR/css-images-3/#valdef-image-orientation-none

Official MDN documentation added it back with new meaning (in 2024),
but it wasn't added back to HTML specification (still pending).

https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap#none

At current moment this option is poor supported on all major browsers,
but there are some
existed WPT tests (ImageBitmap/WebGL) which are actively use it in
createImageBitmap() options.

Chromium (supported):
- stable: same as 'from-image' (but with deprecation warning)
- experimental: ignoring any orientation metadata

Firefox (supported as default option):
- stable: ignoring any orientation metadata ('from-image' do the same)

Testing: Improvements and fails (expects 'from-image' behaviour from
'none' option) in the following tests
-
html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation_none.html
- webgl/tests/conformance/textures/misc/exif-orientation.html

Fixes (partialy): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-25 07:20:12 +00:00
Jonathan Schwender
922d4b83de Use FnvHashmap for LiveDOMReferences (#37673)
These maps are keyed on pointers, so using FnvHashMap should be faster
and we don't need the collision resistance properties of the default
hasher.

These maps showed up as hot when profiling the testcase from
https://github.com/servo/servo/issues/37223#issuecomment-3000705438.
Switching the hashing algorithm reduces the time spent hashing, but
overall that is still only a fractional part of the testcase.

Testing: Functionality unchanged. Overall the performance change is to
small to show up in any of our automated performance tests. When
comparing the perf profile of the above linked testcase, one should see
a reduction of time spent hashing (inverse call stack)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-25 06:47:20 +00:00
Josh Matthews
ef5784da0d servoshell: Enable accesskit integration. (#37519)
These changes ensure that our browser shell can integrate with
screenreaders. We do not provide any accessibility information about
webview content yet, which requires further API design work in both
Servo, accesskit, and egui.

Testing: No a11y-specific testing at this point; just verifying that
existing tests continue to pass.
Fixes: part of #4344

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-25 03:52:49 +00:00
Ashwin Naren
d114feb0fa [IndexedDB] Reduce heed related panics (#37652)
Allows indexeddb backends to return errors on certain operations.
Currently the errors are not demarcated, as the result type is
`Result<(), ()>`. If this is not appropriate then perhaps having a
string error might be better.

Testing: Some tests might perhaps move from PANIC to FAIL
Fixes: Partially fixes a bit of #37647, more work needs to be done
however

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-06-25 00:22:19 +00:00
Josh Matthews
72e0baa997 Disable IndexedDB wpt tests in CI. (#37679)
Per a zulip thread, the tests have too many intermittent results right
now.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-24 19:51:14 +00:00
dependabot[bot]
ec67ac3bec build(deps): bump bumpalo from 3.18.1 to 3.19.0 (#37678)
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.18.1 to
3.19.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md">bumpalo's
changelog</a>.</em></p>
<blockquote>
<h2>3.19.0</h2>
<p>Released 2025-06-24.</p>
<h3>Added</h3>
<ul>
<li>Added <code>bumpalo::collections::Vec::retain_mut</code>, similar to
<code>std::vec::Vec::retain_mut</code>.</li>
</ul>
<hr />
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/fitzgen/bumpalo/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=bumpalo&package-manager=cargo&previous-version=3.18.1&new-version=3.19.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-06-24 17:08:57 +00:00
sagudev
4974b4a1f6 canvas: Remove rect -> line handling (#37664)
This causes wrong rendering on vello. Current backends already handle
one dim zero correctly by themself (this was probably needed for azure),
but if we ever needed this, it should be implemented inside faulty
backend.

Testing: Existing WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-24 14:13:58 +00:00
sagudev
ef7be66c56 canvas: Use strum::{Display, EnumString} for canvas enums (#37670)
This makes it easier to add variants, I also added some spec links and
reordered enum variants to match the spec.

Testing: Just refactor, but the code is covered by WPT tests.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-24 13:03:41 +00:00
Simon Wülker
2dc62c504f Implement declarative shadow root support for async HTML parser (#37443)
Implements the
[`TreeSink::attach_declarative_shadow`](https://docs.rs/html5ever/latest/html5ever/interface/trait.TreeSink.html#method.attach_declarative_shadow)
method for the async html parser.

Try run with the async html parser:
https://github.com/simonwuelker/servo/actions/runs/15634240606/job/44046871826.
(There are far fewer failures than in the initial try run from
https://github.com/servo/servo/issues/37418)

Testing: We don't run tests with the async html parser
Part of https://github.com/servo/servo/issues/37418

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-24 12:45:50 +00:00
Andrei Volykhin
9487f66eaa webgl: Ignore pixel storage parameters for ImageBitmap source (#37635)
Follow the WebGL specification and ignore the values of UNPACK_FLIP_Y,
UNPACK_PREMULTIPLY_ALPHA, and UNPACK_COLORSPACE_CONVERSION
if the TexImageSource is an ImageBitmap.
https://registry.khronos.org/webgl/specs/latest/1.0/#6.10

Testing: There are no dedicated test results changes without the PR
#37634
which unblocks new testing scenarios with premultiplied ImageBitmap from
Blob/Canvas/Image sources.

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-24 11:15:50 +00:00
Andrei Volykhin
3f496f8225 canvas: Reset the current path on canvas context resetting (#37671)
Follow the HTML canvas specification and empty the list of subpaths
in context's current default path (step 2) on canvas context reseting
(reset() or set bitmap dimestion).

https://html.spec.whatwg.org/multipage/#reset-the-rendering-context-to-its-default-state

Testing: Improvements in the tests
- html/canvas/element/canvas-host/2d.canvas.host.initial.reset.path.html
- html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-24 11:09:25 +00:00
Tim van der Lippe
fc20d8b2e1 Move CSP code into one entrypoint (#37604)
This refactoring moves various CSP-related methods away from GlobalScope
and Document into a dedicated entrypoint. It also reduces the amount of
imports of the CSP crate, so that types are consolidated into this one
entrypoint. That way, we control how CSP code interacts with the script
crate.

For reviewing purposes, I split up the refactoring into separate
distinct commits that all move 1 method(group) into the new file.

Testing: no change in behavior, only a build improvement + code cleanup

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2025-06-24 08:50:30 +00:00
Ashwin Naren
2265570c88 [IndexedDB] Fix upgrade version operation (#37653)
Rejects version upgrade if the upgraded version is lower than the
current database version. Also returns the actual version instead of the
requested upgrade version.

Testing: WPT tests might cover this
Fixes: #25322

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-06-24 06:47:03 +00:00
Euclid Ye
94a7428912 [WebDriver] Grant top_level_script_command and browsing_context_script_command freedom to not verify existence of pipeline (#37632)
Sometimes, it is redundant to verify existence of pipeline over and over
again.
Sometimes, it is just wrong to check it. See [Switch to Parent
Frame](https://w3c.github.io/webdriver/#switch-to-parent-frame), where
we only care about existence of parent frame.
1. This PR adds a constant compile-time bool flag to enable this. This
will be essential to fix "no_browsing_context" next.
2. Fix some wrong usage of `top_level_script_command` in `is_selected`
and `is_enabled`.
3. Add and unify some WARN info related to pipeline in Constellation

Testing: All WebDriver test with new passing cases

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-24 06:42:34 +00:00
sagudev
e0f3679d55 canvas: Pass pattern by ref (#37662)
We pass all other options as ref too.

Testing: Just refactor, but the code is covered by WPT tests.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-24 05:20:38 +00:00
Ngo Iok Ui (Wu Yu Wei)
25fe003af2 Fix IndexedDB WPT coverage (#37607)
The settings for WPT IndexedDB coverage is incorrect. We never ran the
IndexedDB tests actually.

Testing: `tests/wpt/tests/IndexedDB`

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-06-24 03:47:45 +00:00
Ashwin Naren
476b05676f Fix indexeddb threadpool (#37649)
Resolves #37638. Fixes threadpool name and adds a config preference
(`threadpools_indexeddb_workers_max`).

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-06-23 22:06:16 +00:00
Ashwin Naren
2879aa264d Fix image_cache threadpool configuration (#37650)
Similar to #37638. It was using `threadpools_async_runtime_workers_max`,
and `threadpools_image_cache_workers_max` was unused, this PR fixes
that.

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-06-23 22:05:53 +00:00
dependabot[bot]
8138ea6ca7 build(deps): bump gif from 0.13.1 to 0.13.3 (#37646)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [gif](https://github.com/image-rs/image-gif) from 0.13.1 to
0.13.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/image-rs/image-gif/blob/v0.13.3/Changes.md">gif's
changelog</a>.</em></p>
<blockquote>
<h1>v0.13.3</h1>
<ul>
<li>Fix interpretation of LZW stream when multiple intermediate reset
codes are used.</li>
<li>Allow extension blocks of unknown type with the
<code>allow_unknown_blocks</code> option.</li>
</ul>
<h1>v0.13.2</h1>
<ul>
<li>Simplified internal decoder size</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="acf2f6f7e6"><code>acf2f6f</code></a>
Release notes for 0.13.3 (<a
href="https://redirect.github.com/image-rs/image-gif/issues/214">#214</a>)</li>
<li><a
href="9d87cbb55e"><code>9d87cbb</code></a>
Merge pull request <a
href="https://redirect.github.com/image-rs/image-gif/issues/213">#213</a>
from image-rs/backport-ignore-unknown-extension-blocks</li>
<li><a
href="deb37a8f1a"><code>deb37a8</code></a>
Enable CI for backport branch</li>
<li><a
href="9344c1c5d6"><code>9344c1c</code></a>
Extend allow_unknown_chunks to extension blocks</li>
<li><a
href="b1115aac71"><code>b1115aa</code></a>
Better handle reset codes in LZW stream</li>
<li><a
href="e2990d5b49"><code>e2990d5</code></a>
Bump</li>
<li><a
href="7dc58ab494"><code>7dc58ab</code></a>
Clippy</li>
<li><a
href="d27900840e"><code>d279008</code></a>
Use a buffer guaranteeing minimum update size</li>
<li><a
href="ed26c15d99"><code>ed26c15</code></a>
Parse control extension from a buffer</li>
<li><a
href="28010613d2"><code>2801061</code></a>
Simplify reallocs</li>
<li>Additional commits viewable in <a
href="https://github.com/image-rs/image-gif/compare/v0.13.1...v0.13.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=gif&package-manager=cargo&previous-version=0.13.1&new-version=0.13.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 21:06:00 +00:00
dependabot[bot]
896daad5a4 build(deps): bump jpeg-decoder from 0.3.1 to 0.3.2 (#37645)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from
0.3.1 to 0.3.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md">jpeg-decoder's
changelog</a>.</em></p>
<blockquote>
<h2>v0.3.2 (2025-06-15)</h2>
<ul>
<li>Depend on wasm-bindgen 0.2.89 or higher</li>
<li>Fix panic when prediction calculation is invalid</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/image-rs/jpeg-decoder/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jpeg-decoder&package-manager=cargo&previous-version=0.3.1&new-version=0.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 21:05:06 +00:00
dependabot[bot]
46fc072306 build(deps): bump prettyplease from 0.2.33 to 0.2.35 (#37642)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from
0.2.33 to 0.2.35.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/prettyplease/releases">prettyplease's
releases</a>.</em></p>
<blockquote>
<h2>0.2.35</h2>
<ul>
<li>Parenthesize for attributes on range expression (<a
href="https://redirect.github.com/dtolnay/prettyplease/issues/119">#119</a>)</li>
</ul>
<h2>0.2.34</h2>
<ul>
<li>Insert parentheses around binary operation with attribute (<a
href="https://redirect.github.com/dtolnay/prettyplease/issues/117">#117</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3819b845a0"><code>3819b84</code></a>
Release 0.2.35</li>
<li><a
href="9b66a06442"><code>9b66a06</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/prettyplease/issues/119">#119</a>
from dtolnay/attrrange</li>
<li><a
href="4ccba327de"><code>4ccba32</code></a>
Parenthesize for attributes on range expression</li>
<li><a
href="d4875363f4"><code>d487536</code></a>
Release 0.2.34</li>
<li><a
href="1b731ec833"><code>1b731ec</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/prettyplease/issues/117">#117</a>
from dtolnay/binaryattr</li>
<li><a
href="b947e90885"><code>b947e90</code></a>
Insert parentheses around binary operation with attribute</li>
<li>See full diff in <a
href="https://github.com/dtolnay/prettyplease/compare/0.2.33...0.2.35">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettyplease&package-manager=cargo&previous-version=0.2.33&new-version=0.2.35)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 21:04:32 +00:00
dependabot[bot]
d561b9ed07 build(deps): bump num_enum from 0.7.3 to 0.7.4 (#37644)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.7.3 to
0.7.4.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e5dc4da1f8"><code>e5dc4da</code></a>
Release 0.7.4 (<a
href="https://redirect.github.com/illicitonion/num_enum/issues/164">#164</a>)</li>
<li><a
href="6cfb0b152d"><code>6cfb0b1</code></a>
Use <code>core::error::Error</code> when available (<a
href="https://redirect.github.com/illicitonion/num_enum/issues/163">#163</a>)</li>
<li>See full diff in <a
href="https://github.com/illicitonion/num_enum/compare/0.7.3...0.7.4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=num_enum&package-manager=cargo&previous-version=0.7.3&new-version=0.7.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 20:07:15 +00:00
dependabot[bot]
be092382d6 build(deps): bump syn from 2.0.103 to 2.0.104 (#37643)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [syn](https://github.com/dtolnay/syn) from 2.0.103 to 2.0.104.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.104</h2>
<ul>
<li>Disallow attributes on range expression (<a
href="https://redirect.github.com/dtolnay/syn/issues/1872">#1872</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2283a9852a"><code>2283a98</code></a>
Release 2.0.104</li>
<li><a
href="d745687fff"><code>d745687</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1872">#1872</a>
from dtolnay/attrrange</li>
<li><a
href="350a4ab22d"><code>350a4ab</code></a>
Disallow attributes on range expression</li>
<li><a
href="da96f95362"><code>da96f95</code></a>
Add test of attributes on range</li>
<li><a
href="7a79818f44"><code>7a79818</code></a>
Update test suite to nightly-2025-06-19</li>
<li>See full diff in <a
href="https://github.com/dtolnay/syn/compare/2.0.103...2.0.104">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=syn&package-manager=cargo&previous-version=2.0.103&new-version=2.0.104)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 19:19:12 +00:00
dependabot[bot]
cb059aba0a build(deps): bump mach2 from 0.4.2 to 0.4.3 (#37641)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [mach2](https://github.com/JohnTitor/mach2) from 0.4.2 to 0.4.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/JohnTitor/mach2/releases">mach2's
releases</a>.</em></p>
<blockquote>
<h2>0.4.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Add <code>time_value</code> by <a
href="https://github.com/ldm0"><code>@​ldm0</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/25">JohnTitor/mach2#25</a></li>
<li>Add <code>mach-o/dyld.h</code> items by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/32">JohnTitor/mach2#32</a></li>
<li>Add <code>struct</code> prefix on all the structs in C by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/33">JohnTitor/mach2#33</a></li>
<li>chore(ci): Update macOS version by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/37">JohnTitor/mach2#37</a></li>
<li>Configure Renovate by <a
href="https://github.com/renovate"><code>@​renovate</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/36">JohnTitor/mach2#36</a></li>
<li>chore(deps): pin dependencies by <a
href="https://github.com/renovate"><code>@​renovate</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/39">JohnTitor/mach2#39</a></li>
<li>chore: Use original ctest by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/40">JohnTitor/mach2#40</a></li>
<li>chore: Prepare 0.4.3 release by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/41">JohnTitor/mach2#41</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/ldm0"><code>@​ldm0</code></a> made their
first contribution in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/25">JohnTitor/mach2#25</a></li>
<li><a href="https://github.com/renovate"><code>@​renovate</code></a>
made their first contribution in <a
href="https://redirect.github.com/JohnTitor/mach2/pull/36">JohnTitor/mach2#36</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/JohnTitor/mach2/compare/0.4.2...0.4.3">https://github.com/JohnTitor/mach2/compare/0.4.2...0.4.3</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ed16d350ab"><code>ed16d35</code></a>
Merge pull request <a
href="https://redirect.github.com/JohnTitor/mach2/issues/41">#41</a>
from JohnTitor/chore/0.4.3</li>
<li><a
href="86b3f278c4"><code>86b3f27</code></a>
chore: Prepare 0.4.3 release</li>
<li><a
href="6b9a8bcdca"><code>6b9a8bc</code></a>
Merge pull request <a
href="https://redirect.github.com/JohnTitor/mach2/issues/40">#40</a>
from JohnTitor/chore/ctest</li>
<li><a
href="ae47e1935b"><code>ae47e19</code></a>
chore: Use original ctest</li>
<li><a
href="52f3edbfaf"><code>52f3edb</code></a>
Merge pull request <a
href="https://redirect.github.com/JohnTitor/mach2/issues/39">#39</a>
from JohnTitor/renovate/pin-dependencies</li>
<li><a
href="ceee600d4b"><code>ceee600</code></a>
chore(deps): pin dependencies</li>
<li><a
href="ac9f277587"><code>ac9f277</code></a>
chore(renovate): Enable GHA digests helper</li>
<li><a
href="3f3769660c"><code>3f37696</code></a>
Merge pull request <a
href="https://redirect.github.com/JohnTitor/mach2/issues/36">#36</a>
from JohnTitor/renovate/configure</li>
<li><a
href="ab4d126d28"><code>ab4d126</code></a>
Add renovate.json</li>
<li><a
href="d156e25e99"><code>d156e25</code></a>
Merge pull request <a
href="https://redirect.github.com/JohnTitor/mach2/issues/37">#37</a>
from JohnTitor/chore/update-macos-version</li>
<li>Additional commits viewable in <a
href="https://github.com/JohnTitor/mach2/compare/0.4.2...0.4.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mach2&package-manager=cargo&previous-version=0.4.2&new-version=0.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 19:17:17 +00:00
dependabot[bot]
9567661d35 build(deps): bump profiling from 1.0.16 to 1.0.17 (#37640)
Bumps [profiling](https://github.com/aclysma/profiling) from 1.0.16 to
1.0.17.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/aclysma/profiling/blob/master/CHANGELOG.md">profiling's
changelog</a>.</em></p>
<blockquote>
<h2>1.0.17</h2>
<ul>
<li>Update superluminal to 0.4</li>
<li>Update tracy-client to 0.18</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/aclysma/profiling/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=profiling&package-manager=cargo&previous-version=1.0.16&new-version=1.0.17)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 18:57:40 +00:00
dependabot[bot]
3a2b784d1e build(deps): bump zune-jpeg from 0.4.17 to 0.4.18 (#37639)
Bumps [zune-jpeg](https://github.com/etemesi254/zune-image) from 0.4.17
to 0.4.18.
<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.17&new-version=0.4.18)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 18:55:44 +00:00
Narfinger
208d4c620a Allow console commands to appear in log files (#37631)
This enables console.* commands in javascript to be forwarded to the
logger and not just stdout.
The domain for this will be `script::dom::console` which seems
appropate.

Testing: Logs do not have any tests.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-23 18:42:36 +00:00
Mukilan Thiyagarajan
5fdd8ee277 ci: copy resources to C:\ drive on GH hosted runners (#37627)
This logic was removed in #37311. However, based on the recent failures
identified in #37626, it seems like GH hosted runners sometimes do use
the `D:` drive for checkouts. It is unclear if this is always the case
or not, so this patch adds the logic back but with a conditional check
on the workspace path.

Testing: This patch has been tested on a fork.
Fixes: #37626

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-06-23 09:33:58 +00:00
Jonathan Schwender
cd30b78f78 resource_thread: Optimize writing JSON (#37628)
Instead of serializing everything at once in memory it is more efficient
to use `to_writer_pretty`.
The memory allocations from writing the HSTS file to disk showed up very
visibly in DHAT and
should be fixed by streaming the writing. This change should reduce
allocations.

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

---------

Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-06-23 09:23:07 +00:00
Euclid Ye
5e252d0ef6 [WebDriver: Release Action] Fix panic by work around buggy spec (#37624)
1. Narrow the lifetime of `input_cancel_list` to avoid Runtime multiple
BorrowMut error.
2. Work around the buggy spec by removing matching item in
`input_cancel_list` when dispatch `keyUp` and `mouseUp`. See
https://github.com/servo/servo/issues/37579#issuecomment-2990762713

Testing: All WebDriver WPT test.
Fixes: #37579

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-23 08:33:18 +00:00
Kenzie Raditya Tirtarahardja
795367c751 Webdriver: Call webdriver handler on headless EventLoop (#37623)
Previously, `handle_webdriver_messages` only called in
`winit::ApplictionHandler`. This means the webdriver command only looped
in headed (desktop) event loop.

Testing: this will fix webdriver test on headless `test-wpt`, which
widely used in the CI.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-06-23 07:52:53 +00:00
sagudev
8140f00988 Add justfile to gitignore (#37621)
I want to be able to have justfile in local servo repo clone.

Testing: Not needed

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-23 02:37:04 +00:00
Jerens Lensun
877010c5f6 Mach clippy & test-tidy github inline annotation (#37294)
When the --report-ci flag is passed to ./mach clippy or ./mach
test-tidy, the commands emit CI-friendly output to files in the tempy
directory. These files can later be used by [GitHub Workflow
Commands](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-error-message)
for annotations. If the flag is not provided, the default behavior
remains unchanged. Both clippy and test-tidy will limit have 10 limit
annotation

⚠️ Note: For ./mach clippy --report-ci to work correctly, the Clippy
command must use --message-format=json. If it's not specified, CI output
will not be generated, and no warning or error will be shown.

Example PR: https://github.com/jerensl/servo/pull/1/files

Fixes: #37231

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-06-22 15:30:19 +00:00
Jonathan Schwender
18d55f4884 Update fontsan to 63f3cde (#37619)
This bump includes the following changes: 

- Update to ots v9.2.0
- Update to lz4 v1.10.0 (multi-threading improvements)
- Remove miniz dependency
- Fix warning when compiling with MSVC

Testing: Should be covered by existing tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-22 11:52:16 +00:00
Servo WPT Sync
2b209449b5 Sync WPT with upstream (22-06-2025) (#37606)
Automated downstream sync of changes from upstream as of 22-06-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-06-22 01:41:56 +00:00
atbrakhi
c8ee11fe77 DevTools: sources for HTML files should be the whole HTML file (#37456)
To show the contents of inline scripts in the Sources panel, we need to
send the whole HTML file from script to devtools, not just the script
code. This is trickier than the external script case, but we can look to
[how Firefox does
it](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Getting.20the.20original.20page.20HTML.20from.20script/near/524392861)
for some inspiration. The process is as follows:

- when we execute a script
  - notify devtools to create the source actor
- if it’s an external script, send the script code to the devtools
server
  - if it’s an inline script, don’t send any source contents yet
  - devtools stores the contents in the source actor
- while loading a new document
  - buffer the markup, so we can send it to devtools
- when we finish loading a new document
  - send the buffered markup to the devtools server
- devtools stores the contents in any source actors with no contents yet
- when a source actor gets a `source` request
  - if we have the contents, send those contents to the client
- if we don’t have the contents (inline script that loaded while
devtools was closed)
    - FUTURE: try to fetch the markup out of cache
    - otherwise send `<!-- not available; please reload! -->`

Testing: Several tests added to test the changes, also updates an
existing test with correct assertion
Fixes: https://github.com/servo/servo/issues/36874

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2025-06-21 18:46:35 +00:00
Euclid Ye
3feec90528 [WebDriver:Release Actions] Fix wrong comments and Improve codestyle (#37585)
[Spec](https://w3c.github.io/webdriver/#release-actions)
Testing: No behaviour change.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-21 18:31:19 +00:00
Tim van der Lippe
d2a688d798 Use undefined as this in trusted type callbacks (#37594)
As discussed in w3c/trusted-types#468 the spec will be aligned to the
other browsers, which call the callback with undefined as this.

That also allows us to cleanup the JSContext arguments across a couple
of methods.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-21 18:29:09 +00:00
Domenico Rizzo
5579b11cf6 [#26488] Refactors WebGLFramebuffer deletion (#37589)
Testing: No tests added
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2025-06-21 18:27:39 +00:00
sagudev
f370606fa8 canvas: Make draw_options non optional in fill_rect (#37603)
All other draw functions already have them non-optional and we always
passed `Some` anyway.

Testing: Existing WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-21 09:34:28 +00:00
Ngo Iok Ui (Wu Yu Wei)
927573de97 script: complete resolve_module_specifier (#37552)
Implement whole spec of `resolve_module_specifier`. Servo can now
support script element with import map type!

Testing: `tests/wpt/tests/import-map`
Fixes: #37316 #36394

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-21 06:17:27 +00:00
Bhuwan Pandit
d7269c0f3b refact: move create_image_bitmap to ImageBitmap Impl (#37348) (#37602)
This PR moves the `create_image_bitmap` method from `GlobalScope` to a
helper function within the `ImageBitmap` implementation in
`imagebitmap.rs`.

Moving this method improves code organization and maintainability. Given
that `globalscope.rs` is already quite large, relocating
`create_image_bitmap` to `imagebitmap.rs` places it closer to the
`ImageBitmap` struct it primarily operates on.

As mentioned in the issue description (No dedicated tests are required
for this change, as long as the project builds), which it does using
`./mach build`. Also ran `./mach fmt` and `./mach test-tidy` which both
didn't report any issue.

Closes #37348

Signed-off-by: Bhuwan Pandit <bhuwanpandit109@gmail.com>
2025-06-21 04:12:11 +00:00
Ngo Iok Ui (Wu Yu Wei)
0832ec5d96 constellation: add multiprocess support on Windows (#37580)
Thanks to ipc-channel 0.20. It's now possible to enable multiprocess
mode on Windows.

Testing: On Windows, run `./mach build -r && ./mach run -r -- -M` We
don't have any CI workflows run on multiprocess IIRC.

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-21 02:32:18 +00:00
dependabot[bot]
ed317ba3e4 build(deps): bump webpki-roots from 1.0.0 to 1.0.1 (#37599)
Bumps [webpki-roots](https://github.com/rustls/webpki-roots) from 1.0.0
to 1.0.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rustls/webpki-roots/releases">webpki-roots's
releases</a>.</em></p>
<blockquote>
<h2>1.0.1</h2>
<p>Remove Chunghwa Telecom &quot;ePKI Root Certification
Authority&quot;. See the <a
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1891438">upstream
issue</a> for details.</p>
<h2>What's Changed</h2>
<ul>
<li>1.0.1: June 2025 updates by <a
href="https://github.com/ctz"><code>@​ctz</code></a> in <a
href="https://redirect.github.com/rustls/webpki-roots/pull/101">rustls/webpki-roots#101</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rustls/webpki-roots/compare/v/1.0.0...v/1.0.1">https://github.com/rustls/webpki-roots/compare/v/1.0.0...v/1.0.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="dd51e4d936"><code>dd51e4d</code></a>
Prepare 1.0.1</li>
<li><a
href="6a4bf92fa5"><code>6a4bf92</code></a>
Take upstream changes</li>
<li>See full diff in <a
href="https://github.com/rustls/webpki-roots/compare/v/1.0.0...v/1.0.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpki-roots&package-manager=cargo&previous-version=1.0.0&new-version=1.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 17:39:53 +00:00
dependabot[bot]
9c3dbc7fd6 build(deps): bump markup5ever from 0.16.1 to 0.16.2 (#37600)
Bumps [markup5ever](https://github.com/servo/html5ever) from 0.16.1 to
0.16.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/servo/html5ever/commits/xml5ever-v0.16.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=markup5ever&package-manager=cargo&previous-version=0.16.1&new-version=0.16.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 17:38:57 +00:00
dependabot[bot]
886f0b760e build(deps): bump xcursor from 0.3.8 to 0.3.9 (#37598)
Bumps [xcursor](https://github.com/esposm03/xcursor-rs) from 0.3.8 to
0.3.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/esposm03/xcursor-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=xcursor&package-manager=cargo&previous-version=0.3.8&new-version=0.3.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 17:32:17 +00:00
dependabot[bot]
232f2cebd1 build(deps): bump errno from 0.3.12 to 0.3.13 (#37597)
Bumps [errno](https://github.com/lambda-fairy/rust-errno) from 0.3.12 to
0.3.13.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/lambda-fairy/rust-errno/blob/main/CHANGELOG.md">errno's
changelog</a>.</em></p>
<blockquote>
<h1>[0.3.13] - 2025-06-19</h1>
<ul>
<li>Update windows-sys requirement from &gt;=0.52, <!-- raw HTML omitted
-->=0.52, &lt;=0.60
<a
href="https://redirect.github.com/lambda-fairy/rust-errno/pull/113">#113</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d09eaa4b54"><code>d09eaa4</code></a>
Release 0.3.13. (<a
href="https://redirect.github.com/lambda-fairy/rust-errno/issues/114">#114</a>)</li>
<li><a
href="9ec212e7e8"><code>9ec212e</code></a>
Update windows-sys requirement from &gt;=0.52, &lt;=0.59 to &gt;=0.52,
&lt;=0.60 (<a
href="https://redirect.github.com/lambda-fairy/rust-errno/issues/113">#113</a>)</li>
<li>See full diff in <a
href="https://github.com/lambda-fairy/rust-errno/compare/v0.3.12...v0.3.13">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=errno&package-manager=cargo&previous-version=0.3.12&new-version=0.3.13)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 17:23:50 +00:00
Martin Robinson
69ff4afa58 Rename script_layout_interface to layout_api (#37591)
Now that we are standardizing on the `_traits` crates becoming `_api`
and exposing the API of the crate that they get their name from [^1],
`script_layout_interface` becomes `layout_api` as it exposes the API for
`layout` that is used by `script` This brings the crate in line with the
naming of the other ones in `shared`.

[^1]:
https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Organizing.20*_traits.20crates/with/396893711

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 17:13:05 +00:00
dependabot[bot]
85c849d843 build(deps): bump the gstreamer-related group with 4 updates (#37595)
Bumps the gstreamer-related group with 4 updates: gstreamer,
gstreamer-gl, [glib](https://github.com/gtk-rs/gtk-rs-core) and
[glib-macros](https://github.com/gtk-rs/gtk-rs-core).

Updates `gstreamer` from 0.23.6 to 0.23.7

Updates `gstreamer-gl` from 0.23.6 to 0.23.7

Updates `glib` from 0.20.10 to 0.20.12
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/gtk-rs/gtk-rs-core/releases">glib's
releases</a>.</em></p>
<blockquote>
<h2>0.20.12</h2>
<pre><code>Carlos Martín Nieto:
      examples: add some docs to the example using the Properties macro
      glib-macros: Properties: copy property docs to getter
      glib-macros: Properties: allow setting getter and setter docs
      glib-macros: Properties: copy over the doc comments more elegantly
      glib-macros: extend `Properties` docs with the getter-setter docs
      glib-macros: add some generic comments for property notifications
<p>Sebastian Dröge:<br />
glib: Remove nonsense comments about <code>glib::Slice</code> pointers
being <code>NULL</code>-terminated<br />
glib: Make sure that empty <code>glib::StrV</code> /
<code>glib::PtrSlice</code> returns a valid pointer<br />
Fix new nightly warning about confusing lifetime flows<br />
Update Cargo.lock<br />
tests: Add Cargo.lock<br />
Update version to 0.20.12</p>
<p>nozwock:<br />
Clarify usage requirement of <code>Properties</code> macro for enum
types<br />
Link to <code>Properties</code> macro section on usage with
<code>Enum</code> derived enums<br />
Derive <code>Default</code> for <code>MyEnum</code> in example of
<code>Properties</code> macro<br />
</code></pre></p>
<h2>0.20.11</h2>
<pre><code>Sebastian Dröge:
      Update version to 0.20.11
<p>Sophie Herold:<br />
Revert &quot;gio: manually implement content_type_guess&quot;<br />
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="337dde55bb"><code>337dde5</code></a>
Update version to 0.20.12</li>
<li><a
href="ffe84f95a3"><code>ffe84f9</code></a>
Merge pull request <a
href="https://redirect.github.com/gtk-rs/gtk-rs-core/issues/1744">#1744</a>
from sdroege/0.20-backports</li>
<li><a
href="85af5ec466"><code>85af5ec</code></a>
tests: Add Cargo.lock</li>
<li><a
href="c6e5ceaa08"><code>c6e5cea</code></a>
Update Cargo.lock</li>
<li><a
href="ad487aab64"><code>ad487aa</code></a>
Fix new nightly warning about confusing lifetime flows</li>
<li><a
href="02baaed026"><code>02baaed</code></a>
Derive <code>Default</code> for <code>MyEnum</code> in example of
<code>Properties</code> macro</li>
<li><a
href="cce148b613"><code>cce148b</code></a>
glib: Make sure that empty <code>glib::StrV</code> /
<code>glib::PtrSlice</code> returns a valid po...</li>
<li><a
href="311cb1fb16"><code>311cb1f</code></a>
glib: Remove nonsense comments about <code>glib::Slice</code> pointers
being <code>NULL</code>-term...</li>
<li><a
href="3baeb181cf"><code>3baeb18</code></a>
Link to <code>Properties</code> macro section on usage with
<code>Enum</code> derived enums</li>
<li><a
href="af720cb81f"><code>af720cb</code></a>
Clarify usage requirement of <code>Properties</code> macro for enum
types</li>
<li>Additional commits viewable in <a
href="https://github.com/gtk-rs/gtk-rs-core/compare/0.20.10...0.20.12">compare
view</a></li>
</ul>
</details>
<br />

Updates `glib-macros` from 0.20.10 to 0.20.12
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/gtk-rs/gtk-rs-core/releases">glib-macros's
releases</a>.</em></p>
<blockquote>
<h2>0.20.12</h2>
<pre><code>Carlos Martín Nieto:
      examples: add some docs to the example using the Properties macro
      glib-macros: Properties: copy property docs to getter
      glib-macros: Properties: allow setting getter and setter docs
      glib-macros: Properties: copy over the doc comments more elegantly
      glib-macros: extend `Properties` docs with the getter-setter docs
      glib-macros: add some generic comments for property notifications
<p>Sebastian Dröge:<br />
glib: Remove nonsense comments about <code>glib::Slice</code> pointers
being <code>NULL</code>-terminated<br />
glib: Make sure that empty <code>glib::StrV</code> /
<code>glib::PtrSlice</code> returns a valid pointer<br />
Fix new nightly warning about confusing lifetime flows<br />
Update Cargo.lock<br />
tests: Add Cargo.lock<br />
Update version to 0.20.12</p>
<p>nozwock:<br />
Clarify usage requirement of <code>Properties</code> macro for enum
types<br />
Link to <code>Properties</code> macro section on usage with
<code>Enum</code> derived enums<br />
Derive <code>Default</code> for <code>MyEnum</code> in example of
<code>Properties</code> macro<br />
</code></pre></p>
<h2>0.20.11</h2>
<pre><code>Sebastian Dröge:
      Update version to 0.20.11
<p>Sophie Herold:<br />
Revert &quot;gio: manually implement content_type_guess&quot;<br />
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="337dde55bb"><code>337dde5</code></a>
Update version to 0.20.12</li>
<li><a
href="ffe84f95a3"><code>ffe84f9</code></a>
Merge pull request <a
href="https://redirect.github.com/gtk-rs/gtk-rs-core/issues/1744">#1744</a>
from sdroege/0.20-backports</li>
<li><a
href="85af5ec466"><code>85af5ec</code></a>
tests: Add Cargo.lock</li>
<li><a
href="c6e5ceaa08"><code>c6e5cea</code></a>
Update Cargo.lock</li>
<li><a
href="ad487aab64"><code>ad487aa</code></a>
Fix new nightly warning about confusing lifetime flows</li>
<li><a
href="02baaed026"><code>02baaed</code></a>
Derive <code>Default</code> for <code>MyEnum</code> in example of
<code>Properties</code> macro</li>
<li><a
href="cce148b613"><code>cce148b</code></a>
glib: Make sure that empty <code>glib::StrV</code> /
<code>glib::PtrSlice</code> returns a valid po...</li>
<li><a
href="311cb1fb16"><code>311cb1f</code></a>
glib: Remove nonsense comments about <code>glib::Slice</code> pointers
being <code>NULL</code>-term...</li>
<li><a
href="3baeb181cf"><code>3baeb18</code></a>
Link to <code>Properties</code> macro section on usage with
<code>Enum</code> derived enums</li>
<li><a
href="af720cb81f"><code>af720cb</code></a>
Clarify usage requirement of <code>Properties</code> macro for enum
types</li>
<li>Additional commits viewable in <a
href="https://github.com/gtk-rs/gtk-rs-core/compare/0.20.10...0.20.12">compare
view</a></li>
</ul>
</details>
<br />


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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 17:06:27 +00:00
Martin Robinson
309485d2db pixels: Move Snapshot and related data structures to pixels (#37590)
1. The `shared` directory is for the "_traits" crates, which will likely
   be moved out of this directly at some point and renamed "_api". These
   crates expose the API of crates to avoid circular dependencies.
   `Snapshot` isn't really this.
2. `Snapshot` is essentially a specialied kind of `Image` so it makes
   sense that it is grouped with other image-related things in `pixels`.

Testing: This should not change any behavior so is covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 14:47:06 +00:00
Martin Robinson
80a7de8c9c libservo: Remove TouchEventType argument from WebView::notify_scroll_event (#37588)
The compositor always does the same thing with these events regardless
of the phase, so I think it is completely unecessary.

Testing: This shouldn't change behavior at all, so is covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 13:59:01 +00:00
Euclid Ye
ce4da2bf97 [WebDriver] Implement "Find Element(s) From ShadowRoot" (#37578)
Also renamed all "CSS" selector variants of `WebDriverScriptCommand` to
avoid confusion.

Testing: Mostly `./mach test-wpt -r
tests\wpt\tests\webdriver\tests\classic\find_*_from_shadow_root\find.py
--product servodriver`
But many other test also relies on finding element(s) from shadow root,
so I ran the entire test.
All deleted lines are from test expectations.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-20 11:54:39 +00:00
Ngo Iok Ui (Wu Yu Wei)
c9d503c458 fix: panic when mouse leave on Windows (#37587)
Add mouse leave event to the check to prevent panic.

Fixes: #37586

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-20 11:31:57 +00:00
Josh Matthews
30ad91b595 net: Avoid all-encompassing synchronous IPC return type for IndexedDB operations (#37576)
This is finishing some incomplete cleanup from #33044. Kitchen sink enum
types like IndexedDBThreadReturnType make code harder to read and
require ignoring variants that will never be sent in many cases.

Testing: No behaviour change; existing WPT tests suffice.
Fixes: part of #6963

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-20 10:06:56 +00:00
Martin Robinson
3774ef00d4 script: Get scroll offsets from layout (#37509)
No longer store scroll offsets for elements in the DOM. Instead
consistently get and set these in layout's `ScrollTree`. This more
consistently requires layout to run when querying scroll offsets, which
ensures that they are up-to-date and properly bounded by scrollable
overflow area.

Testing: This causes several WPT tests to start passing, and one to
start
failing. In the case of
`/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html`, I believe the
issue
is that we don't properly handle scrolling and shadow DOM elements.
Before, the
faulty scrolling was hiding this issue.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 09:39:12 +00:00
Josh Matthews
518729a4f5 script: Expose IDBVersionChangeEvent to worker globals. (#37573)
IDBVersionChangeEvent is already used internally from non-Window
globals, but the constructor wasn't set up to expose the interface
object in worker globals.

Testing: The effort involved in adding a test for this does not seem
worthwhile—we get this for free once we enable the indexeddb preference
while our interfaces.worker.js test is running.
Fixes: part of #6963

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-20 07:42:36 +00:00
Steven Novaryo
b622157c10 Layout: Add Debug Print for The Scroll Tree (#37522)
Add debug option `dump-scroll-tree` to print the scroll tree that had
been stored after each reflow, or log that the scoll tree is not
initialized yet..

To reduce the coupling, the debug print operation will process the
scroll tree node list that have been constructed in the stacking context
tree. It will generate a adjacency list and do preorder traversal. The
order of the tree then will depends on the order of the node in the node
list that has been constructed. Which, in turn, correspond to the
declaration order of the nodes.

This would help with the analysis and development of post composite
queries and its caching.

cc: @xiaochengh

Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
2025-06-20 07:16:30 +00:00
Tim van der Lippe
d70f6ace24 Add top-level creation URL for global scope (#37342)
Global scopes have two creation URLs: one for itself and one for the
"top-level" scope. It's not immediately obvious what is considered
top-level here (it is not strictly defined in the specification).

In any case, reports need the creation URL of the scope itself, not the
top-level version. Therefore, propagate this information from all
scopes, where the worker and worklets remain to pass in `None` for their
top-level scope.

Part of #37328

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-20 07:07:28 +00:00
Andrei Volykhin
a426a2e884 imagebitmap: Add support of Blob as ImageBitmapSource (#37560)
Follow to the HTML specification and support of Blob as
ImageBitmapSource
to able use it as intermediate instance in "fetch() -> Blob ->
ImageBitmap" execution sequence.
https://html.spec.whatwg.org/multipage/#imagebitmapsource

The specification says what these steps must run in parallel
(outside the createImageBitmap task), but currently loading bytes from
Blob
and later image decoding happen in synchronous order while
promise is fullfilled or rejected on bitmap task source.
https://html.spec.whatwg.org/multipage/#the-imagebitmap-interface:blob-4

Testing: Improvements in the following WPT tests
- html/canvas/element/compositing/2d.composite*
- html/canvas/element/drawing-images-to-the-canvas/2d.drawImage*
- html/canvas/element/manual/imagebitmap/createImageBitmap*
- html/canvas/offscreen/compositing/2d.composite
- html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage
- webgl/tests/conformance/textures/image_bitmap_from_blob/*

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-20 06:53:04 +00:00
Josh Matthews
9dc1dde7cb script: Store result value in IDBRequest. (#37568)
While this introduces many new crashes in the test results, that's
actually progress. Previously a huge number of tests were failing early
because we never persisted the load-bearing `result` value for
upgradeneeded events, so now we get to see much more interesting
failures in our IndexedDB implementation.

Testing: Existing WPT testsuite for IndexedDB.
Fixes: part of #6963

Depends on #37567.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-20 04:51:56 +00:00
Josh Matthews
52dc1fa88d script: Support creating a DOMStringList for any global. (#37567)
There were a lot of crashing IndexedDB tests caused by code in
DOMStringList that required a Window object despite being exposed to
non-Window globals.

Testing: Lots of existing tests no longer crash.
Fixes: part of #6963

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-20 03:16:46 +00:00
Euclid Ye
b331cb4603 [WebDriver: handle_get_shadow_root] Fix Serialization problem (#37564)
1. Correctly Serialize the ShadowRoot. Previously, it contains a nested
element identifier "element-6066-11e4-a52e-4f735466cecf"
2. Improve coding style with what I learnt from Josh today

Testing: Passing way more "Find Elements from Shadow Root" test locally
now
Fixes: #37559

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-20 03:07:36 +00:00
sagudev
7d1d50f703 Remove Snapshot::from_shared_memory to avoid double allocation (#37562)
It was always misused, causing extra allocations all over the place.
Discovered in
https://github.com/servo/servo/pull/37560#discussion_r2157222917

Testing: WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-20 02:09:09 +00:00
dependabot[bot]
a97cde0a6f build(deps): bump image-webp from 0.2.2 to 0.2.3 (#37565)
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=image-webp&package-manager=cargo&previous-version=0.2.2&new-version=0.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-19 17:00:10 +00:00
Jonathan Schwender
a0fafac29c android/ohos: Respect user provided TARGET_CFLAGS (#37563)
Preserve user set TARGET_CFLAGS and co.
This allows users to pass additional CFLAGS, when compiling code for the
target, e.g. to optimize for a specific CPU.

Testing: The default behavior if the environment variables are not set
is unchanged and covered by existing CI tests.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-19 16:15:57 +00:00
Usman Yahaya Baba
7d2c9ec19c Fix network event update Message (#37543)
- Add `ResourceArrayType` with `Available` and `Updated` variants
- Rename `resources-available` and `resource-available` to
`resources-array` ,`resource-array`
- Add `ResourceArrayType` as an argument to decide the type of resources
- Add `Option<ResponseContentMsg>`,`Option<ResponseStartMsg>`,
`Option<ResponseCookiesMsg>`,
`Option<ResponseHeadersMsg>`,`Option<RequestCookiesMsg>`,
`Option<RequestHeadersMsg>`, `total_time`, `security_state` to
`NetworkEventActor` struct , and serialize the data in each to
`resource_updates` , flattening the nested arrays into a single JSON
- Refactor the following methods `request_headers`,`response_start` ,
`response_content`,`response_cookies`,`response_headers`,
`request_cookies`,`total_time` to associated functions passing
`HttpRequest` and `HttpResponse` as parameters .

Testing: Ran servo with devtools flag to see the logs corresponding to
the changes
Fixes: https://github.com/servo/servo/issues/37479

This PR Builds on https://github.com/servo/servo/pull/37517 and was
opened due to merge conflicts and branch issues

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-06-19 16:00:37 +00:00
CarePackage17
8edae71286 Upgrade version of Android in default user agent string (#37524)
Fixes: #37111

---------

Signed-off-by: CarePackage17 <5157010+CarePackage17@users.noreply.github.com>
2025-06-19 13:56:56 +00:00
Martin Robinson
f0eb29206d Make the crown disabled warning clearer and less scary (#37535)
Instead of printing a Rust compilation warning, simply print a message
before every build (when using `mach`) that shows the build
configuration and whether or not `crown` is enabled.

Fixes #32597.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-19 12:44:26 +00:00
Simon Wülker
824755d868 Use the document encoding when parsing a <video> elements poster URL (#37556)
Testing: Observing the parsed poster URL is not possible by javascript
and would require the server to somehow tell the client which URL was
requested. I don't know how to do that in WPT and I don't think the
effort is worth it.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-19 12:41:30 +00:00
Oriol Brufau
b394727ff6 Upgrade Stylo to 2025-06-03 (#37444)
This continues #36835

Changelog:
- Upstream:
ca369cbc83...7e2201c32c
- Servo fixups:
f387e6396c...2e1f66b068

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

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-19 12:30:32 +00:00
Martin Robinson
e5c328d660 canvas: Don't do operations on paths with uninvertible transforms (#37551)
When the path is created with an uninvertible transform, don't do any
path-based operations. Now `ensure_path()` returns a `Path` object and
this change adds early returns which prevent trying to use it.

Testing: This change adds a WPT crash test.
Fixes #36995.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-19 10:48:20 +00:00
Simon Wülker
a27c9ee691 Handle nonmappable code points in Document::encoding_parse_a_url (#37541)
This is a followup to https://github.com/servo/servo/pull/33825. Using
`Encoder::encode` introduced a subtle bug: That function will silently
replace nonmappable code points (such as `㐀` in euc-jp). The url spec
however expects nonmappable characters to be treated differently. There
is actually an open bug in the `rust-url` repo about this:
https://github.com/servo/rust-url/issues/649, with the conclusion
apparently being that this should not be implemented by the url crate
itself.

Gecko implementation of the equivalent algorithm for reference:
https://searchfox.org/mozilla-central/rev/d52edf7ea4236446e118a2edc815023c5479663f/netwerk/base/nsStandardURL.cpp#116-172.

Testing: More web platform tests pass

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

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-19 10:14:45 +00:00
Rodion Borovyk
3a54ddd034 script Exclude CDATASection nodes from Node::normalize() (#37550)
Exclude CDATASection nodes from Node::normalize. I made it under the
assumption that CDATAs can't have children so we don't need to go into
the `else node.Normalize()` branch on line 3485 with them, hope this is
correct.

Testing: covered by `dom/nodes/Node-normalize.html`
Fixes: https://github.com/servo/servo/issues/37006

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-06-19 10:08:07 +00:00
Andrei Volykhin
06b5422abf htmlvideoelement: Fix poster frame processing algorithm (#37533)
According to HTML specification the poster attribute determines the
element's poster frame
(regardless of the value of the element's show poster flag).
https://html.spec.whatwg.org/multipage/#poster-frame

So the poster frame and the show poster flag is orthogonal to each
other, the latest one only controls
when browser should display the poster frame and should do not block
accepting video frames
from media pipeline (e.g. on new_preroll callback from video sink).

During layout the video element should select the current frame which
will be presented
based on first matching condition from the list:

https://html.spec.whatwg.org/multipage/#the-video-element:the-video-element-7

Testing: Improvements in the following WPT tests
- html/canvas/element/manual/imagebitmap/createImageBitmap*
- html/semantics/embedded-content/the-canvas-element/*

Fixes: #37165

---------

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-06-19 09:55:10 +00:00
batu_hoang
d0100797e8 [webdriver] Move Webdriver to ServoShell (#36714)
Moving `webdriver` to `servoshell`:

- Let `servoshell` manage lifecycle of `webdriver`
- One by one, move the handling of webdriver commands from
`constellation` to `embedder`

Partially fix: https://github.com/servo/servo/issues/37370
Partially fix webdriver test timeout with `no_top_browsing_context`

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-19 09:52:01 +00:00
Narfinger
d55e2c4c90 Profile: Resident Segments was not correctly parsing /proc/self/smaps as the regexp did not work anymore. (#37549)
Resident Segments was not being correctly parsed because the regexp
changed.

Testing: I do not think memory reporting has testcases. We keep the old
output intact (i.e., resident) while adding the new output
`resident-according-to-smaps` which was previously evaluated to an empty
vector on linux. Other targets always return the empty vector.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-19 09:19:31 +00:00
shuppy
fd1255932b Devtools: make mach test-devtools use BuildType (#37548)
`mach test-devtools` was previously hard-coded to using the release
build, which is confusing and different from how the rest of mach works
(e.g. `mach build`, `mach run`). This patch makes `mach test-devtools`
run with the debug build by default, or the other builds with
`--release` or `--profile`.

Testing: this patch directly affects our devtools tests
Fixes: many hours of head scratching

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-06-19 08:09:50 +00:00
Kenzie Raditya Tirtarahardja
55730e99df script: Reverse wheel event delta sign to match specification-defined behavior (#37461)
Fix wheel event, either dispatched from window or webdriver:
- Positive deltaY means scrolling down, negative deltaY means scrolling
up
- Positive deltaX means scrolling right, negative deltaX means scrolling
left

Tests: Many scrolling interaction test will depend on this.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-06-19 07:45:10 +00:00
Jason Tsai
07ecf34e64 feat(script): parse script element importmap type (#37547)
Support parsing script element to `importmap` type

Testing: Pass WPT
Fixes: part of https://github.com/servo/servo/issues/37316

Signed-off-by: Jason Tsai <git@pews.dev>
2025-06-19 07:06:18 +00:00
batu_hoang
49be5ca05a Implement webdriver release action (#37484)
- Implement webdriver release action.
- Improve `Input Cancel List`.

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

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-19 07:03:38 +00:00
Euclid Ye
212ce933e5 script::webdriver_handlers: Implement "get a known shadow root" (#37546)
Implement "get a known shadow root" and reduce some duplication
This is still a preparation PR to ["find element(s) from shadow
root"](https://w3c.github.io/webdriver/#find-element-from-shadow-root)

Testing: No Behaviour change.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-19 05:32:17 +00:00
Ashwin Naren
ed9a79f3f4 Initial IndexedDB Support (#33044)
Adds indexeddb support to servo. At the moment heed is being used as the
backend, although this can be swapped out by implementing `KvsEngine`.
This PR adds a thread + a thread pool for Indexeddb related operations.
Also `database_access_task_source` is added for Indexeddb related
operations.

This is a partial rewrite of #25214. (Reopened due to branching issue)

Fixes #6963

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Rasmus Viitanen <rasviitanen@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-06-19 05:19:07 +00:00
dependabot[bot]
d33cf8fbd1 build(deps): bump autocfg from 1.4.0 to 1.5.0 (#37537)
Bumps [autocfg](https://github.com/cuviper/autocfg) from 1.4.0 to 1.5.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d912169ed6"><code>d912169</code></a>
Merge pull request <a
href="https://redirect.github.com/cuviper/autocfg/issues/78">#78</a>
from cuviper/release-1.5.0</li>
<li><a
href="57c8793dfc"><code>57c8793</code></a>
Release 1.5.0</li>
<li><a
href="feb385b286"><code>feb385b</code></a>
Merge pull request <a
href="https://redirect.github.com/cuviper/autocfg/issues/77">#77</a>
from cuviper/edition</li>
<li><a
href="f332b4df50"><code>f332b4d</code></a>
Add methods to get/set the edition</li>
<li><a
href="706fa58c2e"><code>706fa58</code></a>
Merge pull request <a
href="https://redirect.github.com/cuviper/autocfg/issues/76">#76</a>
from cuviper/clippy</li>
<li><a
href="4ec911c0d5"><code>4ec911c</code></a>
Fix clippy::nonminimal_bool</li>
<li><a
href="3d217f79cc"><code>3d217f7</code></a>
Merge pull request <a
href="https://redirect.github.com/cuviper/autocfg/issues/75">#75</a>
from cuviper/probe_cleanup</li>
<li><a
href="b1928bac4c"><code>b1928ba</code></a>
Remove probe output files</li>
<li>See full diff in <a
href="https://github.com/cuviper/autocfg/compare/1.4.0...1.5.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=autocfg&package-manager=cargo&previous-version=1.4.0&new-version=1.5.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-06-18 17:33:22 +00:00
dependabot[bot]
ec82370cc9 build(deps): bump libc from 0.2.173 to 0.2.174 (#37536)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.173 to 0.2.174.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/releases">libc's
releases</a>.</em></p>
<blockquote>
<h2>0.2.174</h2>
<h3>Added</h3>
<ul>
<li>Linux: Make <code>pidfd_info</code> fields pub (<a
href="https://redirect.github.com/rust-lang/libc/pull/4487">#4487</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Gnu x32: Add missing <code>timespec.tv_nsec</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4497">#4497</a>)</li>
<li>NuttX: Use <code>nlink_t</code> type for <code>st_nlink</code> in
<code>struct stat</code> definition (<a
href="https://redirect.github.com/rust-lang/libc/pull/4483">#4483</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Allow new <code>unpredictable_function_pointer_comparisons</code>
lints (<a
href="https://redirect.github.com/rust-lang/libc/pull/4489">#4489</a>)</li>
<li>OpenBSD: Fix some clippy warnings to use <code>pointer::cast</code>.
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4490">#4490</a>)</li>
<li>Remove unessecary semicolons from definitions of
<code>CMSG_NXTHDR</code>. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4492">#4492</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/blob/0.2.174/CHANGELOG.md">libc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/libc/compare/0.2.173...0.2.174">0.2.174</a>
- 2025-06-17</h2>
<h3>Added</h3>
<ul>
<li>Linux: Make <code>pidfd_info</code> fields pub (<a
href="https://redirect.github.com/rust-lang/libc/pull/4487">#4487</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Gnu x32: Add missing <code>timespec.tv_nsec</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4497">#4497</a>)</li>
<li>NuttX: Use <code>nlink_t</code> type for <code>st_nlink</code> in
<code>struct stat</code> definition (<a
href="https://redirect.github.com/rust-lang/libc/pull/4483">#4483</a>)</li>
</ul>
<h3>Other</h3>
<ul>
<li>Allow new <code>unpredictable_function_pointer_comparisons</code>
lints (<a
href="https://redirect.github.com/rust-lang/libc/pull/4489">#4489</a>)</li>
<li>OpenBSD: Fix some clippy warnings to use <code>pointer::cast</code>.
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4490">#4490</a>)</li>
<li>Remove unessecary semicolons from definitions of
<code>CMSG_NXTHDR</code>. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4492">#4492</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ea6f07f982"><code>ea6f07f</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/4500">#4500</a>
from tgross35/release</li>
<li><a
href="ce31fdaf1c"><code>ce31fda</code></a>
chore: release libc 0.2.174</li>
<li><a
href="296b5801e9"><code>296b580</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/4499">#4499</a>
from tgross35/backport-hungarian-wax</li>
<li><a
href="264a5399ab"><code>264a539</code></a>
Add missing timespec.tv_nsec for gnux32</li>
<li><a
href="7d92568ed6"><code>7d92568</code></a>
fix: use nlink_t type for st_nlink in struct stat definition for
NuttX</li>
<li><a
href="790180ba16"><code>790180b</code></a>
Remove unessecary semicolons from definitions of
<code>CMSG_NXTHDR</code>.</li>
<li><a
href="1e99d50bc9"><code>1e99d50</code></a>
make pidfd_info fields pub</li>
<li><a
href="c08c5073ef"><code>c08c507</code></a>
openbsd: Fix some clippy warnings to use
<code>pointer::cast</code>.</li>
<li><a
href="513405844c"><code>5134058</code></a>
Allow new <code>unpredictable_function_pointer_comparisons</code>
lints</li>
<li>See full diff in <a
href="https://github.com/rust-lang/libc/compare/0.2.173...0.2.174">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.173&new-version=0.2.174)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 17:27:31 +00:00
Bhuwan Pandit
04bcafa140 chore: Simplify tracing with servo_tracing macro (#36661) (#37497)
This pull request refactors existing tracing annotations to leverage the
new `servo_tracing::instrument` macro introduced in #36573.

Specifically, the following transformations were applied:
- Removed `#[cfg_attr(feature = "tracing", ...)]` wrappers.
- Replaced `tracing::instrument` with `servo_tracing::instrument`.
- Removed `level = "trace"`
- Removed `fields(servo_profiling = true)` from tracing attributes
however retained others like `name`. `skip type`

Closes: #36661

---------

Signed-off-by: Bhuwan Pandit <bhuwanpandit109@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-18 16:18:04 +00:00
Martin Robinson
bdf8c0ebc8 layout: Do not add empty border images to the display list (#37534)
Zero-sized gradient border images cause WebRender to panic, so simply
don't add them to the display list.

Testing: This change adds a WPT crash test.
Fixes: #37432

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-18 15:53:29 +00:00
Taym Haddadi
fc2135cc02 implement Writablestreamdefaultcontroller abortcontroller (#37511)
using abort signal and abortcontroller in
Writablestreamdefaultcontroller

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

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-06-18 15:26:05 +00:00
Euclid Ye
3ee339eb6d script::webdriver_handler: Fully implement get_known_element (#37532)
1. `get_known_element`: Refactor to follow same step of spec (which
reduces unnecessary search) and implement previously missing step 4.2:
If node is stale return error with error code stale element reference.
An element is stale if its node document is not the active document or
if it is not connected.

2. Refactor `find_node_by_unique_id_in_document` to make it not check
error and really return a `Option<DomRoot<Node>>` as the name suggests.
This will greatly reduce duplication when implement [get a known shadow
root](https://w3c.github.io/webdriver/#dfn-get-a-known-shadow-root) soon

Testing: All WebDriver Conformance test after removing two problematic
commits in #37520

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-18 14:43:07 +00:00
Domenico Rizzo
b3c66f4ff4 [#26488] Improves WebGLBuffer drop impl (#37512)
Testing: No tests added
Fixes: Partially #26488

---------

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2025-06-18 12:14:16 +00:00
Tony
b9fcc95992 libservo: Allow embedders to signal when the cursor has left the WebView (#37317)
Currently, the hover state will stay when the mouse moves out of the
webview, this PR fixes it

Testing: Hover on the `About` on servo.org, and then move the mouse up
to the browser UI, see the hover state resets

Signed-off-by: Tony <legendmastertony@gmail.com>
2025-06-18 11:59:11 +00:00
shuppy
0896341285 Devtools: refactor source actor state (#37528)
We currently store the source contents in both the SourceActor and the
ThreadActor’s SourceManager, which is redundant. We also currently send
the source contents in thread `sources` responses and watcher
`resources-available-array` messages, but in both cases this is
unnecessary (and ignored by the client).

This patch merges SourceData into SourceActor, making the latter the
single source of truth for source-related state. We also create a
SourceForm type, which represents the subset of source-related state
that gets sent in thread `sources` responses (and for now, watcher
`resources-available-array` messages).

Finally we rename `source_urls` → `source_actor_names` and `new_source`
→ `new_registered` for clarity.

Testing: no changes to client-facing behaviour, and this is covered by
tests

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-06-18 11:11:46 +00:00
Ngo Iok Ui (Wu Yu Wei)
97011a53ac chore: update ipc-channel to v0.20.0 (#36496)
Companion PR of https://github.com/servo/media/pull/433 and
https://github.com/servo/ipc-channel/pull/390

Testing: existing WPT should pass

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-18 08:25:38 +00:00
Kenzie Raditya Tirtarahardja
cdc8b45965 [WebDriver] Add synchronization for key action (#37403)
Implement action synchronization for key event. Previously only done for
pointer https://github.com/servo/servo/pull/36932 and wheel
https://github.com/servo/servo/pull/37260.

---------

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-06-18 07:26:44 +00:00
Jason Tsai
f97cdb4d12 feat(script): register import map (#37504)
- Register import map when preparing HTML script element
- Added `import_map` to `GlobalScope`

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

---------

Signed-off-by: Jason Tsai <git@pews.dev>
2025-06-18 07:12:57 +00:00
Andrei Volykhin
d8c552f3ab pixels: Multiply by alpha with less loss of precision (#37503)
Integer color components representation has performance and memory
storage benefits
but suffers from precision loss after multiple consequence alpha
(un)premultiply operations.

Rounding any fractional bits (to the nearest integer) during alpha
multiplication should reduce the loss of precision.
Expensive division will be replaced by multiplication and bits shift.

https://research.swtch.com/divmult

https://docs.google.com/document/d/1tNrMWShq55rfltcZxAx1N-6f82Dt7MWLDHm-5GQVEnE

Other browsers and graphics libraries have the similar approach:

- Chromium (Skia):
https://github.com/google/skia/blob/main/include/private/base/SkMath.h#L73
- Firefox:
https://github.com/mozilla/gecko-dev/blob/master/gfx/2d/Swizzle.cpp#L276
- Servo (Raqote):
https://github.com/jrmuizel/sw-composite/blob/master/src/lib.rs#L878

Testing: Improvements in the following WPT test
-
html/canvas/element/manual/imagebitmap/createImageBitmap-premultiplyAlpha.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-18 06:52:42 +00:00
Euclid Ye
e26532e19b webdriver_server: Implement find element(s) from element according to spec (#37521)
Report `InvalidArgument` and `NoSuchElement` properly for [Find Element
from
Element](https://w3c.github.io/webdriver/#find-element-from-element) +
[Find Elements from
Element](https://w3c.github.io/webdriver/#find-elements-from-element)

Testing: `./mach test-wpt -r
.\tests\wpt\tests\webdriver\tests\classic\element_click
.\tests\wpt\tests\webdriver\tests\classic\find_* --product servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-18 06:39:55 +00:00
Kenzie Raditya Tirtarahardja
96ef92b9ac Implement scroll event (#36687)
Reimplementation of https://github.com/servo/servo/pull/35105.

test: `tests/wpt/tests/pointerevents/{pointerevent_hit_test_scroll,
pointerevent_hit_test_scroll_visible_decendant}.html` (after
https://github.com/servo/servo/pull/37461)

Signed-off-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: PotatoCP <kenzieradityatirtarahardja.18@gmail.com>
Co-authored-by: Asun0204 <asun0204@163.com>
2025-06-18 06:05:45 +00:00
batu_hoang
152467bc67 Webdriver get focused webview id only request once (#37506)
The retry in previous implementation doesn't have a good reason, it
seems like webdriver just want to try its luck.
If get focused webview return None, better just return it.
There is a case webdriver still runs when all webview are closed.

cc: @xiaochengh

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-18 03:51:08 +00:00
Domenico Rizzo
50531026a8 [#26488] Makes RTCPeerConnection weak referenceable thorugh Binding.conf (#37518)
This PR fixes some mistakes introduced in
https://github.com/servo/servo/pull/37332. Where Binding.conf and
WeakReferenceable trait were used badly

Testing: No test introduces
Fixes: It fixes mistake introduced in the incrementally implementation
of #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2025-06-17 23:42:22 +00:00
Narfinger
14259c1d59 OHOS: servoshell: forward special alerts to hitrace (#37508)
We want to have special files with testcases running javascript and
reporting their timing via alert(). This pushes these messages to
hitrace.

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

Testing: Does not change functionality and will only add messages to
hitrace.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-17 18:48:45 +00:00
Ville Lindholm
07c33a180c fix(xpath): pass in correct context node for // and / in predicates (#37434)
For example `div[count(//p)]` should count all `<p>` elements in the
document, not just the ones underneath the `<div>`.

Testing: WPT tests cover this, the fix makes two more test pass.

Signed-off-by: Ville Lindholm <ville@lindholm.dev>
2025-06-17 18:45:00 +00:00
Martin Robinson
56e901d0c2 compositor: Always send an animating tick when a pipeline starts animating (#37507)
Instead of taking into account whether the entire WebView starts
animating, always send an animation tick when a pipeline moves from the
"not animating" to "animating" state. It could be that the WebView was
animating, but not painting if the animation was not producing display
lists. In that case, the required tick would never come, because it is
sent after a repaint.

Testing: Added a new WPT test.
Fixes: #37458.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-17 17:47:42 +00:00
dependabot[bot]
ded753f01b build(deps): bump gleam from 0.15.0 to 0.15.1 (#37515)
Bumps [gleam](https://github.com/servo/gleam) from 0.15.0 to 0.15.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/servo/gleam/commits/v0.15.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=gleam&package-manager=cargo&previous-version=0.15.0&new-version=0.15.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 17:27:33 +00:00
dependabot[bot]
8362d75985 build(deps): bump tracing-attributes from 0.1.29 to 0.1.30 (#37516)
Bumps [tracing-attributes](https://github.com/tokio-rs/tracing) from
0.1.29 to 0.1.30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/tracing/releases">tracing-attributes's
releases</a>.</em></p>
<blockquote>
<h2>tracing-attributes 0.1.30</h2>
<h3>Fixed</h3>
<ul>
<li>Fix <code>tracing::instrument</code> regression around shadowing (<a
href="https://redirect.github.com/tokio-rs/tracing/issues/3311">#3311</a>)</li>
</ul>
<p><a
href="https://redirect.github.com/tokio-rs/tracing/issues/3311">#3311</a>:
<a
href="https://redirect.github.com/tokio-rs/tracing/pull/3311">tokio-rs/tracing#3311</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<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>See full diff in <a
href="https://github.com/tokio-rs/tracing/compare/tracing-attributes-0.1.29...tracing-attributes-0.1.30">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tracing-attributes&package-manager=cargo&previous-version=0.1.29&new-version=0.1.30)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 17:24:45 +00:00
dependabot[bot]
a923560637 build(deps): bump r-efi from 5.2.0 to 5.3.0 (#37513)
Bumps [r-efi](https://github.com/r-efi/r-efi) from 5.2.0 to 5.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/r-efi/r-efi/releases">r-efi's
releases</a>.</em></p>
<blockquote>
<h2>r-efi-5.3.0</h2>
<pre><code># r-efi - UEFI Reference Specification Protocol Constants and
Definitions
<h2>CHANGES WITH 5.3.0:</h2>
<pre><code>* Remove the optional dependency on `compiler-builtins`,
which was
  needed to build r-efi as part of rustc. This is no longer necessary.

Contributions from: David Rheinsberg, Trevor Gross

- Dußlingen, 2025-06-17
</code></pre>
<p></code></pre></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/r-efi/r-efi/blob/main/NEWS.md">r-efi's
changelog</a>.</em></p>
<blockquote>
<h2>CHANGES WITH 5.3.0:</h2>
<pre><code> * Remove the optional dependency on `compiler-builtins`,
which was
needed to build r-efi as part of rustc. This is no longer necessary.
<pre><code>Contributions from: David Rheinsberg, Trevor Gross

- Dußlingen, 2025-06-17
</code></pre>
<p></code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="97b55bed1c"><code>97b55be</code></a>
build: prepare v5.3.0</li>
<li><a
href="addacc1f3f"><code>addacc1</code></a>
Remove <code>compiler-builtins</code> from <code>rustc-dep-of-std</code>
dependencies</li>
<li><a
href="345756ae42"><code>345756a</code></a>
ci: use shared publish-workflow</li>
<li>See full diff in <a
href="https://github.com/r-efi/r-efi/compare/v5.2.0...v5.3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=r-efi&package-manager=cargo&previous-version=5.2.0&new-version=5.3.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-06-17 17:18:42 +00:00
dependabot[bot]
38572db371 build(deps): bump async-compression from 0.4.24 to 0.4.25 (#37514)
Bumps
[async-compression](https://github.com/Nullus157/async-compression) from
0.4.24 to 0.4.25.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Nullus157/async-compression/blob/main/CHANGELOG.md">async-compression's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/Nullus157/async-compression/compare/v0.4.24...v0.4.25">0.4.25</a>
- 2025-06-17</h2>
<h3>Changed</h3>
<ul>
<li>Update <code>bzip2</code> dependency to <code>0.6</code>. (<a
href="https://redirect.github.com/Nullus157/async-compression/pull/350">#350</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8f9394ddb7"><code>8f9394d</code></a>
chore: release v0.4.25 (<a
href="https://redirect.github.com/Nullus157/async-compression/issues/351">#351</a>)</li>
<li><a
href="d6175d52dc"><code>d6175d5</code></a>
chore(deps): update bzip2 requirement from 0.5 to 0.6 (<a
href="https://redirect.github.com/Nullus157/async-compression/issues/350">#350</a>)</li>
<li>See full diff in <a
href="https://github.com/Nullus157/async-compression/compare/v0.4.24...v0.4.25">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=async-compression&package-manager=cargo&previous-version=0.4.24&new-version=0.4.25)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 17:12:20 +00:00
Euclid Ye
f22c273ea9 script::webdriver_handlers: Replace find_node_by_unique_id with get_known_element (#37502)
Implement previously missing step 3 of [get a known
element](https://w3c.github.io/webdriver/#dfn-get-a-known-element): "If
node is not null and node does not implement Element, return error with
error code no such element"

Testing: All webdriver conformance test

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-17 15:23:59 +00:00
Narfinger
6159a11905 OHOS: Fixed some clippy lints (#37510)
Fixed some clippy lints which were in the OHOS code.

Testing: Normal testcases apply and changes are trivial.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-17 14:09:37 +00:00
Simon Wülker
f29eee5356 Make layout build a display list when the highlighted DOM node changed (#37501)
Highlights from the devtools trigger reflows. Previously, incremental
layout would notice that nothing about the box tree changed and skip
generating a new display list. This caused the highlights to never be
painted.

Forcing a new DL in this case makes reflows that happen *while* there is
a highlighted DOM node (which did not change since the last reflow)
slightly less efficient. We could check if the highlighted node changed
and only force a new display list if it did, but I'm not sure if
`OpaqueNode`s can be compared like that. It also seems like a very niche
issue.

Testing: This is hard to test for, so there are no tests.
Fixes https://github.com/servo/servo/issues/37500.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-17 11:14:41 +00:00
Martin Robinson
c0970ea655 compositor: Wait for both Script and the Constellation when shutting down Pipelines (#37505)
Previously, the Constellation would immediately ask the Compositor to
shut down a pipeline, even before the ScriptThread finished shutting it
down. This meant that the Compositor might remove a Pipeline and then
re-add it if the ScriptThread sent a Pipeline-related message (such as a
new display list) in the meantime.

This change makes it so that the Compositor waits for both the
Constellation and the ScriptThread to finish shutting down a Pipeline
before removing its data. In addition, the Constellation no longer
synchronously waits on the Compositor when shutting down Pipelines. This
was important when the Compositor would talk to the ScriptThread
directly, but isn't necessary any longer.

Testing: This is very hard to test, because it depends on the creation
and destruction of many iframes and the particular timing of of all
the messaging between Servo bits. That said, this was tested manually
by observing the completion of Speedometer 2.1.
Fixes: #37458.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-17 09:56:31 +00:00
Andrei Volykhin
1bd8f38810 imagebitmap: Resolve promise with ImageBitmap on bitmap task source (#37488)
Follow the ImageBitmap specification and use the global scope bitmap
task source
to fulfill resolved promise (asynchronously). 
https://html.spec.whatwg.org/multipage/#bitmap-task-source

Any promise rejection must be done synchronously.

Testing: Improvements in the following WPT test
-
html/canvas/element/manual/imagebitmap/createImageBitmap-resolves-in-task.any.js

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-17 08:19:32 +00:00
dependabot[bot]
ef5e9b5f4d build(deps): bump slab from 0.4.9 to 0.4.10 (#37492)
Bumps [slab](https://github.com/tokio-rs/slab) from 0.4.9 to 0.4.10.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/slab/releases">slab's
releases</a>.</em></p>
<blockquote>
<h2>v0.4.10</h2>
<ul>
<li>Add <code>Slab::get_disjoint_mut</code> (<a
href="https://redirect.github.com/tokio-rs/slab/issues/149">#149</a>)</li>
<li>Drop build script and <code>autocfg</code> dependency (<a
href="https://redirect.github.com/tokio-rs/slab/issues/150">#150</a>)</li>
<li>Fix redundant import warning in no_std builds (<a
href="https://redirect.github.com/tokio-rs/slab/issues/143">#143</a>)</li>
<li>Fix <code>clippy::needless_lifetimes</code> warning (<a
href="https://redirect.github.com/tokio-rs/slab/issues/147">#147</a>)</li>
<li>Internal CI improvements (<a
href="https://redirect.github.com/tokio-rs/slab/issues/141">#141</a>, <a
href="https://redirect.github.com/tokio-rs/slab/issues/146">#146</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/slab/blob/master/CHANGELOG.md">slab's
changelog</a>.</em></p>
<blockquote>
<h1>0.4.10 (June 15, 2025)</h1>
<ul>
<li>Add <code>Slab::get_disjoint_mut</code> (<a
href="https://redirect.github.com/tokio-rs/slab/issues/149">#149</a>)</li>
<li>Drop build script and <code>autocfg</code> dependency (<a
href="https://redirect.github.com/tokio-rs/slab/issues/150">#150</a>)</li>
<li>Fix redundant import warning in no_std builds (<a
href="https://redirect.github.com/tokio-rs/slab/issues/143">#143</a>)</li>
<li>Fix <code>clippy::needless_lifetimes</code> warning (<a
href="https://redirect.github.com/tokio-rs/slab/issues/147">#147</a>)</li>
<li>Internal CI improvements (<a
href="https://redirect.github.com/tokio-rs/slab/issues/141">#141</a>, <a
href="https://redirect.github.com/tokio-rs/slab/issues/146">#146</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6a1b675665"><code>6a1b675</code></a>
Release v0.4.10 (<a
href="https://redirect.github.com/tokio-rs/slab/issues/151">#151</a>)</li>
<li><a
href="f801afe5cb"><code>f801afe</code></a>
feat: add <code>get_disjoint_mut</code> (<a
href="https://redirect.github.com/tokio-rs/slab/issues/149">#149</a>)</li>
<li><a
href="8e65636d42"><code>8e65636</code></a>
Bump MSRV to v1.46 (<a
href="https://redirect.github.com/tokio-rs/slab/issues/150">#150</a>)</li>
<li><a
href="30e8dd746a"><code>30e8dd7</code></a>
Fix clippy::needless_lifetimes warning (<a
href="https://redirect.github.com/tokio-rs/slab/issues/147">#147</a>)</li>
<li><a
href="fecdd68a53"><code>fecdd68</code></a>
Fix CI failures (<a
href="https://redirect.github.com/tokio-rs/slab/issues/146">#146</a>)</li>
<li><a
href="f7b621f6cf"><code>f7b621f</code></a>
Always set #![no_std] to fix redundant import warning (<a
href="https://redirect.github.com/tokio-rs/slab/issues/143">#143</a>)</li>
<li><a
href="334a8373bd"><code>334a837</code></a>
Update CI config (<a
href="https://redirect.github.com/tokio-rs/slab/issues/141">#141</a>)</li>
<li>See full diff in <a
href="https://github.com/tokio-rs/slab/compare/v0.4.9...v0.4.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=slab&package-manager=cargo&previous-version=0.4.9&new-version=0.4.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 18:42:35 +00:00
dependabot[bot]
c9acd443a0 build(deps): bump jiff from 0.2.14 to 0.2.15 (#37490)
Bumps [jiff](https://github.com/BurntSushi/jiff) from 0.2.14 to 0.2.15.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md">jiff's
changelog</a>.</em></p>
<blockquote>
<h1>0.2.15 (2025-06-13)</h1>
<p>This release fixes a bug where error values were being constructed
during
parsing even in the success case. This was a regression introduced in
<code>0.2.14</code>
as a result of trying to improve compilation times. Thankfully, fixing
this
regression doesn't seem to meaningfully impact the amount of IR
generated by
compiling Jiff.</p>
<p>Bug fixes:</p>
<ul>
<li><a
href="https://redirect.github.com/BurntSushi/jiff/pull/385">#385</a>:
Fixes a performance regression for parsing.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8842b0fcf7"><code>8842b0f</code></a>
0.2.15</li>
<li><a
href="e355d4880e"><code>e355d48</code></a>
error: partially re-inline error constructors</li>
<li><a
href="78ba38538b"><code>78ba385</code></a>
doc: fix outdated mentions of <code>Span</code> assuming 24-hour
days</li>
<li>See full diff in <a
href="https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.14...jiff-static-0.2.15">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jiff&package-manager=cargo&previous-version=0.2.14&new-version=0.2.15)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 18:35:47 +00:00
dependabot[bot]
d8c2b710d3 build(deps): bump libc from 0.2.172 to 0.2.173 (#37491)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.172 to 0.2.173.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/releases">libc's
releases</a>.</em></p>
<blockquote>
<h2>0.2.173</h2>
<h3>Added</h3>
<ul>
<li>AIX: Add an AIX triple to Cargo.toml for doc (<a
href="https://redirect.github.com/rust-lang/libc/pull/4475">#4475</a>)</li>
<li>FreeBSD: Add the <code>SO_SPLICE</code> socket option support for
FreeBSD &gt;= 14.2 (<a
href="https://redirect.github.com/rust-lang/libc/pull/4451">#4451</a>)</li>
<li>Linux GNU: Prepare for supporting <code>_TIME_BITS=64</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4433">#4433</a>)</li>
<li>Linux: Add constant PACKET_IGNORE_OUTGOING (<a
href="https://redirect.github.com/rust-lang/libc/pull/4319">#4319</a>)</li>
<li>Linux: Add constants and types for <code>nsfs</code> ioctls (<a
href="https://redirect.github.com/rust-lang/libc/pull/4436">#4436</a>)</li>
<li>Linux: Add constants for Memory-Deny-Write-Execute
<code>prctls</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4400">#4400</a>)</li>
<li>Linux: Add constants from <code>linux/cn_proc.h</code> and
<code>linux/connector.h</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4434">#4434</a>)</li>
<li>Linux: Add new flags for <code>pwritev2</code> and
<code>preadv2</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4452">#4452</a>)</li>
<li>Linux: Add pid_type enum values (<a
href="https://redirect.github.com/rust-lang/libc/pull/4403">#4403</a>)</li>
<li>Linux: Update pidfd constants and types (Linux 6.9-6.15) (<a
href="https://redirect.github.com/rust-lang/libc/pull/4402">#4402</a>)</li>
<li>Loongarch64 musl: Define the <code>MADV_SOFT_OFFLINE</code> constant
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4448">#4448</a>)</li>
<li>Musl: Add new fields since 1.2.0/1.2.2 to <code>struct
tcp_info</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4443">#4443</a>)</li>
<li>Musl: Prepare for supporting v1.2.3 (<a
href="https://redirect.github.com/rust-lang/libc/pull/4443">#4443</a>)</li>
<li>NuttX: Add <code>arc4random</code> and <code>arc4random_buf</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4464">#4464</a>)</li>
<li>RISC-V Musl: Add <code>MADV_SOFT_OFFLINE</code> definition (<a
href="https://redirect.github.com/rust-lang/libc/pull/4447">#4447</a>)</li>
<li>Redox: Define SCM_RIGHTS (<a
href="https://redirect.github.com/rust-lang/libc/pull/4440">#4440</a>)</li>
<li>VxWorks: Add missing UTIME defines and TASK_RENAME_LENGTH (<a
href="https://redirect.github.com/rust-lang/libc/pull/4407">#4407</a>)</li>
<li>Windows: Add more <code>time.h</code> functions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4427">#4427</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Redox: Update <code>SA_</code> constants. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4426">#4426</a>)</li>
<li>Redox: make <code>CMSG_ALIGN</code>, <code>CMSG_LEN</code>, and
<code>CMSG_SPACE</code> const functions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4441">#4441</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>AIX: Enable libc-test and fix definitions/declarations. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4450">#4450</a>)</li>
<li>Emscripten: Fix querying emcc on windows (use emcc.bat) (<a
href="https://redirect.github.com/rust-lang/libc/pull/4248">#4248</a>)</li>
<li>Hurd: Fix build from missing <code>fpos_t</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4472">#4472</a>)</li>
<li>Loongarch64 Musl: Fix the <code>struct ipc_perm</code> bindings (<a
href="https://redirect.github.com/rust-lang/libc/pull/4384">#4384</a>)</li>
<li>Musl: Fix the <code>O_LARGEFILE</code> constant value. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4443">#4443</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/blob/0.2.173/CHANGELOG.md">libc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/libc/compare/0.2.172...0.2.173">0.2.173</a>
- 2025-06-09</h2>
<h3>Added</h3>
<ul>
<li>AIX: Add an AIX triple to Cargo.toml for doc (<a
href="https://redirect.github.com/rust-lang/libc/pull/4475">#4475</a>)</li>
<li>FreeBSD: Add the <code>SO_SPLICE</code> socket option support for
FreeBSD &gt;= 14.2 (<a
href="https://redirect.github.com/rust-lang/libc/pull/4451">#4451</a>)</li>
<li>Linux GNU: Prepare for supporting <code>_TIME_BITS=64</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4433">#4433</a>)</li>
<li>Linux: Add constant PACKET_IGNORE_OUTGOING (<a
href="https://redirect.github.com/rust-lang/libc/pull/4319">#4319</a>)</li>
<li>Linux: Add constants and types for <code>nsfs</code> ioctls (<a
href="https://redirect.github.com/rust-lang/libc/pull/4436">#4436</a>)</li>
<li>Linux: Add constants for Memory-Deny-Write-Execute
<code>prctls</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4400">#4400</a>)</li>
<li>Linux: Add constants from <code>linux/cn_proc.h</code> and
<code>linux/connector.h</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4434">#4434</a>)</li>
<li>Linux: Add new flags for <code>pwritev2</code> and
<code>preadv2</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4452">#4452</a>)</li>
<li>Linux: Add pid_type enum values (<a
href="https://redirect.github.com/rust-lang/libc/pull/4403">#4403</a>)</li>
<li>Linux: Update pidfd constants and types (Linux 6.9-6.15) (<a
href="https://redirect.github.com/rust-lang/libc/pull/4402">#4402</a>)</li>
<li>Loongarch64 musl: Define the <code>MADV_SOFT_OFFLINE</code> constant
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4448">#4448</a>)</li>
<li>Musl: Add new fields since 1.2.0/1.2.2 to <code>struct
tcp_info</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4443">#4443</a>)</li>
<li>Musl: Prepare for supporting v1.2.3 (<a
href="https://redirect.github.com/rust-lang/libc/pull/4443">#4443</a>)</li>
<li>NuttX: Add <code>arc4random</code> and <code>arc4random_buf</code>
(<a
href="https://redirect.github.com/rust-lang/libc/pull/4464">#4464</a>)</li>
<li>RISC-V Musl: Add <code>MADV_SOFT_OFFLINE</code> definition (<a
href="https://redirect.github.com/rust-lang/libc/pull/4447">#4447</a>)</li>
<li>Redox: Define SCM_RIGHTS (<a
href="https://redirect.github.com/rust-lang/libc/pull/4440">#4440</a>)</li>
<li>VxWorks: Add missing UTIME defines and TASK_RENAME_LENGTH (<a
href="https://redirect.github.com/rust-lang/libc/pull/4407">#4407</a>)</li>
<li>Windows: Add more <code>time.h</code> functions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4427">#4427</a>)</li>
</ul>
<h3>Changed</h3>
<ul>
<li>Redox: Update <code>SA_</code> constants. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4426">#4426</a>)</li>
<li>Redox: make <code>CMSG_ALIGN</code>, <code>CMSG_LEN</code>, and
<code>CMSG_SPACE</code> const functions (<a
href="https://redirect.github.com/rust-lang/libc/pull/4441">#4441</a>)</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>AIX: Enable libc-test and fix definitions/declarations. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4450">#4450</a>)</li>
<li>Emscripten: Fix querying emcc on windows (use emcc.bat) (<a
href="https://redirect.github.com/rust-lang/libc/pull/4248">#4248</a>)</li>
<li>Hurd: Fix build from missing <code>fpos_t</code> (<a
href="https://redirect.github.com/rust-lang/libc/pull/4472">#4472</a>)</li>
<li>Loongarch64 Musl: Fix the <code>struct ipc_perm</code> bindings (<a
href="https://redirect.github.com/rust-lang/libc/pull/4384">#4384</a>)</li>
<li>Musl: Fix the <code>O_LARGEFILE</code> constant value. (<a
href="https://redirect.github.com/rust-lang/libc/pull/4443">#4443</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9288ec0123"><code>9288ec0</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/4486">#4486</a>
from tgross35/fix-no-publish</li>
<li><a
href="6787debbcf"><code>6787deb</code></a>
Fix publishing on the <code>libc-0.2</code> branch</li>
<li><a
href="1c5b5538c8"><code>1c5b553</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/4481">#4481</a>
from tgross35/release</li>
<li><a
href="2d0dfd33ba"><code>2d0dfd3</code></a>
chore: release libc 0.2.173</li>
<li><a
href="92347ec8c9"><code>92347ec</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/4476">#4476</a>
from tgross35/backport-scotch-bonnet</li>
<li><a
href="1a418edf7c"><code>1a418ed</code></a>
lints: Remove <code>allow(dead_code)</code></li>
<li><a
href="7be1a7a7d8"><code>7be1a7a</code></a>
lints: Remove <code>allow(redundant_semicolons)</code></li>
<li><a
href="53301c2052"><code>53301c2</code></a>
lints: Warn rather than deny by default</li>
<li><a
href="6595c614b4"><code>6595c61</code></a>
Add AIX triple to Cargo.toml for doc.</li>
<li><a
href="600d8adc21"><code>600d8ad</code></a>
Add ctest-next stub and expected dependencies</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/libc/compare/0.2.172...0.2.173">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.172&new-version=0.2.173)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 18:35:31 +00:00
dependabot[bot]
8ad9c64c3a build(deps): bump rustls from 0.23.27 to 0.23.28 (#37489)
Bumps [rustls](https://github.com/rustls/rustls) from 0.23.27 to
0.23.28.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="12fe0c123f"><code>12fe0c1</code></a>
Prepare 0.23.28</li>
<li><a
href="46ba039ba0"><code>46ba039</code></a>
Expose <code>named_groups</code> extension in
<code>ClientHello</code></li>
<li><a
href="b9a530a746"><code>b9a530a</code></a>
ci-bench: low-noise benchmarks with rustls-fuzzing-provider</li>
<li><a
href="9b452d26a4"><code>9b452d2</code></a>
fuzzing-provider: support no-op ticketer</li>
<li><a
href="136e857c77"><code>136e857</code></a>
fuzzing-provider: make ciphersuites public</li>
<li><a
href="96d66569c9"><code>96d6656</code></a>
Only include renegotiation SCSV for TLS1.2 attempts</li>
<li><a
href="568b2c6500"><code>568b2c6</code></a>
Use <code>ProtocolName</code> for ALPN protocol pervasively</li>
<li><a
href="229dfe250d"><code>229dfe2</code></a>
Allow future customisation of alert sent for
<code>InvalidMessage</code></li>
<li><a
href="d8828602c5"><code>d882860</code></a>
Return more specific type from <code>outer_hello_ext()</code></li>
<li><a
href="34cdce3d8c"><code>34cdce3</code></a>
Return more specific type from <code>grease_ext()</code></li>
<li>Additional commits viewable in <a
href="https://github.com/rustls/rustls/compare/v/0.23.27...v/0.23.28">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls&package-manager=cargo&previous-version=0.23.27&new-version=0.23.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-06-16 18:25:04 +00:00
Simon Wülker
048de52238 Don't allocate in Dom::trace even when debug assertions are enabled (#37487)
`Dom::trace` currently allocates a new string when debug assertions are
enabled:

0f61361e27/components/script_bindings/root.rs (L232-L241)

This allocation is very heavy in profiles (~14% of runtime). While it
doesn't affect production builds, these few characters are not providing
enough value to justify the cost.

This changes the method to instead only use `std::any::type_name`,
without `format!`. With this change, all the string-format related
methods vanish from the profile.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-16 17:32:33 +00:00
Euclid Ye
f60e9cdff5 layout: capitalize string for TextTransformCase::Capitalize in fn rendered_text_collection_steps (#37486)
Previously, `rendered_text_collection_steps` ignores
`TextTransformCase::Capitalize` due to limitation of iterator. Now we
handle the case outside.

Testing: Added a new test as not covered by existing wpt-test, except
for the indirectly related WebDriver test.
`./mach test-wpt -r
tests\wpt\tests\webdriver\tests\classic\get_element_text\get.py
--product servodriver`

Fixes: #37469

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-16 14:12:07 +00:00
webbeef
910cc0b687 Fix panic in formelement.rs (#37459)
Use borrowing directly with iterators instead of holding the borrowed
value for a longer scope.

Testing: Covered by existing tests, and manual testing with the test
case from https://github.com/servo/servo/issues/37430
Fixes: https://github.com/servo/servo/issues/37430

Signed-off-by: webbeef <me@webbeef.org>
2025-06-16 12:41:37 +00:00
Andrei Volykhin
bcade589e7 imagebitmap: Crop bitmap data with formatting (#37397)
Follow the ImageBitmap specification and make cropping of the bitmap
data to the source rectangle with formatting:
https://html.spec.whatwg.org/multipage/#cropped-to-the-source-rectangle-with-formatting

For now the next functionality not implemented:
- image orientation support (such as EXIF metadata)
- color space conversion (image, blob)

The convertion from ResizeQuality to "image" FilterType:
 - pixelated/low/medium/high -> Nearest/Triangle/CatmullRom/Lanczos3

Other browsers use the following sample filtering:
 - chromium (skia): Nearest/Linear/Linear/CatmullRom
 - firefox (skia): Lanczos3

Testing: Improvements in the following WPT tests
 - html/canvas/element/manual/imagebitmap/*

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-16 12:09:04 +00:00
Martin Robinson
0f61361e27 layout: Unify scrollable overflow calculation and include position: absolute (#37475)
Previously, layout was handling scrollable overflow and srolling area
calculation separately, only excluding the "unreachable scrollable
overflow region" at the last step. In addition, `position: absolute` was
not included in scrollable overflow calculation.

This change combines the two concepts into a single scrollable overflow
calculation and starts taking into account `position: absolute`.
Finally, `BoxFragment::scrollable_overflow_for_parent` is converted to
use early returns which reduces the amount of indentation.

Fixes #35928.
Fixes #37204.
Testing: This causes some WPT test to pass, but also two to start
failing:
- `/css/css-masking/clip-path/clip-path-fixed-scroll.html`: This seems
to fail
because script is scrolling past the boundaries of the document. This is
a
failure that was uncovered by the fixed element now being added to the
   page's scroll area.
- `/css/css-overflow/overflow-outside-padding.html`: One test has
started to fail
here because now the absolutely positioned element is included in the
scroll area,
and I think there is an issue with how we are placing RTL items with
negative margins.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-16 11:30:31 +00:00
Martin Robinson
29e618dcf7 fonts: Start using fontations to read font tables (#37287)
Use `read-fonts` to read font tables for FreeType fonts. This is the
first step to using fontations throughout Servo. The main benefit here
is that we no longer need to provide our own table data structures and
we can read tables from these fonts without making copies of the table
contents.

Testing: This should not change observable behavior and is covered by
existing WPT tests. I have run some manual microbenchmarks and have not
noticed any changes in performance that are larger than the general
noise.
This adds a new memory map of the font file for local fonts, but this
should be very cheap as FreeType is already doing this internally and
subsequent maps should just reuuse the existing memory-mapped file.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-16 11:29:50 +00:00
batu_hoang
1044f8fbf5 Revert "Remove duplication in dispatch_pending_point_input_events" (#37482)
Revert "Remove duplication in dispatch_pending_point_input_events"
(https://github.com/servo/servo/pull/37426) which causes a serious bug.

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-06-16 08:36:05 +00:00
Narfinger
3b73b83a9f Allow OHOS servoshell to have a simple multiple tab implementation. (#36891)
Currently we just pause the compositor and replace the window in it
while having separate bookkeeping to remember which window belongs to
which tab.
Currently there are no tests for OHOS, so we cannot test the changes.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-16 08:17:31 +00:00
Rodion Borovyk
71bf9fb92d Fix the native-bluetooth feature on macOS (#37476)
Fix the native-bluetooth feature on macOS builds. Enable the
native-bluetooth by default.

Testing: Added --features native-bluetooth to GH actions so the build
will fail if something is wrong. Don't know why it was not enabled
previously, please let me know if it is ok to leave the feature enabled.
Fixes: https://github.com/servo/servo/issues/37454

As for the numerous such warnings
```
warning: unexpected `cfg` condition value: `cargo-clippy`
   --> third_party/blurmac/src/framework.rs:480:43
    |
480 |             let uuidstring: *mut Object = msg_send![cbuuid, UUIDString];
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: no expected values for `feature`
    = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
    = help: try referring to `sel_impl` crate for guidance on how handle this unexpected cfg
    = help: the macro `sel_impl` may come from an old version of the `objc` crate, try updating your dependency with `cargo update -p objc`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: this warning originates in the macro `sel_impl` which comes from the expansion of the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)
```

that macOS builds generates (mentioned
[here](https://github.com/servo/servo/pull/37439)) I found this:
https://github.com/SSheldon/rust-objc/issues/125. Also, in general the
`objc` crate seems to be stale and people are forking it, so maybe I
should start a Zulip conversation about migrating to something like this
https://github.com/madsmtm/objc2?

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-06-16 06:58:08 +00:00
Ngo Iok Ui (Wu Yu Wei)
e69962e646 canvas: prevent unwrap on offscreen canvas (#37460)
Remove all unwrap usage on offscreen canvas to prevent panic.

Testing:
`tests/wpt/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen-crash.html`
Fixes: #37415

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
Co-authored-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
2025-06-16 05:39:56 +00:00
Euclid Ye
f8f7c6ebd1 [WebDriver] Properly report error for find_element & find_elements; Get correct visible text when matching links (#37452)
1. Properly report new types of errors for `find_element` and
`find_elements`. Previously never reported.
1.1. `InvalidSelector`
1.2. `NoSuchElement`
1.3. `InvalidArgument`

2. Get the visible text for `<a>` correctly in
`script::webdriver_handler` so that matching would work.

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

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-16 05:23:26 +00:00
Simon Wülker
62b078dd62 Remove "isInitial" argument from memberInit (#37477)
This argument is always `True`.

Testing: Correct generation of dictionary binding code should be covered
by wpt

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-15 23:19:48 +00:00
Simon Wülker
9d10e41a1a Don't count <img> elements with both name and id twice in document's named getter (#37455)
A document's named getter collects elements with either matching name or
id's (varies per element type) and returns them .

We implement this the following way:
* Create an iterator with elements whose `name` attribute matches
* Create an iterator with elements whose `id` attribute matches
* Concatenate both

The spec then asks us if there is more than one element in the list,
which we implement by checking whether the iterator returns `None` after
we get the first element. However, the same element can appear in both
iterators if it is a `img` element and both it's name and id attribute
match. Therefore, we need to check if there are more elements *which are
not equal to the first one*.

Testing: New web platform tests pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-15 18:54:53 +00:00
Oriol Brufau
ae20cdbdc9 layout: Ensure that min/max-content sizes ignore sizing properties (#37464)
This amends #37457 so that the min-content and max-content inline sizes
of a replaced element stop depending on the value of the inline sizing
properties.

In practice I don't think this has any observable effect, but now the
code obeys https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes, and
it's simpler.

Testing: Unneeded

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-15 16:11:18 +00:00
Tim van der Lippe
f2d0be1b9a script: Fix check for document root when targeting CSP events (#37474)
The check was incorrect, where it was never matching and always
discarding the element. Instead, we should check the owner document,
which is the shadow-including root of the node.

Part of #4577

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-15 14:54:41 +00:00
Tim van der Lippe
576c7445b8 Use DOMString for internal data of Trusted Types (#37472)
This avoids various conversions back and forth between DOMString and
String. By using DOMString consistently, we avoid these
double-conversions. The only caveat are the USVString which are
initially passed into
TrustedScriptURL.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-15 14:12:33 +00:00
Tim van der Lippe
dfbd5b7d21 Modularize security_manager by moving report logic (#37347)
Move all report structs into the same file, to
keep them consistent and reuse functions such as stripping
of the URL and serialization of disposition. This is part
of modularizing security_manager, which contained various
logic related to CSP.

Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-15 14:10:19 +00:00
Xiaocheng Hu
f09042340c Stop DedicatedWorker from handling remaining messages after closed (#37471)
Stop DedicatedWorker from handling remaining messages after closed

Testing: WPT workers/WorkerGlobalScope-close.html

Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
2025-06-15 08:09:08 +00:00
Euclid Ye
9352a9db7c script: Support webdriver's Get Element Text operation for non-HTML elements (#37470)
Fix `WebDriverScriptCommand::GetElementText` similar to
https://github.com/servo/servo/pull/37452#discussion_r2146350739, by
correctly retrieving rendered text.

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

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

---------

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

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

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

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

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

---------

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

Part of #36258

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

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

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

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

Testing: Covered by WPT
Fixes: #37433

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

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

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

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


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=windows-link&package-manager=cargo&previous-version=0.1.1&new-version=0.1.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-14 03:48:30 +00:00
dependabot[bot]
b65f78c83f build(deps): bump syn from 2.0.102 to 2.0.103 (#37449)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.102 to 2.0.103.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.103</h2>
<ul>
<li>Insert parentheses around binary operation with attribute (<a
href="https://redirect.github.com/dtolnay/syn/issues/1871">#1871</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="85d427679f"><code>85d4276</code></a>
Release 2.0.103</li>
<li><a
href="6f7b0f39b3"><code>6f7b0f3</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1871">#1871</a>
from dtolnay/binaryattr</li>
<li><a
href="89f88facd1"><code>89f88fa</code></a>
Correctly track bailouts in parenthesized binary expressions</li>
<li><a
href="0e07372e40"><code>0e07372</code></a>
Add binary operator attribute bailout test</li>
<li><a
href="ca8d876bde"><code>ca8d876</code></a>
Insert parentheses around binary operation with attribute</li>
<li><a
href="5be0f7121f"><code>5be0f71</code></a>
Add binary operator attribute tests</li>
<li><a
href="026bb3cf32"><code>026bb3c</code></a>
Discard paren attrs in unparenthesize test</li>
<li><a
href="217dd626aa"><code>217dd62</code></a>
Preserve attributes of Expr::Paren in FlattenParens</li>
<li><a
href="ef977c1059"><code>ef977c1</code></a>
Update test suite to nightly-2025-06-11</li>
<li>See full diff in <a
href="https://github.com/dtolnay/syn/compare/2.0.102...2.0.103">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=syn&package-manager=cargo&previous-version=2.0.102&new-version=2.0.103)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-13 17:29:36 +00:00
dependabot[bot]
851f8b9200 build(deps): bump cc from 1.2.26 to 1.2.27 (#37448)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.2.26 to 1.2.27.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>cc-v1.2.27</h2>
<h3>Other</h3>
<ul>
<li>Regenerate windows sys bindings (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1485">#1485</a>)</li>
<li>Update windows-bindgen requirement from 0.61 to 0.62 (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1484">#1484</a>)</li>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1483">#1483</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md">cc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.26...cc-v1.2.27">1.2.27</a>
- 2025-06-13</h2>
<h3>Other</h3>
<ul>
<li>Regenerate windows sys bindings (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1485">#1485</a>)</li>
<li>Update windows-bindgen requirement from 0.61 to 0.62 (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1484">#1484</a>)</li>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1483">#1483</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7043e38035"><code>7043e38</code></a>
chore: release v1.2.27 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1486">#1486</a>)</li>
<li><a
href="1d99fe33a4"><code>1d99fe3</code></a>
Regenerate windows sys bindings (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1485">#1485</a>)</li>
<li><a
href="2e34d13d5d"><code>2e34d13</code></a>
Update windows-bindgen requirement from 0.61 to 0.62 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1484">#1484</a>)</li>
<li><a
href="191bcf56c4"><code>191bcf5</code></a>
Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1483">#1483</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.2.26...cc-v1.2.27">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.2.26&new-version=1.2.27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-13 17:19:05 +00:00
dependabot[bot]
94af8e5a3d build(deps): bump thread_local from 1.1.8 to 1.1.9 (#37446)
Bumps [thread_local](https://github.com/Amanieu/thread_local-rs) from
1.1.8 to 1.1.9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Amanieu/thread_local-rs/releases">thread_local's
releases</a>.</em></p>
<blockquote>
<h2>v1.1.9</h2>
<h3>Other</h3>
<ul>
<li>Add release-plz for automated releases</li>
<li>Remove once_cell dependency</li>
<li>Bump MSRV to 1.61</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Amanieu/thread_local-rs/blob/master/CHANGELOG.md">thread_local's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/Amanieu/thread_local-rs/compare/v1.1.8...v1.1.9">1.1.9</a>
- 2025-06-12</h2>
<h3>Other</h3>
<ul>
<li>Add release-plz for automated releases</li>
<li>Remove once_cell dependency</li>
<li>Bump MSRV to 1.61</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4b7cc0f30b"><code>4b7cc0f</code></a>
chore: release v1.1.9</li>
<li><a
href="11f0bcc9f1"><code>11f0bcc</code></a>
Add release-plz for automated releases</li>
<li><a
href="b5aa929035"><code>b5aa929</code></a>
Merge pull request <a
href="https://redirect.github.com/Amanieu/thread_local-rs/issues/76">#76</a>
from james7132/remove-once-cell-dependency</li>
<li><a
href="d7f100ab3f"><code>d7f100a</code></a>
Remove once_cell dependency</li>
<li><a
href="6920311014"><code>6920311</code></a>
Merge pull request <a
href="https://redirect.github.com/Amanieu/thread_local-rs/issues/73">#73</a>
from Swatinem/msrv</li>
<li><a
href="e3d9a42add"><code>e3d9a42</code></a>
Bump MSRV to 1.61</li>
<li>See full diff in <a
href="https://github.com/Amanieu/thread_local-rs/compare/1.1.8...v1.1.9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thread_local&package-manager=cargo&previous-version=1.1.8&new-version=1.1.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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

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

---

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

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

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

---------

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

Testing: These are comments, no tests needed

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

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

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

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

Closes: #14869

---------

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

Testing: No tests added
Fixes: Partially #26488

---------

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

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

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

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

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

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

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


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

---------

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

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

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

---------

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

Testing: Tested on device.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-13 09:38:56 +00:00
7296 changed files with 567253 additions and 391930 deletions

21
.github/actions/parse_msrv/action.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Parse rust-version from libservo
description: "Parse rust-version from libservo. Requires cargo-metadata."
outputs:
rust_version:
description: "Minimum rust-version defined by libservo"
value: ${{ steps.parse_version.outputs.LIBSERVO_RUST_VERSION }}
runs:
using: "composite"
steps:
- name: Parse libservo version
id: parse_version
shell: bash
run: |
msrv=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "libservo") | .rust_version')
if [[ "${msrv}" == "null" ]]; then
echo "Failed to determine MSRV of libservo"
exit 1
fi
echo "libservo has a minimum supported Rust version of ${msrv}."
echo "LIBSERVO_RUST_VERSION=${msrv}" >> "$GITHUB_OUTPUT"

View File

@@ -0,0 +1,37 @@
# In the unlikely event a self-hosted runner was selected and reserved but it
# goes down before the workload starts, cancel the workflow run.
name: Detect self-hosted runner assigment timeout
description: "Cancel the workflow run if a self-hosted runner was selected, but the job failed to start"
inputs:
unique-id:
required: true
description: "Unique ID of the runner"
github_token:
required: true
description: "Must be able to do github API calls and cancel jobs."
runs:
using: "composite"
steps:
- name: Wait a bit
shell: bash
run: sleep 120
- name: Cancel if workload job is still queued
shell: bash
run: |
run_url=/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}
export GH_TOKEN=${{ inputs.github_token }}
if [ "$(gh api "$run_url/jobs" \
| jq -er --arg id '${{ inputs.unique-id }}' \
'.jobs[] | select(.name | contains("[" + $id + "]")) | .status'
)" = queued ]; then
echo 'Timeout waiting for runner assignment!'
echo 'Hint: does this repo have permission to access the runner group?'
echo 'Hint: https://github.com/organizations/servo/settings/actions/runner-groups'
echo
echo 'Cancelling workflow run'
gh api "$run_url/cancel" --method POST
exit 1
fi

View File

@@ -2,6 +2,9 @@ version: 2
updates:
- package-ecosystem: cargo
directory: "/"
exclude-paths:
- "tests/blink_perf/**"
- "tests/wpt/**"
schedule:
interval: daily
open-pull-requests-limit: 10
@@ -9,31 +12,33 @@ updates:
- dependency-type: direct
- dependency-type: indirect
groups:
gstreamer-related:
patterns:
- "gio*"
- "glib*"
- "gobject*"
- "gstreamer*"
egui-related:
patterns:
- "ecolor"
- "egui"
- "egui-winit"
- "egui_glow"
- "emath"
- "epaint"
- "epaint_default_fonts"
patterns:
- "ecolor"
- "egui"
- "egui-winit"
- "egui_glow"
- "emath"
- "epaint"
- "epaint_default_fonts"
- "accesskit_winit"
- "egui-file-dialog"
gstreamer-related:
patterns:
- "gio*"
- "glib*"
- "gobject*"
- "gstreamer*"
napi-ohos-related:
patterns:
- "napi-ohos*"
- "napi-*-ohos*"
servo-media-related:
patterns:
- "servo-media*"
objc2-related:
patterns:
- "objc2*"
servo-media-related:
patterns:
- "servo-media*"
ignore:
# Ignore all stylo crates as their upgrades are coordinated via companion PRs.
- dependency-name: selectors

View File

@@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
target: ['aarch64-linux-android', 'armv7-linux-androideabi', 'i686-linux-android', 'x86_64-linux-android']
target: ['aarch64-linux-android', 'armv7-linux-androideabi', 'x86_64-linux-android']
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
@@ -81,7 +81,7 @@ jobs:
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26c
ndk-version: r28b
- name: Setup Gradle caches
uses: gradle/actions/setup-gradle@v4
- name: Trigger initial download of Gradle with retries
@@ -152,7 +152,7 @@ jobs:
needs: ["build"]
strategy:
matrix:
target: ['aarch64-linux-android', 'armv7-linux-androideabi', 'i686-linux-android', 'x86_64-linux-android']
target: ['aarch64-linux-android', 'armv7-linux-androideabi', 'x86_64-linux-android']
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
name: 'Bencher (${{ matrix.target }})'
uses: ./.github/workflows/bencher.yml
@@ -160,8 +160,8 @@ jobs:
target: android-${{ matrix.target }}
profile: ${{ inputs.profile }}
compressed-file-path: ${{ inputs.profile }}-binary-android-${{ matrix.target }}/servoapp.apk
binary-path: lib/${{ matrix.target == 'aarch64-linux-android' && 'arm64-v8a' || matrix.target == 'armv7-linux-androideabi' && 'armeabi-v7a' || matrix.target == 'i686-linux-android' && 'x86' || matrix.target == 'x86_64-linux-android' && 'x86_64'}}/libservoshell.so
binary-path: lib/${{ matrix.target == 'aarch64-linux-android' && 'arm64-v8a' || matrix.target == 'armv7-linux-androideabi' && 'armeabi-v7a' || matrix.target == 'x86_64-linux-android' && 'x86_64'}}/libservoshell.so
file-size: true
speedometer: false
dromaeo: false
secrets: inherit
secrets: inherit

View File

@@ -113,9 +113,10 @@ jobs:
if: github.event_name == 'pull_request_target'
run: |
echo "RUN_BENCHER_OPTIONS=--branch ${{ github.event.number }}/PR \
--branch-start-point ${{ github.base_ref }} \
--branch-start-point-hash ${{ github.event.pull_request.base.sha }} \
--branch-reset \
--start-point ${{ github.base_ref }} \
--start-point-hash ${{ github.event.pull_request.base.sha }} \
--start-point-reset \
--start-point-clone-thresholds \
--github-actions ${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV"
- name: Set bencher opts for main
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
@@ -130,8 +131,9 @@ jobs:
echo "RUN_BENCHER_OPTIONS=--branch try \
--github-actions ${{ secrets.GITHUB_TOKEN }} \
--hash $(git rev-parse HEAD~1) \
--branch-start-point main \
--branch-start-point-hash $(git merge-base upstream/main HEAD) \
--start-point main \
--start-point-hash $(git merge-base upstream/main HEAD) \
--start-point-clone-thresholds \
--branch-reset" >> "$GITHUB_ENV"
# we join results and send all data once to have it all in one report
- name: Send results
@@ -140,4 +142,4 @@ jobs:
./etc/ci/bencher.py merge ${{ env.SERVO_FILE_SIZE_RESULT }} ${{ env.SERVO_STRIPPED_FILE_SIZE_RESULT }} ${{ env.SERVO_SPEEDOMETER_RESULT }} ${{ env.SERVO_DROMAEO_RESULT }} --bmf-output b.json
bencher run --adapter json --file b.json \
--project ${{ env.BENCHER_PROJECT }} --token ${{ secrets.BENCHER_API_TOKEN }} --testbed ubuntu-22.04 \
$RUN_BENCHER_OPTIONS
$RUN_BENCHER_OPTIONS

View File

@@ -75,8 +75,8 @@ jobs:
lint:
if: ${{ inputs.workflow == 'lint' }}
name: Lint
# Note: The lint workflow does not need access to any secrets.
uses: ./.github/workflows/lint.yml
secrets: inherit
android:
if: ${{ inputs.workflow == 'android' }}

View File

@@ -37,15 +37,14 @@ jobs:
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-deny
version: 0.18
version: 0.18.3
locked: true
- name: Bootstrap dependencies
run: |
sudo apt update
./mach bootstrap
# TODO: Do GitHub anotaions
- name: Clippy
run: |
./mach clippy --use-crown --locked -- -- --deny warnings
./mach clippy --use-crown --locked --github-annotations -- -- --deny warnings
- name: Tidy
run: ./mach test-tidy --no-progress --all
run: ./mach test-tidy --no-progress --all --github-annotations

View File

@@ -65,6 +65,7 @@ jobs:
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Bootstrap dependencies
timeout-minutes: 60
run: |
sudo apt update
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers fonts-noto-cjk

View File

@@ -111,11 +111,18 @@ jobs:
runner-timeout:
needs:
- runner-select
uses: ./.github/workflows/self-hosted-runner-timeout.yml
secrets: inherit
with:
unique-id: ${{ needs.runner-select.outputs.unique-id }}
is-self-hosted: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: '.github'
- name: Runner timeout
uses: ./.github/actions/runner-timeout
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
unique-id: '${{ needs.runner-select.outputs.unique-id }}'
build:
needs:
@@ -183,10 +190,6 @@ jobs:
timeout_minutes: 20
max_attempts: 2 # https://github.com/servo/servo/issues/30683
command: ./mach test-unit --${{ inputs.profile }}
- name: Build libservo with examples
if: ${{ inputs.build-libservo }}
continue-on-error: true
run: cargo build -p libservo --all-targets
- name: Archive build timing
uses: actions/upload-artifact@v4
with:
@@ -244,3 +247,34 @@ jobs:
speedometer: ${{ inputs.profile == 'release' }}
dromaeo: ${{ inputs.profile == 'release' }}
secrets: inherit
build-libservo:
if: ${{ inputs.build-libservo }}
name: Build libservo and MSRV check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 1
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Determine MSRV
id: msrv
uses: ./.github/actions/parse_msrv
- name: Install MSRV
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.rust_version }}
- name: Compile libservo with MSRV
run: |
cargo +${{ steps.msrv.outputs.rust_version }} build -p libservo --locked --all-targets

View File

@@ -40,6 +40,7 @@ jobs:
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Prep test environment
timeout-minutes: 60
run: |
gtar -xzf target.tar.gz
./mach bootstrap --skip-lints

View File

@@ -94,11 +94,18 @@ jobs:
runner-timeout:
needs:
- runner-select
uses: ./.github/workflows/self-hosted-runner-timeout.yml
secrets: inherit
with:
unique-id: ${{ needs.runner-select.outputs.unique-id }}
is-self-hosted: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: '.github'
- name: Runner timeout
uses: ./.github/actions/runner-timeout
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
unique-id: '${{ needs.runner-select.outputs.unique-id }}'
build:
needs:
@@ -167,10 +174,6 @@ jobs:
timeout_minutes: 40 # https://github.com/servo/servo/issues/30275
max_attempts: 3 # https://github.com/servo/servo/issues/30683
command: ./mach test-unit --${{ inputs.profile }}
- name: Build libservo with examples
if: ${{ inputs.build-libservo }}
continue-on-error: true
run: cargo build -p libservo --all-targets
- name: Build mach package
run: ./mach package --${{ inputs.profile }}
- name: Run DMG smoketest
@@ -231,3 +234,32 @@ jobs:
speedometer: false
dromaeo: false
secrets: inherit
build-libservo:
if: ${{ inputs.build-libservo }}
name: Build libservo and MSRV check
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 1
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Determine MSRV
id: msrv
uses: ./.github/actions/parse_msrv
- name: Install MSRV
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.rust_version }}
- name: Compile libservo with MSRV
run: |
cargo +${{ steps.msrv.outputs.rust_version }} build -p libservo --locked --all-targets

View File

@@ -25,18 +25,18 @@ on:
default: "release"
type: choice
description: "Cargo build profile"
options: [ "release", "debug", "production"]
options: ["release", "debug", "production"]
bencher:
required: false
default: false
type: boolean
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
CARGO_INCREMENTAL: 0
BENCHER_PROJECT: ${{ vars.BENCHER_PROJECT || 'servo' }}
HITRACE_BENCH_VERSION: 0.8.2
jobs:
build:
@@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
target: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos']
target: ["aarch64-unknown-linux-ohos", "x86_64-unknown-linux-ohos"]
outputs:
signed: ${{ steps.signing_config.outputs.signed }}
steps:
@@ -67,7 +67,7 @@ jobs:
run: sudo apt update && ./mach bootstrap --skip-lints
- name: Setup OpenHarmony SDK
id: setup_sdk
uses: openharmony-rs/setup-ohos-sdk@v0.2.1
uses: openharmony-rs/setup-ohos-sdk@v0.2.3
with:
version: "5.0.2"
fixup-path: true
@@ -138,7 +138,7 @@ jobs:
needs: ["build"]
strategy:
matrix:
target: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos']
target: ["aarch64-unknown-linux-ohos", "x86_64-unknown-linux-ohos"]
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
uses: ./.github/workflows/bencher.yml
with:
@@ -166,22 +166,17 @@ jobs:
- run: |
git switch --detach
git reset --hard FETCH_HEAD
- name: Adding test files to directory
run: cp -r support/hitrace-bencher/* support/openharmony/AppScope/resources/resfile/
- name: Build for aarch64 HarmonyOS
run: |
./mach build --locked --target aarch64-unknown-linux-ohos --profile=${{ inputs.profile }} --flavor=harmonyos --no-default-features --features tracing,tracing-hitrace
- name: Upload supprt/hitrace-bencher/runs.json
uses: actions/upload-artifact@v4
with:
name: runs.json
path: support/hitrace-bencher/runs.json
overwrite: true
- uses: actions/upload-artifact@v4
with:
# Upload the **unsigned** artifact - We don't have the signing materials in pull request workflows
name: servoshell-hos-${{ inputs.profile }}.hap
path: target/openharmony/aarch64-unknown-linux-ohos/${{ inputs.profile }}/entry/build/harmonyos/outputs/default/servoshell-default-unsigned.hap
test-harmonyos-aarch64:
name: Test HarmonyOS aarch64
# Don't block servos Merge queue on this job failing.
@@ -213,7 +208,7 @@ jobs:
- name: Test loading servo.org
env:
TRACE_BUFFER_SZ_KB: "524288" # 512 MB
run: |
run: |
mkdir test_output
hdc shell aa force-stop org.servo.servo
# Hitrace allows us to save application and system traces, which is useful to analyze performance.
@@ -245,19 +240,105 @@ jobs:
[[ $servo_pid =~ ^[0-9]+$ ]] || { echo "It looks like servo crashed!" ; exit 1; }
# If the grep fails, then the trace output for the "page loaded" prompt is missing
grep 'org\.servo\.servo-.* tracing_mark_write.*PageLoadEndedPrompt' test_output/servo.ftrace
- name: Getting runs file
uses: actions/download-artifact@v4
bench-harmonyos-aarch64:
name: Benching HarmonyOS aarch64
continue-on-error: true
runs-on: hos-runner
needs: test-harmonyos-aarch64
if: github.repository == 'servo/servo'
steps:
- uses: actions/download-artifact@v4
with:
# Name of the artifact to download.
# If unspecified, all artifacts for the run are downloaded.
name: runs.json
name: servoshell-hos-${{ inputs.profile }}.hap
- name: Test hdc device
# First we ensure a device is actually connected and working.
run: hdc list targets && hdc shell echo hello world
- name: Sign the hap
run: |
ls -la
/usr/bin/sign-hos.sh servoshell-default-unsigned.hap servoshell-hos-signed.hap
- name: Install
run: |
# Uninstall first. hdc is not very reliable in terms of exiting with an error, so we uninstall first
# to make sure we don't use a previous version if installation failed for some reason.
hdc uninstall org.servo.servo
hdc install -r servoshell-hos-signed.hap
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 0
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Getting hitrace-bench version
run: echo "INSTALLED_HITRACE_BENCH_VERSION=$(hitrace-bench --version | awk '{print $2}')" >> $GITHUB_ENV
- name: Install hitrace-bench
run: cargo install --locked hitrace-bench --version $HITRACE_BENCH_VERSION
if: ${{ env.INSTALLED_HITRACE_BENCH_VERSION != env.HITRACE_BENCH_VERSION }}
- name: "Run benchmark"
run: hitrace-bench -r runs.json
- name: Getting bencher
uses: bencherdev/bencher@main
run: hitrace-bench -r support/hitrace-bencher/runs.json --bencher -p ${{ inputs.profile }}
continue-on-error: true
- name: Run speedometer
id: BencherRun
run: python3 ./mach test-speedometer-ohos --bmf-output speedometer.json --profile ${{ inputs.profile }}
continue-on-error: true
- name: Create empty speedometer.json if failed
run: touch speedometer.json
if: ${{ steps.BencherRun.outcome == 'failure' }}
- name: Getting model name
# awk is used to remove trailing spaces
run: |
echo "MODEL_NAME=$(hdc bugreport | head -n 20 | grep MarketName | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' -)" >> $GITHUB_ENV
echo "MODEL_NAME=$(hdc shell param get const.product.name | awk '{$1=$1;print}' )" >> $GITHUB_ENV
- name: Combining bencher files
run: jq --compact-output --slurp add speedometer.json bench.json > combined-bencher.json
- uses: bencherdev/bencher@main
# set options
- name: Set bencher opts for PRs (label try run)
if: github.event_name == 'pull_request_target'
run: |
echo "RUN_BENCHER_OPTIONS=--branch ${{ github.event.number }}/PR \
--start-point ${{ github.base_ref }} \
--start-point-hash ${{ github.event.pull_request.base.sha }} \
--start-point-reset \
--start-point-clone-thresholds" >> "$GITHUB_ENV"
- name: Set bencher opts for main
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
run: |
echo "RUN_BENCHER_OPTIONS=--branch main" >> "$GITHUB_ENV"
- name: Set bencher opts for try branch
if: ${{ github.event_name == 'push' && github.ref_name == 'try' }}
run: |
git remote add upstream https://github.com/servo/servo
git fetch upstream main
echo "RUN_BENCHER_OPTIONS=--branch try \
--hash $(git rev-parse HEAD~1) \
--start-point main \
--start-point-hash $(git merge-base upstream/main HEAD) \
--start-point-clone-thresholds \
--start-point-reset" >> "$GITHUB_ENV"
- name: Uploading to bencher.dev
# Note: That e.g. `--start-point` is ignored if it is an empty string,
# which should be the case on e.g. normal push workflows on main.
run: |
bencher run --adapter json --file bench.json --project '${{ env.BENCHER_PROJECT }}' --token '${{ secrets.BENCHER_API_TOKEN }}' --github-actions '${{ secrets.GITHUB_TOKEN }}' --testbed="$MODEL_NAME"
bencher run --adapter json \
--file combined-bencher.json \
--project '${{ env.BENCHER_PROJECT }}' \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
--testbed="$MODEL_NAME" \
$RUN_BENCHER_OPTIONS
- name: Success
if: ${{ !contains(steps.*.outcome, 'failure') && !contains(steps.*.outcome, 'cancelled') }}
run: exit 0
- name: Failure
if: contains(steps.*.outcome, 'failure') || contains(steps.*.outcome, 'cancelled')
run: exit 1

View File

@@ -1,39 +0,0 @@
name: Detect Self-hosted Runner Timeout
on:
workflow_call:
inputs:
unique-id:
required: true
type: string
is-self-hosted:
required: true
type: boolean
jobs:
# In the unlikely event a self-hosted runner was selected and reserved but it
# goes down before the workload starts, cancel the workflow run.
runner-timeout:
if: ${{ inputs.is-self-hosted }}
name: Detect Runner Timeout
runs-on: ubuntu-latest
steps:
- name: Wait a bit
run: sleep 120
- name: Cancel if workload job is still queued
run: |
run_url=/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
if [ "$(gh api "$run_url/jobs" \
| jq -er --arg id '${{ inputs.unique-id }}' \
'.jobs[] | select(.name | contains("[" + $id + "]")) | .status'
)" = queued ]; then
echo 'Timeout waiting for runner assignment!'
echo 'Hint: does this repo have permission to access the runner group?'
echo 'Hint: https://github.com/organizations/servo/settings/actions/runner-groups'
echo
echo 'Cancelling workflow run'
gh api "$run_url/cancel" --method POST
exit 1
fi

View File

@@ -85,11 +85,18 @@ jobs:
runner-timeout:
needs:
- runner-select
uses: ./.github/workflows/self-hosted-runner-timeout.yml
secrets: inherit
with:
unique-id: ${{ needs.runner-select.outputs.unique-id }}
is-self-hosted: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: '.github'
- name: Runner timeout
uses: ./.github/actions/runner-timeout
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
unique-id: '${{ needs.runner-select.outputs.unique-id }}'
build:
needs:
@@ -167,6 +174,10 @@ jobs:
run: |
.\mach build --use-crown --locked --${{ inputs.profile }} ${{ inputs.build-args }}
cp C:\a\servo\servo\target\cargo-timings C:\a\servo\servo\target\cargo-timings-windows -Recurse
- name: Copy resources
# GitHub-hosted runners sometimes check out the repo on D: drive.
if: ${{ runner.environment != 'self-hosted' && startsWith(github.workspace, 'D:\') }}
run: cp D:\a\servo\servo\resources C:\a\servo\servo -Recurse
- name: Smoketest
run: .\mach smoketest --${{ inputs.profile }}
- name: Unit tests
@@ -176,10 +187,6 @@ jobs:
timeout_minutes: 30
max_attempts: 3 # https://github.com/servo/servo/issues/30683
command: .\mach test-unit --${{ inputs.profile }} -- -- --test-threads=1
- name: Build libservo with examples
if: ${{ inputs.build-libservo }}
continue-on-error: true
run: cargo build -p libservo --all-targets
- name: Archive build timing
uses: actions/upload-artifact@v4
with:
@@ -219,3 +226,35 @@ jobs:
speedometer: false
dromaeo: false
secrets: inherit
build-libservo:
if: ${{ inputs.build-libservo }}
name: Build libservo and MSRV check
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 1
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Upgrade llvm
if: ${{ runner.environment != 'self-hosted' }}
run: choco upgrade llvm
- name: Determine MSRV
id: msrv
uses: ./.github/actions/parse_msrv
- name: Install MSRV
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.rust_version }}
- name: Compile libservo with MSRV
run: |
cargo +${{ steps.msrv.outputs.rust_version }} build -p libservo --locked --all-targets

3
.gitignore vendored
View File

@@ -71,3 +71,6 @@ support/macos/Brewfile.lock.json
# direnv
.envrc
# Justfiles
justfile

2504
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,11 @@ authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2024"
publish = false
# We have yet to decide on a policy for updating the minimum supported rust version.
# Before increasing this, please open a discussion on zulip explaining the reason
# why we should consider increasing our minimum supported rust version.
# Please also note, that the **default** rust version in rust-toolchain.toml may be
# bumped freely.
rust-version = "1.85.0"
[workspace.dependencies]
@@ -33,15 +38,16 @@ base64 = "0.22.1"
bincode = "1"
bitflags = "2.9"
bluetooth_traits = { path = "components/shared/bluetooth" }
bytemuck = "1"
byteorder = "1.5"
canvas_traits = { path = "components/shared/canvas" }
cbc = "0.1.2"
cfg-if = "1.0.1"
cfg-if = "1.0.3"
chrono = { version = "0.4", features = ["serde"] }
cipher = { version = "0.4.4", features = ["alloc"] }
compositing_traits = { path = "components/shared/compositing" }
constellation_traits = { path = "components/shared/constellation" }
content-security-policy = { git = "https://github.com/servo/rust-content-security-policy/", branch = "servo-csp", features = ["serde"] }
content-security-policy = { git = "https://github.com/servo/rust-content-security-policy", branch = "servo-csp", features = ["serde"] }
cookie = { package = "cookie", version = "0.18" }
crossbeam-channel = "0.5"
cssparser = { version = "0.35", features = ["serde"] }
@@ -69,40 +75,45 @@ gstreamer-gl-sys = "0.23"
gstreamer-sys = "0.23"
gstreamer-video = "0.23"
harfbuzz-sys = "0.6.1"
harfrust = "0.1.1"
headers = "0.4"
hitrace = "0.1.5"
html5ever = "0.31"
html5ever = "0.35"
http = "1.3"
http-body-util = "0.1"
hyper = "1.6"
hyper = "1.7"
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "logging", "tls12", "webpki-tokio"] }
hyper-util = { version = "0.1", features = ["client", "client-legacy", "http2", "tokio"] }
hyper-util = { version = "0.1", features = ["client-legacy", "http2", "tokio"] }
hyper_serde = { path = "components/hyper_serde" }
icu_locid = "1.5.0"
icu_segmenter = "1.5.0"
image = "0.24"
imsz = "0.2"
indexmap = { version = "2.9.0", features = ["std"] }
ipc-channel = "0.19"
indexmap = { version = "2.10.0", features = ["std"] }
ipc-channel = "0.20"
itertools = "0.14"
js = { package = "mozjs", git = "https://github.com/servo/mozjs" }
keyboard-types = "0.7"
keyboard-types = { version = "0.8.1", features = ["serde", "webdriver"] }
kurbo = { version = "0.11.3", features = ["euclid"] }
layout_api = { path = "components/shared/layout" }
libc = "0.2"
log = "0.4"
mach2 = "0.4"
malloc_size_of = { package = "servo_malloc_size_of", path = "components/malloc_size_of" }
malloc_size_of_derive = "0.1"
markup5ever = "0.16.1"
memmap2 = "0.9.5"
markup5ever = "0.35"
memmap2 = "0.9.7"
mime = "0.3.13"
mime_guess = "2.0.5"
mozangle = "0.5.3"
net_traits = { path = "components/shared/net" }
nix = "0.29"
nix = "0.30"
nom = "8.0.0"
num-traits = "0.2"
num_cpus = "1.17.0"
openxr = "0.19"
parking_lot = "0.12"
peniko = "0.4"
percent-encoding = "2.3"
proc-macro2 = "1"
profile_traits = { path = "components/shared/profile" }
@@ -112,14 +123,14 @@ rand_core = "0.6"
rand_isaac = "0.3"
raw-window-handle = "0.6"
rayon = "1"
read-fonts = "0.29.2"
regex = "1.11"
resvg = "0.45.0"
rustls = { version = "0.23", default-features = false, features = ["logging", "std", "tls12"] }
rustls-pemfile = "2.0"
rustls-pki-types = "1.12"
script_layout_interface = { path = "components/shared/script_layout" }
script_traits = { path = "components/shared/script" }
selectors = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
selectors = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
serde = "1.0.219"
serde_bytes = "0.11"
serde_json = "1.0"
@@ -127,26 +138,24 @@ servo-media = { git = "https://github.com/servo/media" }
servo-media-dummy = { git = "https://github.com/servo/media" }
servo-media-gstreamer = { git = "https://github.com/servo/media" }
servo-tracing = { path = "components/servo_tracing" }
servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
skrifa = "0.31.3"
smallbitvec = "2.6.0"
smallvec = "1.15"
snapshot = { path = "./components/shared/snapshot" }
static_assertions = "1.1"
smallvec = { version = "1.15", features = ["serde", "union"] }
string_cache = "0.8"
string_cache_codegen = "0.5"
strum = "0.26"
strum_macros = "0.26"
stylo = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
stylo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
stylo_config = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
stylo_dom = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
stylo_malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
stylo_traits = { git = "https://github.com/servo/stylo", branch = "2025-05-01" }
stylo = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
stylo_atoms = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
stylo_config = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
stylo_dom = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
stylo_malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
stylo_traits = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
surfman = { git = "https://github.com/servo/surfman", rev = "f7688b4585f9e0b5d4bf8ee8e4a91e82349610b1", features = ["chains"] }
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
synstructure = "0.13"
taffy = { version = "0.8.3", default-features = false, features = ["detailed_layout_info", "grid", "serde", "std"] }
thin-vec = "0.2.14"
taffy = { version = "0.9", default-features = false, features = ["calc", "detailed_layout_info", "grid", "std"] }
tikv-jemalloc-sys = "0.6.0"
tikv-jemallocator = "0.6.0"
time = { package = "time", version = "0.3", features = ["large-dates", "local-offset", "serde"] }
@@ -164,7 +173,9 @@ unicode-script = "0.5"
unicode-segmentation = "1.12.0"
url = "2.5"
urlpattern = "0.3"
uuid = { version = "1.12.1", features = ["v4"] }
uuid = { version = "1.18.0", features = ["v4"] }
vello = { git = "https://github.com/linebender/vello", rev = "b0e2e598ac62c7b3d04d8660e7b1b7659b596970" }
vello_cpu = { git = "https://github.com/linebender/vello", rev = "b0e2e598ac62c7b3d04d8660e7b1b7659b596970" }
webdriver = "0.53.0"
webgpu_traits = { path = "components/shared/webgpu" }
webpki-roots = "1.0"
@@ -175,10 +186,11 @@ wgpu-core = "25"
wgpu-types = "25"
winapi = "0.3"
windows-sys = "0.59"
winit = "0.30.12"
wio = "0.2"
wr_malloc_size_of = { git = "https://github.com/servo/webrender", branch = "0.67" }
xi-unicode = "0.3.0"
xml5ever = "0.22"
xml5ever = "0.35"
[profile.release]
opt-level = 3
@@ -220,6 +232,7 @@ codegen-units = 1
#
# html5ever = { path = "../html5ever/html5ever" }
# markup5ever = { path = "../html5ever/markup5ever" }
# web_atoms = { path = "../html5ever/web_atoms" }
# xml5ever = { path = "../html5ever/xml5ever" }
#
# Or for Stylo:
@@ -247,5 +260,4 @@ codegen-units = 1
# <crate> = { path = "/path/to/local/checkout" }
#
# [patch."https://github.com/servo/rust-content-security-policy"]
# content-security-policy = { path = "../rust-content-security-policy/" }
# content-security-policy = { git = "https://github.com/timvdlippe/rust-content-security-policy/", branch = "fix-report-checks", features = ["serde"] }
# content-security-policy = { path = "../rust-content-security-policy" }

View File

@@ -50,7 +50,7 @@ For more detailed build instructions, see the Servo book under [Setting up your
- Download [`uv`](https://docs.astral.sh/uv/getting-started/installation/#standalone-installer), [`choco`](https://chocolatey.org/install#individual), and [`rustup`](https://win.rustup.rs/)
- Be sure to select *Quick install via the Visual Studio Community installer*
- In the Visual Studio Installer, ensure the following components are installed:
- **Windows 10 SDK (10.0.19041.0)** (`Microsoft.VisualStudio.Component.Windows10SDK.19041`)
- **Windows 10/11 SDK (anything >= 10.0.19041.0)** (`Microsoft.VisualStudio.Component.Windows{10, 11}SDK.{>=19041}`)
- **MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)** (`Microsoft.VisualStudio.Component.VC.Tools.x86.x64`)
- **C++ ATL for latest v143 build tools (x86 & x64)** (`Microsoft.VisualStudio.Component.VC.ATL`)
- **C++ MFC for latest v143 build tools (x86 & x64)** (`Microsoft.VisualStudio.Component.VC.ATLMFC`)
@@ -90,4 +90,4 @@ For more detailed build instructions, see the Servo book under [Setting up your
- `OHOS_SDK_NATIVE` (e.g. `${DEVECO_SDK_HOME}/default/openharmony/native` or `${OHOS_BASE_SDK_HOME}/${API_VERSION}/native`)
- `SERVO_OHOS_SIGNING_CONFIG`: Path to json file containing a valid signing configuration for the demo app.
- Review the detailed instructions at [Building for OpenHarmony].
- The target distribution can be modified by passing `--flavor=<default|harmonyos>` to `mach <build|package|install>.
- The target distribution can be modified by passing `--flavor=<default|harmonyos>` to `mach <build|package|install>`.

View File

@@ -11,8 +11,13 @@ rust-version.workspace = true
path = "lib.rs"
[features]
allocation-tracking = ["backtrace", "fnv"]
use-system-allocator = ["libc"]
[dependencies]
backtrace = { workspace = true, optional = true }
fnv = { workspace = true, optional = true }
[target.'cfg(not(any(windows, target_env = "ohos")))'.dependencies]
libc = { workspace = true, optional = true }
tikv-jemalloc-sys = { workspace = true }

View File

@@ -2,13 +2,53 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Selecting the default global allocator for Servo
//! Selecting the default global allocator for Servo, and exposing common
//! allocator introspection APIs for memory profiling.
use std::os::raw::c_void;
#[cfg(not(feature = "allocation-tracking"))]
#[global_allocator]
static ALLOC: Allocator = Allocator;
#[cfg(feature = "allocation-tracking")]
#[global_allocator]
static ALLOC: crate::tracking::AccountingAlloc<Allocator> =
crate::tracking::AccountingAlloc::with_allocator(Allocator);
#[cfg(feature = "allocation-tracking")]
mod tracking;
pub fn dump_unmeasured() {
#[cfg(feature = "allocation-tracking")]
ALLOC.dump_unmeasured_allocations();
}
pub use crate::platform::*;
type EnclosingSizeFn = unsafe extern "C" fn(*const c_void) -> usize;
/// # Safety
/// No restrictions. The passed pointer is never dereferenced.
/// This function is only marked unsafe because the MallocSizeOfOps APIs
/// requires an unsafe function pointer.
#[cfg(feature = "allocation-tracking")]
unsafe extern "C" fn enclosing_size_impl(ptr: *const c_void) -> usize {
let (adjusted, size) = crate::ALLOC.enclosing_size(ptr);
if size != 0 {
crate::ALLOC.note_allocation(adjusted, size);
}
size
}
#[allow(non_upper_case_globals)]
#[cfg(feature = "allocation-tracking")]
pub static enclosing_size: Option<EnclosingSizeFn> = Some(crate::enclosing_size_impl);
#[allow(non_upper_case_globals)]
#[cfg(not(feature = "allocation-tracking"))]
pub static enclosing_size: Option<EnclosingSizeFn> = None;
#[cfg(not(any(windows, feature = "use-system-allocator", target_env = "ohos")))]
mod platform {
use std::os::raw::c_void;
@@ -21,7 +61,10 @@ mod platform {
///
/// Passing a non-heap allocated pointer to this function results in undefined behavior.
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
unsafe { tikv_jemallocator::usable_size(ptr) }
let size = unsafe { tikv_jemallocator::usable_size(ptr) };
#[cfg(feature = "allocation-tracking")]
crate::ALLOC.note_allocation(ptr, size);
size
}
/// Memory allocation APIs compatible with libc
@@ -46,12 +89,18 @@ mod platform {
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
#[cfg(target_vendor = "apple")]
unsafe {
return libc::malloc_size(ptr);
let size = libc::malloc_size(ptr);
#[cfg(feature = "allocation-tracking")]
crate::ALLOC.note_allocation(ptr, size);
size
}
#[cfg(not(target_vendor = "apple"))]
unsafe {
return libc::malloc_usable_size(ptr as *mut _);
let size = libc::malloc_usable_size(ptr as *mut _);
#[cfg(feature = "allocation-tracking")]
crate::ALLOC.note_allocation(ptr, size);
size
}
}
@@ -81,7 +130,10 @@ mod platform {
ptr = *(ptr as *const *const c_void).offset(-1)
}
HeapSize(heap, 0, ptr) as usize
let size = HeapSize(heap, 0, ptr) as usize;
#[cfg(feature = "allocation-tracking")]
crate::ALLOC.note_allocation(ptr, size);
size
}
}
}

View File

@@ -0,0 +1,211 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! An allocator wrapper that records metadata about each live allocation.
//! This metadata can then be used to identify allocations that are not visible
//! through any existing MallocSizeOf path.
use std::alloc::{GlobalAlloc, Layout, System};
use std::cell::Cell;
use std::collections::hash_map::Entry;
use std::os::raw::c_void;
use std::sync::Mutex;
use fnv::{FnvBuildHasher, FnvHashMap};
/// The maximum number of allocations that we'll keep track of. Once the limit
/// is reached, we'll evict the first allocation that is smaller than the new addition.
const MAX_TRACKED_ALLOCATIONS: usize = usize::MAX;
/// Cap the number of stack frames that we'll store per allocation.
const MAX_FRAMES: usize = 50;
/// A certain number of frames at the top of the allocation stack are just
/// just internal liballoc implementation details or AccountingAlloc functions.
/// We can skip them without losing any meaningful information.
const SKIPPED_FRAMES: usize = 5;
/// The minimum size of allocation that we'll track. Can be used to reduce overhead
/// by skipping bookkeeping for small allocations.
const MIN_SIZE: usize = 0;
thread_local! {
static IN_ALLOCATION: Cell<bool> = Cell::new(false);
}
#[derive(PartialEq, Eq)]
struct AllocSite {
/// The stack at the time this allocation was recorded.
frames: [*mut std::ffi::c_void; MAX_FRAMES],
/// The start of the allocated memory.
ptr: *mut u8,
/// The size of the allocated memory.
size: usize,
/// True if this allocation site's size is ever queried after the initial
/// allocation. If false, it means that the allocation is not visible from
/// any of the MallocSizeOf roots.
noted: bool,
}
impl AllocSite {
fn contains(&self, ptr: *mut u8) -> bool {
ptr >= self.ptr && ptr < unsafe { self.ptr.offset(self.size as isize) }
}
}
unsafe impl Send for AllocSite {}
/// A map of pointers to allocation callsite metadata.
static ALLOCATION_SITES: Mutex<FnvHashMap<usize, AllocSite>> =
const { Mutex::new(FnvHashMap::with_hasher(FnvBuildHasher::new())) };
#[derive(Default)]
pub struct AccountingAlloc<A = System> {
allocator: A,
}
impl<A> AccountingAlloc<A> {
pub const fn with_allocator(allocator: A) -> Self {
Self { allocator }
}
fn remove_allocation(&self, ptr: *const c_void, size: usize) {
if size < MIN_SIZE {
return;
}
let old = IN_ALLOCATION.with(|status| status.replace(true));
if old {
return;
}
let mut sites = ALLOCATION_SITES.lock().unwrap();
if let Entry::Occupied(e) = sites.entry(ptr as usize) {
e.remove();
}
IN_ALLOCATION.with(|status| status.set(old));
}
fn record_allocation(&self, ptr: *mut u8, size: usize) {
if size < MIN_SIZE {
return;
}
let old = IN_ALLOCATION.with(|status| status.replace(true));
if old {
return;
}
let mut num_skipped = 0;
let mut num_frames = 0;
let mut frames = [std::ptr::null_mut(); MAX_FRAMES];
backtrace::trace(|frame| {
if num_skipped < SKIPPED_FRAMES {
num_skipped += 1;
return true;
}
frames[num_frames] = frame.ip();
num_frames += 1;
num_frames < MAX_FRAMES
});
let site = AllocSite {
frames,
size,
ptr,
noted: false,
};
let mut sites = ALLOCATION_SITES.lock().unwrap();
if sites.len() < MAX_TRACKED_ALLOCATIONS {
sites.insert(ptr as usize, site);
} else if let Some(key) = sites
.iter()
.find(|(_, s)| s.size < site.size)
.map(|(k, _)| k.clone())
{
sites.remove(&key);
sites.insert(ptr as usize, site);
}
IN_ALLOCATION.with(|status| status.set(old));
}
pub(crate) fn enclosing_size(&self, ptr: *const c_void) -> (*const c_void, usize) {
ALLOCATION_SITES
.lock()
.unwrap()
.iter()
.find(|(_, site)| site.contains(ptr.cast_mut().cast()))
.map_or((std::ptr::null_mut(), 0), |(_, site)| {
(site.ptr.cast(), site.size)
})
}
pub(crate) fn note_allocation(&self, ptr: *const c_void, size: usize) {
if size < MIN_SIZE {
return;
}
IN_ALLOCATION.with(|status| status.set(true));
if let Some(site) = ALLOCATION_SITES.lock().unwrap().get_mut(&(ptr as usize)) {
site.noted = true;
}
IN_ALLOCATION.with(|status| status.set(false));
}
pub(crate) fn dump_unmeasured_allocations(&self) {
// Ensure that we ignore all allocations triggered while processing
// the existing allocation data.
IN_ALLOCATION.with(|status| status.set(true));
{
let sites = ALLOCATION_SITES.lock().unwrap();
let default = "???";
for site in sites
.values()
.filter(|site| site.size > MIN_SIZE && !site.noted)
{
let mut resolved = vec![];
for ip in site.frames.iter().filter(|ip| !ip.is_null()) {
backtrace::resolve(*ip, |symbol| {
resolved.push((
symbol.filename().map(|f| f.to_owned()),
symbol.lineno(),
symbol.name().map(|n| format!("{}", n)),
));
});
}
println!("---\n{}\n", site.size);
for (filename, line, symbol) in &resolved {
let fname = filename.as_ref().map(|f| f.display().to_string());
println!(
"{}:{} ({})",
fname.as_deref().unwrap_or(default),
line.unwrap_or_default(),
symbol.as_deref().unwrap_or(default),
);
}
}
}
IN_ALLOCATION.with(|status| status.set(false));
}
}
unsafe impl<A: GlobalAlloc> GlobalAlloc for AccountingAlloc<A> {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
let ptr = unsafe { self.allocator.alloc(layout) };
self.record_allocation(ptr, layout.size());
ptr
}
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
unsafe { self.allocator.dealloc(ptr, layout) };
self.remove_allocation(ptr.cast(), layout.size());
}
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
let ptr = unsafe { self.allocator.alloc_zeroed(layout) };
self.record_allocation(ptr, layout.size());
ptr
}
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
self.remove_allocation(ptr.cast(), layout.size());
let ptr = unsafe { self.allocator.realloc(ptr, layout, new_size) };
self.record_allocation(ptr, new_size);
ptr
}
}

View File

@@ -21,6 +21,7 @@ crossbeam-channel = { workspace = true }
ipc-channel = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
rustc-demangle = { version = "0.1", optional = true }
serde_json = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
@@ -28,7 +29,9 @@ mach2 = { version = "0.4", optional = true }
[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos", target_env = "musl"))))'.dependencies]
nix = { workspace = true, features = ["signal"], optional = true }
unwind-sys = { version = "0.1.4", optional = true }
[target.'cfg(target_os = "android")'.dependencies]
nix = { workspace = true, features = ["signal"], optional = true }
[features]
sampler = ["unwind-sys", "mach2", "nix"]
sampler = ["mach2", "nix", "rustc-demangle"]

View File

@@ -2,10 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::Cell;
use std::collections::{HashMap, VecDeque};
use std::sync::{Arc, Weak};
use std::thread;
use std::thread::{self, Builder, JoinHandle};
use std::time::{Duration, Instant};
use background_hang_monitor_api::{
@@ -16,46 +14,33 @@ use background_hang_monitor_api::{
use crossbeam_channel::{Receiver, Sender, after, never, select, unbounded};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use log::warn;
use crate::sampler::{NativeStack, Sampler};
#[derive(Clone)]
pub struct HangMonitorRegister {
sender: Weak<Sender<(MonitoredComponentId, MonitoredComponentMsg)>>,
tether: Sender<Never>,
sender: MonitoredComponentSender,
monitoring_enabled: bool,
}
impl HangMonitorRegister {
/// Start a new hang monitor worker, and return a handle to register components for monitoring.
/// Start a new hang monitor worker, and return a handle to register components for monitoring,
/// as well as a join handle on the worker thread.
pub fn init(
constellation_chan: IpcSender<HangMonitorAlert>,
control_port: IpcReceiver<BackgroundHangMonitorControlMsg>,
monitoring_enabled: bool,
) -> Box<dyn BackgroundHangMonitorRegister> {
// Create a channel to pass messages of type `MonitoredComponentMsg`.
// See the discussion in `<HangMonitorRegister as
// BackgroundHangMonitorRegister>::register_component` for why we wrap
// the sender with `Arc` and why `HangMonitorRegister` only maintains
// a weak reference to it.
) -> (Box<dyn BackgroundHangMonitorRegister>, JoinHandle<()>) {
let (sender, port) = unbounded();
let sender = Arc::new(sender);
let sender_weak = Arc::downgrade(&sender);
let sender_clone = sender.clone();
// Create a "tether" channel, whose sole purpose is to keep the worker
// thread alive. The worker thread will terminates when all copies of
// `tether` are dropped.
let (tether, tether_port) = unbounded();
let _ = thread::Builder::new()
let join_handle = Builder::new()
.name("BackgroundHangMonitor".to_owned())
.spawn(move || {
let mut monitor = BackgroundHangMonitorWorker::new(
constellation_chan,
control_port,
(sender, port),
tether_port,
port,
monitoring_enabled,
);
while monitor.run() {
@@ -63,11 +48,13 @@ impl HangMonitorRegister {
}
})
.expect("Couldn't start BHM worker.");
Box::new(HangMonitorRegister {
sender: sender_weak,
tether,
monitoring_enabled,
})
(
Box::new(HangMonitorRegister {
sender: sender_clone,
monitoring_enabled,
}),
join_handle,
)
}
}
@@ -80,11 +67,10 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
component_id: MonitoredComponentId,
transient_hang_timeout: Duration,
permanent_hang_timeout: Duration,
exit_signal: Option<Box<dyn BackgroundHangMonitorExitSignal>>,
exit_signal: Box<dyn BackgroundHangMonitorExitSignal>,
) -> Box<dyn BackgroundHangMonitor> {
let bhm_chan = BackgroundHangMonitorChan::new(
self.sender.clone(),
self.tether.clone(),
component_id,
self.monitoring_enabled,
);
@@ -97,6 +83,8 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
let sampler = crate::sampler_windows::WindowsSampler::new_boxed();
#[cfg(all(feature = "sampler", target_os = "macos"))]
let sampler = crate::sampler_mac::MacOsSampler::new_boxed();
#[cfg(all(feature = "sampler", target_os = "android"))]
let sampler = crate::sampler_linux::LinuxSampler::new_boxed();
#[cfg(all(
feature = "sampler",
target_os = "linux",
@@ -110,7 +98,6 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
let sampler = crate::sampler_linux::LinuxSampler::new_boxed();
#[cfg(any(
not(feature = "sampler"),
target_os = "android",
all(
target_os = "linux",
any(
@@ -123,54 +110,12 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
))]
let sampler = crate::sampler::DummySampler::new_boxed();
// When a component is registered, and there's an exit request that
// reached BHM, we want an exit signal to be delivered to the
// component's exit signal handler eventually. However, there's a race
// condition between the reception of `BackgroundHangMonitorControlMsg::
// Exit` and `MonitoredComponentMsg::Register` that needs to handled
// carefully. When the worker receives an `Exit` message, it stops
// processing messages, and any further `Register` messages sent to the
// worker thread are ignored. If the submissions of `Exit` and
// `Register` messages are far apart enough, the channel is closed by
// the time the client attempts to send a `Register` message, and
// therefore the client can figure out by `Sender::send`'s return value
// that it must deliver an exit signal. However, if these message
// submissions are close enough, the `Register` message is still sent,
// but the worker thread might exit before it sees the message, leaving
// the message unprocessed and the exit signal unsent.
//
// To fix this, we wrap the exit signal handler in an RAII wrapper of
// type `SignalToExitOnDrop` to automatically send a signal when it's
// dropped. This way, we can make sure the exit signal is sent even if
// the message couldn't reach the worker thread and be processed.
//
// However, as it turns out, `crossbeam-channel`'s channels don't drop
// remaining messages until all associated senders *and* receivers are
// dropped. This means the exit signal won't be delivered as long as
// there's at least one `HangMonitorRegister` or
// `BackgroundHangMonitorChan` maintaining a copy of the sender. To work
// around this and guarantee a rapid delivery of the exit signal, the
// sender is wrapped in `Arc`, and only the worker thread maintains a
// strong reference, thus ensuring both the sender and receiver are
// dropped as soon as the worker thread exits.
let exit_signal = SignalToExitOnDrop(exit_signal);
// If the tether is dropped after this call, the worker thread might
// exit before processing the `Register` message because there's no
// implicit ordering guarantee between two channels. If this happens,
// an exit signal will be sent despite we haven't received a
// corresponding exit request. To enforce the correct ordering and
// prevent a false exit signal from being sent, we include a copy of
// `self.tether` in the `Register` message.
let tether = self.tether.clone();
bhm_chan.send(MonitoredComponentMsg::Register(
sampler,
thread::current().name().map(str::to_owned),
transient_hang_timeout,
permanent_hang_timeout,
exit_signal,
tether,
));
Box::new(bhm_chan)
}
@@ -190,8 +135,7 @@ enum MonitoredComponentMsg {
Option<String>,
Duration,
Duration,
SignalToExitOnDrop,
Sender<Never>,
Box<dyn BackgroundHangMonitorExitSignal>,
),
/// Unregister component for monitoring.
Unregister,
@@ -201,54 +145,32 @@ enum MonitoredComponentMsg {
NotifyWait,
}
/// Stable equivalent to the `!` type
enum Never {}
/// A wrapper around a sender to the monitor,
/// which will send the Id of the monitored component along with each message,
/// and keep track of whether the monitor is still listening on the other end.
struct BackgroundHangMonitorChan {
sender: Weak<Sender<(MonitoredComponentId, MonitoredComponentMsg)>>,
_tether: Sender<Never>,
sender: MonitoredComponentSender,
component_id: MonitoredComponentId,
disconnected: Cell<bool>,
monitoring_enabled: bool,
}
impl BackgroundHangMonitorChan {
fn new(
sender: Weak<Sender<(MonitoredComponentId, MonitoredComponentMsg)>>,
tether: Sender<Never>,
sender: MonitoredComponentSender,
component_id: MonitoredComponentId,
monitoring_enabled: bool,
) -> Self {
BackgroundHangMonitorChan {
sender,
_tether: tether,
component_id,
disconnected: Default::default(),
monitoring_enabled,
}
}
fn send(&self, msg: MonitoredComponentMsg) {
if self.disconnected.get() {
return;
}
// The worker thread owns both the receiver *and* the only strong
// reference to the sender. An `upgrade` failure means the latter is
// gone, and a `send` failure means the former is gone. They are dropped
// simultaneously, but we might observe an intermediate state.
if self
.sender
.upgrade()
.and_then(|sender| sender.send((self.component_id.clone(), msg)).ok())
.is_none()
{
warn!("BackgroundHangMonitor has gone away");
self.disconnected.set(true);
}
self.sender
.send((self.component_id.clone(), msg))
.expect("BHM is gone");
}
}
@@ -271,33 +193,6 @@ impl BackgroundHangMonitor for BackgroundHangMonitorChan {
}
}
/// Wraps [`BackgroundHangMonitorExitSignal`] and calls `signal_to_exit` when
/// dropped.
struct SignalToExitOnDrop(Option<Box<dyn BackgroundHangMonitorExitSignal>>);
impl SignalToExitOnDrop {
/// Call `BackgroundHangMonitorExitSignal::signal_to_exit` now.
fn signal_to_exit(&mut self) {
if let Some(signal) = self.0.take() {
signal.signal_to_exit();
}
}
/// Disassociate `BackgroundHangMonitorExitSignal` from itself, preventing
/// `BackgroundHangMonitorExitSignal::signal_to_exit` from being called in
/// the future.
fn release(&mut self) {
self.0 = None;
}
}
impl Drop for SignalToExitOnDrop {
#[inline]
fn drop(&mut self) {
self.signal_to_exit();
}
}
struct MonitoredComponent {
sampler: Box<dyn Sampler>,
last_activity: Instant,
@@ -307,7 +202,7 @@ struct MonitoredComponent {
sent_transient_alert: bool,
sent_permanent_alert: bool,
is_waiting: bool,
exit_signal: SignalToExitOnDrop,
exit_signal: Box<dyn BackgroundHangMonitorExitSignal>,
}
struct Sample(MonitoredComponentId, Instant, NativeStack);
@@ -317,8 +212,6 @@ struct BackgroundHangMonitorWorker {
monitored_components: HashMap<MonitoredComponentId, MonitoredComponent>,
constellation_chan: IpcSender<HangMonitorAlert>,
port: Receiver<(MonitoredComponentId, MonitoredComponentMsg)>,
_port_sender: Arc<Sender<(MonitoredComponentId, MonitoredComponentMsg)>>,
tether_port: Receiver<Never>,
control_port: Receiver<BackgroundHangMonitorControlMsg>,
sampling_duration: Option<Duration>,
sampling_max_duration: Option<Duration>,
@@ -327,6 +220,7 @@ struct BackgroundHangMonitorWorker {
sampling_baseline: Instant,
samples: VecDeque<Sample>,
monitoring_enabled: bool,
shutting_down: bool,
}
type MonitoredComponentSender = Sender<(MonitoredComponentId, MonitoredComponentMsg)>;
@@ -336,8 +230,7 @@ impl BackgroundHangMonitorWorker {
fn new(
constellation_chan: IpcSender<HangMonitorAlert>,
control_port: IpcReceiver<BackgroundHangMonitorControlMsg>,
(port_sender, port): (Arc<MonitoredComponentSender>, MonitoredComponentReceiver),
tether_port: Receiver<Never>,
port: MonitoredComponentReceiver,
monitoring_enabled: bool,
) -> Self {
let control_port = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(control_port);
@@ -346,8 +239,6 @@ impl BackgroundHangMonitorWorker {
monitored_components: Default::default(),
constellation_chan,
port,
_port_sender: port_sender,
tether_port,
control_port,
sampling_duration: None,
sampling_max_duration: None,
@@ -356,6 +247,7 @@ impl BackgroundHangMonitorWorker {
creation: Instant::now(),
samples: Default::default(),
monitoring_enabled,
shutting_down: Default::default(),
}
}
@@ -414,19 +306,14 @@ impl BackgroundHangMonitorWorker {
let received = select! {
recv(self.port) -> event => {
// Since we own the `Arc<Sender<_>>`, the channel never
// gets disconnected.
Some(event.unwrap())
},
recv(self.tether_port) -> _ => {
// This arm can only reached by a tether disconnection
// All associated `HangMonitorRegister` and
// `BackgroundHangMonitorChan` have been dropped. Suppress
// `signal_to_exit` and exit the BHM.
for component in self.monitored_components.values_mut() {
component.exit_signal.release();
if let Ok(event) = event {
Some(event)
} else {
// All senders have dropped,
// which means all monitored components have shut down,
// and so we can as well.
return false;
}
return false;
},
recv(self.control_port) -> event => {
match event {
@@ -443,16 +330,21 @@ impl BackgroundHangMonitorWorker {
}
None
},
Ok(BackgroundHangMonitorControlMsg::Exit(sender)) => {
Ok(BackgroundHangMonitorControlMsg::Exit) => {
for component in self.monitored_components.values_mut() {
component.exit_signal.signal_to_exit();
}
// Confirm exit with to the constellation.
let _ = sender.send(());
// Note the start of shutdown,
// to ensure exit propagates,
// even to components that have yet to register themselves,
// from this point on.
self.shutting_down = true;
// Also exit the BHM.
return false;
// Keep running; this worker thread will shutdown
// when the monitored components have shutdown,
// which we know has happened when `self.port` disconnects.
None
},
Err(_) => return false,
}
@@ -491,9 +383,16 @@ impl BackgroundHangMonitorWorker {
transient_hang_timeout,
permanent_hang_timeout,
exit_signal,
_tether,
),
) => {
// If we are shutting down,
// propagate it to the component,
// and register it(the component will unregister itself
// as part of handling the exit).
if self.shutting_down {
exit_signal.signal_to_exit();
}
let component = MonitoredComponent {
sampler,
last_activity: Instant::now(),
@@ -516,13 +415,9 @@ impl BackgroundHangMonitorWorker {
);
},
(component_id, MonitoredComponentMsg::Unregister) => {
let (_, mut component) = self
.monitored_components
self.monitored_components
.remove_entry(&component_id)
.expect("Received Unregister for an unknown component");
// Prevent `signal_to_exit` from being called
component.exit_signal.release();
},
(component_id, MonitoredComponentMsg::NotifyActivity(annotation)) => {
let component = self

View File

@@ -17,6 +17,8 @@ mod sampler;
))
))]
mod sampler_linux;
#[cfg(all(feature = "sampler", target_os = "android"))]
mod sampler_linux;
#[cfg(all(feature = "sampler", target_os = "macos"))]
mod sampler_mac;
#[cfg(all(feature = "sampler", target_os = "windows"))]

View File

@@ -86,10 +86,15 @@ impl NativeStack {
continue;
}
backtrace::resolve(*ip, |symbol| {
// TODO: use the demangled or C++ demangled symbols if available.
let name = symbol
.name()
.map(|n| String::from_utf8_lossy(n.as_bytes()).to_string());
// demangle if possible -
// the `rustc_demangle` crate transparently supports both
// "legacy" (C++ style) and "v0" mangling formats.
#[cfg(feature = "sampler")]
let name = name.map(|n| rustc_demangle::demangle(&n).to_string());
let filename = symbol.filename().map(|n| n.to_string_lossy().to_string());
let lineno = symbol.lineno();
profile.backtrace.push(HangProfileSymbol {

View File

@@ -5,13 +5,9 @@
#![allow(unsafe_code)]
use std::cell::UnsafeCell;
use std::sync::atomic::{AtomicPtr, Ordering};
use std::{cmp, io, mem, process, ptr, thread};
use std::{io, mem, process, thread};
use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction};
use unwind_sys::{
UNW_ESUCCESS, UNW_REG_IP, UNW_REG_SP, unw_cursor_t, unw_get_reg, unw_init_local, unw_step,
};
use crate::sampler::{NativeStack, Sampler};
@@ -27,8 +23,6 @@ static SHARED_STATE: UncheckedSyncUnsafeCell<SharedState> =
msg4: None,
}));
static CONTEXT: AtomicPtr<libc::ucontext_t> = AtomicPtr::new(ptr::null_mut());
type MonitoredThreadId = libc::pid_t;
struct SharedState {
@@ -48,7 +42,6 @@ fn clear_shared_state() {
shared_state.msg3 = None;
shared_state.msg4 = None;
}
CONTEXT.store(ptr::null_mut(), Ordering::SeqCst);
}
fn reset_shared_state() {
@@ -59,7 +52,6 @@ fn reset_shared_state() {
shared_state.msg3 = Some(PosixSemaphore::new(0).expect("valid semaphore"));
shared_state.msg4 = Some(PosixSemaphore::new(0).expect("valid semaphore"));
}
CONTEXT.store(ptr::null_mut(), Ordering::SeqCst);
}
struct PosixSemaphore {
@@ -149,40 +141,6 @@ impl LinuxSampler {
}
}
enum RegNum {
Ip = UNW_REG_IP as isize,
Sp = UNW_REG_SP as isize,
}
fn get_register(cursor: *mut unw_cursor_t, num: RegNum) -> Result<u64, i32> {
unsafe {
let mut val = 0;
let ret = unw_get_reg(cursor, num as i32, &mut val);
if ret == UNW_ESUCCESS {
Ok(val)
} else {
Err(ret)
}
}
}
fn step(cursor: *mut unw_cursor_t) -> Result<bool, i32> {
unsafe {
// libunwind 1.1 seems to get confused and walks off the end of the stack. The last IP
// it reports is 0, so we'll stop if we're there.
if get_register(cursor, RegNum::Ip).unwrap_or(1) == 0 {
return Ok(false);
}
let ret = unw_step(cursor);
match ret.cmp(&0) {
cmp::Ordering::Less => Err(ret),
cmp::Ordering::Greater => Ok(true),
cmp::Ordering::Equal => Ok(false),
}
}
}
impl Sampler for LinuxSampler {
#[allow(unsafe_code)]
fn suspend_and_sample_thread(&self) -> Result<NativeStack, ()> {
@@ -209,33 +167,17 @@ impl Sampler for LinuxSampler {
.wait_through_intr()
.expect("msg2 failed");
let context = CONTEXT.load(Ordering::SeqCst);
let mut cursor = mem::MaybeUninit::uninit();
let ret = unsafe { unw_init_local(cursor.as_mut_ptr(), context) };
result = if ret == UNW_ESUCCESS {
let mut native_stack = NativeStack::new();
#[allow(clippy::while_let_loop)] // False positive
loop {
let ip = match get_register(cursor.as_mut_ptr(), RegNum::Ip) {
Ok(ip) => ip,
Err(_) => break,
};
let sp = match get_register(cursor.as_mut_ptr(), RegNum::Sp) {
Ok(sp) => sp,
Err(_) => break,
};
if native_stack
.process_register(ip as *mut _, sp as *mut _)
.is_err() ||
!step(cursor.as_mut_ptr()).unwrap_or(false)
{
break;
}
}
Ok(native_stack)
} else {
Err(())
let mut native_stack = NativeStack::new();
unsafe {
backtrace::trace_unsynchronized(|frame| {
let ip = frame.ip();
let sp = frame.sp();
// This return value here determines whether we proceed to the next stack frame or not.
native_stack.process_register(ip, sp).is_ok()
})
};
result = Ok(native_stack);
// signal the thread to continue.
shared_state
@@ -272,11 +214,9 @@ impl Drop for LinuxSampler {
extern "C" fn sigprof_handler(
sig: libc::c_int,
_info: *mut libc::siginfo_t,
ctx: *mut libc::c_void,
_ctx: *mut libc::c_void,
) {
assert_eq!(sig, libc::SIGPROF);
// copy the context.
CONTEXT.store(ctx as *mut libc::ucontext_t, Ordering::SeqCst);
// Safety: non-exclusive reference only
// since the sampling thread is accessing this concurrently

View File

@@ -27,16 +27,23 @@ fn test_hang_monitoring() {
ipc::channel().expect("ipc channel failure");
let (_sampler_sender, sampler_receiver) = ipc::channel().expect("ipc channel failure");
let background_hang_monitor_register = HangMonitorRegister::init(
let (background_hang_monitor_register, join_handle) = HangMonitorRegister::init(
background_hang_monitor_ipc_sender.clone(),
sampler_receiver,
true,
);
struct BHMExitSignal;
impl BackgroundHangMonitorExitSignal for BHMExitSignal {
fn signal_to_exit(&self) {}
}
let background_hang_monitor = background_hang_monitor_register.register_component(
MonitoredComponentId(TEST_PIPELINE_ID, MonitoredComponentType::Script),
Duration::from_millis(10),
Duration::from_millis(1000),
None,
Box::new(BHMExitSignal),
);
// Start an activity.
@@ -119,6 +126,11 @@ fn test_hang_monitoring() {
// Still no new alerts because the hang monitor has shut-down already.
assert!(background_hang_monitor_receiver.try_recv().is_err());
// Join on the worker thread(channels are dropped above).
join_handle
.join()
.expect("Failed to join on the BHM worker thread");
}
#[test]
@@ -131,16 +143,23 @@ fn test_hang_monitoring_unregister() {
ipc::channel().expect("ipc channel failure");
let (_sampler_sender, sampler_receiver) = ipc::channel().expect("ipc channel failure");
let background_hang_monitor_register = HangMonitorRegister::init(
let (background_hang_monitor_register, join_handle) = HangMonitorRegister::init(
background_hang_monitor_ipc_sender.clone(),
sampler_receiver,
true,
);
struct BHMExitSignal;
impl BackgroundHangMonitorExitSignal for BHMExitSignal {
fn signal_to_exit(&self) {}
}
let background_hang_monitor = background_hang_monitor_register.register_component(
MonitoredComponentId(TEST_PIPELINE_ID, MonitoredComponentType::Script),
Duration::from_millis(10),
Duration::from_millis(1000),
None,
Box::new(BHMExitSignal),
);
// Start an activity.
@@ -155,6 +174,13 @@ fn test_hang_monitoring_unregister() {
// No new alert yet
assert!(background_hang_monitor_receiver.try_recv().is_err());
// Drop the channels and join on the worker thread.
drop(background_hang_monitor);
drop(background_hang_monitor_register);
join_handle
.join()
.expect("Failed to join on the BHM worker thread");
}
// Perform two certain steps in `test_hang_monitoring_exit_signal_inner` in
@@ -218,15 +244,13 @@ fn test_hang_monitoring_exit_signal_inner(op_order: fn(&mut dyn FnMut(), &mut dy
}));
// Init a worker, without active monitoring.
let background_hang_monitor_register = HangMonitorRegister::init(
let (background_hang_monitor_register, join_handle) = HangMonitorRegister::init(
background_hang_monitor_ipc_sender.clone(),
control_receiver,
false,
);
let mut background_hang_monitor = None;
let (exit_sender, exit_receiver) = ipc::channel().expect("Failed to create IPC channel!");
let mut exit_sender = Some(exit_sender);
// `op_order` determines the order in which these two closures are
// executed.
@@ -237,24 +261,26 @@ fn test_hang_monitoring_exit_signal_inner(op_order: fn(&mut dyn FnMut(), &mut dy
MonitoredComponentId(TEST_PIPELINE_ID, MonitoredComponentType::Script),
Duration::from_millis(10),
Duration::from_millis(1000),
Some(signal.take().unwrap()),
signal.take().unwrap(),
));
},
&mut || {
// Send the exit message.
control_sender
.send(BackgroundHangMonitorControlMsg::Exit(
exit_sender.take().unwrap(),
))
.send(BackgroundHangMonitorControlMsg::Exit)
.unwrap();
},
);
// Assert we receive a confirmation back.
assert!(exit_receiver.recv().is_ok());
// Assert we get the exit signal.
while !closing.load(Ordering::SeqCst) {
thread::sleep(Duration::from_millis(10));
}
// Drop the channels and join on the worker thread.
drop(background_hang_monitor);
drop(background_hang_monitor_register);
join_handle
.join()
.expect("Failed to join on the BHM worker thread");
}

View File

@@ -11,24 +11,39 @@ rust-version.workspace = true
name = "canvas"
path = "lib.rs"
[features]
vello = ["dep:vello", "dep:pollster", "dep:futures-intrusive", "dep:peniko"]
vello_cpu = ["dep:vello_cpu", "dep:peniko"]
raqote = ["dep:raqote", "dep:font-kit"]
tracing = ["dep:tracing"]
[dependencies]
app_units = { workspace = true }
bytemuck = { workspace = true, features = ["extern_crate_alloc"] }
canvas_traits = { workspace = true }
compositing_traits = { workspace = true }
crossbeam-channel = { workspace = true }
cssparser = { workspace = true }
euclid = { workspace = true }
font-kit = "0.14"
fonts = { path = "../fonts" }
font-kit = { version = "0.14", optional = true }
fonts = { path = "../fonts", default-features = false }
ipc-channel = { workspace = true }
kurbo = { workspace = true }
log = { workspace = true }
lyon_geom = "1.0.4"
net_traits = { workspace = true }
peniko = { workspace = true, optional = true }
pixels = { path = "../pixels" }
range = { path = "../range" }
raqote = "0.8.5"
raqote = { version = "0.8.5", optional = true }
servo_arc = { workspace = true }
snapshot = { workspace = true }
stylo = { workspace = true }
unicode-script = { workspace = true }
webrender_api = { workspace = true }
servo_config = { path = "../config" }
vello = { workspace = true, optional = true }
vello_cpu = { workspace = true, optional = true }
pollster = { version = "0.4", optional = true }
futures-intrusive = { version = "0.5", optional = true }
tracing = { workspace = true, optional = true }
servo-tracing = { workspace = true }

View File

@@ -2,270 +2,101 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::borrow::Cow;
use canvas_traits::canvas::{
CompositionOrBlending, FillOrStrokeStyle, LineCapStyle, LineJoinStyle,
CompositionOptions, FillOrStrokeStyle, FillRule, LineOptions, Path, ShadowOptions,
};
use euclid::Angle;
use euclid::default::{Point2D, Rect, Size2D, Transform2D, Vector2D};
use lyon_geom::Arc;
use style::color::AbsoluteColor;
use compositing_traits::SerializableImageData;
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
use pixels::Snapshot;
use webrender_api::ImageDescriptor;
use crate::canvas_data::{CanvasPaintState, Filter, TextRun};
pub(crate) trait Backend: Clone + Sized {
type Pattern<'a>: PatternHelpers + Clone;
type StrokeOptions: StrokeOptionsHelpers + Clone;
type Color: Clone;
type DrawOptions: DrawOptionsHelpers + Clone;
type CompositionOp;
type DrawTarget: GenericDrawTarget<Self>;
type PathBuilder: GenericPathBuilder<Self>;
type SourceSurface;
type Path: PathHelpers<Self> + Clone;
type GradientStop;
type GradientStops;
fn get_composition_op(&self, opts: &Self::DrawOptions) -> Self::CompositionOp;
fn need_to_draw_shadow(&self, color: &Self::Color) -> bool;
fn set_shadow_color(&mut self, color: AbsoluteColor, state: &mut CanvasPaintState<'_, Self>);
fn set_fill_style(
&mut self,
style: FillOrStrokeStyle,
state: &mut CanvasPaintState<'_, Self>,
drawtarget: &Self::DrawTarget,
);
fn set_stroke_style(
&mut self,
style: FillOrStrokeStyle,
state: &mut CanvasPaintState<'_, Self>,
drawtarget: &Self::DrawTarget,
);
fn set_global_composition(
&mut self,
op: CompositionOrBlending,
state: &mut CanvasPaintState<'_, Self>,
);
fn create_drawtarget(&self, size: Size2D<u64>) -> Self::DrawTarget;
fn new_paint_state<'a>(&self) -> CanvasPaintState<'a, Self>;
}
use crate::canvas_data::{Filter, TextRun};
// This defines required methods for a DrawTarget (currently only implemented for raqote). The
// prototypes are derived from the now-removed Azure backend's methods.
pub(crate) trait GenericDrawTarget<B: Backend> {
fn clear_rect(&mut self, rect: &Rect<f32>);
pub(crate) trait GenericDrawTarget {
type SourceSurface;
fn new(size: Size2D<u32>) -> Self;
fn create_similar_draw_target(&self, size: &Size2D<i32>) -> Self;
fn clear_rect(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>);
fn copy_surface(
&mut self,
surface: B::SourceSurface,
surface: Self::SourceSurface,
source: Rect<i32>,
destination: Point2D<i32>,
);
fn create_path_builder(&self) -> B::PathBuilder;
fn create_similar_draw_target(&self, size: &Size2D<i32>) -> Self;
fn create_source_surface_from_data(&self, data: &[u8]) -> Option<B::SourceSurface>;
fn create_source_surface_from_data(&self, data: Snapshot) -> Option<Self::SourceSurface>;
fn draw_surface(
&mut self,
surface: B::SourceSurface,
surface: Self::SourceSurface,
dest: Rect<f64>,
source: Rect<f64>,
filter: Filter,
draw_options: &B::DrawOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
);
fn draw_surface_with_shadow(
&self,
surface: B::SourceSurface,
surface: Self::SourceSurface,
dest: &Point2D<f32>,
color: &B::Color,
offset: &Vector2D<f32>,
sigma: f32,
operator: B::CompositionOp,
shadow_options: ShadowOptions,
composition_options: CompositionOptions,
);
fn fill(
&mut self,
path: &Path,
fill_rule: FillRule,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
);
fn fill(&mut self, path: &B::Path, pattern: B::Pattern<'_>, draw_options: &B::DrawOptions);
fn fill_text(
&mut self,
text_runs: Vec<TextRun>,
start: Point2D<f32>,
pattern: &B::Pattern<'_>,
draw_options: &B::DrawOptions,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
);
fn fill_rect(
&mut self,
rect: &Rect<f32>,
pattern: B::Pattern<'_>,
draw_options: Option<&B::DrawOptions>,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
);
fn get_size(&self) -> Size2D<i32>;
fn get_transform(&self) -> Transform2D<f32>;
fn pop_clip(&mut self);
fn push_clip(&mut self, path: &B::Path);
fn set_transform(&mut self, matrix: &Transform2D<f32>);
fn push_clip(&mut self, path: &Path, fill_rule: FillRule, transform: Transform2D<f64>);
fn push_clip_rect(&mut self, rect: &Rect<i32>);
fn stroke(
&mut self,
path: &B::Path,
pattern: B::Pattern<'_>,
stroke_options: &B::StrokeOptions,
draw_options: &B::DrawOptions,
);
fn stroke_line(
&mut self,
start: Point2D<f32>,
end: Point2D<f32>,
pattern: B::Pattern<'_>,
stroke_options: &B::StrokeOptions,
draw_options: &B::DrawOptions,
path: &Path,
style: FillOrStrokeStyle,
line_options: LineOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
);
fn stroke_rect(
&mut self,
rect: &Rect<f32>,
pattern: B::Pattern<'_>,
stroke_options: &B::StrokeOptions,
draw_options: &B::DrawOptions,
style: FillOrStrokeStyle,
line_options: LineOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
);
fn surface(&self) -> B::SourceSurface;
fn bytes(&self) -> Cow<[u8]>;
}
/// A generic PathBuilder that abstracts the interface for azure's and raqote's PathBuilder.
pub(crate) trait GenericPathBuilder<B: Backend> {
fn arc(
fn surface(&mut self) -> Self::SourceSurface;
fn image_descriptor_and_serializable_data(
&mut self,
origin: Point2D<f32>,
radius: f32,
start_angle: f32,
end_angle: f32,
anticlockwise: bool,
) {
Self::ellipse(
self,
origin,
radius,
radius,
0.,
start_angle,
end_angle,
anticlockwise,
);
}
fn bezier_curve_to(
&mut self,
control_point1: &Point2D<f32>,
control_point2: &Point2D<f32>,
control_point3: &Point2D<f32>,
);
fn close(&mut self);
#[allow(clippy::too_many_arguments)]
fn ellipse(
&mut self,
origin: Point2D<f32>,
radius_x: f32,
radius_y: f32,
rotation_angle: f32,
start_angle: f32,
end_angle: f32,
anticlockwise: bool,
) {
let mut start = Angle::radians(start_angle);
let mut end = Angle::radians(end_angle);
// Wrap angles mod 2 * PI if necessary
if !anticlockwise && start > end + Angle::two_pi() ||
anticlockwise && end > start + Angle::two_pi()
{
start = start.positive();
end = end.positive();
}
// Calculate the total arc we're going to sweep.
let sweep = match anticlockwise {
true => {
if end - start == Angle::two_pi() {
-Angle::two_pi()
} else if end > start {
-(Angle::two_pi() - (end - start))
} else {
-(start - end)
}
},
false => {
if start - end == Angle::two_pi() {
Angle::two_pi()
} else if start > end {
Angle::two_pi() - (start - end)
} else {
end - start
}
},
};
let arc: Arc<f32> = Arc {
center: origin,
radii: Vector2D::new(radius_x, radius_y),
start_angle: start,
sweep_angle: sweep,
x_rotation: Angle::radians(rotation_angle),
};
self.line_to(arc.from());
arc.for_each_quadratic_bezier(&mut |q| {
self.quadratic_curve_to(&q.ctrl, &q.to);
});
}
fn get_current_point(&mut self) -> Option<Point2D<f32>>;
fn line_to(&mut self, point: Point2D<f32>);
fn move_to(&mut self, point: Point2D<f32>);
fn quadratic_curve_to(&mut self, control_point: &Point2D<f32>, end_point: &Point2D<f32>);
fn svg_arc(
&mut self,
radius_x: f32,
radius_y: f32,
rotation_angle: f32,
large_arc: bool,
sweep: bool,
end_point: Point2D<f32>,
) {
let Some(start) = self.get_current_point() else {
return;
};
let arc = lyon_geom::SvgArc {
from: start,
to: end_point,
radii: lyon_geom::vector(radius_x, radius_y),
x_rotation: lyon_geom::Angle::degrees(rotation_angle),
flags: lyon_geom::ArcFlags { large_arc, sweep },
};
arc.for_each_quadratic_bezier(&mut |q| {
self.quadratic_curve_to(&q.ctrl, &q.to);
});
}
fn finish(&mut self) -> B::Path;
) -> (ImageDescriptor, SerializableImageData);
fn snapshot(&mut self) -> Snapshot;
}
pub(crate) trait PatternHelpers {
fn is_zero_size_gradient(&self) -> bool;
fn draw_rect(&self, rect: &Rect<f32>) -> Rect<f32>;
}
pub(crate) trait StrokeOptionsHelpers {
fn set_line_width(&mut self, _val: f32);
fn set_miter_limit(&mut self, _val: f32);
fn set_line_join(&mut self, val: LineJoinStyle);
fn set_line_cap(&mut self, val: LineCapStyle);
fn set_line_dash(&mut self, items: Vec<f32>);
fn set_line_dash_offset(&mut self, offset: f32);
}
pub(crate) trait DrawOptionsHelpers {
fn set_alpha(&mut self, val: f32);
}
pub(crate) trait PathHelpers<B: Backend> {
fn transformed_copy_to_builder(&self, transform: &Transform2D<f32>) -> B::PathBuilder;
fn contains_point(&self, x: f64, y: f64, path_transform: &Transform2D<f32>) -> bool;
fn copy_to_builder(&self) -> B::PathBuilder;
#[allow(dead_code)] // used by gated backends
/// A version of the `Into<T>` trait from the standard library that can be used
/// to convert between two types that are not defined in the canvas crate.
pub(crate) trait Convert<T> {
fn convert(self) -> T;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,18 @@
#![deny(unsafe_code)]
mod backend;
#[cfg(feature = "raqote")]
mod raqote_backend;
#[cfg(any(feature = "vello", feature = "vello_cpu"))]
mod peniko_conversions;
#[cfg(feature = "vello")]
mod vello_backend;
#[cfg(feature = "vello_cpu")]
mod vello_cpu_backend;
pub mod canvas_data;
pub mod canvas_paint_thread;

View File

@@ -0,0 +1,225 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use canvas_traits::canvas::*;
use pixels::{SnapshotAlphaMode, SnapshotPixelFormat};
use style::color::AbsoluteColor;
use crate::backend::Convert;
use crate::canvas_data::Filter;
impl Convert<peniko::Font> for fonts::FontDataAndIndex {
fn convert(self) -> peniko::Font {
use std::sync::Arc;
peniko::Font::new(peniko::Blob::new(Arc::new(self.data)), self.index)
}
}
impl Convert<kurbo::Join> for LineJoinStyle {
fn convert(self) -> kurbo::Join {
match self {
LineJoinStyle::Round => kurbo::Join::Round,
LineJoinStyle::Bevel => kurbo::Join::Bevel,
LineJoinStyle::Miter => kurbo::Join::Miter,
}
}
}
impl Convert<kurbo::Cap> for LineCapStyle {
fn convert(self) -> kurbo::Cap {
match self {
LineCapStyle::Butt => kurbo::Cap::Butt,
LineCapStyle::Round => kurbo::Cap::Round,
LineCapStyle::Square => kurbo::Cap::Square,
}
}
}
impl Convert<peniko::Color> for AbsoluteColor {
fn convert(self) -> peniko::Color {
let srgb = self.into_srgb_legacy();
peniko::Color::new([
srgb.components.0,
srgb.components.1,
srgb.components.2,
srgb.alpha,
])
}
}
impl Convert<peniko::BlendMode> for CompositionOrBlending {
fn convert(self) -> peniko::BlendMode {
match self {
CompositionOrBlending::Composition(composition_style) => {
composition_style.convert().into()
},
CompositionOrBlending::Blending(blending_style) => blending_style.convert().into(),
}
}
}
impl Convert<peniko::Compose> for CompositionStyle {
fn convert(self) -> peniko::Compose {
match self {
CompositionStyle::SourceIn => peniko::Compose::SrcIn,
CompositionStyle::SourceOut => peniko::Compose::SrcOut,
CompositionStyle::SourceOver => peniko::Compose::SrcOver,
CompositionStyle::SourceAtop => peniko::Compose::SrcAtop,
CompositionStyle::DestinationIn => peniko::Compose::DestIn,
CompositionStyle::DestinationOut => peniko::Compose::DestOut,
CompositionStyle::DestinationOver => peniko::Compose::DestOver,
CompositionStyle::DestinationAtop => peniko::Compose::DestAtop,
CompositionStyle::Copy => peniko::Compose::Copy,
CompositionStyle::Lighter => peniko::Compose::Plus,
CompositionStyle::Xor => peniko::Compose::Xor,
CompositionStyle::Clear => peniko::Compose::Clear,
}
}
}
impl Convert<peniko::Mix> for BlendingStyle {
fn convert(self) -> peniko::Mix {
match self {
BlendingStyle::Multiply => peniko::Mix::Multiply,
BlendingStyle::Screen => peniko::Mix::Screen,
BlendingStyle::Overlay => peniko::Mix::Overlay,
BlendingStyle::Darken => peniko::Mix::Darken,
BlendingStyle::Lighten => peniko::Mix::Lighten,
BlendingStyle::ColorDodge => peniko::Mix::ColorDodge,
BlendingStyle::ColorBurn => peniko::Mix::ColorBurn,
BlendingStyle::HardLight => peniko::Mix::HardLight,
BlendingStyle::SoftLight => peniko::Mix::SoftLight,
BlendingStyle::Difference => peniko::Mix::Difference,
BlendingStyle::Exclusion => peniko::Mix::Exclusion,
BlendingStyle::Hue => peniko::Mix::Hue,
BlendingStyle::Saturation => peniko::Mix::Saturation,
BlendingStyle::Color => peniko::Mix::Color,
BlendingStyle::Luminosity => peniko::Mix::Luminosity,
}
}
}
impl Convert<kurbo::Stroke> for LineOptions {
fn convert(self) -> kurbo::Stroke {
let LineOptions {
width,
cap_style,
join_style,
miter_limit,
dash,
dash_offset,
} = self;
kurbo::Stroke {
width,
join: join_style.convert(),
miter_limit,
start_cap: cap_style.convert(),
end_cap: cap_style.convert(),
dash_pattern: dash.iter().map(|x| *x as f64).collect(),
dash_offset,
}
}
}
impl Convert<peniko::Brush> for FillOrStrokeStyle {
fn convert(self) -> peniko::Brush {
use canvas_traits::canvas::FillOrStrokeStyle::*;
match self {
Color(absolute_color) => peniko::Brush::Solid(absolute_color.convert()),
LinearGradient(style) => {
let start = kurbo::Point::new(style.x0, style.y0);
let end = kurbo::Point::new(style.x1, style.y1);
let mut gradient = peniko::Gradient::new_linear(start, end);
gradient.stops = style.stops.convert();
peniko::Brush::Gradient(gradient)
},
RadialGradient(style) => {
let center1 = kurbo::Point::new(style.x0, style.y0);
let center2 = kurbo::Point::new(style.x1, style.y1);
let mut gradient = peniko::Gradient::new_two_point_radial(
center1,
style.r0 as f32,
center2,
style.r1 as f32,
);
gradient.stops = style.stops.convert();
peniko::Brush::Gradient(gradient)
},
Surface(surface_style) => {
let data = surface_style
.surface_data
.to_owned()
.to_vec(
Some(SnapshotAlphaMode::Transparent {
premultiplied: false,
}),
Some(SnapshotPixelFormat::RGBA),
)
.0;
peniko::Brush::Image(peniko::Image {
data: peniko::Blob::from(data),
format: peniko::ImageFormat::Rgba8,
width: surface_style.surface_size.width,
height: surface_style.surface_size.height,
x_extend: if surface_style.repeat_x {
peniko::Extend::Repeat
} else {
peniko::Extend::Pad
},
y_extend: if surface_style.repeat_y {
peniko::Extend::Repeat
} else {
peniko::Extend::Pad
},
quality: peniko::ImageQuality::Low,
alpha: 1.0,
})
},
}
}
}
impl Convert<peniko::color::DynamicColor> for AbsoluteColor {
fn convert(self) -> peniko::color::DynamicColor {
peniko::color::DynamicColor::from_alpha_color(self.convert())
}
}
impl Convert<peniko::ColorStop> for CanvasGradientStop {
fn convert(self) -> peniko::ColorStop {
peniko::ColorStop {
offset: self.offset as f32,
color: self.color.convert(),
}
}
}
impl Convert<peniko::ColorStops> for Vec<CanvasGradientStop> {
fn convert(self) -> peniko::ColorStops {
let mut stops = peniko::ColorStops(self.into_iter().map(|item| item.convert()).collect());
// https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap
stops
.0
.sort_by(|a, b| a.offset.partial_cmp(&b.offset).unwrap());
stops
}
}
impl Convert<peniko::ImageQuality> for Filter {
fn convert(self) -> peniko::ImageQuality {
match self {
Filter::Bilinear => peniko::ImageQuality::Medium,
Filter::Nearest => peniko::ImageQuality::Low,
}
}
}
impl Convert<peniko::Fill> for FillRule {
fn convert(self) -> peniko::Fill {
match self {
FillRule::Nonzero => peniko::Fill::NonZero,
FillRule::Evenodd => peniko::Fill::EvenOdd,
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,705 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Vello implementation of 2D canvas backend.
//!
//! Vello only encodes commands for GPU, then runs rendering when
//! image is explicitly requested. This requires to copy image
//! from texture to buffer, then download buffer to CPU
//! (where we also need to un pad it).
//!
//! All Vello images are in no alpha premultiplied RGBA8 pixel format.
use std::cell::RefCell;
use std::collections::HashMap;
use std::num::NonZeroUsize;
use std::rc::Rc;
use canvas_traits::canvas::{
CompositionOptions, CompositionOrBlending, CompositionStyle, FillOrStrokeStyle, FillRule,
LineOptions, Path, ShadowOptions,
};
use compositing_traits::SerializableImageData;
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
use fonts::{ByteIndex, FontIdentifier, FontTemplateRefMethods as _};
use ipc_channel::ipc::IpcSharedMemory;
use kurbo::Shape as _;
use pixels::{Snapshot, SnapshotAlphaMode, SnapshotPixelFormat};
use range::Range;
use vello::wgpu::{
BackendOptions, Backends, Buffer, BufferDescriptor, BufferUsages, COPY_BYTES_PER_ROW_ALIGNMENT,
CommandEncoderDescriptor, Device, Extent3d, Instance, InstanceDescriptor, InstanceFlags,
MapMode, Origin3d, Queue, TexelCopyBufferInfo, TexelCopyBufferLayout, TexelCopyTextureInfoBase,
Texture, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, TextureView,
TextureViewDescriptor,
};
use vello::{kurbo, peniko};
use webrender_api::{ImageDescriptor, ImageDescriptorFlags};
use crate::backend::{Convert as _, GenericDrawTarget};
use crate::canvas_data::{Filter, TextRun};
thread_local! {
/// The shared font cache used by all canvases that render on a thread. It would be nicer
/// to have a global cache, but it looks like font-kit uses a per-thread FreeType, so
/// in order to ensure that fonts are particular to a thread we have to make our own
/// cache thread local as well.
static SHARED_FONT_CACHE: RefCell<HashMap<FontIdentifier, peniko::Font>> = RefCell::default();
}
pub(crate) struct VelloDrawTarget {
device: Device,
queue: Queue,
renderer: Rc<RefCell<vello::Renderer>>,
scene: vello::Scene,
size: Size2D<u32>,
clips: Vec<Path>,
state: State,
render_texture: Texture,
render_texture_view: TextureView,
render_image: peniko::Image,
padded_byte_width: u32,
rendered_buffer: Buffer,
}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
enum State {
/// Scene is drawing. It will be consumed when rendered.
Drawing,
/// Scene is already rendered
/// Before next draw we need to put current rendering
/// in the background by calling [`VelloDrawTarget::ensure_drawing`].
RenderedToTexture,
RenderedToBuffer,
}
impl VelloDrawTarget {
fn new_with_renderer(
device: Device,
queue: Queue,
renderer: Rc<RefCell<vello::Renderer>>,
size: Size2D<u32>,
) -> Self {
let render_texture = device.create_texture(&TextureDescriptor {
label: None,
size: extend3d(size),
mip_level_count: 1,
sample_count: 1,
dimension: TextureDimension::D2,
format: TextureFormat::Rgba8Unorm,
usage: TextureUsages::COPY_SRC | TextureUsages::STORAGE_BINDING,
view_formats: &[],
});
let render_texture_view = render_texture.create_view(&TextureViewDescriptor::default());
let render_image = peniko::Image {
data: vec![].into(),
format: peniko::ImageFormat::Rgba8,
width: size.width,
height: size.height,
x_extend: peniko::Extend::Pad,
y_extend: peniko::Extend::Pad,
quality: peniko::ImageQuality::Low,
alpha: 1.0,
};
renderer.borrow_mut().override_image(
&render_image,
Some(TexelCopyTextureInfoBase {
texture: render_texture.clone(),
mip_level: 0,
origin: Origin3d::ZERO,
aspect: vello::wgpu::TextureAspect::All,
}),
);
let padded_byte_width = (size.width * 4).next_multiple_of(COPY_BYTES_PER_ROW_ALIGNMENT);
let buffer_size = padded_byte_width as u64 * size.height as u64;
let rendered_buffer = device.create_buffer(&BufferDescriptor {
label: Some("val"),
size: buffer_size,
usage: BufferUsages::MAP_READ | BufferUsages::COPY_DST,
mapped_at_creation: false,
});
Self {
device,
queue,
renderer,
scene: vello::Scene::new(),
size,
clips: Vec::new(),
state: State::RenderedToBuffer,
render_texture,
render_texture_view,
render_image,
padded_byte_width,
rendered_buffer,
}
}
fn with_composition<F: FnOnce(&mut Self)>(
&mut self,
composition_operation: CompositionOrBlending,
f: F,
) {
// Fast-path for default and most common composition operation
if composition_operation == CompositionOrBlending::Composition(CompositionStyle::SourceOver)
{
f(self);
return;
}
self.scene.push_layer(
composition_operation.convert(),
1.0,
kurbo::Affine::IDENTITY,
&kurbo::Rect::ZERO.with_size(self.size.cast()),
);
f(self);
self.scene.pop_layer();
}
fn ignore_clips(&mut self, f: impl FnOnce(&mut Self)) {
// pop all clip layers
for _ in &self.clips {
self.scene.pop_layer();
}
f(self);
// push all clip layers back
for path in &self.clips {
self.scene
.push_layer(peniko::Mix::Clip, 1.0, kurbo::Affine::IDENTITY, &path.0);
}
}
fn is_viewport_cleared(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>) -> bool {
let transformed_rect = transform.outer_transformed_rect(&rect.cast());
if transformed_rect.is_empty() {
return false;
}
let viewport: Rect<f64> = Rect::from_size(self.get_size().cast());
let Some(clip) = self.clips.iter().try_fold(viewport, |acc, e| {
acc.intersection(&e.0.bounding_box().into())
}) else {
// clip makes no visible side effects
return false;
};
transformed_rect.cast().contains_rect(&viewport) && // whole viewport is cleared
clip.contains_rect(&viewport) // viewport is not clipped
}
fn ensure_drawing(&mut self) {
match self.state {
State::Drawing => {},
State::RenderedToBuffer | State::RenderedToTexture => {
self.ignore_clips(|self_| {
self_
.scene
.draw_image(&self_.render_image, kurbo::Affine::IDENTITY);
});
self.state = State::Drawing;
},
}
}
}
impl GenericDrawTarget for VelloDrawTarget {
type SourceSurface = Vec<u8>; // TODO: this should be texture
fn new(size: Size2D<u32>) -> Self {
// TODO: we should read prefs instead of env
// we forbid GL because it clashes with servo's GL usage
let backends = Backends::from_env().unwrap_or_default() - Backends::GL;
let flags = InstanceFlags::from_build_config().with_env();
let backend_options = BackendOptions::from_env_or_default();
let instance = Instance::new(&InstanceDescriptor {
backends,
flags,
backend_options,
});
let mut context = vello::util::RenderContext {
instance,
devices: Vec::new(),
};
let device_id = pollster::block_on(context.device(None)).unwrap();
let device_handle = &mut context.devices[device_id];
let device = device_handle.device.clone();
let queue = device_handle.queue.clone();
let renderer = vello::Renderer::new(
&device,
vello::RendererOptions {
use_cpu: false,
num_init_threads: NonZeroUsize::new(1),
antialiasing_support: vello::AaSupport::area_only(),
pipeline_cache: None,
},
)
.unwrap();
device.on_uncaptured_error(Box::new(|error| {
log::error!("VELLO WGPU ERROR: {error}");
}));
Self::new_with_renderer(device, queue, Rc::new(RefCell::new(renderer)), size)
}
fn clear_rect(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>) {
// vello scene only ever grows,
// so we use every opportunity to shrink it
if self.is_viewport_cleared(rect, transform) {
self.scene.reset();
self.clips.clear(); // no clips are affecting rendering
self.state = State::Drawing;
return;
}
self.ensure_drawing();
let rect: kurbo::Rect = rect.cast().into();
let transform = transform.into();
self.scene
.push_layer(peniko::Compose::Clear, 0.0, transform, &rect);
self.scene.fill(
peniko::Fill::NonZero,
transform,
peniko::BrushRef::Solid(peniko::color::AlphaColor::TRANSPARENT),
None,
&rect,
);
self.scene.pop_layer();
}
fn copy_surface(&mut self, surface: Vec<u8>, source: Rect<i32>, destination: Point2D<i32>) {
self.ensure_drawing();
let destination: kurbo::Point = destination.cast::<f64>().into();
let rect = kurbo::Rect::from_origin_size(destination, source.size.cast());
self.ignore_clips(|self_| {
self_
.scene
.push_layer(peniko::Compose::Copy, 1.0, kurbo::Affine::IDENTITY, &rect);
self_.scene.fill(
peniko::Fill::NonZero,
kurbo::Affine::IDENTITY,
&peniko::Image {
data: peniko::Blob::from(surface),
format: peniko::ImageFormat::Rgba8,
width: source.size.width as u32,
height: source.size.height as u32,
x_extend: peniko::Extend::Pad,
y_extend: peniko::Extend::Pad,
quality: peniko::ImageQuality::Low,
alpha: 1.0,
},
Some(kurbo::Affine::translate(destination.to_vec2())),
&rect,
);
self_.scene.pop_layer();
});
}
fn create_similar_draw_target(&self, size: &Size2D<i32>) -> Self {
Self::new_with_renderer(
self.device.clone(),
self.queue.clone(),
self.renderer.clone(),
size.cast(),
)
}
fn draw_surface(
&mut self,
surface: Vec<u8>,
dest: Rect<f64>,
source: Rect<f64>,
filter: Filter,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
let scale_up = dest.size.width > source.size.width || dest.size.height > source.size.height;
let shape: kurbo::Rect = dest.into();
self.with_composition(composition_options.composition_operation, move |self_| {
self_.scene.fill(
peniko::Fill::NonZero,
transform.cast().into(),
&peniko::Image {
data: peniko::Blob::from(surface),
format: peniko::ImageFormat::Rgba8,
width: source.size.width as u32,
height: source.size.height as u32,
x_extend: peniko::Extend::Pad,
y_extend: peniko::Extend::Pad,
// we should only do bicubic when scaling up
quality: if scale_up {
filter.convert()
} else {
peniko::ImageQuality::Low
},
alpha: composition_options.alpha as f32,
},
Some(
kurbo::Affine::translate((dest.origin.x, dest.origin.y)).pre_scale_non_uniform(
dest.size.width / source.size.width,
dest.size.height / source.size.height,
),
),
&shape,
)
})
}
fn draw_surface_with_shadow(
&self,
_surface: Vec<u8>,
_dest: &Point2D<f32>,
_shadow_options: ShadowOptions,
_composition_options: CompositionOptions,
) {
log::warn!("no support for drawing shadows");
/*
We will need to do some changes to support drawing shadows with vello, as current abstraction is made for azure.
In vello we do not need new draw target (we will use layers) and we need to pass whole rect.
offsets will be applied to rect directly. shadow blur will be passed directly to let backend do transforms.
*/
// self_.scene.draw_blurred_rounded_rect(self_.transform, rect, color, 0.0, sigma);
}
fn fill(
&mut self,
path: &Path,
fill_rule: FillRule,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.with_composition(composition_options.composition_operation, |self_| {
self_.scene.fill(
fill_rule.convert(),
transform.cast().into(),
&convert_to_brush(style, composition_options),
None,
&path.0,
);
})
}
fn fill_text(
&mut self,
text_runs: Vec<TextRun>,
start: Point2D<f32>,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
let pattern = convert_to_brush(style, composition_options);
let transform = transform.cast().into();
self.with_composition(composition_options.composition_operation, |self_| {
let mut advance = 0.;
for run in text_runs.iter() {
let glyphs = &run.glyphs;
let template = &run.font.template;
SHARED_FONT_CACHE.with(|font_cache| {
let identifier = template.identifier();
if !font_cache.borrow().contains_key(&identifier) {
let Ok(font) = run.font.font_data_and_index() else {
return;
};
let font = font.clone().convert();
font_cache.borrow_mut().insert(identifier.clone(), font);
}
let font_cache = font_cache.borrow();
let Some(font) = font_cache.get(&identifier) else {
return;
};
self_
.scene
.draw_glyphs(font)
.transform(transform)
.brush(&pattern)
.font_size(run.font.descriptor.pt_size.to_f32_px())
.draw(
peniko::Fill::NonZero,
glyphs
.iter_glyphs_for_byte_range(&Range::new(ByteIndex(0), glyphs.len()))
.map(|glyph| {
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
let x = advance + start.x + glyph_offset.x.to_f32_px();
let y = start.y + glyph_offset.y.to_f32_px();
advance += glyph.advance().to_f32_px();
vello::Glyph {
id: glyph.id(),
x,
y,
}
}),
);
});
}
})
}
fn fill_rect(
&mut self,
rect: &Rect<f32>,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
let pattern = convert_to_brush(style, composition_options);
let transform = transform.cast().into();
let rect: kurbo::Rect = rect.cast().into();
self.with_composition(composition_options.composition_operation, |self_| {
self_
.scene
.fill(peniko::Fill::NonZero, transform, &pattern, None, &rect);
})
}
fn get_size(&self) -> Size2D<i32> {
self.size.cast()
}
fn pop_clip(&mut self) {
if self.clips.pop().is_some() {
self.scene.pop_layer();
}
}
fn push_clip(&mut self, path: &Path, _fill_rule: FillRule, transform: Transform2D<f64>) {
self.scene
.push_layer(peniko::Mix::Clip, 1.0, transform.cast().into(), &path.0);
let mut path = path.clone();
path.transform(transform.cast());
self.clips.push(path);
}
fn push_clip_rect(&mut self, rect: &Rect<i32>) {
let mut path = Path::new();
let rect = rect.cast();
path.rect(
rect.origin.x,
rect.origin.y,
rect.size.width,
rect.size.height,
);
self.push_clip(&path, FillRule::Nonzero, Transform2D::identity());
}
fn stroke(
&mut self,
path: &Path,
style: FillOrStrokeStyle,
line_options: LineOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.with_composition(composition_options.composition_operation, |self_| {
self_.scene.stroke(
&line_options.convert(),
transform.cast().into(),
&convert_to_brush(style, composition_options),
None,
&path.0,
);
})
}
fn stroke_rect(
&mut self,
rect: &Rect<f32>,
style: FillOrStrokeStyle,
line_options: LineOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
let rect: kurbo::Rect = rect.cast().into();
self.with_composition(composition_options.composition_operation, |self_| {
self_.scene.stroke(
&line_options.convert(),
transform.cast().into(),
&convert_to_brush(style, composition_options),
None,
&rect,
);
})
}
fn image_descriptor_and_serializable_data(
&mut self,
) -> (ImageDescriptor, SerializableImageData) {
let size = self.size;
let stride = self.padded_byte_width;
self.map_read(|data| {
let image_desc = ImageDescriptor {
format: webrender_api::ImageFormat::RGBA8,
size: size.cast().cast_unit(),
stride: data.map(|_| stride as i32),
offset: 0,
flags: ImageDescriptorFlags::empty(),
};
let data = SerializableImageData::Raw(if let Some(data) = data {
let mut data = IpcSharedMemory::from_bytes(data);
#[allow(unsafe_code)]
unsafe {
pixels::generic_transform_inplace::<1, false, false>(data.deref_mut());
};
data
} else {
IpcSharedMemory::from_byte(0, size.area() as usize * 4)
});
(image_desc, data)
})
}
fn snapshot(&mut self) -> pixels::Snapshot {
let size = self.size;
let padded_byte_width = self.padded_byte_width;
self.map_read(|data| {
let data = data
.map(|data| {
let mut result_unpadded = Vec::<u8>::with_capacity(size.area() as usize * 4);
for row in 0..size.height {
let start = (row * padded_byte_width).try_into().unwrap();
result_unpadded.extend(&data[start..start + (size.width * 4) as usize]);
}
result_unpadded
})
.unwrap_or_else(|| vec![0; size.area() as usize * 4]);
Snapshot::from_vec(
size,
SnapshotPixelFormat::RGBA,
SnapshotAlphaMode::Transparent {
premultiplied: false,
},
data,
)
})
}
fn surface(&mut self) -> Vec<u8> {
self.snapshot().to_vec(None, None).0
}
fn create_source_surface_from_data(&self, data: Snapshot) -> Option<Vec<u8>> {
let (data, _, _) = data.to_vec(
Some(SnapshotAlphaMode::Transparent {
premultiplied: false,
}),
Some(SnapshotPixelFormat::RGBA),
);
Some(data)
}
}
impl Drop for VelloDrawTarget {
fn drop(&mut self) {
self.renderer
.borrow_mut()
.override_image(&self.render_image, None);
}
}
fn convert_to_brush(
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
) -> peniko::Brush {
let brush: peniko::Brush = style.convert();
brush.multiply_alpha(composition_options.alpha as f32)
}
impl VelloDrawTarget {
fn render_to_texture(&mut self) {
if matches!(
self.state,
State::RenderedToTexture | State::RenderedToBuffer
) {
return;
}
self.renderer
.borrow_mut()
.render_to_texture(
&self.device,
&self.queue,
&self.scene,
&self.render_texture_view,
&vello::RenderParams {
base_color: peniko::color::AlphaColor::TRANSPARENT,
width: self.size.width,
height: self.size.height,
antialiasing_method: vello::AaConfig::Area,
},
)
.unwrap();
self.state = State::RenderedToTexture;
// prune scene
self.scene.reset();
// push all clip layers back
for path in &self.clips {
self.scene
.push_layer(peniko::Mix::Clip, 1.0, kurbo::Affine::IDENTITY, &path.0);
}
}
fn render_to_buffer(&mut self) {
if matches!(self.state, State::RenderedToBuffer) {
return;
}
self.render_to_texture();
let size = extend3d(self.size);
// TODO(perf): do a render pass that will multiply with alpha on GPU
let mut encoder = self
.device
.create_command_encoder(&CommandEncoderDescriptor {
label: Some("Copy out buffer"),
});
encoder.copy_texture_to_buffer(
self.render_texture.as_image_copy(),
TexelCopyBufferInfo {
buffer: &self.rendered_buffer,
layout: TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(self.padded_byte_width),
rows_per_image: None,
},
},
size,
);
self.queue.submit([encoder.finish()]);
self.state = State::RenderedToBuffer;
}
fn map_read<R>(&mut self, f: impl FnOnce(Option<&[u8]>) -> R) -> R {
self.render_to_buffer();
let result = {
let buf_slice = self.rendered_buffer.slice(..);
let (sender, receiver) = futures_intrusive::channel::shared::oneshot_channel();
buf_slice.map_async(MapMode::Read, move |v| sender.send(v).unwrap());
if let Err(error) =
vello::util::block_on_wgpu(&self.device, receiver.receive()).unwrap()
{
log::warn!("VELLO WGPU MAP ASYNC ERROR {error}");
return f(None);
}
let data = buf_slice.get_mapped_range();
f(Some(&data))
};
self.rendered_buffer.unmap();
result
}
}
fn extend3d(size: Size2D<u32>) -> Extent3d {
Extent3d {
width: size.width,
height: size.height,
depth_or_array_layers: 1,
}
}

View File

@@ -0,0 +1,548 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::RefCell;
use std::collections::HashMap;
use std::sync::Arc;
use canvas_traits::canvas::{
CompositionOptions, CompositionOrBlending, CompositionStyle, FillOrStrokeStyle, FillRule,
LineOptions, Path, ShadowOptions,
};
use compositing_traits::SerializableImageData;
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
use fonts::{ByteIndex, FontIdentifier, FontTemplateRefMethods as _};
use ipc_channel::ipc::IpcSharedMemory;
use kurbo::Shape;
use pixels::{Snapshot, SnapshotAlphaMode, SnapshotPixelFormat};
use range::Range;
use vello_cpu::{kurbo, peniko};
use webrender_api::{ImageDescriptor, ImageDescriptorFlags};
use crate::backend::{Convert, GenericDrawTarget};
use crate::canvas_data::{Filter, TextRun};
thread_local! {
/// The shared font cache used by all canvases that render on a thread. It would be nicer
/// to have a global cache, but it looks like font-kit uses a per-thread FreeType, so
/// in order to ensure that fonts are particular to a thread we have to make our own
/// cache thread local as well.
static SHARED_FONT_CACHE: RefCell<HashMap<FontIdentifier, peniko::Font>> = RefCell::default();
}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
enum State {
/// Scene is drawing. It will be consumed when rendered.
Drawing,
/// Scene is already rendered
/// Before next draw we need to put current rendering
/// in the background by calling [`VelloCPUDrawTarget::ensure_drawing`].
Rendered,
}
pub(crate) struct VelloCPUDrawTarget {
/// Because this is stateful context
/// caller cannot assume anything about transform, paint, stroke,
/// so it should provide it's own used by each command
/// but it can assume paint_transform to be identity
/// and fill rule to be `peniko::Fill::NonZero`
///
/// This is because paint_transform is rarely set,
/// so it's cheaper to always reset it after use.
ctx: vello_cpu::RenderContext,
pixmap: vello_cpu::Pixmap,
clips: Vec<Path>,
state: State,
}
impl VelloCPUDrawTarget {
fn with_composition(
&mut self,
composition_operation: CompositionOrBlending,
f: impl FnOnce(&mut Self),
) {
// Fast-path for default and most common composition operation
if composition_operation == CompositionOrBlending::Composition(CompositionStyle::SourceOver)
{
f(self);
return;
}
self.ctx.push_blend_layer(composition_operation.convert());
f(self);
self.ctx.pop_layer();
}
fn ignore_clips(&mut self, f: impl FnOnce(&mut Self)) {
// pop all clip layers
for _ in &self.clips {
self.ctx.pop_layer();
}
f(self);
// push all clip layers back
for path in &self.clips {
self.ctx.push_clip_layer(&path.0);
}
}
fn ensure_drawing(&mut self) {
match self.state {
State::Drawing => {},
State::Rendered => {
self.ignore_clips(|self_| {
self_.ctx.set_transform(kurbo::Affine::IDENTITY);
self_.ctx.set_paint(vello_cpu::Image {
source: vello_cpu::ImageSource::Pixmap(Arc::new(self_.pixmap.clone())),
x_extend: peniko::Extend::Pad,
y_extend: peniko::Extend::Pad,
quality: peniko::ImageQuality::Low,
});
self_.ctx.fill_rect(&kurbo::Rect::from_origin_size(
(0., 0.),
self_.size().cast(),
));
});
self.state = State::Drawing;
},
}
}
fn pixmap(&mut self) -> &[u8] {
if self.state == State::Drawing {
self.ignore_clips(|self_| {
self_.ctx.flush();
self_
.ctx
.render_to_pixmap(&mut self_.pixmap, vello_cpu::RenderMode::OptimizeSpeed);
self_.ctx.reset();
self_.state = State::Rendered;
});
}
self.pixmap.data_as_u8_slice()
}
fn size(&self) -> Size2D<u32> {
Size2D::new(self.ctx.width(), self.ctx.height()).cast()
}
fn is_viewport_cleared(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>) -> bool {
let transformed_rect = transform.outer_transformed_rect(&rect.cast());
if transformed_rect.is_empty() {
return false;
}
let viewport: Rect<f64> = Rect::from_size(self.get_size().cast());
let Some(clip) = self.clips.iter().try_fold(viewport, |acc, e| {
acc.intersection(&e.0.bounding_box().into())
}) else {
// clip makes no visible side effects
return false;
};
transformed_rect.cast().contains_rect(&viewport) && // whole viewport is cleared
clip.contains_rect(&viewport) // viewport is not clipped
}
}
impl GenericDrawTarget for VelloCPUDrawTarget {
type SourceSurface = Arc<vello_cpu::Pixmap>;
fn new(size: Size2D<u32>) -> Self {
let size = size.cast();
Self {
ctx: vello_cpu::RenderContext::new(size.width, size.height),
pixmap: vello_cpu::Pixmap::new(size.width, size.height),
clips: Vec::new(),
state: State::Rendered,
}
}
fn clear_rect(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>) {
// vello_cpu RenderingContext only ever grows,
// so we need to use every opportunity to shrink it
if self.is_viewport_cleared(rect, transform) {
self.ctx.reset();
self.clips.clear(); // no clips are affecting rendering
self.state = State::Drawing;
return;
}
self.ensure_drawing();
let rect: kurbo::Rect = rect.cast().into();
let mut clip_path = rect.to_path(0.1);
clip_path.apply_affine(transform.cast().into());
let blend_mode = peniko::Compose::Clear;
self.ctx.push_layer(
Some(&clip_path.to_path(0.1)),
Some(blend_mode.into()),
None,
None,
);
self.ctx.pop_layer();
}
fn copy_surface(
&mut self,
surface: Self::SourceSurface,
source: Rect<i32>,
destination: Point2D<i32>,
) {
self.ensure_drawing();
let destination: kurbo::Point = destination.cast::<f64>().into();
let rect = kurbo::Rect::from_origin_size(destination, source.size.cast());
self.ctx.set_transform(kurbo::Affine::IDENTITY);
self.ignore_clips(|self_| {
// Clipped blending does not work correctly:
// https://github.com/linebender/vello/issues/1119
// self_.push_layer(Some(rect.to_path(0.1)), Some(peniko::Compose::Copy.into()), None, None);
self_.ctx.set_paint(vello_cpu::Image {
source: vello_cpu::ImageSource::Pixmap(surface),
x_extend: peniko::Extend::Pad,
y_extend: peniko::Extend::Pad,
quality: peniko::ImageQuality::Low,
});
self_.ctx.fill_rect(&rect);
// self_.ctx.pop_layer();
});
}
fn create_similar_draw_target(&self, size: &Size2D<i32>) -> Self {
Self::new(size.cast())
}
fn draw_surface(
&mut self,
mut surface: Self::SourceSurface,
dest: Rect<f64>,
source: Rect<f64>,
filter: Filter,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
let scale_up = dest.size.width > source.size.width || dest.size.height > source.size.height;
if composition_options.alpha != 1.0 {
Arc::get_mut(&mut surface)
.expect("surface should be owned")
.multiply_alpha((composition_options.alpha * 255.0) as u8);
}
self.with_composition(composition_options.composition_operation, move |self_| {
self_.ctx.set_transform(transform.cast().into());
self_.ctx.set_paint(vello_cpu::Image {
source: vello_cpu::ImageSource::Pixmap(surface),
x_extend: peniko::Extend::Pad,
y_extend: peniko::Extend::Pad,
// we should only do bicubic when scaling up
quality: if scale_up {
filter.convert()
} else {
peniko::ImageQuality::Low
},
});
self_.ctx.set_paint_transform(
kurbo::Affine::translate((dest.origin.x, dest.origin.y)).pre_scale_non_uniform(
dest.size.width / source.size.width,
dest.size.height / source.size.height,
),
);
self_.ctx.fill_rect(&dest.into());
self_.ctx.reset_paint_transform();
})
}
fn draw_surface_with_shadow(
&self,
_surface: Self::SourceSurface,
_dest: &Point2D<f32>,
_shadow_options: ShadowOptions,
_composition_options: CompositionOptions,
) {
log::warn!("no support for drawing shadows");
/*
We will need to do some changes to support drawing shadows with vello, as current abstraction is made for azure.
In vello we do not need new draw target (we will use layers) and we need to pass whole rect.
offsets will be applied to rect directly. shadow blur will be passed directly to let backend do transforms.
*/
// self_.scene.draw_blurred_rounded_rect(self_.transform, rect, color, 0.0, sigma);
}
fn fill(
&mut self,
path: &Path,
fill_rule: FillRule,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.with_composition(composition_options.composition_operation, |self_| {
self_.ctx.set_transform(transform.cast().into());
self_.ctx.set_fill_rule(fill_rule.convert());
self_.ctx.set_paint(paint(style, composition_options.alpha));
self_.ctx.fill_path(&path.0);
});
self.ctx.set_fill_rule(peniko::Fill::NonZero);
}
fn fill_text(
&mut self,
text_runs: Vec<TextRun>,
start: Point2D<f32>,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.ctx.set_paint(paint(style, composition_options.alpha));
self.ctx.set_transform(transform.cast().into());
self.with_composition(composition_options.composition_operation, |self_| {
let mut advance = 0.;
for run in text_runs.iter() {
let glyphs = &run.glyphs;
let template = &run.font.template;
SHARED_FONT_CACHE.with(|font_cache| {
let identifier = template.identifier();
if !font_cache.borrow().contains_key(&identifier) {
let Ok(font) = run.font.font_data_and_index() else {
return;
};
let font = font.clone().convert();
font_cache.borrow_mut().insert(identifier.clone(), font);
}
let font_cache = font_cache.borrow();
let Some(font) = font_cache.get(&identifier) else {
return;
};
self_
.ctx
.glyph_run(font)
.font_size(run.font.descriptor.pt_size.to_f32_px())
.fill_glyphs(
glyphs
.iter_glyphs_for_byte_range(&Range::new(ByteIndex(0), glyphs.len()))
.map(|glyph| {
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
let x = advance + start.x + glyph_offset.x.to_f32_px();
let y = start.y + glyph_offset.y.to_f32_px();
advance += glyph.advance().to_f32_px();
vello_cpu::Glyph {
id: glyph.id(),
x,
y,
}
}),
);
});
}
})
}
fn fill_rect(
&mut self,
rect: &Rect<f32>,
style: FillOrStrokeStyle,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.with_composition(composition_options.composition_operation, |self_| {
self_.ctx.set_transform(transform.cast().into());
self_.ctx.set_paint(paint(style, composition_options.alpha));
self_.ctx.fill_rect(&rect.cast().into());
})
}
fn get_size(&self) -> Size2D<i32> {
self.size().cast()
}
fn pop_clip(&mut self) {
if self.clips.pop().is_some() {
self.ctx.pop_layer();
}
}
fn push_clip(&mut self, path: &Path, fill_rule: FillRule, transform: Transform2D<f64>) {
self.ctx.set_transform(transform.cast().into());
let mut path = path.clone();
path.transform(transform.cast());
self.ctx.set_fill_rule(fill_rule.convert());
self.ctx.push_clip_layer(&path.0);
self.clips.push(path);
self.ctx.set_fill_rule(peniko::Fill::NonZero);
}
fn push_clip_rect(&mut self, rect: &Rect<i32>) {
let mut path = Path::new();
let rect = rect.cast();
path.rect(
rect.origin.x,
rect.origin.y,
rect.size.width,
rect.size.height,
);
self.push_clip(&path, FillRule::Nonzero, Transform2D::identity());
}
fn stroke(
&mut self,
path: &Path,
style: FillOrStrokeStyle,
line_options: LineOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.with_composition(composition_options.composition_operation, |self_| {
self_.ctx.set_transform(transform.cast().into());
self_.ctx.set_paint(paint(style, composition_options.alpha));
self_.ctx.set_stroke(line_options.convert());
self_.ctx.stroke_path(&path.0);
})
}
fn stroke_rect(
&mut self,
rect: &Rect<f32>,
style: FillOrStrokeStyle,
line_options: LineOptions,
composition_options: CompositionOptions,
transform: Transform2D<f64>,
) {
self.ensure_drawing();
self.with_composition(composition_options.composition_operation, |self_| {
self_.ctx.set_transform(transform.cast().into());
self_.ctx.set_paint(paint(style, composition_options.alpha));
self_.ctx.set_stroke(line_options.convert());
self_.ctx.stroke_rect(&rect.cast().into());
})
}
fn image_descriptor_and_serializable_data(
&mut self,
) -> (ImageDescriptor, SerializableImageData) {
let image_desc = ImageDescriptor {
format: webrender_api::ImageFormat::RGBA8,
size: self.size().cast().cast_unit(),
stride: None,
offset: 0,
flags: ImageDescriptorFlags::empty(),
};
let data = SerializableImageData::Raw(IpcSharedMemory::from_bytes(self.pixmap()));
(image_desc, data)
}
fn snapshot(&mut self) -> pixels::Snapshot {
Snapshot::from_vec(
self.size().cast(),
SnapshotPixelFormat::RGBA,
SnapshotAlphaMode::Transparent {
premultiplied: true,
},
self.pixmap().to_vec(),
)
}
fn surface(&mut self) -> Self::SourceSurface {
self.pixmap(); // sync pixmap
Arc::new(vello_cpu::Pixmap::from_parts(
self.pixmap.clone().take(),
self.pixmap.width(),
self.pixmap.height(),
))
}
fn create_source_surface_from_data(&self, data: Snapshot) -> Option<Self::SourceSurface> {
Some(snapshot_as_pixmap(data))
}
}
fn snapshot_as_pixmap(data: Snapshot) -> Arc<vello_cpu::Pixmap> {
let size = data.size().cast();
let (data, _, _) = data.to_vec(
Some(SnapshotAlphaMode::Transparent {
premultiplied: true,
}),
Some(SnapshotPixelFormat::RGBA),
);
Arc::new(vello_cpu::Pixmap::from_parts(
bytemuck::cast_vec(data),
size.width,
size.height,
))
}
impl Convert<vello_cpu::PaintType> for FillOrStrokeStyle {
fn convert(self) -> vello_cpu::PaintType {
use canvas_traits::canvas::FillOrStrokeStyle::*;
match self {
Color(absolute_color) => vello_cpu::PaintType::Solid(absolute_color.convert()),
LinearGradient(style) => {
let start = kurbo::Point::new(style.x0, style.y0);
let end = kurbo::Point::new(style.x1, style.y1);
let mut gradient = peniko::Gradient::new_linear(start, end);
gradient.stops = style.stops.convert();
vello_cpu::PaintType::Gradient(gradient)
},
RadialGradient(style) => {
let center1 = kurbo::Point::new(style.x0, style.y0);
let center2 = kurbo::Point::new(style.x1, style.y1);
let mut gradient = peniko::Gradient::new_two_point_radial(
center1,
style.r0 as f32,
center2,
style.r1 as f32,
);
gradient.stops = style.stops.convert();
vello_cpu::PaintType::Gradient(gradient)
},
Surface(surface_style) => {
let pixmap = snapshot_as_pixmap(surface_style.surface_data.to_owned());
vello_cpu::PaintType::Image(vello_cpu::Image {
source: vello_cpu::ImageSource::Pixmap(pixmap),
x_extend: if surface_style.repeat_x {
peniko::Extend::Repeat
} else {
peniko::Extend::Pad
},
y_extend: if surface_style.repeat_y {
peniko::Extend::Repeat
} else {
peniko::Extend::Pad
},
quality: peniko::ImageQuality::Low,
})
},
}
}
}
fn paint(style: FillOrStrokeStyle, alpha: f64) -> vello_cpu::PaintType {
assert!((0.0..=1.0).contains(&alpha));
let paint = style.convert();
if alpha == 1.0 {
paint
} else {
match paint {
vello_cpu::PaintType::Solid(alpha_color) => {
vello_cpu::PaintType::Solid(alpha_color.multiply_alpha(alpha as f32))
},
vello_cpu::PaintType::Gradient(gradient) => {
vello_cpu::PaintType::Gradient(gradient.multiply_alpha(alpha as f32))
},
vello_cpu::PaintType::Image(mut image) => {
match &mut image.source {
vello_cpu::ImageSource::Pixmap(pixmap) => Arc::get_mut(pixmap)
.expect("pixmap should not be shared with anyone at this point")
.multiply_alpha((alpha * 255.0) as u8),
vello_cpu::ImageSource::OpaqueId(_) => unimplemented!(),
};
vello_cpu::PaintType::Image(image)
},
}
}
}

View File

@@ -16,6 +16,10 @@ default = []
tracing = ["dep:tracing"]
webxr = ["dep:webxr"]
[lints.clippy]
unwrap_used = "deny"
panic = "deny"
[dependencies]
base = { workspace = true }
bincode = { workspace = true }
@@ -31,12 +35,12 @@ gleam = { workspace = true }
ipc-channel = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
net = { path = "../net" }
pixels = { path = "../pixels" }
profile_traits = { workspace = true }
servo_allocator = { path = "../allocator" }
servo_config = { path = "../config" }
servo_geometry = { path = "../geometry" }
servo-tracing = { workspace = true }
stylo_traits = { workspace = true }
timers = { path = "../timers" }
tracing = { workspace = true, optional = true }

View File

@@ -11,47 +11,41 @@ use std::rc::Rc;
use std::sync::Arc;
use std::time::{SystemTime, UNIX_EPOCH};
use base::Epoch;
use base::cross_process_instant::CrossProcessInstant;
use base::id::{PipelineId, WebViewId};
use base::{Epoch, WebRenderEpochToU16};
use bitflags::bitflags;
use compositing_traits::display_list::{
CompositorDisplayListInfo, HitTestInfo, ScrollTree, ScrollType,
};
use compositing_traits::display_list::{CompositorDisplayListInfo, ScrollTree, ScrollType};
use compositing_traits::rendering_context::RenderingContext;
use compositing_traits::{
CompositionPipeline, CompositorMsg, ImageUpdate, SendableFrameTree, WebViewTrait,
CompositionPipeline, CompositorMsg, ImageUpdate, PipelineExitSource, SendableFrameTree,
WebViewTrait,
};
use constellation_traits::{EmbedderToConstellationMessage, PaintMetricEvent};
use crossbeam_channel::{Receiver, Sender};
use dpi::PhysicalSize;
use embedder_traits::{
CompositorHitTestResult, Cursor, InputEvent, MouseButtonEvent, MouseMoveEvent, ShutdownState,
TouchEventType, UntrustedNodeAddress, ViewportDetails, WheelDelta, WheelEvent, WheelMode,
};
use euclid::{Point2D, Rect, Scale, Size2D, Transform3D, Vector2D};
use fnv::FnvHashMap;
use ipc_channel::ipc::{self, IpcSharedMemory};
use libc::c_void;
use embedder_traits::{CompositorHitTestResult, InputEvent, ShutdownState, ViewportDetails};
use euclid::{Point2D, Rect, Scale, Size2D, Transform3D};
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
use log::{debug, info, trace, warn};
use pixels::{CorsStatus, ImageFrame, ImageMetadata, PixelFormat, RasterImage};
use profile_traits::mem::{ProcessReports, ProfilerRegistration, Report, ReportKind};
use profile_traits::time::{self as profile_time, ProfilerCategory};
use profile_traits::{path, time_profile};
use servo_config::opts;
use servo_config::{opts, pref};
use servo_geometry::DeviceIndependentPixel;
use style_traits::CSSPixel;
use webrender::{CaptureBits, RenderApi, Transaction};
use webrender_api::units::{
DeviceIntPoint, DeviceIntRect, DevicePixel, DevicePoint, DeviceRect, LayoutPoint, LayoutRect,
LayoutSize, LayoutVector2D, WorldPoint,
LayoutSize, WorldPoint,
};
use webrender_api::{
self, BuiltDisplayList, DirtyRect, DisplayListPayload, DocumentId, Epoch as WebRenderEpoch,
ExternalScrollId, FontInstanceFlags, FontInstanceKey, FontInstanceOptions, FontKey,
HitTestFlags, PipelineId as WebRenderPipelineId, PropertyBinding, ReferenceFrameKind,
RenderReasons, SampledScrollOffset, ScrollLocation, SpaceAndClipInfo, SpatialId,
SpatialTreeItemKey, TransformStyle,
FontVariation, HitTestFlags, PipelineId as WebRenderPipelineId, PropertyBinding,
ReferenceFrameKind, RenderReasons, SampledScrollOffset, ScrollLocation, SpaceAndClipInfo,
SpatialId, SpatialTreeItemKey, TransformStyle,
};
use crate::InitialCompositorState;
@@ -60,13 +54,12 @@ use crate::webview_manager::WebViewManager;
use crate::webview_renderer::{PinchZoomResult, UnknownWebView, WebViewRenderer};
#[derive(Debug, PartialEq)]
enum UnableToComposite {
pub enum UnableToComposite {
NotReadyToPaintImage(NotReadyToPaint),
}
#[derive(Debug, PartialEq)]
enum NotReadyToPaint {
AnimationsActive,
pub enum NotReadyToPaint {
JustNotifiedConstellation,
WaitingOnConstellation,
}
@@ -92,11 +85,6 @@ pub struct ServoRenderer {
/// The [`RefreshDriver`] which manages the rythym of painting.
refresh_driver: RefreshDriver,
/// This is a temporary map between [`PipelineId`]s and their associated [`WebViewId`]. Once
/// all renderer operations become per-`WebView` this map can be removed, but we still sometimes
/// need to work backwards to figure out what `WebView` is associated with a `Pipeline`.
pub(crate) pipeline_to_webview_map: HashMap<PipelineId, WebViewId>,
/// Tracks whether we are in the process of shutting down, or have shut down and should close
/// the compositor. This is shared with the `Servo` instance.
shutdown_state: Rc<Cell<ShutdownState>>,
@@ -126,11 +114,9 @@ pub struct ServoRenderer {
/// True to translate mouse input into touch events.
pub(crate) convert_mouse_to_touch: bool,
/// Current mouse cursor.
cursor: Cursor,
/// Current cursor position.
cursor_pos: DevicePoint,
/// The last position in the rendered view that the mouse moved over. This becomes `None`
/// when the mouse leaves the rendered view.
pub(crate) last_mouse_move_position: Option<DevicePoint>,
}
/// NB: Never block on the constellation, because sometimes the constellation blocks on us.
@@ -151,7 +137,7 @@ pub struct IOCompositor {
/// The webrender renderer.
webrender: Option<webrender::Renderer>,
/// The surfman instance that webrender targets
/// The [`RenderingContext`] instance that webrender targets, which is the viewport.
rendering_context: Rc<dyn RenderingContext>,
/// The number of frames pending to receive from WebRender.
@@ -201,10 +187,6 @@ pub(crate) struct PipelineDetails {
/// The id of the parent pipeline, if any.
pub parent_pipeline_id: Option<PipelineId>,
/// The epoch of the most recent display list for this pipeline. Note that this display
/// list might not be displayed, as WebRender processes display lists asynchronously.
pub most_recent_display_list_epoch: Option<WebRenderEpoch>,
/// Whether animations are running
pub animations_running: bool,
@@ -214,10 +196,6 @@ pub(crate) struct PipelineDetails {
/// Whether to use less resources by stopping animations.
pub throttled: bool,
/// Hit test items for this pipeline. This is used to map WebRender hit test
/// information to the full information necessary for Servo.
pub hit_test_items: Vec<HitTestInfo>,
/// The compositor-side [ScrollTree]. This is used to allow finding and scrolling
/// nodes in the compositor before forwarding new offsets to WebRender.
pub scroll_tree: ScrollTree,
@@ -227,13 +205,18 @@ pub(crate) struct PipelineDetails {
/// The paint metric status of the first contentful paint.
pub first_contentful_paint_metric: PaintMetricState,
/// The CSS pixel to device pixel scale of the viewport of this pipeline, including
/// page zoom, but not including any pinch zoom amount. This is used to detect
/// situations where the current display list is for an old scale.
pub viewport_scale: Option<Scale<f32, CSSPixel, DevicePixel>>,
/// Which parts of Servo have reported that this `Pipeline` has exited. Only when all
/// have done so will it be discarded.
pub exited: PipelineExitSource,
}
impl PipelineDetails {
pub(crate) fn animations_or_animation_callbacks_running(&self) -> bool {
self.animations_running || self.animation_callbacks_running
}
pub(crate) fn animation_callbacks_running(&self) -> bool {
self.animation_callbacks_running
}
@@ -248,157 +231,67 @@ impl PipelineDetails {
PipelineDetails {
pipeline: None,
parent_pipeline_id: None,
most_recent_display_list_epoch: None,
viewport_scale: None,
animations_running: false,
animation_callbacks_running: false,
throttled: false,
hit_test_items: Vec::new(),
scroll_tree: ScrollTree::default(),
first_paint_metric: PaintMetricState::Waiting,
first_contentful_paint_metric: PaintMetricState::Waiting,
exited: PipelineExitSource::empty(),
}
}
fn install_new_scroll_tree(&mut self, new_scroll_tree: ScrollTree) {
let old_scroll_offsets: FnvHashMap<ExternalScrollId, LayoutVector2D> = self
.scroll_tree
.nodes
.drain(..)
.filter_map(|node| match (node.external_id(), node.offset()) {
(Some(external_id), Some(offset)) => Some((external_id, offset)),
_ => None,
})
.collect();
let old_scroll_offsets = self.scroll_tree.scroll_offsets();
self.scroll_tree = new_scroll_tree;
for node in self.scroll_tree.nodes.iter_mut() {
match node.external_id() {
Some(external_id) => match old_scroll_offsets.get(&external_id) {
Some(new_offset) => node.set_offset(*new_offset),
None => continue,
},
_ => continue,
};
}
self.scroll_tree.set_all_scroll_offsets(&old_scroll_offsets);
}
}
pub enum HitTestError {
EpochMismatch,
Others,
}
impl ServoRenderer {
pub fn shutdown_state(&self) -> ShutdownState {
self.shutdown_state.get()
}
pub(crate) fn hit_test_at_point<'a>(
&self,
point: DevicePoint,
details_for_pipeline: impl Fn(PipelineId) -> Option<&'a PipelineDetails>,
) -> Result<CompositorHitTestResult, HitTestError> {
match self.hit_test_at_point_with_flags_and_pipeline(
point,
HitTestFlags::empty(),
None,
details_for_pipeline,
) {
Ok(hit_test_results) => hit_test_results
.first()
.cloned()
.ok_or(HitTestError::Others),
Err(error) => Err(error),
}
pub(crate) fn hit_test_at_point(&self, point: DevicePoint) -> Vec<CompositorHitTestResult> {
self.hit_test_at_point_with_flags(point, HitTestFlags::empty())
}
// TODO: split this into first half (global) and second half (one for whole compositor, one for webview)
pub(crate) fn hit_test_at_point_with_flags_and_pipeline<'a>(
pub(crate) fn hit_test_at_point_with_flags(
&self,
point: DevicePoint,
flags: HitTestFlags,
pipeline_id: Option<WebRenderPipelineId>,
details_for_pipeline: impl Fn(PipelineId) -> Option<&'a PipelineDetails>,
) -> Result<Vec<CompositorHitTestResult>, HitTestError> {
) -> Vec<CompositorHitTestResult> {
// DevicePoint and WorldPoint are the same for us.
let world_point = WorldPoint::from_untyped(point.to_untyped());
let results =
self.webrender_api
.hit_test(self.webrender_document, pipeline_id, world_point, flags);
let results = self.webrender_api.hit_test(
self.webrender_document,
None, /* pipeline_id */
world_point,
flags,
);
let mut epoch_mismatch = false;
let results = results
results
.items
.iter()
.filter_map(|item| {
.map(|item| {
let pipeline_id = item.pipeline.into();
let details = details_for_pipeline(pipeline_id)?;
// If the epoch in the tag does not match the current epoch of the pipeline,
// then the hit test is against an old version of the display list.
match details.most_recent_display_list_epoch {
Some(epoch) => {
if epoch.as_u16() != item.tag.1 {
// It's too early to hit test for now.
// New scene building is in progress.
epoch_mismatch = true;
return None;
}
},
_ => return None,
}
let info = &details.hit_test_items[item.tag.0 as usize];
Some(CompositorHitTestResult {
let external_scroll_id = ExternalScrollId(item.tag.0, item.pipeline);
CompositorHitTestResult {
pipeline_id,
point_in_viewport: item.point_in_viewport.to_untyped(),
point_relative_to_item: item.point_relative_to_item.to_untyped(),
node: UntrustedNodeAddress(info.node as *const c_void),
cursor: info.cursor,
scroll_tree_node: info.scroll_tree_node,
})
point_in_viewport: Point2D::from_untyped(item.point_in_viewport.to_untyped()),
external_scroll_id,
}
})
.collect();
if epoch_mismatch {
return Err(HitTestError::EpochMismatch);
}
Ok(results)
.collect()
}
pub(crate) fn send_transaction(&mut self, transaction: Transaction) {
self.webrender_api
.send_transaction(self.webrender_document, transaction);
}
pub(crate) fn update_cursor(&mut self, pos: DevicePoint, result: &CompositorHitTestResult) {
self.cursor_pos = pos;
let cursor = match result.cursor {
Some(cursor) if cursor != self.cursor => cursor,
_ => return,
};
let Some(webview_id) = self
.pipeline_to_webview_map
.get(&result.pipeline_id)
.cloned()
else {
warn!("Couldn't update cursor for non-WebView-associated pipeline");
return;
};
self.cursor = cursor;
if let Err(e) = self
.constellation_sender
.send(EmbedderToConstellationMessage::SetCursor(
webview_id, cursor,
))
{
warn!("Sending event to constellation failed ({:?}).", e);
}
}
}
impl IOCompositor {
@@ -415,7 +308,6 @@ impl IOCompositor {
state.event_loop_waker,
),
shutdown_state: state.shutdown_state,
pipeline_to_webview_map: Default::default(),
compositor_receiver: state.receiver,
constellation_sender: state.constellation_chan,
time_profiler_chan: state.time_profiler_chan,
@@ -425,8 +317,7 @@ impl IOCompositor {
#[cfg(feature = "webxr")]
webxr_main_thread: state.webxr_main_thread,
convert_mouse_to_touch,
cursor: Cursor::None,
cursor_pos: DevicePoint::new(0.0, 0.0),
last_mouse_move_position: None,
})),
webview_renderers: WebViewManager::default(),
needs_repaint: Cell::default(),
@@ -584,18 +475,6 @@ impl IOCompositor {
};
webview_renderer.on_touch_event_processed(result);
},
CompositorMsg::CreatePng(webview_id, page_rect, reply) => {
let res = self.render_to_shared_memory(webview_id, page_rect);
if let Err(ref e) = res {
info!("Error retrieving PNG: {:?}", e);
}
let img = res.unwrap_or(None);
if let Err(e) = reply.send(img) {
warn!("Sending reply to create png failed ({:?}).", e);
}
},
CompositorMsg::IsReadyToSaveImageReply(is_ready) => {
assert_eq!(
self.ready_to_save_state,
@@ -622,35 +501,18 @@ impl IOCompositor {
}
},
CompositorMsg::PipelineExited(webview_id, pipeline_id, sender) => {
CompositorMsg::PipelineExited(webview_id, pipeline_id, pipeline_exit_source) => {
debug!(
"Compositor got pipeline exited: {:?} {:?}",
webview_id, pipeline_id
);
if let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) {
webview_renderer.remove_pipeline(pipeline_id);
webview_renderer.pipeline_exited(pipeline_id, pipeline_exit_source);
}
let _ = sender.send(());
},
CompositorMsg::NewWebRenderFrameReady(_document_id, recomposite_needed) => {
self.pending_frames -= 1;
let point: DevicePoint = self.global.borrow().cursor_pos;
if recomposite_needed {
let details_for_pipeline = |pipeline_id| self.details_for_pipeline(pipeline_id);
let result = self
.global
.borrow()
.hit_test_at_point(point, details_for_pipeline);
if let Ok(result) = result {
self.global.borrow_mut().update_cursor(point, &result);
}
}
if recomposite_needed || self.animation_callbacks_running() {
self.set_needs_repaint(RepaintReason::NewWebRenderFrame);
}
self.handle_new_webrender_frame_ready(recomposite_needed);
},
CompositorMsg::LoadComplete(_) => {
@@ -659,68 +521,6 @@ impl IOCompositor {
}
},
CompositorMsg::WebDriverMouseButtonEvent(
webview_id,
action,
button,
x,
y,
message_id,
) => {
let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) else {
warn!("Handling input event for unknown webview: {webview_id}");
return;
};
let dppx = webview_renderer.device_pixels_per_page_pixel();
let point = dppx.transform_point(Point2D::new(x, y));
webview_renderer.dispatch_point_input_event(
InputEvent::MouseButton(MouseButtonEvent::new(action, button, point))
.with_webdriver_message_id(message_id),
);
},
CompositorMsg::WebDriverMouseMoveEvent(webview_id, x, y, message_id) => {
let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) else {
warn!("Handling input event for unknown webview: {webview_id}");
return;
};
let dppx = webview_renderer.device_pixels_per_page_pixel();
let point = dppx.transform_point(Point2D::new(x, y));
webview_renderer.dispatch_point_input_event(
InputEvent::MouseMove(MouseMoveEvent::new(point))
.with_webdriver_message_id(message_id),
);
},
CompositorMsg::WebDriverWheelScrollEvent(
webview_id,
x,
y,
delta_x,
delta_y,
message_id,
) => {
let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) else {
warn!("Handling input event for unknown webview: {webview_id}");
return;
};
let delta = WheelDelta {
x: delta_x,
y: delta_y,
z: 0.0,
mode: WheelMode::DeltaPixel,
};
let dppx = webview_renderer.device_pixels_per_page_pixel();
let point = dppx.transform_point(Point2D::new(x, y));
let scroll_delta =
dppx.transform_vector(Vector2D::new(delta_x as f32, delta_y as f32));
webview_renderer.dispatch_point_input_event(
InputEvent::Wheel(WheelEvent::new(delta, point))
.with_webdriver_message_id(message_id),
);
webview_renderer.on_webdriver_wheel_action(scroll_delta, point);
},
CompositorMsg::SendInitialTransaction(pipeline) => {
let mut txn = Transaction::new();
txn.set_display_list(WebRenderEpoch(0), (pipeline, Default::default()));
@@ -728,7 +528,7 @@ impl IOCompositor {
self.global.borrow_mut().send_transaction(txn);
},
CompositorMsg::SendScrollNode(webview_id, pipeline_id, point, external_scroll_id) => {
CompositorMsg::SendScrollNode(webview_id, pipeline_id, offset, external_scroll_id) => {
let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) else {
return;
};
@@ -739,15 +539,17 @@ impl IOCompositor {
return;
};
let offset = LayoutVector2D::new(point.x, point.y);
let Some(offset) = pipeline_details
.scroll_tree
.set_scroll_offsets_for_node_with_external_scroll_id(
.set_scroll_offset_for_node_with_external_scroll_id(
external_scroll_id,
-offset,
offset,
ScrollType::Script,
)
else {
// The renderer should be fully up-to-date with script at this point and script
// should never try to scroll to an invalid location.
warn!("Could not scroll node with id: {external_scroll_id:?}");
return;
};
@@ -755,7 +557,7 @@ impl IOCompositor {
txn.set_scroll_offsets(
external_scroll_id,
vec![SampledScrollOffset {
offset: -offset,
offset,
generation: 0,
}],
);
@@ -825,14 +627,14 @@ impl IOCompositor {
let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) else {
return warn!("Could not find WebView for incoming display list");
};
// WebRender is not ready until we receive "NewWebRenderFrameReady"
webview_renderer.webrender_frame_ready.set(false);
let old_scale = webview_renderer.device_pixels_per_page_pixel();
let pipeline_id = display_list_info.pipeline_id;
let details = webview_renderer.ensure_pipeline_details(pipeline_id.into());
details.most_recent_display_list_epoch = Some(display_list_info.epoch);
details.hit_test_items = display_list_info.hit_test_info;
details.install_new_scroll_tree(display_list_info.scroll_tree);
details.viewport_scale =
Some(display_list_info.viewport_details.hidpi_scale_factor);
let epoch = display_list_info.epoch;
let first_reflow = display_list_info.first_reflow;
@@ -847,6 +649,14 @@ impl IOCompositor {
}
let mut transaction = Transaction::new();
let is_root_pipeline =
Some(pipeline_id.into()) == webview_renderer.root_pipeline_id;
if is_root_pipeline && old_scale != webview_renderer.device_pixels_per_page_pixel()
{
self.send_root_pipeline_display_list_in_transaction(&mut transaction);
}
transaction
.set_display_list(display_list_info.epoch, (pipeline_id, built_display_list));
self.update_transaction_with_all_scroll_offsets(&mut transaction);
@@ -854,37 +664,23 @@ impl IOCompositor {
self.global.borrow_mut().send_transaction(transaction);
},
CompositorMsg::HitTest(pipeline, point, flags, sender) => {
// When a display list is sent to WebRender, it starts scene building in a
// separate thread and then that display list is available for hit testing.
// Without flushing scene building, any hit test we do might be done against
// a previous scene, if the last one we sent hasn't finished building.
//
// TODO(mrobinson): Flushing all scene building is a big hammer here, because
// we might only be interested in a single pipeline. The only other option
// would be to listen to the TransactionNotifier for previous per-pipeline
// transactions, but that isn't easily compatible with the event loop wakeup
// mechanism from libserver.
self.global.borrow().webrender_api.flush_scene_builder();
let details_for_pipeline = |pipeline_id| self.details_for_pipeline(pipeline_id);
let result = self
.global
.borrow()
.hit_test_at_point_with_flags_and_pipeline(
point,
flags,
pipeline,
details_for_pipeline,
)
.unwrap_or_default();
let _ = sender.send(result);
},
CompositorMsg::GenerateImageKey(sender) => {
let _ = sender.send(self.global.borrow().webrender_api.generate_image_key());
},
CompositorMsg::GenerateImageKeysForPipeline(pipeline_id) => {
let image_keys = (0..pref!(image_key_batch_size))
.map(|_| self.global.borrow().webrender_api.generate_image_key())
.collect();
if let Err(error) = self.global.borrow().constellation_sender.send(
EmbedderToConstellationMessage::SendImageKeysForPipeline(
pipeline_id,
image_keys,
),
) {
warn!("Sending Image Keys to Constellation failed with({error:?}).");
}
},
CompositorMsg::UpdateImages(updates) => {
let mut txn = Transaction::new();
for update in updates {
@@ -911,8 +707,14 @@ impl IOCompositor {
self.global.borrow_mut().send_transaction(transaction);
},
CompositorMsg::AddFontInstance(font_instance_key, font_key, size, flags) => {
self.add_font_instance(font_instance_key, font_key, size, flags);
CompositorMsg::AddFontInstance(
font_instance_key,
font_key,
size,
flags,
variations,
) => {
self.add_font_instance(font_instance_key, font_key, size, flags, variations);
},
CompositorMsg::RemoveFonts(keys, instance_keys) => {
@@ -928,61 +730,16 @@ impl IOCompositor {
self.global.borrow_mut().send_transaction(transaction);
},
CompositorMsg::AddImage(key, desc, data) => {
let mut txn = Transaction::new();
txn.add_image(key, desc, data.into(), None);
self.global.borrow_mut().send_transaction(txn);
},
CompositorMsg::GenerateFontKeys(
number_of_font_keys,
number_of_font_instance_keys,
result_sender,
) => {
let font_keys = (0..number_of_font_keys)
.map(|_| self.global.borrow().webrender_api.generate_font_key())
.collect();
let font_instance_keys = (0..number_of_font_instance_keys)
.map(|_| {
self.global
.borrow()
.webrender_api
.generate_font_instance_key()
})
.collect();
let _ = result_sender.send((font_keys, font_instance_keys));
},
CompositorMsg::GetClientWindowRect(webview_id, response_sender) => {
let client_window_rect = self
.webview_renderers
.get(webview_id)
.map(|webview_renderer| {
webview_renderer.client_window_rect(self.rendering_context.size2d())
})
.unwrap_or_default();
if let Err(error) = response_sender.send(client_window_rect) {
warn!("Sending response to get client window failed ({error:?}).");
}
},
CompositorMsg::GetScreenSize(webview_id, response_sender) => {
let screen_size = self
.webview_renderers
.get(webview_id)
.map(WebViewRenderer::screen_size)
.unwrap_or_default();
if let Err(error) = response_sender.send(screen_size) {
warn!("Sending response to get screen size failed ({error:?}).");
}
},
CompositorMsg::GetAvailableScreenSize(webview_id, response_sender) => {
let available_screen_size = self
.webview_renderers
.get(webview_id)
.map(WebViewRenderer::available_screen_size)
.unwrap_or_default();
if let Err(error) = response_sender.send(available_screen_size) {
warn!("Sending response to get screen size failed ({error:?}).");
}
self.handle_generate_font_keys(
number_of_font_keys,
number_of_font_instance_keys,
result_sender,
);
},
CompositorMsg::Viewport(webview_id, viewport_description) => {
if let Some(webview) = self.webview_renderers.get_mut(webview_id) {
@@ -1003,15 +760,14 @@ impl IOCompositor {
/// compositor no longer does any WebRender frame generation.
fn handle_browser_message_while_shutting_down(&mut self, msg: CompositorMsg) {
match msg {
CompositorMsg::PipelineExited(webview_id, pipeline_id, sender) => {
CompositorMsg::PipelineExited(webview_id, pipeline_id, pipeline_exit_source) => {
debug!(
"Compositor got pipeline exited: {:?} {:?}",
webview_id, pipeline_id
);
if let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) {
webview_renderer.remove_pipeline(pipeline_id);
webview_renderer.pipeline_exited(pipeline_id, pipeline_exit_source);
}
let _ = sender.send(());
},
CompositorMsg::GenerateImageKey(sender) => {
let _ = sender.send(self.global.borrow().webrender_api.generate_image_key());
@@ -1021,33 +777,11 @@ impl IOCompositor {
number_of_font_instance_keys,
result_sender,
) => {
let font_keys = (0..number_of_font_keys)
.map(|_| self.global.borrow().webrender_api.generate_font_key())
.collect();
let font_instance_keys = (0..number_of_font_instance_keys)
.map(|_| {
self.global
.borrow()
.webrender_api
.generate_font_instance_key()
})
.collect();
let _ = result_sender.send((font_keys, font_instance_keys));
},
CompositorMsg::GetClientWindowRect(_, response_sender) => {
if let Err(error) = response_sender.send(Default::default()) {
warn!("Sending response to get client window failed ({error:?}).");
}
},
CompositorMsg::GetScreenSize(_, response_sender) => {
if let Err(error) = response_sender.send(Default::default()) {
warn!("Sending response to get client window failed ({error:?}).");
}
},
CompositorMsg::GetAvailableScreenSize(_, response_sender) => {
if let Err(error) = response_sender.send(Default::default()) {
warn!("Sending response to get client window failed ({error:?}).");
}
self.handle_generate_font_keys(
number_of_font_keys,
number_of_font_instance_keys,
result_sender,
);
},
CompositorMsg::NewWebRenderFrameReady(..) => {
// Subtract from the number of pending frames, but do not do any compositing.
@@ -1059,6 +793,27 @@ impl IOCompositor {
}
}
/// Generate the font keys and send them to the `result_sender`.
fn handle_generate_font_keys(
&self,
number_of_font_keys: usize,
number_of_font_instance_keys: usize,
result_sender: IpcSender<(Vec<FontKey>, Vec<FontInstanceKey>)>,
) {
let font_keys = (0..number_of_font_keys)
.map(|_| self.global.borrow().webrender_api.generate_font_key())
.collect();
let font_instance_keys = (0..number_of_font_instance_keys)
.map(|_| {
self.global
.borrow()
.webrender_api
.generate_font_instance_key()
})
.collect();
let _ = result_sender.send((font_keys, font_instance_keys));
}
/// Queue a new frame in the transaction and increase the pending frames count.
pub(crate) fn generate_frame(&mut self, transaction: &mut Transaction, reason: RenderReasons) {
self.pending_frames += 1;
@@ -1163,7 +918,6 @@ impl IOCompositor {
continue;
};
let offset = LayoutVector2D::new(-offset.x, -offset.y);
transaction.set_scroll_offsets(
external_id,
vec![SampledScrollOffset {
@@ -1333,9 +1087,8 @@ impl IOCompositor {
}
if let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) {
webview_renderer.set_page_zoom(1.0);
webview_renderer.set_page_zoom(Scale::new(1.0));
}
self.send_root_pipeline_display_list();
}
pub fn on_zoom_window_event(&mut self, webview_id: WebViewId, magnification: f32) {
@@ -1344,29 +1097,9 @@ impl IOCompositor {
}
if let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) {
webview_renderer.set_page_zoom(magnification);
let current_page_zoom = webview_renderer.page_zoom();
webview_renderer.set_page_zoom(current_page_zoom * Scale::new(magnification));
}
self.send_root_pipeline_display_list();
}
fn details_for_pipeline(&self, pipeline_id: PipelineId) -> Option<&PipelineDetails> {
let webview_id = self
.global
.borrow()
.pipeline_to_webview_map
.get(&pipeline_id)
.cloned()?;
self.webview_renderers
.get(webview_id)?
.pipelines
.get(&pipeline_id)
}
// Check if any pipelines currently have active animations or animation callbacks.
fn animations_or_animation_callbacks_running(&self) -> bool {
self.webview_renderers
.iter()
.any(WebViewRenderer::animations_or_animation_callbacks_running)
}
/// Returns true if any animation callbacks (ie `requestAnimationFrame`) are waiting for a response.
@@ -1452,7 +1185,7 @@ impl IOCompositor {
/// Render the WebRender scene to the shared memory, without updating other state of this
/// [`IOCompositor`]. If succesful return the output image in shared memory.
fn render_to_shared_memory(
pub fn render_to_shared_memory(
&mut self,
webview_id: WebViewId,
page_rect: Option<Rect<f32, CSSPixel>>,
@@ -1501,10 +1234,7 @@ impl IOCompositor {
}))
}
#[cfg_attr(
feature = "tracing",
tracing::instrument(skip_all, fields(servo_profiling = true), level = "trace")
)]
#[servo_tracing::instrument(skip_all)]
fn render_inner(&mut self) -> Result<(), UnableToComposite> {
if let Err(err) = self.rendering_context.make_current() {
warn!("Failed to make the rendering context current: {:?}", err);
@@ -1516,13 +1246,6 @@ impl IOCompositor {
}
if opts::get().wait_for_stable_image {
// The current image may be ready to output. However, if there are animations active,
// continue waiting for the image output to be stable AND all active animations to complete.
if self.animations_or_animation_callbacks_running() {
return Err(UnableToComposite::NotReadyToPaintImage(
NotReadyToPaint::AnimationsActive,
));
}
if let Err(result) = self.is_ready_to_paint_image_output() {
return Err(UnableToComposite::NotReadyToPaintImage(result));
}
@@ -1654,14 +1377,11 @@ impl IOCompositor {
}
/// Get the message receiver for this [`IOCompositor`].
pub fn receiver(&self) -> Ref<Receiver<CompositorMsg>> {
pub fn receiver(&self) -> Ref<'_, Receiver<CompositorMsg>> {
Ref::map(self.global.borrow(), |global| &global.compositor_receiver)
}
#[cfg_attr(
feature = "tracing",
tracing::instrument(skip_all, fields(servo_profiling = true), level = "trace")
)]
#[servo_tracing::instrument(skip_all)]
pub fn handle_messages(&mut self, mut messages: Vec<CompositorMsg>) {
// Check for new messages coming from the other threads in the system.
let mut found_recomposite_msg = false;
@@ -1675,15 +1395,6 @@ impl IOCompositor {
},
CompositorMsg::NewWebRenderFrameReady(..) => {
found_recomposite_msg = true;
// Process all pending events
// FIXME: Shouldn't `webview_frame_ready` be stored globally and why can't `pending_frames`
// be used here?
self.webview_renderers.iter().for_each(|webview| {
webview.dispatch_pending_point_input_events();
webview.webrender_frame_ready.set(true);
});
true
},
_ => true,
@@ -1698,10 +1409,7 @@ impl IOCompositor {
}
}
#[cfg_attr(
feature = "tracing",
tracing::instrument(skip_all, fields(servo_profiling = true), level = "trace")
)]
#[servo_tracing::instrument(skip_all)]
pub fn perform_updates(&mut self) -> bool {
if self.global.borrow().shutdown_state() == ShutdownState::FinishedShuttingDown {
return false;
@@ -1734,11 +1442,10 @@ impl IOCompositor {
self.send_root_pipeline_display_list_in_transaction(&mut transaction);
}
for update in scroll_offset_updates {
let offset = LayoutVector2D::new(-update.offset.x, -update.offset.y);
transaction.set_scroll_offsets(
update.external_scroll_id,
vec![SampledScrollOffset {
offset,
offset: update.offset,
generation: 0,
}],
);
@@ -1806,7 +1513,14 @@ impl IOCompositor {
font_key: FontKey,
size: f32,
flags: FontInstanceFlags,
variations: Vec<FontVariation>,
) {
let variations = if pref!(layout_variable_fonts_enabled) {
variations
} else {
vec![]
};
let mut transaction = Transaction::new();
let font_instance_options = FontInstanceOptions {
@@ -1819,7 +1533,7 @@ impl IOCompositor {
size,
Some(font_instance_options),
None,
Vec::new(),
variations,
);
self.global.borrow_mut().send_transaction(transaction);
@@ -1842,10 +1556,9 @@ impl IOCompositor {
webview_id: WebViewId,
scroll_location: ScrollLocation,
cursor: DeviceIntPoint,
event_type: TouchEventType,
) {
if let Some(webview_renderer) = self.webview_renderers.get_mut(webview_id) {
webview_renderer.notify_scroll_event(scroll_location, cursor, event_type);
webview_renderer.notify_scroll_event(scroll_location, cursor);
}
}
@@ -1868,4 +1581,39 @@ impl IOCompositor {
fn shutdown_state(&self) -> ShutdownState {
self.global.borrow().shutdown_state()
}
fn refresh_cursor(&self) {
let global = self.global.borrow();
let Some(last_mouse_move_position) = global.last_mouse_move_position else {
return;
};
let Some(hit_test_result) = global
.hit_test_at_point(last_mouse_move_position)
.first()
.cloned()
else {
return;
};
if let Err(error) =
global
.constellation_sender
.send(EmbedderToConstellationMessage::RefreshCursor(
hit_test_result.pipeline_id,
))
{
warn!("Sending event to constellation failed ({:?}).", error);
}
}
fn handle_new_webrender_frame_ready(&mut self, recomposite_needed: bool) {
self.pending_frames -= 1;
if recomposite_needed {
self.refresh_cursor();
}
if recomposite_needed || self.animation_callbacks_running() {
self.set_needs_repaint(RepaintReason::NewWebRenderFrame);
}
}
}

View File

@@ -292,6 +292,10 @@ impl TouchHandler {
.expect("Current Touch sequence does not exist")
}
fn try_get_current_touch_sequence_mut(&mut self) -> Option<&mut TouchSequenceInfo> {
self.touch_sequence_map.get_mut(&self.current_sequence_id)
}
pub(crate) fn get_touch_sequence(&self, sequence_id: TouchSequenceId) -> &TouchSequenceInfo {
self.touch_sequence_map
.get(&sequence_id)
@@ -374,7 +378,12 @@ impl TouchHandler {
id: TouchId,
point: Point2D<f32, DevicePixel>,
) -> TouchMoveAction {
let touch_sequence = self.get_current_touch_sequence_mut();
// As `TouchHandler` is per `WebViewRenderer` which is per `WebView` we might get a Touch Sequence Move that
// started with a down on a different webview. As the touch_sequence id is only changed on touch_down this
// move event gets a touch id which is already cleaned up.
let Some(touch_sequence) = self.try_get_current_touch_sequence_mut() else {
return TouchMoveAction::NoAction;
};
let idx = match touch_sequence
.active_touch_points
.iter_mut()
@@ -397,7 +406,9 @@ impl TouchHandler {
*velocity /= 2.0;
// update the touch point every time when panning.
touch_sequence.active_touch_points[idx].point = point;
TouchMoveAction::Scroll(delta, point)
// Scroll offsets are opposite to the direction of finger motion.
TouchMoveAction::Scroll(-delta, point)
} else if delta.x.abs() > TOUCH_PAN_MIN_SCREEN_PX ||
delta.y.abs() > TOUCH_PAN_MIN_SCREEN_PX
{
@@ -408,7 +419,9 @@ impl TouchHandler {
touch_sequence.prevent_click = true;
// update the touch point
touch_sequence.active_touch_points[idx].point = point;
TouchMoveAction::Scroll(delta, point)
// Scroll offsets are opposite to the direction of finger motion.
TouchMoveAction::Scroll(-delta, point)
} else {
// We don't update the touchpoint, so multiple small moves can
// accumulate and merge into a larger move.
@@ -426,8 +439,11 @@ impl TouchHandler {
touch_sequence.active_touch_points[idx].point = point;
let (d1, c1) = touch_sequence.pinch_distance_and_center();
let magnification = d1 / d0;
let scroll_delta = c1 - c0 * Scale::new(magnification);
TouchMoveAction::Zoom(magnification, scroll_delta)
// Scroll offsets are opposite to the direction of finger motion.
TouchMoveAction::Zoom(magnification, -scroll_delta)
} else {
// We don't update the touchpoint, so multiple small moves can
// accumulate and merge into a larger move.
@@ -529,7 +545,10 @@ impl TouchHandler {
}
pub fn on_touch_cancel(&mut self, id: TouchId, _point: Point2D<f32, DevicePixel>) {
let touch_sequence = self.get_current_touch_sequence_mut();
// A similar thing with touch move can happen here where the event is coming from a different webview.
let Some(touch_sequence) = self.try_get_current_touch_sequence_mut() else {
return;
};
match touch_sequence
.active_touch_points
.iter()

View File

@@ -34,32 +34,24 @@ mod from_constellation {
Self::CreateOrUpdateWebView(..) => target!("CreateOrUpdateWebView"),
Self::RemoveWebView(..) => target!("RemoveWebView"),
Self::TouchEventProcessed(..) => target!("TouchEventProcessed"),
Self::CreatePng(..) => target!("CreatePng"),
Self::IsReadyToSaveImageReply(..) => target!("IsReadyToSaveImageReply"),
Self::SetThrottled(..) => target!("SetThrottled"),
Self::NewWebRenderFrameReady(..) => target!("NewWebRenderFrameReady"),
Self::PipelineExited(..) => target!("PipelineExited"),
Self::LoadComplete(..) => target!("LoadComplete"),
Self::WebDriverMouseButtonEvent(..) => target!("WebDriverMouseButtonEvent"),
Self::WebDriverMouseMoveEvent(..) => target!("WebDriverMouseMoveEvent"),
Self::WebDriverWheelScrollEvent(..) => target!("WebDriverWheelScrollEvent"),
Self::SendInitialTransaction(..) => target!("SendInitialTransaction"),
Self::SendScrollNode(..) => target!("SendScrollNode"),
Self::SendDisplayList { .. } => target!("SendDisplayList"),
Self::HitTest(..) => target!("HitTest"),
Self::GenerateImageKey(..) => target!("GenerateImageKey"),
Self::AddImage(..) => target!("AddImage"),
Self::UpdateImages(..) => target!("UpdateImages"),
Self::GenerateFontKeys(..) => target!("GenerateFontKeys"),
Self::AddFont(..) => target!("AddFont"),
Self::AddSystemFont(..) => target!("AddSystemFont"),
Self::AddFontInstance(..) => target!("AddFontInstance"),
Self::RemoveFonts(..) => target!("RemoveFonts"),
Self::GetClientWindowRect(..) => target!("GetClientWindowRect"),
Self::GetScreenSize(..) => target!("GetScreenSize"),
Self::GetAvailableScreenSize(..) => target!("GetAvailableScreenSize"),
Self::CollectMemoryReport(..) => target!("CollectMemoryReport"),
Self::Viewport(..) => target!("Viewport"),
Self::GenerateImageKeysForPipeline(..) => target!("GenerateImageKeysForPipeline"),
}
}
}

View File

@@ -127,7 +127,7 @@ mod test {
webviews: &WebViewManager<WebView>,
) -> Vec<(WebViewId, WebView)> {
let mut keys = webviews.webviews.keys().collect::<Vec<_>>();
keys.sort();
keys.sort_unstable();
keys.iter()
.map(|&id| (*id, webviews.webviews.get(id).cloned().unwrap()))
.collect()

View File

@@ -2,34 +2,32 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::{Cell, RefCell};
use std::collections::hash_map::Keys;
use std::collections::{HashMap, VecDeque};
use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::hash_map::{Entry, Keys};
use std::rc::Rc;
use base::id::{PipelineId, WebViewId};
use compositing_traits::display_list::ScrollType;
use compositing_traits::viewport_description::{
DEFAULT_ZOOM, MAX_ZOOM, MIN_ZOOM, ViewportDescription,
DEFAULT_PAGE_ZOOM, MAX_PAGE_ZOOM, MIN_PAGE_ZOOM, ViewportDescription,
};
use compositing_traits::{SendableFrameTree, WebViewTrait};
use constellation_traits::{EmbedderToConstellationMessage, ScrollState, WindowSizeType};
use compositing_traits::{PipelineExitSource, SendableFrameTree, WebViewTrait};
use constellation_traits::{EmbedderToConstellationMessage, WindowSizeType};
use embedder_traits::{
AnimationState, CompositorHitTestResult, InputEvent, MouseButton, MouseButtonAction,
MouseButtonEvent, MouseMoveEvent, ShutdownState, TouchEvent, TouchEventResult, TouchEventType,
TouchId, ViewportDetails,
MouseButtonEvent, MouseMoveEvent, ScrollEvent as EmbedderScrollEvent, ShutdownState,
TouchEvent, TouchEventResult, TouchEventType, TouchId, ViewportDetails,
};
use euclid::{Box2D, Point2D, Scale, Size2D, Vector2D};
use euclid::{Point2D, Scale, Vector2D};
use fnv::FnvHashSet;
use log::{debug, warn};
use servo_geometry::DeviceIndependentPixel;
use style_traits::{CSSPixel, PinchZoomFactor};
use webrender_api::units::{
DeviceIntPoint, DeviceIntRect, DevicePixel, DevicePoint, DeviceRect, LayoutVector2D,
};
use webrender_api::units::{DeviceIntPoint, DevicePixel, DevicePoint, DeviceRect, LayoutVector2D};
use webrender_api::{ExternalScrollId, HitTestFlags, ScrollLocation};
use crate::compositor::{HitTestError, PipelineDetails, ServoRenderer};
use crate::compositor::{PipelineDetails, ServoRenderer};
use crate::touch::{TouchHandler, TouchMoveAction, TouchMoveAllowed, TouchSequenceState};
#[derive(Clone, Copy)]
@@ -46,16 +44,16 @@ struct ScrollEvent {
enum ScrollZoomEvent {
/// A pinch zoom event that magnifies the view by the given factor.
PinchZoom(f32),
/// A zoom event that magnifies the view by the factor parsed from meta tag.
ViewportZoom(f32),
/// A zoom event that establishes the initial zoom from the viewport meta tag.
InitialViewportZoom(f32),
/// A scroll event that scrolls the scroll node at the given location by the
/// given amount.
Scroll(ScrollEvent),
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Debug)]
pub(crate) struct ScrollResult {
pub pipeline_id: PipelineId,
pub hit_test_result: CompositorHitTestResult,
pub external_scroll_id: ExternalScrollId,
pub offset: LayoutVector2D,
}
@@ -78,6 +76,7 @@ pub(crate) struct WebViewRenderer {
pub webview: Box<dyn WebViewTrait>,
/// The root [`PipelineId`] of the currently displayed page in this WebView.
pub root_pipeline_id: Option<PipelineId>,
/// The rectangle of the [`WebView`] in device pixels, which is the viewport.
pub rect: DeviceRect,
/// Tracks details about each active pipeline that the compositor knows about.
pub pipelines: HashMap<PipelineId, PipelineDetails>,
@@ -90,30 +89,18 @@ pub(crate) struct WebViewRenderer {
/// "Desktop-style" zoom that resizes the viewport to fit the window.
pub page_zoom: Scale<f32, CSSPixel, DeviceIndependentPixel>,
/// "Mobile-style" zoom that does not reflow the page.
viewport_zoom: PinchZoomFactor,
pinch_zoom: PinchZoomFactor,
/// The HiDPI scale factor for the `WebView` associated with this renderer. This is controlled
/// by the embedding layer.
hidpi_scale_factor: Scale<f32, DeviceIndependentPixel, DevicePixel>,
/// Whether or not this [`WebViewRenderer`] isn't throttled and has a pipeline with
/// active animations or animation frame callbacks.
animating: bool,
/// Pending input events queue. Priavte and only this thread pushes events to it.
pending_point_input_events: RefCell<VecDeque<InputEvent>>,
/// WebRender is not ready between `SendDisplayList` and `WebRenderFrameReady` messages.
pub webrender_frame_ready: Cell<bool>,
/// Viewport Description
/// A [`ViewportDescription`] for this [`WebViewRenderer`], which contains the limitations
/// and initial values for zoom derived from the `viewport` meta tag in web content.
viewport_description: Option<ViewportDescription>,
}
impl Drop for WebViewRenderer {
fn drop(&mut self) {
self.global
.borrow_mut()
.pipeline_to_webview_map
.retain(|_, webview_id| self.id != *webview_id);
}
}
impl WebViewRenderer {
pub(crate) fn new(
global: Rc<RefCell<ServoRenderer>>,
@@ -131,22 +118,14 @@ impl WebViewRenderer {
touch_handler: TouchHandler::new(),
global,
pending_scroll_zoom_events: Default::default(),
page_zoom: Scale::new(1.0),
viewport_zoom: PinchZoomFactor::new(DEFAULT_ZOOM),
page_zoom: DEFAULT_PAGE_ZOOM,
pinch_zoom: PinchZoomFactor::new(1.0),
hidpi_scale_factor: Scale::new(hidpi_scale_factor.0),
animating: false,
pending_point_input_events: Default::default(),
webrender_frame_ready: Cell::default(),
viewport_description: None,
}
}
pub(crate) fn animations_or_animation_callbacks_running(&self) -> bool {
self.pipelines
.values()
.any(PipelineDetails::animations_or_animation_callbacks_running)
}
pub(crate) fn animation_callbacks_running(&self) -> bool {
self.pipelines
.values()
@@ -166,26 +145,32 @@ impl WebViewRenderer {
&mut self,
pipeline_id: PipelineId,
) -> &mut PipelineDetails {
self.pipelines.entry(pipeline_id).or_insert_with(|| {
self.global
.borrow_mut()
.pipeline_to_webview_map
.insert(pipeline_id, self.id);
PipelineDetails::new()
})
self.pipelines
.entry(pipeline_id)
.or_insert_with(PipelineDetails::new)
}
pub(crate) fn remove_pipeline(&mut self, pipeline_id: PipelineId) {
self.global
.borrow_mut()
.pipeline_to_webview_map
.remove(&pipeline_id);
self.pipelines.remove(&pipeline_id);
pub(crate) fn pipeline_exited(&mut self, pipeline_id: PipelineId, source: PipelineExitSource) {
let pipeline = self.pipelines.entry(pipeline_id);
let Entry::Occupied(mut pipeline) = pipeline else {
return;
};
pipeline.get_mut().exited.insert(source);
// Do not remove pipeline details until both the Constellation and Script have
// finished processing the pipeline shutdown. This prevents any followup messges
// from re-adding the pipeline details and creating a zombie.
if !pipeline.get().exited.is_all() {
return;
}
pipeline.remove_entry();
}
pub(crate) fn set_frame_tree(&mut self, frame_tree: &SendableFrameTree) {
let pipeline_id = frame_tree.pipeline.id;
let old_pipeline_id = std::mem::replace(&mut self.root_pipeline_id, Some(pipeline_id));
let old_pipeline_id = self.root_pipeline_id.replace(pipeline_id);
if old_pipeline_id != self.root_pipeline_id {
debug!(
@@ -204,18 +189,18 @@ impl WebViewRenderer {
return;
};
let mut scroll_states = Vec::new();
details.scroll_tree.nodes.iter().for_each(|node| {
if let (Some(scroll_id), Some(scroll_offset)) = (node.external_id(), node.offset()) {
scroll_states.push(ScrollState {
scroll_id,
scroll_offset,
});
}
});
let scroll_offsets = details.scroll_tree.scroll_offsets();
// This might be true if we have not received a display list from the layout
// associated with this pipeline yet. In that case, the layout is not ready to
// receive scroll offsets anyway, so just save time and prevent other issues by
// not sending them.
if scroll_offsets.is_empty() {
return;
}
let _ = self.global.borrow().constellation_sender.send(
EmbedderToConstellationMessage::SetScrollStates(pipeline_id, scroll_states),
EmbedderToConstellationMessage::SetScrollStates(pipeline_id, scroll_offsets),
);
}
@@ -257,21 +242,18 @@ impl WebViewRenderer {
self.pipelines
.iter_mut()
.filter(|(id, _)| !attached_pipelines.contains(id))
.for_each(|(_, details)| {
details.scroll_tree.nodes.iter_mut().for_each(|node| {
node.set_offset(LayoutVector2D::zero());
})
})
.for_each(|(_, details)| details.scroll_tree.reset_all_scroll_offsets());
}
/// Sets or unsets the animations-running flag for the given pipeline. Returns
/// true if the [`WebViewRenderer`]'s overall animating state changed.
/// true if the pipeline has started animating.
pub(crate) fn change_pipeline_running_animations_state(
&mut self,
pipeline_id: PipelineId,
animation_state: AnimationState,
) -> bool {
let pipeline_details = self.ensure_pipeline_details(pipeline_id);
let was_animating = pipeline_details.animating();
match animation_state {
AnimationState::AnimationsPresent => {
pipeline_details.animations_running = true;
@@ -286,83 +268,85 @@ impl WebViewRenderer {
pipeline_details.animation_callbacks_running = false;
},
}
self.update_animation_state()
let started_animating = !was_animating && pipeline_details.animating();
self.update_animation_state();
// It's important that an animation tick is triggered even if the
// WebViewRenderer's overall animation state hasn't changed. It's possible that
// the WebView was animating, but not producing new display lists. In that case,
// no repaint will happen and thus no repaint will trigger the next animation tick.
started_animating
}
/// Sets or unsets the throttled flag for the given pipeline. Returns
/// true if the [`WebViewRenderer`]'s overall animating state changed.
/// true if the pipeline has started animating.
pub(crate) fn set_throttled(&mut self, pipeline_id: PipelineId, throttled: bool) -> bool {
self.ensure_pipeline_details(pipeline_id).throttled = throttled;
let pipeline_details = self.ensure_pipeline_details(pipeline_id);
let was_animating = pipeline_details.animating();
pipeline_details.throttled = throttled;
let started_animating = !was_animating && pipeline_details.animating();
// Throttling a pipeline can cause it to be taken into the "not-animating" state.
self.update_animation_state()
self.update_animation_state();
// It's important that an animation tick is triggered even if the
// WebViewRenderer's overall animation state hasn't changed. It's possible that
// the WebView was animating, but not producing new display lists. In that case,
// no repaint will happen and thus no repaint will trigger the next animation tick.
started_animating
}
pub(crate) fn update_animation_state(&mut self) -> bool {
let animating = self.pipelines.values().any(PipelineDetails::animating);
let old_animating = std::mem::replace(&mut self.animating, animating);
self.webview.set_animating(self.animating);
old_animating != self.animating
fn update_animation_state(&mut self) {
self.animating = self.pipelines.values().any(PipelineDetails::animating);
self.webview.set_animating(self.animating());
}
/// On a Window refresh tick (e.g. vsync)
pub(crate) fn on_vsync(&mut self) {
if let Some(fling_action) = self.touch_handler.on_vsync() {
self.on_scroll_window_event(
ScrollLocation::Delta(fling_action.delta),
ScrollLocation::Delta(-fling_action.delta),
fling_action.cursor,
);
}
}
pub(crate) fn dispatch_point_input_event(&mut self, mut event: InputEvent) -> bool {
// Events that do not need to do hit testing are sent directly to the
// constellation to filter down.
let Some(point) = event.point() else {
return false;
};
// Delay the event if the epoch is not synchronized yet (new frame is not ready),
// or hit test result would fail and the event is rejected anyway.
if !self.webrender_frame_ready.get() || !self.pending_point_input_events.borrow().is_empty()
{
self.pending_point_input_events
.borrow_mut()
.push_back(event);
return false;
}
// If we can't find a pipeline to send this event to, we cannot continue.
let get_pipeline_details = |pipeline_id| self.pipelines.get(&pipeline_id);
let result = match self
.global
.borrow()
.hit_test_at_point(point, get_pipeline_details)
{
Ok(hit_test_results) => hit_test_results,
Err(HitTestError::EpochMismatch) => {
self.pending_point_input_events
.borrow_mut()
.push_back(event);
return false;
},
_ => {
return false;
pub(crate) fn dispatch_input_event_with_hit_testing(&self, mut event: InputEvent) -> bool {
let event_point = event.point();
let hit_test_result = match event_point {
Some(point) => {
let hit_test_result = self
.global
.borrow()
.hit_test_at_point(point)
.into_iter()
.nth(0);
if hit_test_result.is_none() {
warn!("Empty hit test result for input event, ignoring.");
return false;
}
hit_test_result
},
None => None,
};
match event {
InputEvent::Touch(ref mut touch_event) => {
touch_event.init_sequence_id(self.touch_handler.current_sequence_id);
},
InputEvent::MouseButton(_) | InputEvent::MouseMove(_) | InputEvent::Wheel(_) => {
self.global.borrow_mut().update_cursor(point, &result);
InputEvent::MouseMove(_) => {
self.global.borrow_mut().last_mouse_move_position = event_point;
},
InputEvent::MouseLeftViewport(_) => {
self.global.borrow_mut().last_mouse_move_position = None;
},
InputEvent::MouseButton(_) | InputEvent::Wheel(_) => {},
_ => unreachable!("Unexpected input event type: {event:?}"),
}
if let Err(error) = self.global.borrow().constellation_sender.send(
EmbedderToConstellationMessage::ForwardInputEvent(self.id, event, Some(result)),
EmbedderToConstellationMessage::ForwardInputEvent(self.id, event, hit_test_result),
) {
warn!("Sending event to constellation failed ({error:?}).");
false
@@ -371,46 +355,6 @@ impl WebViewRenderer {
}
}
// TODO: This function duplicates a lot of `dispatch_point_input_event.
// Perhaps it should just be called here instead.
pub(crate) fn dispatch_pending_point_input_events(&self) {
while let Some(mut event) = self.pending_point_input_events.borrow_mut().pop_front() {
// Events that do not need to do hit testing are sent directly to the
// constellation to filter down.
let Some(point) = event.point() else {
continue;
};
// If we can't find a pipeline to send this event to, we cannot continue.
let get_pipeline_details = |pipeline_id| self.pipelines.get(&pipeline_id);
let Ok(result) = self
.global
.borrow()
.hit_test_at_point(point, get_pipeline_details)
else {
// Don't need to process pending input events in this frame any more.
// TODO: Add multiple retry later if needed.
return;
};
match event {
InputEvent::Touch(ref mut touch_event) => {
touch_event.init_sequence_id(self.touch_handler.current_sequence_id);
},
InputEvent::MouseButton(_) | InputEvent::MouseMove(_) | InputEvent::Wheel(_) => {
self.global.borrow_mut().update_cursor(point, &result);
},
_ => unreachable!("Unexpected input event type: {event:?}"),
}
if let Err(error) = self.global.borrow().constellation_sender.send(
EmbedderToConstellationMessage::ForwardInputEvent(self.id, event, Some(result)),
) {
warn!("Sending event to constellation failed ({error:?}).");
}
}
}
pub(crate) fn notify_input_event(&mut self, event: InputEvent) {
if self.global.borrow().shutdown_state() != ShutdownState::NotShuttingDown {
return;
@@ -477,11 +421,11 @@ impl WebViewRenderer {
}
}
self.dispatch_point_input_event(event);
self.dispatch_input_event_with_hit_testing(event);
}
fn send_touch_event(&mut self, event: TouchEvent) -> bool {
self.dispatch_point_input_event(InputEvent::Touch(event))
self.dispatch_input_event_with_hit_testing(InputEvent::Touch(event))
}
pub(crate) fn on_touch_event(&mut self, event: TouchEvent) {
@@ -745,13 +689,15 @@ impl WebViewRenderer {
/// <http://w3c.github.io/touch-events/#mouse-events>
fn simulate_mouse_click(&mut self, point: DevicePoint) {
let button = MouseButton::Left;
self.dispatch_point_input_event(InputEvent::MouseMove(MouseMoveEvent::new(point)));
self.dispatch_point_input_event(InputEvent::MouseButton(MouseButtonEvent::new(
self.dispatch_input_event_with_hit_testing(InputEvent::MouseMove(MouseMoveEvent::new(
point,
)));
self.dispatch_input_event_with_hit_testing(InputEvent::MouseButton(MouseButtonEvent::new(
MouseButtonAction::Down,
button,
point,
)));
self.dispatch_point_input_event(InputEvent::MouseButton(MouseButtonEvent::new(
self.dispatch_input_event_with_hit_testing(InputEvent::MouseButton(MouseButtonEvent::new(
MouseButtonAction::Up,
button,
point,
@@ -762,21 +708,11 @@ impl WebViewRenderer {
&mut self,
scroll_location: ScrollLocation,
cursor: DeviceIntPoint,
event_type: TouchEventType,
) {
if self.global.borrow().shutdown_state() != ShutdownState::NotShuttingDown {
return;
}
match event_type {
TouchEventType::Move => self.on_scroll_window_event(scroll_location, cursor),
TouchEventType::Up | TouchEventType::Cancel => {
self.on_scroll_window_event(scroll_location, cursor);
},
TouchEventType::Down => {
self.on_scroll_window_event(scroll_location, cursor);
},
}
self.on_scroll_window_event(scroll_location, cursor);
}
fn on_scroll_window_event(&mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint) {
@@ -788,22 +724,6 @@ impl WebViewRenderer {
}));
}
/// Push scroll pending event when receiving wheel action from webdriver
pub(crate) fn on_webdriver_wheel_action(
&mut self,
scroll_delta: Vector2D<f32, DevicePixel>,
point: Point2D<f32, DevicePixel>,
) {
if self.global.borrow().shutdown_state() != ShutdownState::NotShuttingDown {
return;
}
let scroll_location =
ScrollLocation::Delta(LayoutVector2D::from_untyped(scroll_delta.to_untyped()));
let cursor = DeviceIntPoint::new(point.x as i32, point.y as i32);
self.on_scroll_window_event(scroll_location, cursor)
}
/// Process pending scroll events for this [`WebViewRenderer`]. Returns a tuple containing:
///
/// - A boolean that is true if a zoom occurred.
@@ -819,13 +739,16 @@ impl WebViewRenderer {
// Batch up all scroll events into one, or else we'll do way too much painting.
let mut combined_scroll_event: Option<ScrollEvent> = None;
let mut base_page_zoom = self.pinch_zoom_level().get();
let mut combined_magnification = 1.0;
for scroll_event in self.pending_scroll_zoom_events.drain(..) {
match scroll_event {
ScrollZoomEvent::PinchZoom(magnification) |
ScrollZoomEvent::ViewportZoom(magnification) => {
ScrollZoomEvent::PinchZoom(magnification) => {
combined_magnification *= magnification
},
ScrollZoomEvent::InitialViewportZoom(magnification) => {
base_page_zoom = magnification
},
ScrollZoomEvent::Scroll(scroll_event_info) => {
let combined_event = match combined_scroll_event.as_mut() {
None => {
@@ -872,24 +795,29 @@ impl WebViewRenderer {
combined_event.scroll_location,
)
});
if let Some(scroll_result) = scroll_result {
self.send_scroll_positions_to_layout_for_pipeline(scroll_result.pipeline_id);
if let Some(scroll_result) = scroll_result.clone() {
self.send_scroll_positions_to_layout_for_pipeline(
scroll_result.hit_test_result.pipeline_id,
);
self.dispatch_scroll_event(
scroll_result.external_scroll_id,
scroll_result.hit_test_result,
);
}
let pinch_zoom_result = match self
.set_pinch_zoom_level(self.pinch_zoom_level().get() * combined_magnification)
{
true => PinchZoomResult::DidPinchZoom,
false => PinchZoomResult::DidNotPinchZoom,
};
let pinch_zoom_result =
match self.set_pinch_zoom_level(base_page_zoom * combined_magnification) {
true => PinchZoomResult::DidPinchZoom,
false => PinchZoomResult::DidNotPinchZoom,
};
(pinch_zoom_result, scroll_result)
}
/// Perform a hit test at the given [`DevicePoint`] and apply the [`ScrollLocation`]
/// scrolling to the applicable scroll node under that point. If a scroll was
/// performed, returns the [`PipelineId`] of the node scrolled, the id, and the final
/// scroll delta.
/// performed, returns the hit test result contains [`PipelineId`] of the node
/// scrolled, the id, and the final scroll delta.
fn scroll_node_at_device_point(
&mut self,
cursor: DevicePoint,
@@ -908,38 +836,28 @@ impl WebViewRenderer {
ScrollLocation::Start | ScrollLocation::End => scroll_location,
};
let get_pipeline_details = |pipeline_id| self.pipelines.get(&pipeline_id);
let hit_test_results = self
.global
.borrow()
.hit_test_at_point_with_flags_and_pipeline(
cursor,
HitTestFlags::FIND_ALL,
None,
get_pipeline_details,
)
.unwrap_or_default();
.hit_test_at_point_with_flags(cursor, HitTestFlags::FIND_ALL);
// Iterate through all hit test results, processing only the first node of each pipeline.
// This is needed to propagate the scroll events from a pipeline representing an iframe to
// its ancestor pipelines.
let mut previous_pipeline_id = None;
for CompositorHitTestResult {
pipeline_id,
scroll_tree_node,
..
} in hit_test_results.iter()
{
let pipeline_details = self.pipelines.get_mut(pipeline_id)?;
if previous_pipeline_id.replace(pipeline_id) != Some(pipeline_id) {
for hit_test_result in hit_test_results.iter() {
let pipeline_details = self.pipelines.get_mut(&hit_test_result.pipeline_id)?;
if previous_pipeline_id.replace(&hit_test_result.pipeline_id) !=
Some(&hit_test_result.pipeline_id)
{
let scroll_result = pipeline_details.scroll_tree.scroll_node_or_ancestor(
scroll_tree_node,
&hit_test_result.external_scroll_id,
scroll_location,
ScrollType::InputEvents,
);
if let Some((external_scroll_id, offset)) = scroll_result {
return Some(ScrollResult {
pipeline_id: *pipeline_id,
hit_test_result: hit_test_result.clone(),
external_scroll_id,
offset,
});
@@ -949,8 +867,24 @@ impl WebViewRenderer {
None
}
fn dispatch_scroll_event(
&self,
external_id: ExternalScrollId,
hit_test_result: CompositorHitTestResult,
) {
let event = InputEvent::Scroll(EmbedderScrollEvent { external_id });
let msg = EmbedderToConstellationMessage::ForwardInputEvent(
self.id,
event,
Some(hit_test_result),
);
if let Err(e) = self.global.borrow().constellation_sender.send(msg) {
warn!("Sending scroll event to constellation failed ({:?}).", e);
}
}
pub(crate) fn pinch_zoom_level(&self) -> Scale<f32, DevicePixel, DevicePixel> {
Scale::new(self.viewport_zoom.get())
Scale::new(self.pinch_zoom.get())
}
fn set_pinch_zoom_level(&mut self, mut zoom: f32) -> bool {
@@ -958,19 +892,43 @@ impl WebViewRenderer {
zoom = viewport.clamp_zoom(zoom);
}
let old_zoom = std::mem::replace(&mut self.viewport_zoom, PinchZoomFactor::new(zoom));
old_zoom != self.viewport_zoom
let old_zoom = std::mem::replace(&mut self.pinch_zoom, PinchZoomFactor::new(zoom));
old_zoom != self.pinch_zoom
}
pub(crate) fn set_page_zoom(&mut self, magnification: f32) {
self.page_zoom =
Scale::new((self.page_zoom.get() * magnification).clamp(MIN_ZOOM, MAX_ZOOM));
pub(crate) fn page_zoom(&mut self) -> Scale<f32, CSSPixel, DeviceIndependentPixel> {
self.page_zoom
}
pub(crate) fn set_page_zoom(
&mut self,
new_page_zoom: Scale<f32, CSSPixel, DeviceIndependentPixel>,
) {
let new_page_zoom = new_page_zoom.clamp(MIN_PAGE_ZOOM, MAX_PAGE_ZOOM);
let old_zoom = std::mem::replace(&mut self.page_zoom, new_page_zoom);
if old_zoom != self.page_zoom {
self.send_window_size_message();
}
}
/// The scale to use when displaying this [`WebViewRenderer`] in WebRender
/// including both viewport scale (page zoom and hidpi scale) as well as any
/// pinch zoom applied. This is based on the latest display list received,
/// as page zoom changes are applied asynchronously and the rendered view
/// should reflect the latest display list.
pub(crate) fn device_pixels_per_page_pixel(&self) -> Scale<f32, CSSPixel, DevicePixel> {
self.page_zoom * self.hidpi_scale_factor * self.pinch_zoom_level()
let viewport_scale = self
.root_pipeline_id
.and_then(|pipeline_id| self.pipelines.get(&pipeline_id))
.and_then(|pipeline| pipeline.viewport_scale)
.unwrap_or_else(|| self.page_zoom * self.hidpi_scale_factor);
viewport_scale * self.pinch_zoom_level()
}
/// The current viewport scale (hidpi scale and page zoom and not pinch
/// zoom) based on the current setting of the WebView. Note that this may
/// not be the rendered viewport zoom as that is based on the latest display
/// list and zoom changes are applied asynchronously.
pub(crate) fn device_pixels_per_page_pixel_not_including_pinch_zoom(
&self,
) -> Scale<f32, CSSPixel, DevicePixel> {
@@ -1034,33 +992,9 @@ impl WebViewRenderer {
old_rect != self.rect
}
pub(crate) fn client_window_rect(
&self,
rendering_context_size: Size2D<u32, DevicePixel>,
) -> Box2D<i32, DeviceIndependentPixel> {
let screen_geometry = self.webview.screen_geometry().unwrap_or_default();
let rect = DeviceIntRect::from_origin_and_size(
screen_geometry.offset,
rendering_context_size.to_i32(),
)
.to_f32() /
self.hidpi_scale_factor;
rect.to_i32()
}
pub(crate) fn screen_size(&self) -> Size2D<i32, DeviceIndependentPixel> {
let screen_geometry = self.webview.screen_geometry().unwrap_or_default();
(screen_geometry.size.to_f32() / self.hidpi_scale_factor).to_i32()
}
pub(crate) fn available_screen_size(&self) -> Size2D<i32, DeviceIndependentPixel> {
let screen_geometry = self.webview.screen_geometry().unwrap_or_default();
(screen_geometry.available_size.to_f32() / self.hidpi_scale_factor).to_i32()
}
pub fn set_viewport_description(&mut self, viewport_description: ViewportDescription) {
self.pending_scroll_zoom_events
.push(ScrollZoomEvent::ViewportZoom(
.push(ScrollZoomEvent::InitialViewportZoom(
viewport_description
.clone()
.clamp_zoom(viewport_description.initial_scale.get()),

View File

@@ -34,6 +34,12 @@ fn servo_preferences_derive(input: synstructure::Structure) -> TokenStream {
set_match_cases.extend(quote!(stringify!(#name) => self.#name = value.try_into().unwrap(),))
}
let mut comparisons = quote!();
for field in named_fields.named.iter() {
let name = field.ident.as_ref().unwrap();
comparisons.extend(quote!(if self.#name != other.#name { changes.push((stringify!(#name), self.#name.clone().into(),)) }))
}
let structure_name = &ast.ident;
quote! {
impl #structure_name {
@@ -50,6 +56,12 @@ fn servo_preferences_derive(input: synstructure::Structure) -> TokenStream {
_ => { panic!("Unknown preference: {:?}", name); }
}
}
pub fn diff(&self, other: &Self) -> Vec<(&'static str, PrefValue)> {
let mut changes = vec![];
#comparisons
changes
}
}
}
}

View File

@@ -7,7 +7,7 @@
use std::default::Default;
use std::path::PathBuf;
use std::sync::{LazyLock, RwLock, RwLockReadGuard};
use std::sync::OnceLock;
use serde::{Deserialize, Serialize};
use servo_url::ServoUrl;
@@ -44,13 +44,13 @@ pub struct Opts {
/// behavior for debugging purposes.
pub debug: DebugOptions,
/// `None` to disable WebDriver or `Some` with a port number to start a server to listen to
/// remote WebDriver commands.
pub webdriver_port: Option<u16>,
/// Whether we're running in multiprocess mode.
pub multiprocess: bool,
/// Whether to force using ipc_channel instead of crossbeam_channel in singleprocess mode. Does
/// nothing in multiprocess mode.
pub force_ipc: bool,
/// Whether we want background hang monitor enabled or not
pub background_hang_monitor: bool,
@@ -110,6 +110,9 @@ pub struct DebugOptions {
/// Print the stacking context tree after each layout.
pub dump_stacking_context_tree: bool,
/// Print the scroll tree after each layout.
pub dump_scroll_tree: bool,
/// Print the display list after each layout.
pub dump_display_list: bool,
@@ -156,6 +159,7 @@ impl DebugOptions {
"dump-flow-tree" => self.dump_flow_tree = true,
"dump-rule-tree" => self.dump_rule_tree = true,
"dump-style-tree" => self.dump_style_tree = true,
"dump-scroll-tree" => self.dump_scroll_tree = true,
"gc-profile" => self.gc_profile = true,
"profile-script-events" => self.profile_script_events = true,
"relayout-event" => self.relayout_event = true,
@@ -188,8 +192,8 @@ impl Default for Opts {
nonincremental_layout: false,
user_stylesheets: Vec::new(),
hard_fail: true,
webdriver_port: None,
multiprocess: false,
force_ipc: false,
background_hang_monitor: false,
random_pipeline_closure_probability: None,
random_pipeline_closure_seed: None,
@@ -210,13 +214,27 @@ impl Default for Opts {
// Make Opts available globally. This saves having to clone and pass
// opts everywhere it is used, which gets particularly cumbersome
// when passing through the DOM structures.
static OPTIONS: LazyLock<RwLock<Opts>> = LazyLock::new(|| RwLock::new(Opts::default()));
static OPTIONS: OnceLock<Opts> = OnceLock::new();
pub fn set_options(opts: Opts) {
*OPTIONS.write().unwrap() = opts;
/// Initialize options.
///
/// Should only be called once at process startup.
/// Must be called before the first call to [get].
pub fn initialize_options(opts: Opts) {
OPTIONS.set(opts).expect("Already initialized");
}
/// Get the servo options
///
/// If the servo options have not been initialized by calling [initialize_options], then the
/// options will be initialized to default values. Outside of tests the options should
/// be explicitly initialized.
#[inline]
pub fn get() -> RwLockReadGuard<'static, Opts> {
OPTIONS.read().unwrap()
pub fn get() -> &'static Opts {
// In unit-tests using default options reduces boilerplate.
// We can't use `cfg(test)` since that only is enabled when this crate
// is compiled in test mode.
// We rely on the `expect` in `initialize_options` to inform us if refactoring
// causes a `get` call to move before `initialize_options`.
OPTIONS.get_or_init(Default::default)
}

View File

@@ -11,12 +11,22 @@ pub use crate::pref_util::PrefValue;
static PREFERENCES: RwLock<Preferences> = RwLock::new(Preferences::const_default());
pub trait Observer: Send + Sync {
fn prefs_changed(&self, _changes: &[(&'static str, PrefValue)]) {}
}
static OBSERVERS: RwLock<Vec<Box<dyn Observer>>> = RwLock::new(Vec::new());
#[inline]
/// Get the current set of global preferences for Servo.
pub fn get() -> RwLockReadGuard<'static, Preferences> {
PREFERENCES.read().unwrap()
}
pub fn add_observer(observer: Box<dyn Observer>) {
OBSERVERS.write().unwrap().push(observer);
}
pub fn set(preferences: Preferences) {
// Map between Stylo preference names and Servo preference names as the This should be
// kept in sync with components/script/dom/bindings/codegen/run.py which generates the
@@ -38,8 +48,18 @@ pub fn set(preferences: Preferences) {
"layout.container-queries.enabled",
preferences.layout_container_queries_enabled,
);
stylo_config::set_bool(
"layout.variable_fonts.enabled",
preferences.layout_variable_fonts_enabled,
);
let changed = preferences.diff(&PREFERENCES.read().unwrap());
*PREFERENCES.write().unwrap() = preferences;
for observer in &*OBSERVERS.read().unwrap() {
observer.prefs_changed(&changed);
}
}
/// A convenience macro for accessing a preference value using its static path.
@@ -69,14 +89,24 @@ pub struct Preferences {
/// List of comma-separated backends to be used by wgpu.
pub dom_webgpu_wgpu_backend: String,
pub dom_abort_controller_enabled: bool,
pub dom_adoptedstylesheet_enabled: bool,
pub dom_async_clipboard_enabled: bool,
pub dom_bluetooth_enabled: bool,
pub dom_bluetooth_testing_enabled: bool,
pub dom_allow_scripts_to_close_windows: bool,
pub dom_canvas_capture_enabled: bool,
pub dom_canvas_text_enabled: bool,
/// Selects canvas backend
///
/// Available values:
/// - ` `/`auto`
/// - raqote
/// - vello
/// - vello_cpu
pub dom_canvas_backend: String,
pub dom_clipboardevent_enabled: bool,
pub dom_composition_event_enabled: bool,
pub dom_cookiestore_enabled: bool,
pub dom_crypto_subtle_enabled: bool,
pub dom_customelements_enabled: bool,
pub dom_document_dblclick_timeout: i64,
@@ -84,11 +114,12 @@ pub struct Preferences {
pub dom_fontface_enabled: bool,
pub dom_fullscreen_test: bool,
pub dom_gamepad_enabled: bool,
pub dom_imagebitmap_enabled: bool,
pub dom_indexeddb_enabled: bool,
pub dom_intersection_observer_enabled: bool,
pub dom_microdata_testing_enabled: bool,
pub dom_mouse_event_which_enabled: bool,
pub dom_mutation_observer_enabled: bool,
pub dom_navigator_sendbeacon_enabled: bool,
pub dom_notification_enabled: bool,
pub dom_offscreen_canvas_enabled: bool,
pub dom_permissions_enabled: bool,
@@ -99,7 +130,6 @@ pub struct Preferences {
pub dom_serviceworker_timeout_seconds: i64,
pub dom_servo_helpers_enabled: bool,
pub dom_servoparser_async_html_tokenizer_enabled: bool,
pub dom_svg_enabled: bool,
pub dom_testable_crash_enabled: bool,
pub dom_testbinding_enabled: bool,
pub dom_testbinding_prefcontrolled_enabled: bool,
@@ -148,6 +178,8 @@ pub struct Preferences {
/// Whether or not subpixel antialiasing is enabled for text rendering.
pub gfx_subpixel_text_antialiasing_enabled: bool,
pub gfx_texture_swizzling_enabled: bool,
/// The amount of image keys we request per batch for the image cache.
pub image_key_batch_size: i64,
/// Whether or not the DOM inspector should show shadow roots of user-agent shadow trees
pub inspector_show_servo_internal_shadow_roots: bool,
pub js_asmjs_enabled: bool,
@@ -169,7 +201,6 @@ pub struct Preferences {
pub js_mem_gc_decommit_threshold_mb: i64,
pub js_mem_gc_dynamic_heap_growth_enabled: bool,
pub js_mem_gc_dynamic_mark_slice_enabled: bool,
pub js_mem_gc_empty_chunk_count_max: i64,
pub js_mem_gc_empty_chunk_count_min: i64,
pub js_mem_gc_high_frequency_heap_growth_max: i64,
pub js_mem_gc_high_frequency_heap_growth_min: i64,
@@ -185,7 +216,6 @@ pub struct Preferences {
pub js_mem_max: i64,
pub js_native_regex_enabled: bool,
pub js_offthread_compilation_enabled: bool,
pub js_parallel_parsing_enabled: bool,
pub js_shared_memory: bool,
pub js_throw_on_asmjs_validation_failure: bool,
pub js_throw_on_debuggee_would_run: bool,
@@ -202,6 +232,7 @@ pub struct Preferences {
pub layout_flexbox_enabled: bool,
pub layout_threads: i64,
pub layout_unimplemented: bool,
pub layout_variable_fonts_enabled: bool,
pub layout_writing_mode_enabled: bool,
/// Enable hardware acceleration for video playback.
pub media_glvideo_enabled: bool,
@@ -222,6 +253,8 @@ pub struct Preferences {
pub threadpools_fallback_worker_num: i64,
/// Maximum number of workers for the Image Cache thread pool
pub threadpools_image_cache_workers_max: i64,
/// Maximum number of workers for the IndexedDB thread pool
pub threadpools_indexeddb_workers_max: i64,
/// Maximum number of workers for the Networking async runtime thread pool
pub threadpools_async_runtime_workers_max: i64,
/// Maximum number of workers for the Core Resource Manager
@@ -242,14 +275,17 @@ impl Preferences {
devtools_server_enabled: false,
devtools_server_port: 0,
dom_abort_controller_enabled: false,
dom_adoptedstylesheet_enabled: false,
dom_allow_scripts_to_close_windows: false,
dom_async_clipboard_enabled: false,
dom_bluetooth_enabled: false,
dom_bluetooth_testing_enabled: false,
dom_canvas_capture_enabled: false,
dom_canvas_text_enabled: true,
dom_canvas_backend: String::new(),
dom_clipboardevent_enabled: true,
dom_composition_event_enabled: false,
dom_cookiestore_enabled: false,
dom_crypto_subtle_enabled: true,
dom_customelements_enabled: true,
dom_document_dblclick_dist: 1,
@@ -257,11 +293,12 @@ impl Preferences {
dom_fontface_enabled: false,
dom_fullscreen_test: false,
dom_gamepad_enabled: true,
dom_imagebitmap_enabled: false,
dom_indexeddb_enabled: false,
dom_intersection_observer_enabled: false,
dom_microdata_testing_enabled: false,
dom_mouse_event_which_enabled: false,
dom_mutation_observer_enabled: true,
dom_navigator_sendbeacon_enabled: false,
dom_notification_enabled: false,
dom_offscreen_canvas_enabled: false,
dom_permissions_enabled: false,
@@ -272,7 +309,6 @@ impl Preferences {
dom_serviceworker_timeout_seconds: 60,
dom_servo_helpers_enabled: false,
dom_servoparser_async_html_tokenizer_enabled: false,
dom_svg_enabled: false,
dom_testable_crash_enabled: false,
dom_testbinding_enabled: false,
dom_testbinding_prefcontrolled2_enabled: false,
@@ -322,6 +358,7 @@ impl Preferences {
gfx_text_antialiasing_enabled: true,
gfx_subpixel_text_antialiasing_enabled: true,
gfx_texture_swizzling_enabled: true,
image_key_batch_size: 10,
inspector_show_servo_internal_shadow_roots: false,
js_asmjs_enabled: true,
js_asyncstack: false,
@@ -341,7 +378,6 @@ impl Preferences {
js_mem_gc_decommit_threshold_mb: 32,
js_mem_gc_dynamic_heap_growth_enabled: true,
js_mem_gc_dynamic_mark_slice_enabled: true,
js_mem_gc_empty_chunk_count_max: 30,
js_mem_gc_empty_chunk_count_min: 1,
js_mem_gc_high_frequency_heap_growth_max: 300,
js_mem_gc_high_frequency_heap_growth_min: 150,
@@ -357,7 +393,6 @@ impl Preferences {
js_mem_max: -1,
js_native_regex_enabled: true,
js_offthread_compilation_enabled: true,
js_parallel_parsing_enabled: true,
js_shared_memory: true,
js_throw_on_asmjs_validation_failure: false,
js_throw_on_debuggee_would_run: false,
@@ -375,6 +410,7 @@ impl Preferences {
// TODO(mrobinson): This should likely be based on the number of processors.
layout_threads: 3,
layout_unimplemented: false,
layout_variable_fonts_enabled: false,
layout_writing_mode_enabled: false,
media_glvideo_enabled: false,
media_testing_enabled: false,
@@ -389,6 +425,7 @@ impl Preferences {
threadpools_async_runtime_workers_max: 6,
threadpools_fallback_worker_num: 3,
threadpools_image_cache_workers_max: 4,
threadpools_indexeddb_workers_max: 4,
threadpools_resource_workers_max: 4,
threadpools_webrender_workers_max: 4,
webgl_testing_context_creation_error: false,
@@ -444,12 +481,12 @@ impl UserAgentPlatform {
const ARCHITECTURE: &str = "";
format!(
"Mozilla/5.0 (Windows NT 10.0; Win64; {ARCHITECTURE}rv:128.0) Servo/{SERVO_VERSION} Firefox/128.0"
"Mozilla/5.0 (Windows NT 10.0; Win64; {ARCHITECTURE}rv:140.0) Servo/{SERVO_VERSION} Firefox/140.0"
)
},
UserAgentPlatform::Desktop if cfg!(target_os = "macos") => {
format!(
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Servo/{SERVO_VERSION} Firefox/128.0"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:140.0) Servo/{SERVO_VERSION} Firefox/140.0"
)
},
UserAgentPlatform::Desktop => {
@@ -460,19 +497,19 @@ impl UserAgentPlatform {
const ARCHITECTURE: &str = "i686";
format!(
"Mozilla/5.0 (X11; Linux {ARCHITECTURE}; rv:128.0) Servo/{SERVO_VERSION} Firefox/128.0"
"Mozilla/5.0 (X11; Linux {ARCHITECTURE}; rv:140.0) Servo/{SERVO_VERSION} Firefox/140.0"
)
},
UserAgentPlatform::Android => {
format!(
"Mozilla/5.0 (Android; Mobile; rv:128.0) Servo/{SERVO_VERSION} Firefox/128.0"
"Mozilla/5.0 (Android 10; Mobile; rv:140.0) Servo/{SERVO_VERSION} Firefox/140.0"
)
},
UserAgentPlatform::OpenHarmony => format!(
"Mozilla/5.0 (OpenHarmony; Mobile; rv:128.0) Servo/{SERVO_VERSION} Firefox/128.0"
"Mozilla/5.0 (OpenHarmony; Mobile; rv:140.0) Servo/{SERVO_VERSION} Firefox/140.0"
),
UserAgentPlatform::Ios => format!(
"Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X; rv:128.0) Servo/{SERVO_VERSION} Firefox/128.0"
"Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X; rv:140.0) Servo/{SERVO_VERSION} Firefox/140.0"
),
}
}

View File

@@ -14,8 +14,15 @@ path = "lib.rs"
[features]
bluetooth = ["bluetooth_traits"]
default = []
tracing = ["dep:tracing"]
tracing = ["dep:tracing", "canvas/tracing"]
webgpu = ["script_traits/webgpu"]
vello = ["canvas/vello"]
vello_cpu = ["canvas/vello_cpu"]
raqote = ["canvas/raqote"]
[lints.clippy]
unwrap_used = "deny"
panic = "deny"
[dependencies]
background_hang_monitor = { path = "../background_hang_monitor" }
@@ -23,6 +30,7 @@ background_hang_monitor_api = { workspace = true }
backtrace = { workspace = true }
base = { workspace = true }
bluetooth_traits = { workspace = true, optional = true }
canvas = { path = "../canvas" }
canvas_traits = { workspace = true }
compositing_traits = { workspace = true }
constellation_traits = { workspace = true }
@@ -30,9 +38,10 @@ crossbeam-channel = { workspace = true }
devtools_traits = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
fonts = { path = "../fonts" }
fonts = { path = "../fonts", default-features = false }
ipc-channel = { workspace = true }
keyboard-types = { workspace = true }
layout_api = { workspace = true }
log = { workspace = true }
media = { path = "../media" }
net = { path = "../net" }
@@ -40,7 +49,6 @@ net_traits = { workspace = true }
parking_lot = { workspace = true }
profile = { path = "../profile" }
profile_traits = { workspace = true }
script_layout_interface = { workspace = true }
script_traits = { workspace = true }
serde = { workspace = true }
servo_config = { path = "../config" }
@@ -53,6 +61,7 @@ webgpu_traits = { workspace = true }
webrender = { workspace = true }
webrender_api = { workspace = true }
webxr-api = { workspace = true, features = ["ipc"] }
servo-tracing = { workspace = true }
[target.'cfg(any(target_os="macos", all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_env="ohos"), not(target_arch="arm"), not(target_arch="aarch64"))))'.dependencies]
gaol = "0.2.1"

View File

@@ -0,0 +1,129 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::collections::HashMap;
use base::id::BroadcastChannelRouterId;
use constellation_traits::BroadcastChannelMsg;
use ipc_channel::ipc::IpcSender;
use log::warn;
use servo_url::ImmutableOrigin;
#[derive(Default)]
pub(crate) struct BroadcastChannels {
/// A map of broadcast routers to their IPC sender.
routers: HashMap<BroadcastChannelRouterId, IpcSender<BroadcastChannelMsg>>,
/// A map of origin to a map of channel name to a list of relevant routers.
channels: HashMap<ImmutableOrigin, HashMap<String, Vec<BroadcastChannelRouterId>>>,
}
impl BroadcastChannels {
/// Add a new broadcast router.
#[servo_tracing::instrument(skip_all)]
pub fn new_broadcast_channel_router(
&mut self,
router_id: BroadcastChannelRouterId,
broadcast_ipc_sender: IpcSender<BroadcastChannelMsg>,
) {
if self
.routers
.insert(router_id, broadcast_ipc_sender)
.is_some()
{
warn!("Multiple attempts to add BroadcastChannel router.");
}
}
/// Remove a broadcast router.
#[servo_tracing::instrument(skip_all)]
pub fn remove_broadcast_channel_router(&mut self, router_id: BroadcastChannelRouterId) {
if self.routers.remove(&router_id).is_none() {
warn!("Attempt to remove unknown BroadcastChannel router.");
}
// Also remove the router_id from the broadcast_channels list.
for channels in self.channels.values_mut() {
for routers in channels.values_mut() {
routers.retain(|router| router != &router_id);
}
}
}
/// Note a new channel-name relevant to a given broadcast router.
#[servo_tracing::instrument(skip_all)]
pub fn new_broadcast_channel_name_in_router(
&mut self,
router_id: BroadcastChannelRouterId,
channel_name: String,
origin: ImmutableOrigin,
) {
let channels = self.channels.entry(origin).or_default();
let routers = channels.entry(channel_name).or_default();
routers.push(router_id);
}
/// Remove a channel-name for a given broadcast router.
#[servo_tracing::instrument(skip_all)]
pub fn remove_broadcast_channel_name_in_router(
&mut self,
router_id: BroadcastChannelRouterId,
channel_name: String,
origin: ImmutableOrigin,
) {
if let Some(channels) = self.channels.get_mut(&origin) {
let is_empty = if let Some(routers) = channels.get_mut(&channel_name) {
routers.retain(|router| router != &router_id);
routers.is_empty()
} else {
return warn!(
"Multiple attempts to remove name for BroadcastChannel {:?} at {:?}",
channel_name, origin
);
};
if is_empty {
channels.remove(&channel_name);
}
} else {
warn!(
"Attempt to remove a channel name for an origin without channels {:?}",
origin
);
}
}
/// Broadcast a message via routers in various event-loops.
#[servo_tracing::instrument(skip_all)]
pub fn schedule_broadcast(
&self,
router_id: BroadcastChannelRouterId,
message: BroadcastChannelMsg,
) {
if let Some(channels) = self.channels.get(&message.origin) {
let routers = match channels.get(&message.channel_name) {
Some(routers) => routers,
None => return warn!("Broadcast to channel name without active routers."),
};
for router in routers {
// Exclude the sender of the broadcast.
// Broadcasting locally is done at the point of sending.
if router == &router_id {
continue;
}
if let Some(broadcast_ipc_sender) = self.routers.get(router) {
if broadcast_ipc_sender.send(message.clone()).is_err() {
warn!("Failed to broadcast message to router: {:?}", router);
}
} else {
warn!("No sender for broadcast router: {:?}", router);
}
}
} else {
warn!(
"Attempt to schedule a broadcast for an origin without routers {:?}",
message.origin
);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use base::id::BrowsingContextId;
use embedder_traits::Theme;
use std::collections::HashMap;
use base::id::{BrowsingContextId, PipelineId};
use embedder_traits::{InputEvent, MouseLeftViewportEvent, Theme};
use euclid::Point2D;
use log::warn;
use script_traits::{ConstellationInputEvent, ScriptThreadMessage};
use style_traits::CSSPixel;
use crate::browsingcontext::BrowsingContext;
use crate::pipeline::Pipeline;
use crate::session_history::JointSessionHistory;
/// The `Constellation`'s view of a `WebView` in the embedding layer. This tracks all of the
@@ -15,6 +23,14 @@ pub(crate) struct ConstellationWebView {
/// context.
pub focused_browsing_context_id: BrowsingContextId,
/// The [`BrowsingContextId`] of the currently hovered browsing context, to use for
/// knowing which frame is currently receiving cursor events.
pub hovered_browsing_context_id: Option<BrowsingContextId>,
/// The last mouse move point in the coordinate space of the Pipeline that it
/// happened int.
pub last_mouse_move_point: Point2D<f32, CSSPixel>,
/// The joint session history for this webview.
pub session_history: JointSessionHistory,
@@ -27,6 +43,8 @@ impl ConstellationWebView {
pub(crate) fn new(focused_browsing_context_id: BrowsingContextId) -> Self {
Self {
focused_browsing_context_id,
hovered_browsing_context_id: None,
last_mouse_move_point: Default::default(),
session_history: JointSessionHistory::new(),
theme: Theme::Light,
}
@@ -42,4 +60,93 @@ impl ConstellationWebView {
pub(crate) fn theme(&self) -> Theme {
self.theme
}
fn target_pipeline_id_for_input_event(
&self,
event: &ConstellationInputEvent,
browsing_contexts: &HashMap<BrowsingContextId, BrowsingContext>,
) -> Option<PipelineId> {
if let Some(hit_test_result) = &event.hit_test_result {
return Some(hit_test_result.pipeline_id);
}
// If there's no hit test, send the event to either the hovered or focused browsing context,
// depending on the event type.
let browsing_context_id = if matches!(event.event, InputEvent::MouseLeftViewport(_)) {
self.hovered_browsing_context_id
.unwrap_or(self.focused_browsing_context_id)
} else {
self.focused_browsing_context_id
};
Some(browsing_contexts.get(&browsing_context_id)?.pipeline_id)
}
pub(crate) fn forward_input_event(
&mut self,
event: ConstellationInputEvent,
pipelines: &HashMap<PipelineId, Pipeline>,
browsing_contexts: &HashMap<BrowsingContextId, BrowsingContext>,
) {
let Some(pipeline_id) = self.target_pipeline_id_for_input_event(&event, browsing_contexts)
else {
warn!("Unknown pipeline for input event. Ignoring.");
return;
};
let Some(pipeline) = pipelines.get(&pipeline_id) else {
warn!("Unknown pipeline id {pipeline_id:?} for input event. Ignoring.");
return;
};
let mut update_hovered_browsing_context =
|newly_hovered_browsing_context_id, focus_moving_to_another_iframe: bool| {
let old_hovered_context_id = std::mem::replace(
&mut self.hovered_browsing_context_id,
newly_hovered_browsing_context_id,
);
if old_hovered_context_id == newly_hovered_browsing_context_id {
return;
}
let Some(old_hovered_context_id) = old_hovered_context_id else {
return;
};
let Some(pipeline) = browsing_contexts
.get(&old_hovered_context_id)
.and_then(|browsing_context| pipelines.get(&browsing_context.pipeline_id))
else {
return;
};
let mut synthetic_mouse_leave_event = event.clone();
synthetic_mouse_leave_event.event =
InputEvent::MouseLeftViewport(MouseLeftViewportEvent {
focus_moving_to_another_iframe,
});
let _ = pipeline
.event_loop
.send(ScriptThreadMessage::SendInputEvent(
pipeline.id,
synthetic_mouse_leave_event,
));
};
if let InputEvent::MouseLeftViewport(_) = &event.event {
update_hovered_browsing_context(None, false);
return;
}
if let InputEvent::MouseMove(_) = &event.event {
update_hovered_browsing_context(Some(pipeline.browsing_context_id), true);
self.last_mouse_move_point = event
.hit_test_result
.as_ref()
.expect("MouseMove events should always have hit tests.")
.point_in_viewport;
}
let _ = pipeline
.event_loop
.send(ScriptThreadMessage::SendInputEvent(pipeline.id, event));
}
}

View File

@@ -11,15 +11,15 @@ use std::marker::PhantomData;
use std::rc::Rc;
use std::sync::atomic::{AtomicUsize, Ordering};
use base::generic_channel::GenericSender;
use ipc_channel::Error;
use ipc_channel::ipc::IpcSender;
use script_traits::ScriptThreadMessage;
static CURRENT_EVENT_LOOP_ID: AtomicUsize = AtomicUsize::new(0);
/// <https://html.spec.whatwg.org/multipage/#event-loop>
pub struct EventLoop {
script_chan: IpcSender<ScriptThreadMessage>,
script_chan: GenericSender<ScriptThreadMessage>,
dont_send_or_sync: PhantomData<Rc<()>>,
id: usize,
}
@@ -46,7 +46,7 @@ impl Drop for EventLoop {
impl EventLoop {
/// Create a new event loop from the channel to its script thread.
pub fn new(script_chan: IpcSender<ScriptThreadMessage>) -> Rc<EventLoop> {
pub fn new(script_chan: GenericSender<ScriptThreadMessage>) -> Rc<EventLoop> {
let id = CURRENT_EVENT_LOOP_ID.fetch_add(1, Ordering::Relaxed);
Rc::new(EventLoop {
script_chan,
@@ -57,6 +57,8 @@ impl EventLoop {
/// Send a message to the event loop.
pub fn send(&self, msg: ScriptThreadMessage) -> Result<(), Error> {
self.script_chan.send(msg)
self.script_chan
.send(msg)
.map_err(|_err| Box::new(ipc_channel::ErrorKind::Custom("SendError".into())))
}
}

View File

@@ -7,6 +7,7 @@
#[macro_use]
mod tracing;
mod broadcastchannel;
mod browsingcontext;
mod constellation;
mod constellation_webview;

View File

@@ -5,12 +5,14 @@
use std::collections::HashSet;
use std::rc::Rc;
use std::sync::Arc;
use std::thread::JoinHandle;
use background_hang_monitor::HangMonitorRegister;
use background_hang_monitor_api::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
};
use base::Epoch;
use base::generic_channel::{GenericReceiver, GenericSender};
use base::id::{
BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, WebViewId,
@@ -30,15 +32,15 @@ use fonts::{SystemFontServiceProxy, SystemFontServiceProxySender};
use ipc_channel::Error;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout_api::{LayoutFactory, ScriptThreadFactory};
use log::{debug, error, warn};
use media::WindowGLContext;
use net::image_cache::ImageCacheImpl;
use net_traits::ResourceThreads;
use net_traits::image_cache::ImageCache;
use net_traits::{CoreResourceThread, ResourceThreads};
use profile::system_reporter;
use profile_traits::mem::{ProfilerMsg, Reporter};
use profile_traits::{mem as profile_mem, time};
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
use script_traits::{
DiscardBrowsingContext, DocumentActivity, InitialScriptState, NewLayoutInfo,
ScriptThreadMessage,
@@ -208,6 +210,7 @@ pub struct NewPipeline {
pub pipeline: Pipeline,
pub bhm_control_chan: Option<IpcSender<BackgroundHangMonitorControlMsg>>,
pub lifeline: Option<(IpcReceiver<()>, Process)>,
pub join_handle: Option<JoinHandle<()>>,
}
impl Pipeline {
@@ -217,7 +220,7 @@ impl Pipeline {
) -> Result<NewPipeline, Error> {
// Note: we allow channel creation to panic, since recovering from this
// probably requires a general low-memory strategy.
let (script_chan, (bhm_control_chan, lifeline)) = match state.event_loop {
let (script_chan, (bhm_control_chan, lifeline, join_handle)) = match state.event_loop {
Some(script_chan) => {
let new_layout_info = NewLayoutInfo {
parent_info: state.parent_pipeline_id,
@@ -234,10 +237,11 @@ impl Pipeline {
{
warn!("Sending to script during pipeline creation failed ({})", e);
}
(script_chan, (None, None))
(script_chan, (None, None, None))
},
None => {
let (script_chan, script_port) = ipc::channel().expect("Pipeline script chan");
let (script_chan, script_port) =
base::generic_channel::channel().expect("Pipeline script chan");
// Route messages coming from content to devtools as appropriate.
let script_to_devtools_ipc_sender =
@@ -314,18 +318,18 @@ impl Pipeline {
ipc::channel().expect("Failed to create lifeline channel");
unprivileged_pipeline_content.lifeline_sender = Some(sender);
let process = unprivileged_pipeline_content.spawn_multiprocess()?;
(Some(bhm_control_chan), Some((receiver, process)))
(Some(bhm_control_chan), Some((receiver, process)), None)
} else {
// Should not be None in single-process mode.
let register = state
.background_monitor_register
.expect("Couldn't start content, no background monitor has been initiated");
unprivileged_pipeline_content.start_all::<STF>(
let join_handle = unprivileged_pipeline_content.start_all::<STF>(
false,
state.layout_factory,
register,
);
(None, None)
(None, None, Some(join_handle))
};
(EventLoop::new(script_chan), multiprocess_data)
@@ -346,6 +350,7 @@ impl Pipeline {
pipeline,
bhm_control_chan,
lifeline,
join_handle,
})
}
@@ -385,41 +390,20 @@ impl Pipeline {
pipeline
}
/// A normal exit of the pipeline, which waits for the compositor,
/// and delegates layout shutdown to the script thread.
pub fn exit(&self, discard_bc: DiscardBrowsingContext) {
debug!("pipeline {:?} exiting", self.id);
// The compositor wants to know when pipelines shut down too.
// It may still have messages to process from these other threads
// before they can be safely shut down.
// It's OK for the constellation to block on the compositor,
// since the compositor never blocks on the constellation.
if let Ok((sender, receiver)) = ipc::channel() {
self.compositor_proxy.send(CompositorMsg::PipelineExited(
self.webview_id,
self.id,
sender,
));
if let Err(e) = receiver.recv() {
warn!("Sending exit message failed ({:?}).", e);
}
}
/// Let the `ScriptThread` for this [`Pipeline`] know that it has exited. If the `ScriptThread` hasn't
/// panicked and is still alive, it will send a `PipelineExited` message back to the `Constellation`
/// when it finishes cleaning up.
pub fn send_exit_message_to_script(&self, discard_bc: DiscardBrowsingContext) {
debug!("{:?} Sending exit message to script", self.id);
// Script thread handles shutting down layout, and layout handles shutting down the painter.
// For now, if the script thread has failed, we give up on clean shutdown.
let msg = ScriptThreadMessage::ExitPipeline(self.id, discard_bc);
if let Err(e) = self.event_loop.send(msg) {
warn!("Sending script exit message failed ({}).", e);
}
}
/// A forced exit of the shutdown, which does not wait for the compositor,
/// or for the script thread to shut down layout.
pub fn force_exit(&self, discard_bc: DiscardBrowsingContext) {
let msg = ScriptThreadMessage::ExitPipeline(self.id, discard_bc);
if let Err(e) = self.event_loop.send(msg) {
warn!("Sending script exit message failed ({}).", e);
if let Err(error) = self.event_loop.send(ScriptThreadMessage::ExitPipeline(
self.webview_id,
self.id,
discard_bc,
)) {
warn!("Sending script exit message failed ({error}).");
}
}
@@ -500,9 +484,9 @@ pub struct UnprivilegedPipelineContent {
mem_profiler_chan: profile_mem::ProfilerChan,
viewport_details: ViewportDetails,
theme: Theme,
script_chan: IpcSender<ScriptThreadMessage>,
script_chan: GenericSender<ScriptThreadMessage>,
load_data: LoadData,
script_port: IpcReceiver<ScriptThreadMessage>,
script_port: GenericReceiver<ScriptThreadMessage>,
opts: Opts,
prefs: Box<Preferences>,
pipeline_namespace_id: PipelineNamespaceId,
@@ -521,7 +505,7 @@ impl UnprivilegedPipelineContent {
wait_for_completion: bool,
layout_factory: Arc<dyn LayoutFactory>,
background_hang_monitor_register: Box<dyn BackgroundHangMonitorRegister>,
) {
) -> JoinHandle<()> {
// Setup pipeline-namespace-installing for all threads in this process.
// Idempotent in single-process mode.
PipelineNamespace::set_installer_sender(self.namespace_request_sender);
@@ -531,7 +515,7 @@ impl UnprivilegedPipelineContent {
self.rippy_data,
));
let (content_process_shutdown_chan, content_process_shutdown_port) = unbounded();
STF::create(
let join_handle = STF::create(
InitialScriptState {
id: self.id,
browsing_context_id: self.browsing_context_id,
@@ -571,6 +555,8 @@ impl UnprivilegedPipelineContent {
Err(_) => error!("Script-thread shut-down unexpectedly"),
}
}
join_handle
}
pub fn spawn_multiprocess(self) -> Result<Process, Error> {
@@ -579,7 +565,7 @@ impl UnprivilegedPipelineContent {
pub fn register_with_background_hang_monitor(
&mut self,
) -> Box<dyn BackgroundHangMonitorRegister> {
) -> (Box<dyn BackgroundHangMonitorRegister>, JoinHandle<()>) {
HangMonitorRegister::init(
self.background_hang_monitor_to_constellation_chan.clone(),
self.bhm_control_port.take().expect("no sampling profiler?"),
@@ -591,6 +577,10 @@ impl UnprivilegedPipelineContent {
&self.script_to_constellation_chan
}
pub fn core_resource_thread(&self) -> &CoreResourceThread {
&self.resource_threads.core_thread
}
pub fn opts(&self) -> Opts {
self.opts.clone()
}

View File

@@ -2,10 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#[cfg(not(windows))]
use std::env;
use std::ffi::OsStr;
use std::process;
use std::{env, process};
#[cfg(any(
target_os = "macos",
@@ -142,10 +140,11 @@ pub fn content_process_sandbox_profile() {
}
#[cfg(any(
target_os = "windows",
target_os = "android",
target_env = "ohos",
target_arch = "arm",
all(target_arch = "aarch64", not(target_os = "windows"))
target_arch = "aarch64"
))]
pub fn spawn_multiprocess(content: UnprivilegedContent) -> Result<Process, Error> {
use ipc_channel::ipc::{IpcOneShotServer, IpcSender};
@@ -238,13 +237,12 @@ pub fn spawn_multiprocess(content: UnprivilegedContent) -> Result<Process, Error
Ok(process)
}
#[cfg(any(target_os = "windows", target_os = "ios"))]
#[cfg(target_os = "ios")]
pub fn spawn_multiprocess(_content: UnprivilegedContent) -> Result<Process, Error> {
log::error!("Multiprocess is not supported on Windows or iOS.");
log::error!("Multiprocess is not supported on iOS.");
process::exit(1);
}
#[cfg(not(windows))]
fn setup_common<C: CommandMethods>(command: &mut C, token: String) {
C::arg(command, "--content-process");
C::arg(command, token);

View File

@@ -50,9 +50,6 @@ mod from_compositor {
fn log_target(&self) -> &'static str {
match self {
Self::Exit => target!("Exit"),
Self::GetFocusTopLevelBrowsingContext(..) => {
target!("GetFocusTopLevelBrowsingContext")
},
Self::IsReadyToSaveImage(..) => target!("IsReadyToSaveImage"),
Self::AllowNavigationResponse(..) => target!("AllowNavigationResponse"),
Self::LoadUrl(..) => target!("LoadUrl"),
@@ -70,7 +67,7 @@ mod from_compositor {
Self::FocusWebView(..) => target!("FocusWebView"),
Self::BlurWebView => target!("BlurWebView"),
Self::ForwardInputEvent(_webview_id, event, ..) => event.log_target(),
Self::SetCursor(..) => target!("SetCursor"),
Self::RefreshCursor(..) => target!("RefreshCursor"),
Self::ToggleProfiler(..) => target!("EnableProfiler"),
Self::ExitFullScreen(_) => target!("ExitFullScreen"),
Self::MediaSessionAction(_) => target!("MediaSessionAction"),
@@ -79,6 +76,9 @@ mod from_compositor {
Self::PaintMetric(..) => target!("PaintMetric"),
Self::EvaluateJavaScript(..) => target!("EvaluateJavaScript"),
Self::CreateMemoryReport(..) => target!("CreateMemoryReport"),
Self::SendImageKeysForPipeline(..) => target!("SendImageKeysForPipeline"),
Self::SetWebDriverResponseSender(..) => target!("SetWebDriverResponseSender"),
Self::PreferencesUpdated(..) => target!("PreferencesUpdated"),
}
}
}
@@ -97,8 +97,10 @@ mod from_compositor {
InputEvent::Keyboard(..) => target_variant!("Keyboard"),
InputEvent::MouseButton(..) => target_variant!("MouseButton"),
InputEvent::MouseMove(..) => target_variant!("MouseMove"),
InputEvent::MouseLeftViewport(..) => target_variant!("MouseLeftViewport"),
InputEvent::Touch(..) => target_variant!("Touch"),
InputEvent::Wheel(..) => target_variant!("Wheel"),
InputEvent::Scroll(..) => target_variant!("Scroll"),
}
}
}
@@ -213,6 +215,9 @@ mod from_script {
Self::SetCursor(..) => target_variant!("SetCursor"),
Self::NewFavicon(..) => target_variant!("NewFavicon"),
Self::HistoryChanged(..) => target_variant!("HistoryChanged"),
Self::HistoryTraversalComplete(..) => target_variant!("HistoryTraversalComplete"),
Self::GetWindowRect(..) => target_variant!("GetWindowRect"),
Self::GetScreenMetrics(..) => target_variant!("GetScreenMetrics"),
Self::NotifyFullscreenStateChanged(..) => {
target_variant!("NotifyFullscreenStateChanged")
},

View File

@@ -67,11 +67,14 @@ impl<WebView> WebViewManager<WebView> {
}
}
pub fn focus(&mut self, webview_id: WebViewId) {
debug_assert!(self.webviews.contains_key(&webview_id));
pub fn focus(&mut self, webview_id: WebViewId) -> Result<(), ()> {
if !self.webviews.contains_key(&webview_id) {
return Err(());
}
self.focus_order.retain(|b| *b != webview_id);
self.focus_order.push(webview_id);
self.is_focused = true;
Ok(())
}
pub fn unfocus(&mut self) {
@@ -96,7 +99,7 @@ mod test {
webviews: &WebViewManager<WebView>,
) -> Vec<(WebViewId, WebView)> {
let mut keys = webviews.webviews.keys().collect::<Vec<_>>();
keys.sort();
keys.sort_unstable();
keys.iter()
.map(|&id| {
(
@@ -128,13 +131,13 @@ mod test {
assert_eq!(webviews.is_focused, false);
// focus() makes the given webview the latest in focus order.
webviews.focus(id(0, 2));
let _ = webviews.focus(id(0, 2));
assert_eq!(webviews.focus_order, vec![id(0, 2)]);
assert_eq!(webviews.is_focused, true);
webviews.focus(id(0, 1));
let _ = webviews.focus(id(0, 1));
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 1)]);
assert_eq!(webviews.is_focused, true);
webviews.focus(id(0, 3));
let _ = webviews.focus(id(0, 3));
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 1), id(0, 3)]);
assert_eq!(webviews.is_focused, true);
@@ -144,7 +147,7 @@ mod test {
assert_eq!(webviews.is_focused, false);
// focus() avoids duplicates in focus order, when the given webview has been focused before.
webviews.focus(id(0, 1));
let _ = webviews.focus(id(0, 1));
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 3), id(0, 1)]);
assert_eq!(webviews.is_focused, true);

View File

@@ -13,6 +13,7 @@ path = "lib.rs"
[dependencies]
base = { workspace = true }
base64 = { workspace = true }
chrono = { workspace = true }
crossbeam-channel = { workspace = true }
devtools_traits = { workspace = true }
@@ -21,6 +22,7 @@ headers = { workspace = true }
http = { workspace = true }
ipc-channel = { workspace = true }
log = { workspace = true }
net = { path = "../net" }
net_traits = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
@@ -29,5 +31,6 @@ servo_rand = { path = "../rand" }
servo_url = { path = "../url" }
uuid = { workspace = true }
[build-dependencies]
chrono = { workspace = true }

View File

@@ -10,16 +10,39 @@ use std::net::TcpStream;
use std::sync::{Arc, Mutex};
use base::cross_process_instant::CrossProcessInstant;
use log::debug;
use serde_json::{Map, Value};
use base::id::PipelineId;
use log::{debug, warn};
use serde_json::{Map, Value, json};
/// General actor system infrastructure.
use crate::StreamId;
use crate::protocol::{ClientRequest, JsonPacketStream};
#[derive(PartialEq)]
pub enum ActorMessageStatus {
Processed,
Ignored,
/// Error replies.
///
/// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#error-packets>
#[derive(Debug)]
pub enum ActorError {
MissingParameter,
BadParameterType,
UnrecognizedPacketType,
/// Custom errors, not defined in the protocol docs.
/// This includes send errors, and errors that prevent Servo from sending a reply.
Internal,
}
impl ActorError {
pub fn name(&self) -> &'static str {
match self {
ActorError::MissingParameter => "missingParameter",
ActorError::BadParameterType => "badParameterType",
ActorError::UnrecognizedPacketType => "unrecognizedPacketType",
// The devtools frontend always checks for specific protocol errors by catching a JS exception `e` whose
// message contains the error name, and checking `e.message.includes("someErrorName")`. As a result, the
// only error name we can safely use for custom errors is the empty string, because any other error name we
// use may be a substring of some upstream error name.
ActorError::Internal => "",
}
}
}
/// A common trait for all devtools actors that encompasses an immutable name
@@ -28,12 +51,12 @@ pub enum ActorMessageStatus {
pub(crate) trait Actor: Any + ActorAsAny {
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
stream_id: StreamId,
) -> Result<ActorMessageStatus, ()>;
) -> Result<(), ActorError>;
fn name(&self) -> String;
fn cleanup(&self, _id: StreamId) {}
}
@@ -58,6 +81,12 @@ pub struct ActorRegistry {
new_actors: RefCell<Vec<Box<dyn Actor + Send>>>,
old_actors: RefCell<Vec<String>>,
script_actors: RefCell<HashMap<String, String>>,
/// Lookup table for SourceActor names associated with a given PipelineId.
source_actor_names: RefCell<HashMap<PipelineId, Vec<String>>>,
/// Lookup table for inline source content associated with a given PipelineId.
inline_source_content: RefCell<HashMap<PipelineId, String>>,
shareable: Option<Arc<Mutex<ActorRegistry>>>,
next: Cell<u32>,
start_stamp: CrossProcessInstant,
@@ -71,6 +100,8 @@ impl ActorRegistry {
new_actors: RefCell::new(vec![]),
old_actors: RefCell::new(vec![]),
script_actors: RefCell::new(HashMap::new()),
source_actor_names: RefCell::new(HashMap::new()),
inline_source_content: RefCell::new(HashMap::new()),
shareable: None,
next: Cell::new(0),
start_stamp: CrossProcessInstant::now(),
@@ -164,8 +195,8 @@ impl ActorRegistry {
actor.actor_as_any_mut().downcast_mut::<T>().unwrap()
}
/// Attempt to process a message as directed by its `to` property. If the actor is not
/// found or does not indicate that it knew how to process the message, ignore the failure.
/// Attempt to process a message as directed by its `to` property. If the actor is not found, does not support the
/// message, or failed to handle the message, send an error reply instead.
pub(crate) fn handle_message(
&mut self,
msg: &Map<String, Value>,
@@ -181,17 +212,22 @@ impl ActorRegistry {
};
match self.actors.get(to) {
None => log::warn!("message received for unknown actor \"{}\"", to),
None => {
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#packets>
let msg = json!({ "from": to, "error": "noSuchActor" });
let _ = stream.write_json_packet(&msg);
},
Some(actor) => {
let msg_type = msg.get("type").unwrap().as_str().unwrap();
if actor.handle_message(self, msg_type, msg, stream, stream_id)? !=
ActorMessageStatus::Processed
{
log::warn!(
"unexpected message type \"{}\" found for actor \"{}\"",
msg_type,
to
);
if let Err(error) = ClientRequest::handle(stream, to, |req| {
actor.handle_message(req, self, msg_type, msg, stream_id)
}) {
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#error-packets>
let error = json!({
"from": actor.name(), "error": error.name()
});
warn!("Sending devtools protocol error: error={error:?} request={msg:?}");
let _ = stream.write_json_packet(&error);
}
},
}
@@ -215,4 +251,36 @@ impl ActorRegistry {
let mut actors = self.old_actors.borrow_mut();
actors.push(name);
}
pub fn register_source_actor(&self, pipeline_id: PipelineId, actor_name: &str) {
self.source_actor_names
.borrow_mut()
.entry(pipeline_id)
.or_default()
.push(actor_name.to_owned());
}
pub fn source_actor_names_for_pipeline(&mut self, pipeline_id: PipelineId) -> Vec<String> {
if let Some(source_actor_names) = self.source_actor_names.borrow_mut().get(&pipeline_id) {
return source_actor_names.clone();
}
vec![]
}
pub fn set_inline_source_content(&mut self, pipeline_id: PipelineId, content: String) {
assert!(
self.inline_source_content
.borrow_mut()
.insert(pipeline_id, content)
.is_none()
);
}
pub fn inline_source_content(&mut self, pipeline_id: PipelineId) -> Option<String> {
self.inline_source_content
.borrow()
.get(&pipeline_id)
.cloned()
}
}

View File

@@ -5,8 +5,8 @@
use serde::Serialize;
use crate::EmptyReplyMsg;
use crate::actor::{Actor, ActorMessageStatus};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError};
use crate::protocol::ClientRequest;
#[derive(Serialize)]
pub struct BreakpointListActorMsg {
@@ -24,27 +24,31 @@ impl Actor for BreakpointListActor {
fn handle_message(
&self,
request: ClientRequest,
_registry: &crate::actor::ActorRegistry,
msg_type: &str,
_msg: &serde_json::Map<String, serde_json::Value>,
stream: &mut std::net::TcpStream,
_stream_id: crate::StreamId,
) -> Result<crate::actor::ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
// Client wants to set a breakpoint.
// Seems to be infallible, unlike the thread actors `setBreakpoint`.
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#breakpoints>
"setBreakpoint" => {
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"setActiveEventBreakpoints" => {
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
"removeBreakpoint" => {
let msg = EmptyReplyMsg { from: self.name() };
request.reply_final(&msg)?
},
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}
@@ -52,4 +56,8 @@ impl BreakpointListActor {
pub fn new(name: String) -> Self {
Self { name }
}
pub fn encodable(&self) -> BreakpointListActorMsg {
BreakpointListActorMsg { actor: self.name() }
}
}

View File

@@ -20,7 +20,7 @@ use ipc_channel::ipc::{self, IpcSender};
use serde::Serialize;
use serde_json::{Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::inspector::InspectorActor;
use crate::actors::inspector::accessibility::AccessibilityActor;
use crate::actors::inspector::css_properties::CssPropertiesActor;
@@ -30,7 +30,7 @@ use crate::actors::tab::TabDescriptorActor;
use crate::actors::thread::ThreadActor;
use crate::actors::watcher::{SessionContext, SessionContextType, WatcherActor};
use crate::id::{DevtoolsBrowserId, DevtoolsBrowsingContextId, DevtoolsOuterWindowId, IdMap};
use crate::protocol::JsonPacketStream;
use crate::protocol::{ClientRequest, JsonPacketStream};
use crate::resource::ResourceAvailable;
use crate::{EmptyReplyMsg, StreamId};
@@ -166,29 +166,28 @@ impl Actor for BrowsingContextActor {
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"listFrames" => {
// TODO: Find out what needs to be listed here
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"listWorkers" => {
let _ = stream.write_json_packet(&ListWorkersReply {
request.reply_final(&ListWorkersReply {
from: self.name(),
// TODO: Find out what needs to be listed here
workers: vec![],
});
ActorMessageStatus::Processed
})?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
fn cleanup(&self, id: StreamId) {
@@ -353,8 +352,8 @@ impl BrowsingContextActor {
*self.title.borrow_mut() = title;
}
pub(crate) fn frame_update(&self, stream: &mut TcpStream) {
let _ = stream.write_json_packet(&FrameUpdateReply {
pub(crate) fn frame_update(&self, request: &mut ClientRequest) {
let _ = request.write_json_packet(&FrameUpdateReply {
from: self.name(),
type_: "frameUpdate".into(),
frames: vec![FrameUpdateMsg {

View File

@@ -25,12 +25,12 @@ use serde::Serialize;
use serde_json::{self, Map, Number, Value};
use uuid::Uuid;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::browsing_context::BrowsingContextActor;
use crate::actors::object::ObjectActor;
use crate::actors::worker::WorkerActor;
use crate::protocol::JsonPacketStream;
use crate::resource::ResourceAvailable;
use crate::protocol::{ClientRequest, JsonPacketStream};
use crate::resource::{ResourceArrayType, ResourceAvailable};
use crate::{StreamId, UniqueId};
trait EncodableConsoleMessage {
@@ -261,13 +261,12 @@ impl ConsoleActor {
.push(CachedConsoleMessage::PageError(page_error.clone()));
if id == self.current_unique_id(registry) {
if let Root::BrowsingContext(bc) = &self.root {
registry
.find::<BrowsingContextActor>(bc)
.resource_available(
PageErrorWrapper { page_error },
"error-message".into(),
stream,
)
registry.find::<BrowsingContextActor>(bc).resource_array(
PageErrorWrapper { page_error },
"error-message".into(),
ResourceArrayType::Available,
stream,
)
};
}
}
@@ -287,9 +286,12 @@ impl ConsoleActor {
.push(CachedConsoleMessage::ConsoleLog(log_message.clone()));
if id == self.current_unique_id(registry) {
if let Root::BrowsingContext(bc) = &self.root {
registry
.find::<BrowsingContextActor>(bc)
.resource_available(log_message, "console-message".into(), stream)
registry.find::<BrowsingContextActor>(bc).resource_array(
log_message,
"console-message".into(),
ResourceArrayType::Available,
stream,
)
};
}
}
@@ -302,18 +304,19 @@ impl Actor for ConsoleActor {
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"clearMessagesCache" => {
self.cached_events
.borrow_mut()
.remove(&self.current_unique_id(registry));
ActorMessageStatus::Processed
// FIXME: need to send a reply here!
return Err(ActorError::UnrecognizedPacketType);
},
"getCachedMessages" => {
@@ -366,12 +369,11 @@ impl Actor for ConsoleActor {
from: self.name(),
messages,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"startListeners" => {
//TODO: actually implement listener filters that support starting/stopping
// TODO: actually implement listener filters that support starting/stopping
let listeners = msg.get("listeners").unwrap().as_array().unwrap().to_owned();
let msg = StartedListenersReply {
from: self.name(),
@@ -382,12 +384,11 @@ impl Actor for ConsoleActor {
.collect(),
traits: StartedListenersTraits,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"stopListeners" => {
//TODO: actually implement listener filters that support starting/stopping
// TODO: actually implement listener filters that support starting/stopping
let msg = StopListenersReply {
from: self.name(),
stopped_listeners: msg
@@ -399,11 +400,10 @@ impl Actor for ConsoleActor {
.map(|listener| listener.as_str().unwrap().to_owned())
.collect(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
//TODO: implement autocompletion like onAutocomplete in
// TODO: implement autocompletion like onAutocomplete in
// http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/webconsole.js
"autocomplete" => {
let msg = AutocompleteReply {
@@ -411,14 +411,12 @@ impl Actor for ConsoleActor {
matches: vec![],
match_prop: "".to_owned(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"evaluateJS" => {
let msg = self.evaluate_js(registry, msg);
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"evaluateJSAsync" => {
@@ -429,14 +427,12 @@ impl Actor for ConsoleActor {
};
// Emit an eager reply so that the client starts listening
// for an async event with the resultID
if stream.write_json_packet(&early_reply).is_err() {
return Ok(ActorMessageStatus::Processed);
}
let stream = request.reply(&early_reply)?;
if msg.get("eager").and_then(|v| v.as_bool()).unwrap_or(false) {
// We don't support the side-effect free evaluation that eager evalaution
// really needs.
return Ok(ActorMessageStatus::Processed);
return Ok(());
}
let reply = self.evaluate_js(registry, msg).unwrap();
@@ -452,8 +448,7 @@ impl Actor for ConsoleActor {
helper_result: reply.helper_result,
};
// Send the data from evaluateJS along with a resultID
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
stream.write_json_packet(&msg)?
},
"setPreferences" => {
@@ -461,11 +456,11 @@ impl Actor for ConsoleActor {
from: self.name(),
updated: vec![],
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -2,14 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::{ActorDescription, JsonPacketStream, Method};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::{ActorDescription, ClientRequest, Method};
#[derive(Serialize)]
struct GetDescriptionReply {
@@ -46,13 +44,13 @@ impl Actor for DeviceActor {
}
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"getDescription" => {
let msg = GetDescriptionReply {
from: self.name(),
@@ -64,12 +62,12 @@ impl Actor for DeviceActor {
brand_name: "Servo".to_string(),
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::mem;
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg;
@@ -11,8 +10,9 @@ use ipc_channel::ipc::IpcSender;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::timeline::HighResolutionStamp;
use crate::protocol::ClientRequest;
pub struct FramerateActor {
name: String,
@@ -29,13 +29,13 @@ impl Actor for FramerateActor {
fn handle_message(
&self,
_request: ClientRequest,
_registry: &ActorRegistry,
_msg_type: &str,
_msg: &Map<String, Value>,
_stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Ignored)
) -> Result<(), ActorError> {
Err(ActorError::UnrecognizedPacketType)
}
}

View File

@@ -6,7 +6,6 @@
use std::cell::RefCell;
use std::collections::HashMap;
use std::net::TcpStream;
use devtools_traits::DevtoolScriptControlMsg;
use devtools_traits::DevtoolScriptControlMsg::GetRootNode;
@@ -15,13 +14,13 @@ use serde::Serialize;
use serde_json::{self, Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::browsing_context::BrowsingContextActor;
use crate::actors::inspector::highlighter::{HighlighterActor, HighlighterMsg};
use crate::actors::inspector::node::NodeInfoToProtocol;
use crate::actors::inspector::page_style::{PageStyleActor, PageStyleMsg};
use crate::actors::inspector::walker::{WalkerActor, WalkerMsg};
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
pub mod accessibility;
pub mod css_properties;
@@ -73,19 +72,19 @@ impl Actor for InspectorActor {
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
) -> Result<(), ActorError> {
let browsing_context = registry.find::<BrowsingContextActor>(&self.browsing_context);
let pipeline = browsing_context.active_pipeline_id.get();
Ok(match msg_type {
match msg_type {
"getWalker" => {
let (tx, rx) = ipc::channel().unwrap();
self.script_chan.send(GetRootNode(pipeline, tx)).unwrap();
let root_info = rx.recv().unwrap().ok_or(())?;
let root_info = rx.recv().unwrap().ok_or(ActorError::Internal)?;
let name = self
.walker
@@ -93,13 +92,8 @@ impl Actor for InspectorActor {
.clone()
.unwrap_or_else(|| registry.new_name("walker"));
let root = root_info.encode(
registry,
false,
self.script_chan.clone(),
pipeline,
name.clone(),
);
let root =
root_info.encode(registry, self.script_chan.clone(), pipeline, name.clone());
if self.walker.borrow().is_none() {
let walker = WalkerActor {
@@ -121,8 +115,7 @@ impl Actor for InspectorActor {
root,
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getPageStyle" => {
@@ -149,8 +142,7 @@ impl Actor for InspectorActor {
]),
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"supportsHighlighters" => {
@@ -158,8 +150,7 @@ impl Actor for InspectorActor {
from: self.name(),
value: true,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getHighlighterByType" => {
@@ -180,11 +171,10 @@ impl Actor for InspectorActor {
actor: self.highlighter.borrow().clone().unwrap(),
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -5,14 +5,12 @@
//! The Accessibility actor is responsible for the Accessibility tab in the DevTools page. Right
//! now it is a placeholder for future functionality.
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
#[derive(Serialize)]
struct BootstrapState {
@@ -75,20 +73,19 @@ impl Actor for AccessibilityActor {
/// inspector Walker actor)
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"bootstrap" => {
let msg = BootstrapReply {
from: self.name(),
state: BootstrapState { enabled: false },
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getSimulator" => {
// TODO: Create actual simulator
@@ -97,8 +94,7 @@ impl Actor for AccessibilityActor {
from: self.name(),
simulator: ActorMsg { actor: simulator },
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getTraits" => {
let msg = GetTraitsReply {
@@ -107,8 +103,7 @@ impl Actor for AccessibilityActor {
tabbing_order: true,
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getWalker" => {
// TODO: Create actual accessible walker
@@ -117,11 +112,11 @@ impl Actor for AccessibilityActor {
from: self.name(),
walker: ActorMsg { actor: walker },
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -6,15 +6,14 @@
//! alternative names
use std::collections::HashMap;
use std::net::TcpStream;
use devtools_traits::CssDatabaseProperty;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
pub struct CssPropertiesActor {
name: String,
@@ -38,23 +37,20 @@ impl Actor for CssPropertiesActor {
/// inspector can show the available options
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
"getCSSDatabase" => {
let _ = stream.write_json_packet(&GetCssDatabaseReply {
from: self.name(),
properties: &self.properties,
});
ActorMessageStatus::Processed
},
_ => ActorMessageStatus::Ignored,
})
) -> Result<(), ActorError> {
match msg_type {
"getCSSDatabase" => request.reply_final(&GetCssDatabaseReply {
from: self.name(),
properties: &self.properties,
})?,
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -5,16 +5,14 @@
//! Handles highlighting selected DOM nodes in the inspector. At the moment it only replies and
//! changes nothing on Servo's side.
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg;
use ipc_channel::ipc::IpcSender;
use serde::Serialize;
use serde_json::{self, Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
use crate::{EmptyReplyMsg, StreamId};
#[derive(Serialize)]
@@ -46,22 +44,20 @@ impl Actor for HighlighterActor {
/// - `hide`: Disables highlighting for the selected node
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"show" => {
let Some(node_actor) = msg.get("node") else {
// TODO: send missing parameter error
return Ok(ActorMessageStatus::Ignored);
return Err(ActorError::MissingParameter);
};
let Some(node_actor_name) = node_actor.as_str() else {
// TODO: send invalid parameter error
return Ok(ActorMessageStatus::Ignored);
return Err(ActorError::BadParameterType);
};
if node_actor_name.starts_with("inspector") {
@@ -71,8 +67,7 @@ impl Actor for HighlighterActor {
from: self.name(),
value: false,
};
let _ = stream.write_json_packet(&msg);
return Ok(ActorMessageStatus::Processed);
return request.reply_final(&msg);
}
self.instruct_script_thread_to_highlight_node(
@@ -83,20 +78,19 @@ impl Actor for HighlighterActor {
from: self.name(),
value: true,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"hide" => {
self.instruct_script_thread_to_highlight_node(None, registry);
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -5,14 +5,12 @@
//! The layout actor informs the DevTools client of the layout properties of the document, such as
//! grids or flexboxes. It acts as a placeholder for now.
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
#[derive(Serialize)]
pub struct LayoutInspectorActorMsg {
@@ -47,21 +45,20 @@ impl Actor for LayoutInspectorActor {
/// - `getCurrentFlexbox`: Returns the active flexbox, non functional at the moment
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"getGrids" => {
let msg = GetGridsReply {
from: self.name(),
// TODO: Actually create a list of grids
grids: vec![],
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getCurrentFlexbox" => {
let msg = GetCurrentFlexboxReply {
@@ -69,12 +66,14 @@ impl Actor for LayoutInspectorActor {
// TODO: Create and return the current flexbox object
flexbox: None,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
fn cleanup(&self, _id: StreamId) {}
}
impl LayoutInspectorActor {

View File

@@ -7,7 +7,6 @@
use std::cell::RefCell;
use std::collections::HashMap;
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg::{GetChildren, GetDocumentElement, ModifyAttribute};
@@ -16,9 +15,9 @@ use ipc_channel::ipc::{self, IpcSender};
use serde::Serialize;
use serde_json::{self, Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::inspector::walker::WalkerActor;
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
use crate::{EmptyReplyMsg, StreamId};
/// Text node type constant. This is defined again to avoid depending on `script`, where it is defined originally.
@@ -60,6 +59,9 @@ pub struct NodeActorMsg {
is_anonymous: bool,
is_before_pseudo_element: bool,
is_direct_shadow_host_child: Option<bool>,
/// Whether or not this node is displayed.
///
/// Setting this value to `false` will cause the devtools to render the node name in gray.
is_displayed: bool,
#[serde(rename = "isInHTMLDocument")]
is_in_html_document: Option<bool>,
@@ -113,15 +115,19 @@ impl Actor for NodeActor {
/// - `getUniqueSelector`: Returns the display name of this node
fn handle_message(
&self,
mut request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"modifyAttributes" => {
let mods = msg.get("modifications").ok_or(())?.as_array().ok_or(())?;
let mods = msg
.get("modifications")
.ok_or(ActorError::MissingParameter)?
.as_array()
.ok_or(ActorError::BadParameterType)?;
let modifications: Vec<_> = mods
.iter()
.filter_map(|json_mod| {
@@ -130,7 +136,7 @@ impl Actor for NodeActor {
.collect();
let walker = registry.find::<WalkerActor>(&self.walker);
walker.new_mutations(stream, &self.name, &modifications);
walker.new_mutations(&mut request, &self.name, &modifications);
self.script_chan
.send(ModifyAttribute(
@@ -138,11 +144,10 @@ impl Actor for NodeActor {
registry.actor_to_script(self.name()),
modifications,
))
.map_err(|_| ())?;
.map_err(|_| ActorError::Internal)?;
let reply = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
"getUniqueSelector" => {
@@ -150,10 +155,12 @@ impl Actor for NodeActor {
self.script_chan
.send(GetDocumentElement(self.pipeline, tx))
.unwrap();
let doc_elem_info = rx.recv().map_err(|_| ())?.ok_or(())?;
let doc_elem_info = rx
.recv()
.map_err(|_| ActorError::Internal)?
.ok_or(ActorError::Internal)?;
let node = doc_elem_info.encode(
registry,
true,
self.script_chan.clone(),
self.pipeline,
self.walker.clone(),
@@ -163,12 +170,12 @@ impl Actor for NodeActor {
from: self.name(),
value: node.display_name,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}
@@ -176,7 +183,6 @@ pub trait NodeInfoToProtocol {
fn encode(
self,
actors: &ActorRegistry,
display: bool,
script_chan: IpcSender<DevtoolScriptControlMsg>,
pipeline: PipelineId,
walker: String,
@@ -187,7 +193,6 @@ impl NodeInfoToProtocol for NodeInfo {
fn encode(
self,
actors: &ActorRegistry,
display: bool,
script_chan: IpcSender<DevtoolScriptControlMsg>,
pipeline: PipelineId,
walker: String,
@@ -234,7 +239,7 @@ impl NodeInfoToProtocol for NodeInfo {
let mut children = rx.recv().ok()??;
let child = children.pop()?;
let msg = child.encode(actors, true, script_chan.clone(), pipeline, walker);
let msg = child.encode(actors, script_chan.clone(), pipeline, walker);
// If the node child is not a text node, do not represent it inline.
if msg.node_type != TEXT_NODE {
@@ -262,7 +267,7 @@ impl NodeInfoToProtocol for NodeInfo {
is_anonymous: false,
is_before_pseudo_element: false,
is_direct_shadow_host_child: None,
is_displayed: display,
is_displayed: self.is_displayed,
is_in_html_document: Some(true),
is_marker_pseudo_element: false,
is_native_anonymous: false,

View File

@@ -8,7 +8,6 @@
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::iter::once;
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg::{GetLayout, GetSelectors};
@@ -18,11 +17,11 @@ use serde::Serialize;
use serde_json::{self, Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::inspector::node::NodeActor;
use crate::actors::inspector::style_rule::{AppliedRule, ComputedDeclaration, StyleRuleActor};
use crate::actors::inspector::walker::{WalkerActor, find_child};
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
#[derive(Serialize)]
struct GetAppliedReply {
@@ -114,30 +113,34 @@ impl Actor for PageStyleActor {
/// - `isPositionEditable`: Informs whether you can change a style property in the inspector.
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
"getApplied" => self.get_applied(msg, registry, stream)?,
"getComputed" => self.get_computed(msg, registry, stream)?,
"getLayout" => self.get_layout(msg, registry, stream)?,
"isPositionEditable" => self.is_position_editable(stream),
_ => ActorMessageStatus::Ignored,
})
) -> Result<(), ActorError> {
match msg_type {
"getApplied" => self.get_applied(request, msg, registry),
"getComputed" => self.get_computed(request, msg, registry),
"getLayout" => self.get_layout(request, msg, registry),
"isPositionEditable" => self.is_position_editable(request),
_ => Err(ActorError::UnrecognizedPacketType),
}
}
}
impl PageStyleActor {
fn get_applied(
&self,
request: ClientRequest,
msg: &Map<String, Value>,
registry: &ActorRegistry,
stream: &mut TcpStream,
) -> Result<ActorMessageStatus, ()> {
let target = msg.get("node").ok_or(())?.as_str().ok_or(())?;
) -> Result<(), ActorError> {
let target = msg
.get("node")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
let node = registry.find::<NodeActor>(target);
let walker = registry.find::<WalkerActor>(&node.walker);
let entries: Vec<_> = find_child(
@@ -172,59 +175,61 @@ impl PageStyleActor {
// For each selector (plus an empty one that represents the style attribute)
// get all of the rules associated with it.
let entries =
once(("".into(), usize::MAX))
.chain(selectors)
.filter_map(move |selector| {
let rule = match node_actor.style_rules.borrow_mut().entry(selector) {
Entry::Vacant(e) => {
let name = registry.new_name("style-rule");
let actor = StyleRuleActor::new(
name.clone(),
node_actor.name(),
(!e.key().0.is_empty()).then_some(e.key().clone()),
);
let rule = actor.applied(registry)?;
registry.register_later(Box::new(actor));
e.insert(name);
rule
},
Entry::Occupied(e) => {
let actor = registry.find::<StyleRuleActor>(e.get());
actor.applied(registry)?
},
};
if inherited.is_some() && rule.declarations.is_empty() {
return None;
}
once(("".into(), usize::MAX))
.chain(selectors)
.filter_map(move |selector| {
let rule = match node_actor.style_rules.borrow_mut().entry(selector) {
Entry::Vacant(e) => {
let name = registry.new_name("style-rule");
let actor = StyleRuleActor::new(
name.clone(),
node_actor.name(),
(!e.key().0.is_empty()).then_some(e.key().clone()),
);
let rule = actor.applied(registry)?;
Some(AppliedEntry {
rule,
// TODO: Handle pseudo elements
pseudo_element: None,
is_system: false,
inherited: inherited.clone(),
})
});
entries
registry.register_later(Box::new(actor));
e.insert(name);
rule
},
Entry::Occupied(e) => {
let actor = registry.find::<StyleRuleActor>(e.get());
actor.applied(registry)?
},
};
if inherited.is_some() && rule.declarations.is_empty() {
return None;
}
Some(AppliedEntry {
rule,
// TODO: Handle pseudo elements
pseudo_element: None,
is_system: false,
inherited: inherited.clone(),
})
})
})
.collect();
let msg = GetAppliedReply {
entries,
from: self.name(),
};
let _ = stream.write_json_packet(&msg);
Ok(ActorMessageStatus::Processed)
request.reply_final(&msg)
}
fn get_computed(
&self,
request: ClientRequest,
msg: &Map<String, Value>,
registry: &ActorRegistry,
stream: &mut TcpStream,
) -> Result<ActorMessageStatus, ()> {
let target = msg.get("node").ok_or(())?.as_str().ok_or(())?;
) -> Result<(), ActorError> {
let target = msg
.get("node")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
let node_actor = registry.find::<NodeActor>(target);
let computed = (|| match node_actor
.style_rules
@@ -249,18 +254,22 @@ impl PageStyleActor {
computed,
from: self.name(),
};
let _ = stream.write_json_packet(&msg);
Ok(ActorMessageStatus::Processed)
request.reply_final(&msg)
}
fn get_layout(
&self,
request: ClientRequest,
msg: &Map<String, Value>,
registry: &ActorRegistry,
stream: &mut TcpStream,
) -> Result<ActorMessageStatus, ()> {
let target = msg.get("node").ok_or(())?.as_str().ok_or(())?;
let (computed_node_sender, computed_node_receiver) = ipc::channel().map_err(|_| ())?;
) -> Result<(), ActorError> {
let target = msg
.get("node")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
let (computed_node_sender, computed_node_receiver) =
ipc::channel().map_err(|_| ActorError::Internal)?;
self.script_chan
.send(GetLayout(
self.pipeline,
@@ -288,7 +297,10 @@ impl PageStyleActor {
padding_left,
width,
height,
} = computed_node_receiver.recv().map_err(|_| ())?.ok_or(())?;
} = computed_node_receiver
.recv()
.map_err(|_| ActorError::Internal)?
.ok_or(ActorError::Internal)?;
let msg_auto_margins = msg
.get("autoMargins")
.and_then(Value::as_bool)
@@ -333,18 +345,16 @@ impl PageStyleActor {
width,
height,
};
let msg = serde_json::to_string(&msg).map_err(|_| ())?;
let msg = serde_json::from_str::<Value>(&msg).map_err(|_| ())?;
let _ = stream.write_json_packet(&msg);
Ok(ActorMessageStatus::Processed)
let msg = serde_json::to_string(&msg).map_err(|_| ActorError::Internal)?;
let msg = serde_json::from_str::<Value>(&msg).map_err(|_| ActorError::Internal)?;
request.reply_final(&msg)
}
fn is_position_editable(&self, stream: &mut TcpStream) -> ActorMessageStatus {
fn is_position_editable(&self, request: ClientRequest) -> Result<(), ActorError> {
let msg = IsPositionEditableReply {
from: self.name(),
value: false,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)
}
}

View File

@@ -7,7 +7,6 @@
//! A group is either the html style attribute or one selector from one stylesheet.
use std::collections::HashMap;
use std::net::TcpStream;
use devtools_traits::DevtoolScriptControlMsg::{
GetAttributeStyle, GetComputedStyle, GetDocumentElement, GetStylesheetStyle, ModifyRule,
@@ -17,10 +16,10 @@ use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::inspector::node::NodeActor;
use crate::actors::inspector::walker::WalkerActor;
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
const ELEMENT_STYLE_TYPE: u32 = 100;
@@ -98,16 +97,20 @@ impl Actor for StyleRuleActor {
/// when returning the list of rules.
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"setRuleText" => {
// Parse the modifications sent from the client
let mods = msg.get("modifications").ok_or(())?.as_array().ok_or(())?;
let mods = msg
.get("modifications")
.ok_or(ActorError::MissingParameter)?
.as_array()
.ok_or(ActorError::BadParameterType)?;
let modifications: Vec<_> = mods
.iter()
.filter_map(|json_mod| {
@@ -125,13 +128,13 @@ impl Actor for StyleRuleActor {
registry.actor_to_script(self.node.clone()),
modifications,
))
.map_err(|_| ())?;
.map_err(|_| ActorError::Internal)?;
let _ = stream.write_json_packet(&self.encodable(registry));
ActorMessageStatus::Processed
request.reply_final(&self.encodable(registry))?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -5,7 +5,6 @@
//! The walker actor is responsible for traversing the DOM tree in various ways to create new nodes
use std::cell::RefCell;
use std::net::TcpStream;
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg::{GetChildren, GetDocumentElement};
@@ -14,10 +13,10 @@ use ipc_channel::ipc::{self, IpcSender};
use serde::Serialize;
use serde_json::{self, Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::inspector::layout::{LayoutInspectorActor, LayoutInspectorActorMsg};
use crate::actors::inspector::node::{NodeActorMsg, NodeInfoToProtocol};
use crate::protocol::JsonPacketStream;
use crate::protocol::{ClientRequest, JsonPacketStream};
use crate::{EmptyReplyMsg, StreamId};
#[derive(Serialize)]
@@ -64,7 +63,7 @@ struct GetLayoutInspectorReply {
}
#[derive(Serialize)]
struct WatchRootNodeReply {
struct WatchRootNodeNotification {
#[serde(rename = "type")]
type_: String,
from: String,
@@ -94,7 +93,7 @@ struct GetOffsetParentReply {
}
#[derive(Serialize)]
struct NewMutationsReply {
struct NewMutationsNotification {
from: String,
#[serde(rename = "type")]
type_: String,
@@ -123,24 +122,31 @@ impl Actor for WalkerActor {
/// node and its ascendents
fn handle_message(
&self,
mut request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"children" => {
let target = msg.get("node").ok_or(())?.as_str().ok_or(())?;
let (tx, rx) = ipc::channel().map_err(|_| ())?;
let target = msg
.get("node")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
let (tx, rx) = ipc::channel().map_err(|_| ActorError::Internal)?;
self.script_chan
.send(GetChildren(
self.pipeline,
registry.actor_to_script(target.into()),
tx,
))
.map_err(|_| ())?;
let children = rx.recv().map_err(|_| ())?.ok_or(())?;
.map_err(|_| ActorError::Internal)?;
let children = rx
.recv()
.map_err(|_| ActorError::Internal)?
.ok_or(ActorError::Internal)?;
let msg = ChildrenReply {
has_first: true,
@@ -150,7 +156,6 @@ impl Actor for WalkerActor {
.map(|child| {
child.encode(
registry,
true,
self.script_chan.clone(),
self.pipeline,
self.name(),
@@ -159,23 +164,23 @@ impl Actor for WalkerActor {
.collect(),
from: self.name(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"clearPseudoClassLocks" => {
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"documentElement" => {
let (tx, rx) = ipc::channel().map_err(|_| ())?;
let (tx, rx) = ipc::channel().map_err(|_| ActorError::Internal)?;
self.script_chan
.send(GetDocumentElement(self.pipeline, tx))
.map_err(|_| ())?;
let doc_elem_info = rx.recv().map_err(|_| ())?.ok_or(())?;
.map_err(|_| ActorError::Internal)?;
let doc_elem_info = rx
.recv()
.map_err(|_| ActorError::Internal)?
.ok_or(ActorError::Internal)?;
let node = doc_elem_info.encode(
registry,
true,
self.script_chan.clone(),
self.pipeline,
self.name(),
@@ -185,8 +190,7 @@ impl Actor for WalkerActor {
from: self.name(),
node,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getLayoutInspector" => {
// TODO: Create actual layout inspector actor
@@ -198,8 +202,7 @@ impl Actor for WalkerActor {
from: self.name(),
actor,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getMutations" => {
let msg = GetMutationsReply {
@@ -216,20 +219,26 @@ impl Actor for WalkerActor {
})
.collect(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getOffsetParent" => {
let msg = GetOffsetParentReply {
from: self.name(),
node: None,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"querySelector" => {
let selector = msg.get("selector").ok_or(())?.as_str().ok_or(())?;
let node = msg.get("node").ok_or(())?.as_str().ok_or(())?;
let selector = msg
.get("selector")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
let node = msg
.get("node")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
let mut hierarchy = find_child(
&self.script_chan,
self.pipeline,
@@ -239,39 +248,38 @@ impl Actor for WalkerActor {
vec![],
|msg| msg.display_name == selector,
)
.map_err(|_| ())?;
.map_err(|_| ActorError::Internal)?;
hierarchy.reverse();
let node = hierarchy.pop().ok_or(())?;
let node = hierarchy.pop().ok_or(ActorError::Internal)?;
let msg = QuerySelectorReply {
from: self.name(),
node,
new_parents: hierarchy,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"watchRootNode" => {
let msg = WatchRootNodeReply {
let msg = WatchRootNodeNotification {
type_: "root-available".into(),
from: self.name(),
node: self.root_node.clone(),
};
let _ = stream.write_json_packet(&msg);
let _ = request.write_json_packet(&msg);
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}
impl WalkerActor {
pub(crate) fn new_mutations(
&self,
stream: &mut TcpStream,
request: &mut ClientRequest,
target: &str,
modifications: &[AttrModification],
) {
@@ -279,7 +287,7 @@ impl WalkerActor {
let mut mutations = self.mutations.borrow_mut();
mutations.extend(modifications.iter().cloned().map(|m| (m, target.into())));
}
let _ = stream.write_json_packet(&NewMutationsReply {
let _ = request.write_json_packet(&NewMutationsNotification {
from: self.name(),
type_: "newMutations".into(),
});
@@ -309,7 +317,7 @@ pub fn find_child(
let children = rx.recv().unwrap().ok_or(vec![])?;
for child in children {
let msg = child.encode(registry, true, script_chan.clone(), pipeline, name.into());
let msg = child.encode(registry, script_chan.clone(), pipeline, name.into());
if compare_fn(&msg) {
hierarchy.push(msg);
return Ok(hierarchy);

View File

@@ -0,0 +1,87 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
const INITIAL_LENGTH: usize = 500;
pub struct LongStringActor {
name: String,
full_string: String,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LongStringObj {
#[serde(rename = "type")]
type_: String,
actor: String,
length: usize,
initial: String,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct SubstringReply {
from: String,
substring: String,
}
impl Actor for LongStringActor {
fn name(&self) -> String {
self.name.clone()
}
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
_id: StreamId,
) -> Result<(), ActorError> {
match msg_type {
"substring" => {
let start = msg.get("start").and_then(|v| v.as_u64()).unwrap_or(0) as usize;
let end = msg
.get("end")
.and_then(|v| v.as_u64())
.unwrap_or(self.full_string.len() as u64) as usize;
let substring: String = self
.full_string
.chars()
.skip(start)
.take(end - start)
.collect();
let reply = SubstringReply {
from: self.name(),
substring,
};
request.reply_final(&reply)?
},
_ => return Err(ActorError::UnrecognizedPacketType),
}
Ok(())
}
}
impl LongStringActor {
pub fn new(registry: &ActorRegistry, full_string: String) -> Self {
let name = registry.new_name("longStringActor");
LongStringActor { name, full_string }
}
pub fn long_string_obj(&self) -> LongStringObj {
LongStringObj {
type_: "longString".to_string(),
actor: self.name.clone(),
length: self.full_string.len(),
initial: self.full_string.chars().take(INITIAL_LENGTH).collect(),
}
}
}

View File

@@ -2,13 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
@@ -36,13 +35,13 @@ impl Actor for MemoryActor {
fn handle_message(
&self,
_request: ClientRequest,
_registry: &ActorRegistry,
_msg_type: &str,
_msg: &Map<String, Value>,
_stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(ActorMessageStatus::Ignored)
) -> Result<(), ActorError> {
Err(ActorError::UnrecognizedPacketType)
}
}

View File

@@ -5,50 +5,66 @@
//! Liberally derived from the [Firefox JS implementation](http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/webconsole.js).
//! Handles interaction with the remote web console on network events (HTTP requests, responses) in Servo.
use std::net::TcpStream;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use base64::engine::Engine;
use base64::engine::general_purpose::STANDARD;
use chrono::{Local, LocalResult, TimeZone};
use devtools_traits::{HttpRequest as DevtoolsHttpRequest, HttpResponse as DevtoolsHttpResponse};
use headers::{ContentType, Cookie, HeaderMapExt};
use http::{HeaderMap, Method, header};
use net_traits::http_status::HttpStatus;
use headers::{ContentLength, ContentType, Cookie, HeaderMapExt};
use http::{HeaderMap, Method};
use net::cookie::ServoCookie;
use net_traits::CookieSource;
use net_traits::request::Destination as RequestDestination;
use serde::Serialize;
use serde_json::{Map, Value};
use servo_url::ServoUrl;
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::long_string::LongStringActor;
use crate::network_handler::Cause;
use crate::protocol::JsonPacketStream;
struct HttpRequest {
url: String,
method: Method,
headers: HeaderMap,
body: Option<Vec<u8>>,
started_date_time: SystemTime,
time_stamp: i64,
connect_time: Duration,
send_time: Duration,
}
struct HttpResponse {
headers: Option<HeaderMap>,
status: HttpStatus,
body: Option<Vec<u8>>,
}
use crate::protocol::ClientRequest;
pub struct NetworkEventActor {
pub name: String,
request: HttpRequest,
response: HttpResponse,
is_xhr: bool,
pub resource_id: u64,
pub is_xhr: bool,
pub request_url: String,
pub request_method: Method,
pub request_started: SystemTime,
pub request_time_stamp: i64,
pub request_destination: RequestDestination,
pub request_headers_raw: Option<HeaderMap>,
pub request_body: Option<Vec<u8>>,
pub request_cookies: Option<RequestCookiesMsg>,
pub request_headers: Option<RequestHeadersMsg>,
pub response_headers_raw: Option<HeaderMap>,
pub response_body: Option<Vec<u8>>,
pub response_content: Option<ResponseContentMsg>,
pub response_start: Option<ResponseStartMsg>,
pub response_cookies: Option<ResponseCookiesMsg>,
pub response_headers: Option<ResponseHeadersMsg>,
pub total_time: Duration,
pub security_state: String,
pub event_timing: Option<Timings>,
pub watcher_name: String,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct NetworkEventResource {
pub resource_id: u64,
pub resource_updates: Map<String, Value>,
pub browsing_context_id: u64,
pub inner_window_id: u64,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct EventActor {
pub actor: String,
pub resource_id: u64,
pub url: String,
pub method: String,
pub started_date_time: String,
@@ -61,7 +77,7 @@ pub struct EventActor {
#[derive(Serialize)]
pub struct ResponseCookiesMsg {
pub cookies: usize,
pub cookies: Vec<ResponseCookieObj>,
}
#[derive(Serialize)]
@@ -94,7 +110,7 @@ pub struct ResponseHeadersMsg {
#[derive(Serialize)]
pub struct RequestCookiesMsg {
pub cookies: usize,
pub cookies: Vec<RequestCookieObj>,
}
#[derive(Serialize)]
@@ -132,7 +148,7 @@ struct GetResponseHeadersReply {
#[serde(rename_all = "camelCase")]
struct GetResponseContentReply {
from: String,
content: Option<Vec<u8>>,
content: Option<ResponseContentObj>,
content_discarded: bool,
}
@@ -147,17 +163,50 @@ struct GetRequestPostDataReply {
#[derive(Serialize)]
struct GetRequestCookiesReply {
from: String,
cookies: Vec<u8>,
cookies: Vec<RequestCookieObj>,
}
#[derive(Serialize)]
struct GetResponseCookiesReply {
from: String,
cookies: Vec<u8>,
cookies: Vec<ResponseCookieObj>,
}
#[derive(Clone, Serialize)]
pub struct ResponseCookieObj {
pub name: String,
pub value: String,
pub path: Option<String>,
pub domain: Option<String>,
pub expires: Option<String>,
#[serde(rename = "httpOnly")]
pub http_only: Option<bool>,
pub secure: Option<bool>,
#[serde(rename = "sameSite")]
pub same_site: Option<String>,
}
#[derive(Serialize)]
struct Timings {
#[serde(rename_all = "camelCase")]
struct ResponseContentObj {
mime_type: String,
text: Value,
body_size: usize,
decoded_body_size: usize,
size: usize,
headers_size: usize,
transferred_size: usize,
#[serde(skip_serializing_if = "Option::is_none")]
encoding: Option<String>,
}
#[derive(Clone, Serialize)]
pub struct RequestCookieObj {
pub name: String,
pub value: String,
}
#[derive(Clone, Default, Serialize)]
pub struct Timings {
blocked: u32,
dns: u32,
connect: u64,
@@ -193,62 +242,60 @@ impl Actor for NetworkEventActor {
fn handle_message(
&self,
_registry: &ActorRegistry,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"getRequestHeaders" => {
let mut headers = Vec::new();
let mut raw_headers_string = "".to_owned();
let mut headers_size = 0;
for (name, value) in self.request.headers.iter() {
let value = &value.to_str().unwrap().to_string();
raw_headers_string = raw_headers_string + name.as_str() + ":" + value + "\r\n";
headers_size += name.as_str().len() + value.len();
headers.push(Header {
name: name.as_str().to_owned(),
value: value.to_owned(),
});
if let Some(ref headers_map) = self.request_headers_raw {
for (name, value) in headers_map.iter() {
let value = &value.to_str().unwrap().to_string();
raw_headers_string =
raw_headers_string + name.as_str() + ":" + value + "\r\n";
headers_size += name.as_str().len() + value.len();
headers.push(Header {
name: name.as_str().to_owned(),
value: value.to_owned(),
});
}
}
let msg = GetRequestHeadersReply {
from: self.name(),
headers,
header_size: headers_size,
raw_headers: raw_headers_string,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getRequestCookies" => {
let mut cookies = Vec::new();
for cookie in self.request.headers.get_all(header::COOKIE) {
if let Ok(cookie_value) = String::from_utf8(cookie.as_bytes().to_vec()) {
cookies = cookie_value.into_bytes();
}
}
let cookies = self
.request_cookies
.as_ref()
.map(|msg| msg.cookies.clone())
.unwrap_or_default();
let msg = GetRequestCookiesReply {
from: self.name(),
cookies,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getRequestPostData" => {
let msg = GetRequestPostDataReply {
from: self.name(),
post_data: self.request.body.clone(),
post_data_discarded: false,
post_data: self.request_body.clone(),
post_data_discarded: self.request_body.is_none(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getResponseHeaders" => {
if let Some(ref response_headers) = self.response.headers {
if let Some(ref response_headers) = self.response_headers_raw {
let mut headers = vec![];
let mut raw_headers_string = "".to_owned();
let mut headers_size = 0;
@@ -269,45 +316,88 @@ impl Actor for NetworkEventActor {
header_size: headers_size,
raw_headers: raw_headers_string,
};
let _ = stream.write_json_packet(&msg);
request.reply_final(&msg)?;
} else {
// FIXME: what happens when there are no response headers?
return Err(ActorError::Internal);
}
ActorMessageStatus::Processed
},
"getResponseCookies" => {
let mut cookies = Vec::new();
// TODO: This seems quite broken
for cookie in self.request.headers.get_all(header::SET_COOKIE) {
if let Ok(cookie_value) = String::from_utf8(cookie.as_bytes().to_vec()) {
cookies = cookie_value.into_bytes();
}
}
let cookies = self
.response_cookies
.as_ref()
.map(|msg| msg.cookies.clone())
.unwrap_or_default();
let msg = GetResponseCookiesReply {
from: self.name(),
cookies,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getResponseContent" => {
let content_obj = self.response_body.as_ref().map(|body| {
let mime_type = self
.response_content
.as_ref()
.map(|c| c.mime_type.clone())
.unwrap_or_default();
let headers_size = self
.response_headers
.as_ref()
.map(|h| h.headers_size)
.unwrap_or(0);
let transferred_size = self
.response_content
.as_ref()
.map(|c| c.transferred_size as usize)
.unwrap_or(0);
let body_size = body.len();
let decoded_body_size = body.len();
let size = body.len();
if Self::is_text_mime(&mime_type) {
let full_str = String::from_utf8_lossy(body).to_string();
// Queue a LongStringActor for this body
let long_string_actor = LongStringActor::new(registry, full_str);
let long_string_obj = long_string_actor.long_string_obj();
registry.register_later(Box::new(long_string_actor));
ResponseContentObj {
mime_type,
text: serde_json::to_value(long_string_obj).unwrap(),
body_size,
decoded_body_size,
size,
headers_size,
transferred_size,
encoding: None,
}
} else {
let b64 = STANDARD.encode(body);
ResponseContentObj {
mime_type,
text: serde_json::to_value(b64).unwrap(),
body_size,
decoded_body_size,
size,
headers_size,
transferred_size,
encoding: Some("base64".to_string()),
}
}
});
let msg = GetResponseContentReply {
from: self.name(),
content: self.response.body.clone(),
content_discarded: self.response.body.is_none(),
content: content_obj,
content_discarded: self.response_body.is_none(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getEventTimings" => {
// TODO: This is a fake timings msg
let timings_obj = Timings {
blocked: 0,
dns: 0,
connect: self.request.connect_time.as_millis() as u64,
send: self.request.send_time.as_millis() as u64,
wait: 0,
receive: 0,
};
let timings_obj = self.event_timing.clone().unwrap_or_default();
// Might use the one on self
let total = timings_obj.connect + timings_obj.send;
// TODO: Send the correct values for all these fields.
let msg = GetEventTimingsReply {
@@ -315,8 +405,7 @@ impl Actor for NetworkEventActor {
timings: timings_obj,
total_time: total,
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getSecurityInfo" => {
// TODO: Send the correct values for securityInfo.
@@ -326,65 +415,78 @@ impl Actor for NetworkEventActor {
state: "insecure".to_owned(),
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}
impl NetworkEventActor {
pub fn new(name: String) -> NetworkEventActor {
pub fn new(name: String, resource_id: u64, watcher_name: String) -> NetworkEventActor {
NetworkEventActor {
name,
request: HttpRequest {
url: String::new(),
method: Method::GET,
headers: HeaderMap::new(),
body: None,
started_date_time: SystemTime::now(),
time_stamp: SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_secs() as i64,
send_time: Duration::ZERO,
connect_time: Duration::ZERO,
},
response: HttpResponse {
headers: None,
status: HttpStatus::default(),
body: None,
},
resource_id,
is_xhr: false,
request_url: String::new(),
request_method: Method::GET,
request_started: SystemTime::now(),
request_time_stamp: SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_secs() as i64,
request_destination: RequestDestination::None,
request_headers_raw: None,
request_body: None,
request_cookies: None,
request_headers: None,
response_headers_raw: None,
response_body: None,
response_content: None,
response_start: None,
response_cookies: None,
response_headers: None,
total_time: Duration::ZERO,
security_state: "insecure".to_owned(),
event_timing: None,
watcher_name,
}
}
pub fn add_request(&mut self, request: DevtoolsHttpRequest) {
request.url.as_str().clone_into(&mut self.request.url);
self.request.method = request.method.clone();
self.request.headers = request.headers.clone();
self.request.body = request.body;
self.request.started_date_time = request.started_date_time;
self.request.time_stamp = request.time_stamp;
self.request.connect_time = request.connect_time;
self.request.send_time = request.send_time;
self.is_xhr = request.is_xhr;
self.request_cookies = Self::request_cookies(&request);
self.request_headers = Some(Self::request_headers(&request));
self.total_time = Self::total_time(&request);
self.event_timing = Some(Self::event_timing(&request));
self.request_url = request.url.to_string();
self.request_method = request.method;
self.request_started = request.started_date_time;
self.request_time_stamp = request.time_stamp;
self.request_destination = request.destination;
self.request_body = request.body.clone();
self.request_headers_raw = Some(request.headers.clone());
}
pub fn add_response(&mut self, response: DevtoolsHttpResponse) {
self.response.headers.clone_from(&response.headers);
self.response.status = response.status;
self.response.body = response.body;
self.response_headers = Some(Self::response_headers(&response));
self.response_cookies = ServoUrl::parse(&self.request_url)
.ok()
.as_ref()
.and_then(|url| Self::response_cookies(&response, url));
self.response_start = Some(Self::response_start(&response));
if let Some(response_content) = Self::response_content(self, &response) {
self.response_content = Some(response_content);
}
self.response_headers_raw = response.headers.clone();
}
pub fn event_actor(&self) -> EventActor {
// TODO: Send the correct values for startedDateTime, isXHR, private
let started_datetime_rfc3339 = match Local.timestamp_millis_opt(
self.request
.started_date_time
self.request_started
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_millis() as i64,
@@ -394,35 +496,28 @@ impl NetworkEventActor {
LocalResult::Ambiguous(date_time, _) => date_time.to_rfc3339().to_string(),
};
let cause_type = match self.request.url.as_str() {
// Adjust based on request data
url if url.ends_with(".css") => "stylesheet",
url if url.ends_with(".js") => "script",
url if url.ends_with(".png") || url.ends_with(".jpg") => "img",
_ => "document",
};
EventActor {
actor: self.name(),
url: self.request.url.clone(),
method: format!("{}", self.request.method),
resource_id: self.resource_id,
url: self.request_url.clone(),
method: format!("{}", self.request_method),
started_date_time: started_datetime_rfc3339,
time_stamp: self.request.time_stamp,
time_stamp: self.request_time_stamp,
is_xhr: self.is_xhr,
private: false,
cause: Cause {
type_: cause_type.to_string(),
type_: self.request_destination.as_str().to_string(),
loading_document_uri: None, // Set if available
},
}
}
pub fn response_start(&self) -> ResponseStartMsg {
pub fn response_start(response: &DevtoolsHttpResponse) -> ResponseStartMsg {
// TODO: Send the correct values for all these fields.
let h_size_option = self.response.headers.as_ref().map(|headers| headers.len());
let h_size = h_size_option.unwrap_or(0);
let status = &self.response.status;
// TODO: Send the correct values for remoteAddress and remotePort and http_version.
let h_size = response.headers.as_ref().map(|h| h.len()).unwrap_or(0);
let status = &response.status;
// TODO: Send the correct values for remoteAddress and remotePort and http_version
ResponseStartMsg {
http_version: "HTTP/1.1".to_owned(),
remote_address: "63.245.217.43".to_owned(),
@@ -434,72 +529,195 @@ impl NetworkEventActor {
}
}
pub fn response_content(&self) -> ResponseContentMsg {
let mut m_string = "".to_owned();
if let Some(ref headers) = self.response.headers {
m_string = match headers.typed_get::<ContentType>() {
Some(ct) => ct.to_string(),
_ => "".to_owned(),
};
}
// TODO: Set correct values when response's body is sent to the devtools in http_loader.
ResponseContentMsg {
mime_type: m_string,
content_size: 0,
transferred_size: 0,
discard_response_body: true,
}
pub fn response_content(
&mut self,
response: &DevtoolsHttpResponse,
) -> Option<ResponseContentMsg> {
let body = response.body.as_ref()?;
self.response_body = Some(body.clone());
let mime_type = response
.headers
.as_ref()
.and_then(|h| h.typed_get::<ContentType>())
.map(|ct| ct.to_string())
.unwrap_or_default();
let transferred_size = response
.headers
.as_ref()
.and_then(|hdrs| hdrs.typed_get::<ContentLength>())
.map(|cl| cl.0);
let content_size = response.body.as_ref().map(|body| body.len() as u64);
Some(ResponseContentMsg {
mime_type,
content_size: content_size.unwrap_or(0) as u32,
transferred_size: transferred_size.unwrap_or(0) as u32,
discard_response_body: false,
})
}
pub fn response_cookies(&self) -> ResponseCookiesMsg {
let mut cookies_size = 0;
if let Some(ref headers) = self.response.headers {
cookies_size = match headers.typed_get::<Cookie>() {
Some(ref cookie) => cookie.len(),
_ => 0,
};
}
ResponseCookiesMsg {
cookies: cookies_size,
}
pub fn response_cookies(
response: &DevtoolsHttpResponse,
url: &ServoUrl,
) -> Option<ResponseCookiesMsg> {
let headers = response.headers.as_ref()?;
let cookies = headers
.get_all("set-cookie")
.iter()
.filter_map(|cookie| {
let cookie_str = String::from_utf8(cookie.as_bytes().to_vec()).ok()?;
ServoCookie::from_cookie_string(cookie_str, url, CookieSource::HTTP)
})
.map(|servo_cookie| {
let c = &servo_cookie.cookie;
ResponseCookieObj {
name: c.name().to_string(),
value: c.value().to_string(),
path: c.path().map(|p| p.to_string()),
domain: c.domain().map(|d| d.to_string()),
expires: c.expires().map(|dt| format!("{:?}", dt)),
http_only: c.http_only(),
secure: c.secure(),
same_site: c.same_site().map(|s| s.to_string()),
}
})
.collect::<Vec<_>>();
Some(ResponseCookiesMsg { cookies })
}
pub fn response_headers(&self) -> ResponseHeadersMsg {
let mut headers_size = 0;
pub fn response_headers(response: &DevtoolsHttpResponse) -> ResponseHeadersMsg {
let mut header_size = 0;
let mut headers_byte_count = 0;
if let Some(ref headers) = self.response.headers {
headers_size = headers.len();
if let Some(ref headers) = response.headers {
for (name, value) in headers.iter() {
header_size += 1;
headers_byte_count += name.as_str().len() + value.len();
}
}
ResponseHeadersMsg {
headers: headers_size,
headers: header_size,
headers_size: headers_byte_count,
}
}
pub fn request_headers(&self) -> RequestHeadersMsg {
let size = self.request.headers.iter().fold(0, |acc, (name, value)| {
pub fn request_headers(request: &DevtoolsHttpRequest) -> RequestHeadersMsg {
let size = request.headers.iter().fold(0, |acc, (name, value)| {
acc + name.as_str().len() + value.len()
});
RequestHeadersMsg {
headers: self.request.headers.len(),
headers: request.headers.len(),
headers_size: size,
}
}
pub fn request_cookies(&self) -> RequestCookiesMsg {
let cookies_size = match self.request.headers.typed_get::<Cookie>() {
Some(ref cookie) => cookie.len(),
_ => 0,
};
RequestCookiesMsg {
cookies: cookies_size,
pub fn request_cookies(request: &DevtoolsHttpRequest) -> Option<RequestCookiesMsg> {
let header_value = request.headers.typed_get::<Cookie>()?;
let cookies = header_value
.iter()
.map(|cookie| RequestCookieObj {
name: cookie.0.to_string(),
value: cookie.1.to_string(),
})
.collect::<Vec<_>>();
Some(RequestCookiesMsg { cookies })
}
pub fn total_time(request: &DevtoolsHttpRequest) -> Duration {
request.connect_time + request.send_time
}
pub fn event_timing(request: &DevtoolsHttpRequest) -> Timings {
Timings {
blocked: 0,
dns: 0,
connect: request.connect_time.as_millis() as u64,
send: request.send_time.as_millis() as u64,
wait: 0,
receive: 0,
}
}
pub fn total_time(&self) -> Duration {
self.request.connect_time + self.request.send_time
pub fn is_text_mime(mime: &str) -> bool {
let lower = mime.to_ascii_lowercase();
lower.starts_with("text/") ||
lower.contains("json") ||
lower.contains("javascript") ||
lower.contains("xml") ||
lower.contains("csv") ||
lower.contains("html")
}
fn insert_serialized_map<T: Serialize>(map: &mut Map<String, Value>, obj: &Option<T>) {
if let Some(value) = obj {
if let Ok(Value::Object(serialized)) = serde_json::to_value(value) {
for (key, val) in serialized {
map.insert(key, val);
}
}
}
}
pub fn resource_updates(&self) -> NetworkEventResource {
let mut resource_updates = Map::new();
resource_updates.insert(
"requestCookiesAvailable".to_owned(),
Value::Bool(self.request_cookies.is_some()),
);
resource_updates.insert(
"requestHeadersAvailable".to_owned(),
Value::Bool(self.request_headers.is_some()),
);
resource_updates.insert(
"responseHeadersAvailable".to_owned(),
Value::Bool(self.response_headers.is_some()),
);
resource_updates.insert(
"responseCookiesAvailable".to_owned(),
Value::Bool(self.response_cookies.is_some()),
);
resource_updates.insert(
"responseStartAvailable".to_owned(),
Value::Bool(self.response_start.is_some()),
);
resource_updates.insert(
"responseContentAvailable".to_owned(),
Value::Bool(self.response_content.is_some()),
);
resource_updates.insert(
"totalTime".to_string(),
Value::from(self.total_time.as_secs_f64()),
);
resource_updates.insert(
"securityState".to_string(),
Value::String(self.security_state.clone()),
);
resource_updates.insert(
"eventTimingsAvailable".to_owned(),
Value::Bool(self.event_timing.is_some()),
);
Self::insert_serialized_map(&mut resource_updates, &self.response_content);
Self::insert_serialized_map(&mut resource_updates, &self.response_headers);
Self::insert_serialized_map(&mut resource_updates, &self.response_cookies);
Self::insert_serialized_map(&mut resource_updates, &self.request_headers);
Self::insert_serialized_map(&mut resource_updates, &self.request_cookies);
Self::insert_serialized_map(&mut resource_updates, &self.response_start);
Self::insert_serialized_map(&mut resource_updates, &self.event_timing);
// TODO: Set the correct values for these fields
NetworkEventResource {
resource_id: self.resource_id,
resource_updates,
browsing_context_id: 0,
inner_window_id: 0,
}
}
}

View File

@@ -2,12 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
pub struct ObjectActor {
pub name: String,
@@ -20,14 +19,14 @@ impl Actor for ObjectActor {
}
fn handle_message(
&self,
_request: ClientRequest,
_: &ActorRegistry,
_: &str,
_: &Map<String, Value>,
_: &mut TcpStream,
_: StreamId,
) -> Result<ActorMessageStatus, ()> {
) -> Result<(), ActorError> {
// TODO: Handle enumSymbols for console object inspection
Ok(ActorMessageStatus::Ignored)
Err(ActorError::UnrecognizedPacketType)
}
}

View File

@@ -5,14 +5,12 @@
// TODO: Is this actor still relevant?
#![allow(dead_code)]
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::{ActorDescription, JsonPacketStream, Method};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::{ActorDescription, ClientRequest, Method};
pub struct PerformanceActor {
name: String,
@@ -62,13 +60,13 @@ impl Actor for PerformanceActor {
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"connect" => {
let msg = ConnectReply {
from: self.name(),
@@ -82,8 +80,7 @@ impl Actor for PerformanceActor {
},
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"canCurrentlyRecord" => {
let msg = CanCurrentlyRecordReply {
@@ -93,11 +90,11 @@ impl Actor for PerformanceActor {
errors: vec![],
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -2,16 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use log::warn;
use serde::Serialize;
use serde_json::{Map, Value};
use servo_config::pref;
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
pub struct PreferenceActor {
name: String,
@@ -30,43 +27,44 @@ impl Actor for PreferenceActor {
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
let Some(key) = msg.get("value").and_then(|v| v.as_str()) else {
warn!("PreferenceActor: handle_message: value is not a string");
return Ok(ActorMessageStatus::Ignored);
};
) -> Result<(), ActorError> {
let key = msg
.get("value")
.ok_or(ActorError::MissingParameter)?
.as_str()
.ok_or(ActorError::BadParameterType)?;
// TODO: Map more preferences onto their Servo values.
Ok(match key {
match key {
"dom.serviceWorkers.enabled" => {
self.write_bool(pref!(dom_serviceworker_enabled), stream)
self.write_bool(request, pref!(dom_serviceworker_enabled))
},
_ => self.handle_missing_preference(msg_type, stream),
})
_ => self.handle_missing_preference(request, msg_type),
}
}
}
impl PreferenceActor {
fn handle_missing_preference(
&self,
request: ClientRequest,
msg_type: &str,
stream: &mut TcpStream,
) -> ActorMessageStatus {
) -> Result<(), ActorError> {
match msg_type {
"getBoolPref" => self.write_bool(false, stream),
"getCharPref" => self.write_char("".into(), stream),
"getIntPref" => self.write_int(0, stream),
"getFloatPref" => self.write_float(0., stream),
_ => ActorMessageStatus::Ignored,
"getBoolPref" => self.write_bool(request, false),
"getCharPref" => self.write_char(request, "".into()),
"getIntPref" => self.write_int(request, 0),
"getFloatPref" => self.write_float(request, 0.),
_ => Err(ActorError::UnrecognizedPacketType),
}
}
fn write_bool(&self, pref_value: bool, stream: &mut TcpStream) -> ActorMessageStatus {
fn write_bool(&self, request: ClientRequest, pref_value: bool) -> Result<(), ActorError> {
#[derive(Serialize)]
struct BoolReply {
from: String,
@@ -77,11 +75,10 @@ impl PreferenceActor {
from: self.name.clone(),
value: pref_value,
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)
}
fn write_char(&self, pref_value: String, stream: &mut TcpStream) -> ActorMessageStatus {
fn write_char(&self, request: ClientRequest, pref_value: String) -> Result<(), ActorError> {
#[derive(Serialize)]
struct CharReply {
from: String,
@@ -92,11 +89,10 @@ impl PreferenceActor {
from: self.name.clone(),
value: pref_value,
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)
}
fn write_int(&self, pref_value: i64, stream: &mut TcpStream) -> ActorMessageStatus {
fn write_int(&self, request: ClientRequest, pref_value: i64) -> Result<(), ActorError> {
#[derive(Serialize)]
struct IntReply {
from: String,
@@ -107,11 +103,10 @@ impl PreferenceActor {
from: self.name.clone(),
value: pref_value,
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)
}
fn write_float(&self, pref_value: f64, stream: &mut TcpStream) -> ActorMessageStatus {
fn write_float(&self, request: ClientRequest, pref_value: f64) -> Result<(), ActorError> {
#[derive(Serialize)]
struct FloatReply {
from: String,
@@ -122,7 +117,6 @@ impl PreferenceActor {
from: self.name.clone(),
value: pref_value,
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)
}
}

View File

@@ -6,15 +6,13 @@
//!
//! [Firefox JS implementation]: https://searchfox.org/mozilla-central/source/devtools/server/actors/descriptors/process.js
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::root::DescriptorTraits;
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
#[derive(Serialize)]
struct ListWorkersReply {
@@ -46,24 +44,24 @@ impl Actor for ProcessActor {
/// - `listWorkers`: Returns a list of web workers, not supported yet.
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"listWorkers" => {
let reply = ListWorkersReply {
from: self.name(),
workers: vec![],
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -4,12 +4,11 @@
//! This actor is used for protocol purposes, it forwards the reflow events to clients.
use std::net::TcpStream;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
use crate::{EmptyReplyMsg, StreamId};
pub struct ReflowActor {
name: String,
@@ -25,20 +24,24 @@ impl Actor for ReflowActor {
/// - `start`: Does nothing yet. This doesn't need a reply like other messages.
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
_stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"start" => {
// TODO: Create an observer on "reflows" events
ActorMessageStatus::Processed
let msg = EmptyReplyMsg { from: self.name() };
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
fn cleanup(&self, _id: StreamId) {}
}
impl ReflowActor {

View File

@@ -10,19 +10,18 @@
//! [Firefox JS implementation]: https://searchfox.org/mozilla-central/source/devtools/server/actors/root.js
use std::cell::RefCell;
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value, json};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::device::DeviceActor;
use crate::actors::performance::PerformanceActor;
use crate::actors::process::{ProcessActor, ProcessActorMsg};
use crate::actors::tab::{TabDescriptorActor, TabDescriptorActorMsg};
use crate::actors::worker::{WorkerActor, WorkerMsg};
use crate::protocol::{ActorDescription, JsonPacketStream};
use crate::protocol::{ActorDescription, ClientRequest};
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
@@ -116,13 +115,6 @@ struct GetProcessResponse {
process_descriptor: ProcessActorMsg,
}
#[derive(Serialize)]
struct ErrorResponse {
from: String,
error: String,
message: String,
}
pub struct RootActor {
pub tabs: Vec<String>,
pub workers: Vec<String>,
@@ -140,27 +132,25 @@ impl Actor for RootActor {
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"connect" => {
let message = json!({
"from": "root",
});
let _ = stream.write_json_packet(&message);
ActorMessageStatus::Processed
request.reply_final(&message)?
},
"listAddons" => {
let actor = ListAddonsReply {
from: "root".to_owned(),
addons: vec![],
};
let _ = stream.write_json_packet(&actor);
ActorMessageStatus::Processed
request.reply_final(&actor)?
},
"listProcesses" => {
@@ -169,8 +159,7 @@ impl Actor for RootActor {
from: self.name(),
processes: vec![process],
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
// TODO: Unexpected message getTarget for process (when inspecting)
@@ -180,8 +169,7 @@ impl Actor for RootActor {
from: self.name(),
process_descriptor: process,
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
"getRoot" => {
@@ -192,8 +180,7 @@ impl Actor for RootActor {
device_actor: self.device.clone(),
preference_actor: self.preference.clone(),
};
let _ = stream.write_json_packet(&actor);
ActorMessageStatus::Processed
request.reply_final(&actor)?
},
"listTabs" => {
@@ -213,8 +200,7 @@ impl Actor for RootActor {
})
.collect(),
};
let _ = stream.write_json_packet(&actor);
ActorMessageStatus::Processed
request.reply_final(&actor)?
},
"listServiceWorkerRegistrations" => {
@@ -222,8 +208,7 @@ impl Actor for RootActor {
from: self.name(),
registrations: vec![],
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
"listWorkers" => {
@@ -235,26 +220,24 @@ impl Actor for RootActor {
.map(|name| registry.find::<WorkerActor>(name).encodable())
.collect(),
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
"getTab" => {
let Some(serde_json::Value::Number(browser_id)) = msg.get("browserId") else {
return Ok(ActorMessageStatus::Ignored);
};
let browser_id = browser_id.as_u64().unwrap();
let browser_id = msg
.get("browserId")
.ok_or(ActorError::MissingParameter)?
.as_u64()
.ok_or(ActorError::BadParameterType)?;
let Some(tab) = self.get_tab_msg_by_browser_id(registry, browser_id as u32) else {
return Ok(ActorMessageStatus::Ignored);
return Err(ActorError::Internal);
};
let reply = GetTabReply {
from: self.name(),
tab,
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
"protocolDescription" => {
@@ -265,24 +248,12 @@ impl Actor for RootActor {
device: DeviceActor::description(),
},
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => {
let reply = ErrorResponse {
from: self.name(),
error: "unrecognizedPacketType".to_owned(),
message: format!(
"Actor {} does not recognize the packet type '{}'",
self.name(),
msg_type,
),
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Ignored
},
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -2,90 +2,176 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::{Ref, RefCell};
use std::collections::BTreeSet;
use std::net::TcpStream;
use std::cell::RefCell;
use std::collections::{BTreeMap, BTreeSet};
use base::id::PipelineId;
use devtools_traits::DevtoolScriptControlMsg;
use ipc_channel::ipc::{IpcSender, channel};
use serde::Serialize;
use serde_json::{Map, Value};
use servo_url::ServoUrl;
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
/// A `sourceForm` as used in responses to thread `sources` requests.
///
/// For now, we also use this for sources in watcher `resource-available-array` messages,
/// but in Firefox those have extra fields.
///
/// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#loading-script-sources>
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SourceData {
pub(crate) struct SourceForm {
pub actor: String,
/// URL of the script, or URL of the page for inline scripts.
pub url: String,
pub is_black_boxed: bool,
pub source_content: String,
/// `introductionType` in SpiderMonkey `CompileOptionsWrapper`.
pub introduction_type: String,
}
#[derive(Serialize)]
pub(crate) struct SourcesReply {
pub from: String,
pub sources: Vec<SourceData>,
pub sources: Vec<SourceForm>,
}
pub(crate) struct SourceManager {
pub source_urls: RefCell<BTreeSet<SourceData>>,
source_actor_names: RefCell<BTreeSet<String>>,
}
#[derive(Clone, Debug)]
pub struct SourceActor {
/// Actor name.
pub name: String,
pub content: String,
pub content_type: String,
/// URL of the script, or URL of the page for inline scripts.
pub url: ServoUrl,
/// The black-boxed flag, which tells the debugger to avoid pausing inside this script.
/// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#black-boxing-sources>
pub is_black_boxed: bool,
pub content: Option<String>,
pub content_type: Option<String>,
// TODO: use it in #37667, then remove this allow
#[allow(unused)]
pub spidermonkey_id: u32,
/// `introductionType` in SpiderMonkey `CompileOptionsWrapper`.
pub introduction_type: String,
script_sender: IpcSender<DevtoolScriptControlMsg>,
}
#[derive(Serialize)]
struct SourceContentReply {
from: String,
#[serde(rename = "contentType")]
content_type: String,
content_type: Option<String>,
source: String,
}
#[derive(Serialize)]
struct GetBreakableLinesReply {
from: String,
// Line numbers are one-based.
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#source-locations>
lines: BTreeSet<u32>,
}
#[derive(Serialize)]
struct GetBreakpointPositionsCompressedReply {
from: String,
// Column numbers are in UTF-16 code units, not Unicode scalar values or grapheme clusters.
// Line number are one-based. Column numbers are zero-based.
// FIXME: the docs say column numbers are one-based, but this appears to be incorrect.
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#source-locations>
positions: BTreeMap<u32, BTreeSet<u32>>,
}
impl SourceManager {
pub fn new() -> Self {
Self {
source_urls: RefCell::new(BTreeSet::default()),
source_actor_names: RefCell::new(BTreeSet::default()),
}
}
pub fn add_source(&self, url: ServoUrl, source_content: String, actor_name: String) {
self.source_urls.borrow_mut().insert(SourceData {
actor: actor_name,
url: url.to_string(),
is_black_boxed: false,
source_content,
});
pub fn add_source(&self, actor_name: &str) {
self.source_actor_names
.borrow_mut()
.insert(actor_name.to_owned());
}
pub fn sources(&self) -> Ref<BTreeSet<SourceData>> {
self.source_urls.borrow()
pub fn source_forms(&self, actors: &ActorRegistry) -> Vec<SourceForm> {
self.source_actor_names
.borrow()
.iter()
.map(|actor_name| actors.find::<SourceActor>(actor_name).source_form())
.collect()
}
}
impl SourceActor {
pub fn new(name: String, content: String, content_type: String) -> SourceActor {
pub fn new(
name: String,
url: ServoUrl,
content: Option<String>,
content_type: Option<String>,
spidermonkey_id: u32,
introduction_type: String,
script_sender: IpcSender<DevtoolScriptControlMsg>,
) -> SourceActor {
SourceActor {
name,
url,
content,
content_type,
is_black_boxed: false,
spidermonkey_id,
introduction_type,
script_sender,
}
}
pub fn new_source(actors: &mut ActorRegistry, content: String, content_type: String) -> String {
#[allow(clippy::too_many_arguments)]
pub fn new_registered(
actors: &mut ActorRegistry,
pipeline_id: PipelineId,
url: ServoUrl,
content: Option<String>,
content_type: Option<String>,
spidermonkey_id: u32,
introduction_type: String,
script_sender: IpcSender<DevtoolScriptControlMsg>,
) -> &SourceActor {
let source_actor_name = actors.new_name("source");
let source_actor = SourceActor::new(source_actor_name.clone(), content, content_type);
let source_actor = SourceActor::new(
source_actor_name.clone(),
url,
content,
content_type,
spidermonkey_id,
introduction_type,
script_sender,
);
actors.register(Box::new(source_actor));
actors.register_source_actor(pipeline_id, &source_actor_name);
source_actor_name
actors.find(&source_actor_name)
}
pub fn source_form(&self) -> SourceForm {
SourceForm {
actor: self.name.clone(),
url: self.url.to_string(),
is_black_boxed: self.is_black_boxed,
introduction_type: self.introduction_type.clone(),
}
}
}
@@ -96,24 +182,82 @@ impl Actor for SourceActor {
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
// Client has requested contents of the source.
"source" => {
let reply = SourceContentReply {
from: self.name(),
content_type: self.content_type.clone(),
source: self.content.clone(),
// TODO: if needed, fetch the page again, in the same way as in the original request.
// Fetch it from cache, even if the original request was non-idempotent (e.g. POST).
// If we cant fetch it from cache, we should probably give up, because with a real
// fetch, the server could return a different response.
// TODO: do we want to wait instead of giving up immediately, in cases where the content could
// become available later (e.g. after a fetch)?
source: self
.content
.as_deref()
.unwrap_or("<!-- not available; please reload! -->")
.to_owned(),
};
let _ = stream.write_json_packet(&reply);
ActorMessageStatus::Processed
request.reply_final(&reply)?
},
_ => ActorMessageStatus::Ignored,
})
// Client wants to know which lines can have breakpoints.
// Sent when opening a source in the Sources panel, and controls whether the line numbers can be clicked.
"getBreakableLines" => {
let (tx, rx) = channel().map_err(|_| ActorError::Internal)?;
self.script_sender
.send(DevtoolScriptControlMsg::GetPossibleBreakpoints(
self.spidermonkey_id,
tx,
))
.map_err(|_| ActorError::Internal)?;
let result = rx.recv().map_err(|_| ActorError::Internal)?;
let lines = result
.into_iter()
.map(|entry| entry.line_number)
.collect::<BTreeSet<_>>();
let reply = GetBreakableLinesReply {
from: self.name(),
lines,
};
request.reply_final(&reply)?
},
// Client wants to know which columns in the line can have breakpoints.
// Sent when the user tries to set a breakpoint by clicking a line number in a source.
"getBreakpointPositionsCompressed" => {
let (tx, rx) = channel().map_err(|_| ActorError::Internal)?;
self.script_sender
.send(DevtoolScriptControlMsg::GetPossibleBreakpoints(
self.spidermonkey_id,
tx,
))
.map_err(|_| ActorError::Internal)?;
let result = rx.recv().map_err(|_| ActorError::Internal)?;
let mut positions: BTreeMap<u32, BTreeSet<u32>> = BTreeMap::default();
for entry in result {
// Line number are one-based. Column numbers are zero-based.
// FIXME: the docs say column numbers are one-based, but this appears to be incorrect.
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#source-locations>
positions
.entry(entry.line_number)
.or_default()
.insert(entry.column_number - 1);
}
let reply = GetBreakpointPositionsCompressedReply {
from: self.name(),
positions,
};
request.reply_final(&reply)?
},
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -2,14 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
@@ -28,24 +26,24 @@ impl Actor for StyleSheetsActor {
}
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"getStyleSheets" => {
let msg = GetStyleSheetsReply {
from: self.name(),
style_sheets: vec![],
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -9,17 +9,15 @@
//!
//! [Firefox JS implementation]: https://searchfox.org/mozilla-central/source/devtools/server/actors/descriptors/tab.js
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::browsing_context::{BrowsingContextActor, BrowsingContextActorMsg};
use crate::actors::root::{DescriptorTraits, RootActor};
use crate::actors::watcher::{WatcherActor, WatcherActorMsg};
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
@@ -89,42 +87,40 @@ impl Actor for TabDescriptorActor {
/// to describe the debugging capabilities of this tab.
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"getTarget" => {
let frame = registry
.find::<BrowsingContextActor>(&self.browsing_context_actor)
.encodable();
let _ = stream.write_json_packet(&GetTargetReply {
request.reply_final(&GetTargetReply {
from: self.name(),
frame,
});
ActorMessageStatus::Processed
})?
},
"getFavicon" => {
// TODO: Return a favicon when available
let _ = stream.write_json_packet(&GetFaviconReply {
request.reply_final(&GetFaviconReply {
from: self.name(),
favicon: String::new(),
});
ActorMessageStatus::Processed
})?
},
"getWatcher" => {
let ctx_actor = registry.find::<BrowsingContextActor>(&self.browsing_context_actor);
let watcher = registry.find::<WatcherActor>(&ctx_actor.watcher);
let _ = stream.write_json_packet(&GetWatcherReply {
request.reply_final(&GetWatcherReply {
from: self.name(),
watcher: watcher.encodable(),
});
ActorMessageStatus::Processed
})?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -2,14 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use super::source::{SourceData, SourceManager, SourcesReply};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use super::source::{SourceManager, SourcesReply};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::{ClientRequest, JsonPacketStream};
use crate::{EmptyReplyMsg, StreamId};
#[derive(Serialize)]
@@ -71,13 +69,13 @@ impl Actor for ThreadActor {
fn handle_message(
&self,
mut request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"attach" => {
let msg = ThreadAttached {
from: self.name(),
@@ -92,9 +90,8 @@ impl Actor for ThreadActor {
type_: "attached".to_owned(),
},
};
let _ = stream.write_json_packet(&msg);
let _ = stream.write_json_packet(&EmptyReplyMsg { from: self.name() });
ActorMessageStatus::Processed
request.write_json_packet(&msg)?;
request.reply_final(&EmptyReplyMsg { from: self.name() })?
},
"resume" => {
@@ -102,9 +99,8 @@ impl Actor for ThreadActor {
from: self.name(),
type_: "resumed".to_owned(),
};
let _ = stream.write_json_packet(&msg);
let _ = stream.write_json_packet(&EmptyReplyMsg { from: self.name() });
ActorMessageStatus::Processed
request.write_json_packet(&msg)?;
request.reply_final(&EmptyReplyMsg { from: self.name() })?
},
"interrupt" => {
@@ -112,34 +108,23 @@ impl Actor for ThreadActor {
from: self.name(),
type_: "interrupted".to_owned(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.write_json_packet(&msg)?;
request.reply_final(&EmptyReplyMsg { from: self.name() })?
},
"reconfigure" => {
let _ = stream.write_json_packet(&EmptyReplyMsg { from: self.name() });
ActorMessageStatus::Processed
},
"reconfigure" => request.reply_final(&EmptyReplyMsg { from: self.name() })?,
// Client has attached to the thread and wants to load script sources.
// <https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#loading-script-sources>
"sources" => {
let sources: Vec<SourceData> = self
.source_manager
.source_urls
.borrow()
.iter()
.cloned()
.collect();
let msg = SourcesReply {
from: self.name(),
sources,
sources: self.source_manager.source_forms(registry),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -6,7 +6,6 @@
#![allow(dead_code)]
use std::cell::RefCell;
use std::error::Error;
use std::net::TcpStream;
use std::sync::{Arc, Mutex};
use std::thread;
@@ -21,10 +20,10 @@ use serde::{Serialize, Serializer};
use serde_json::{Map, Value};
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::framerate::FramerateActor;
use crate::actors::memory::{MemoryActor, TimelineMemoryReply};
use crate::protocol::JsonPacketStream;
use crate::protocol::{ClientRequest, JsonPacketStream};
pub struct TimelineActor {
name: String,
@@ -127,7 +126,7 @@ impl Serialize for HighResolutionStamp {
}
}
static DEFAULT_TIMELINE_DATA_PULL_TIMEOUT: u64 = 200; //ms
static DEFAULT_TIMELINE_DATA_PULL_TIMEOUT: u64 = 200; // ms
impl TimelineActor {
pub fn new(
@@ -191,13 +190,13 @@ impl Actor for TimelineActor {
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"start" => {
**self.is_recording.lock().as_mut().unwrap() = true;
@@ -210,8 +209,8 @@ impl Actor for TimelineActor {
))
.unwrap();
//TODO: support multiple connections by using root actor's streams instead.
*self.stream.borrow_mut() = stream.try_clone().ok();
// TODO: support multiple connections by using root actor's streams instead.
*self.stream.borrow_mut() = request.try_clone_stream().ok();
// init memory actor
if let Some(with_memory) = msg.get("withMemory") {
@@ -236,7 +235,7 @@ impl Actor for TimelineActor {
self.name(),
registry.shareable(),
registry.start_stamp(),
stream.try_clone().unwrap(),
request.try_clone_stream().unwrap(),
self.memory_actor.borrow().clone(),
self.framerate_actor.borrow().clone(),
);
@@ -250,8 +249,7 @@ impl Actor for TimelineActor {
CrossProcessInstant::now(),
),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"stop" => {
@@ -263,7 +261,6 @@ impl Actor for TimelineActor {
),
};
let _ = stream.write_json_packet(&msg);
self.script_sender
.send(DropTimelineMarkers(
self.pipeline_id,
@@ -271,7 +268,7 @@ impl Actor for TimelineActor {
))
.unwrap();
//TODO: move this to the cleanup method.
// TODO: move this to the cleanup method.
if let Some(ref actor_name) = *self.framerate_actor.borrow() {
registry.drop_actor_later(actor_name.clone());
}
@@ -282,7 +279,7 @@ impl Actor for TimelineActor {
**self.is_recording.lock().as_mut().unwrap() = false;
self.stream.borrow_mut().take();
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"isRecording" => {
@@ -291,12 +288,12 @@ impl Actor for TimelineActor {
value: *self.is_recording.lock().unwrap(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}
@@ -330,7 +327,7 @@ impl Emitter {
}
}
fn send(&mut self, markers: Vec<TimelineMarkerReply>) -> Result<(), Box<dyn Error>> {
fn send(&mut self, markers: Vec<TimelineMarkerReply>) -> Result<(), ActorError> {
let end_time = CrossProcessInstant::now();
let reply = MarkersEmitterReply {
type_: "markers".to_owned(),

View File

@@ -14,15 +14,18 @@ use std::collections::HashMap;
use std::net::TcpStream;
use std::time::{SystemTime, UNIX_EPOCH};
use base::id::BrowsingContextId;
use log::warn;
use serde::Serialize;
use serde_json::{Map, Value};
use servo_url::ServoUrl;
use self::network_parent::{NetworkParentActor, NetworkParentActorMsg};
use super::breakpoint::BreakpointListActor;
use super::thread::ThreadActor;
use super::worker::WorkerMsg;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::breakpoint::BreakpointListActorMsg;
use crate::actors::browsing_context::{BrowsingContextActor, BrowsingContextActorMsg};
use crate::actors::root::RootActor;
use crate::actors::watcher::target_configuration::{
@@ -31,9 +34,9 @@ use crate::actors::watcher::target_configuration::{
use crate::actors::watcher::thread_configuration::{
ThreadConfigurationActor, ThreadConfigurationActorMsg,
};
use crate::protocol::JsonPacketStream;
use crate::resource::ResourceAvailable;
use crate::{EmptyReplyMsg, StreamId, WorkerActor};
use crate::protocol::{ClientRequest, JsonPacketStream};
use crate::resource::{ResourceArrayType, ResourceAvailable};
use crate::{EmptyReplyMsg, IdMap, StreamId, WorkerActor};
pub mod network_parent;
pub mod target_configuration;
@@ -79,7 +82,7 @@ impl SessionContext {
("local-storage", false),
("session-storage", false),
("platform-message", false),
("network-event", false),
("network-event", true),
("network-event-stacktrace", false),
("reflow", false),
("stylesheet", false),
@@ -149,12 +152,7 @@ struct GetThreadConfigurationActorReply {
#[serde(rename_all = "camelCase")]
struct GetBreakpointListActorReply {
from: String,
breakpoint_list: GetBreakpointListActorReplyInner,
}
#[derive(Serialize)]
struct GetBreakpointListActorReplyInner {
actor: String,
breakpoint_list: BreakpointListActorMsg,
}
#[derive(Serialize)]
@@ -189,9 +187,23 @@ pub struct WatcherActor {
network_parent: String,
target_configuration: String,
thread_configuration: String,
breakpoint_list: String,
session_context: SessionContext,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WillNavigateMessage {
#[serde(rename = "browsingContextID")]
browsing_context_id: u32,
inner_window_id: u32,
name: String,
time: u128,
is_frame_switching: bool,
#[serde(rename = "newURI")]
new_uri: ServoUrl,
}
impl Actor for WatcherActor {
fn name(&self) -> String {
self.name.clone()
@@ -215,15 +227,15 @@ impl Actor for WatcherActor {
/// - `getThreadConfigurationActor`: The same but with the configuration actor for the thread
fn handle_message(
&self,
mut request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
) -> Result<(), ActorError> {
let target = registry.find::<BrowsingContextActor>(&self.browsing_context_actor);
let root = registry.find::<RootActor>("root");
Ok(match msg_type {
match msg_type {
"watchTargets" => {
// As per logs we either get targetType as "frame" or "worker"
let target_type = msg
@@ -237,9 +249,9 @@ impl Actor for WatcherActor {
type_: "target-available-form".into(),
target: TargetActorMsg::BrowsingContext(target.encodable()),
};
let _ = stream.write_json_packet(&msg);
let _ = request.write_json_packet(&msg);
target.frame_update(stream);
target.frame_update(&mut request);
} else if target_type == "worker" {
for worker_name in &root.workers {
let worker = registry.find::<WorkerActor>(worker_name);
@@ -248,11 +260,10 @@ impl Actor for WatcherActor {
type_: "target-available-form".into(),
target: TargetActorMsg::Worker(worker.encodable()),
};
let _ = stream.write_json_packet(&worker_msg);
let _ = request.write_json_packet(&worker_msg);
}
} else {
warn!("Unexpected target_type: {}", target_type);
return Ok(ActorMessageStatus::Ignored);
}
// Messages that contain a `type` field are used to send event callbacks, but they
@@ -260,15 +271,14 @@ impl Actor for WatcherActor {
// extra empty packet to the devtools host to inform that we successfully received
// and processed the message so that it can continue
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"watchResources" => {
let Some(resource_types) = msg.get("resourceTypes") else {
return Ok(ActorMessageStatus::Ignored);
return Err(ActorError::MissingParameter);
};
let Some(resource_types) = resource_types.as_array() else {
return Ok(ActorMessageStatus::Ignored);
return Err(ActorError::BadParameterType);
};
for resource in resource_types {
@@ -292,46 +302,49 @@ impl Actor for WatcherActor {
title: Some(target.title.borrow().clone()),
url: Some(target.url.borrow().clone()),
};
target.resource_available(event, "document-event".into(), stream);
target.resource_array(
event,
"document-event".into(),
ResourceArrayType::Available,
&mut request,
);
}
},
"source" => {
let thread_actor = registry.find::<ThreadActor>(&target.thread);
let sources = thread_actor.source_manager.sources();
target.resources_available(
sources.iter().collect(),
target.resources_array(
thread_actor.source_manager.source_forms(registry),
"source".into(),
stream,
ResourceArrayType::Available,
&mut request,
);
for worker_name in &root.workers {
let worker = registry.find::<WorkerActor>(worker_name);
let thread = registry.find::<ThreadActor>(&worker.thread);
let worker_sources = thread.source_manager.sources();
worker.resources_available(
worker_sources.iter().collect(),
worker.resources_array(
thread.source_manager.source_forms(registry),
"source".into(),
stream,
ResourceArrayType::Available,
&mut request,
);
}
},
"console-message" | "error-message" => {},
"network-event" => {},
_ => warn!("resource {} not handled yet", resource),
}
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
}
ActorMessageStatus::Processed
let msg = EmptyReplyMsg { from: self.name() };
request.reply_final(&msg)?
},
"getParentBrowsingContextID" => {
let msg = GetParentBrowsingContextIDReply {
from: self.name(),
browsing_context_id: target.browsing_context_id.value(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getNetworkParentActor" => {
let network_parent = registry.find::<NetworkParentActor>(&self.network_parent);
@@ -339,8 +352,7 @@ impl Actor for WatcherActor {
from: self.name(),
network: network_parent.encodable(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getTargetConfigurationActor" => {
let target_configuration =
@@ -349,8 +361,7 @@ impl Actor for WatcherActor {
from: self.name(),
configuration: target_configuration.encodable(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getThreadConfigurationActor" => {
let thread_configuration =
@@ -359,24 +370,24 @@ impl Actor for WatcherActor {
from: self.name(),
configuration: thread_configuration.encodable(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
"getBreakpointListActor" => {
let breakpoint_list_name = registry.new_name("breakpoint-list");
let breakpoint_list = BreakpointListActor::new(breakpoint_list_name.clone());
registry.register_later(Box::new(breakpoint_list));
let _ = stream.write_json_packet(&GetBreakpointListActorReply {
let breakpoint_list = registry.find::<BreakpointListActor>(&self.breakpoint_list);
request.reply_final(&GetBreakpointListActorReply {
from: self.name(),
breakpoint_list: GetBreakpointListActorReplyInner {
actor: breakpoint_list_name,
},
});
ActorMessageStatus::Processed
breakpoint_list: breakpoint_list.encodable(),
})?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}
impl ResourceAvailable for WatcherActor {
fn actor_name(&self) -> String {
self.name.clone()
}
}
@@ -391,6 +402,7 @@ impl WatcherActor {
TargetConfigurationActor::new(actors.new_name("target-configuration"));
let thread_configuration =
ThreadConfigurationActor::new(actors.new_name("thread-configuration"));
let breakpoint_list = BreakpointListActor::new(actors.new_name("breakpoint-list"));
let watcher = Self {
name: actors.new_name("watcher"),
@@ -398,12 +410,14 @@ impl WatcherActor {
network_parent: network_parent.name(),
target_configuration: target_configuration.name(),
thread_configuration: thread_configuration.name(),
breakpoint_list: breakpoint_list.name(),
session_context,
};
actors.register(Box::new(network_parent));
actors.register(Box::new(target_configuration));
actors.register(Box::new(thread_configuration));
actors.register(Box::new(breakpoint_list));
watcher
}
@@ -417,4 +431,33 @@ impl WatcherActor {
},
}
}
pub fn emit_will_navigate(
&self,
browsing_context_id: BrowsingContextId,
url: ServoUrl,
connections: &mut Vec<TcpStream>,
id_map: &mut IdMap,
) {
let msg = WillNavigateMessage {
browsing_context_id: id_map.browsing_context_id(browsing_context_id).value(),
inner_window_id: 0, // TODO: set this to the correct value
name: "will-navigate".to_string(),
time: SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_millis(),
is_frame_switching: false, // TODO: Implement frame switching
new_uri: url,
};
for stream in connections {
self.resource_array(
msg.clone(),
"document-event".to_string(),
ResourceArrayType::Available,
stream,
);
}
}
}

View File

@@ -2,13 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
use crate::{EmptyReplyMsg, StreamId};
#[derive(Serialize)]
@@ -30,20 +28,20 @@ impl Actor for NetworkParentActor {
/// - `setSaveRequestAndResponseBodies`: Doesn't do anything yet
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"setSaveRequestAndResponseBodies" => {
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -6,17 +6,16 @@
//! This actor manages the configuration flags that the devtools host can apply to the targets.
use std::collections::HashMap;
use std::net::TcpStream;
use embedder_traits::Theme;
use log::warn;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::actors::browsing_context::BrowsingContextActor;
use crate::actors::tab::TabDescriptorActor;
use crate::protocol::JsonPacketStream;
use crate::protocol::ClientRequest;
use crate::{EmptyReplyMsg, RootActor, StreamId};
#[derive(Serialize)]
@@ -48,22 +47,19 @@ impl Actor for TargetConfigurationActor {
/// - `updateConfiguration`: Receives new configuration flags from the devtools host.
fn handle_message(
&self,
request: ClientRequest,
registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"updateConfiguration" => {
let config = match msg.get("configuration").and_then(|v| v.as_object()) {
Some(config) => config,
None => {
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
return Ok(ActorMessageStatus::Processed);
},
};
let config = msg
.get("configuration")
.ok_or(ActorError::MissingParameter)?
.as_object()
.ok_or(ActorError::BadParameterType)?;
if let Some(scheme) = config.get("colorSchemeSimulation").and_then(|v| v.as_str()) {
let theme = match scheme {
"dark" => Theme::Dark,
@@ -76,17 +72,19 @@ impl Actor for TargetConfigurationActor {
let browsing_context_name = tab_actor.browsing_context();
let browsing_context_actor =
registry.find::<BrowsingContextActor>(&browsing_context_name);
browsing_context_actor.simulate_color_scheme(theme)?;
browsing_context_actor
.simulate_color_scheme(theme)
.map_err(|_| ActorError::Internal)?;
} else {
warn!("No active tab for updateConfiguration");
}
}
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -6,13 +6,12 @@
//! This actor manages the configuration flags that the devtools host can apply to threads.
use std::collections::HashMap;
use std::net::TcpStream;
use serde::Serialize;
use serde_json::{Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::ClientRequest;
use crate::{EmptyReplyMsg, StreamId};
#[derive(Serialize)]
@@ -35,21 +34,21 @@ impl Actor for ThreadConfigurationActor {
/// - `updateConfiguration`: Receives new configuration flags from the devtools host.
fn handle_message(
&self,
request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"updateConfiguration" => {
// TODO: Actually update configuration
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
request.reply_final(&msg)?
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
}

View File

@@ -15,8 +15,8 @@ use serde_json::{Map, Value};
use servo_url::ServoUrl;
use crate::StreamId;
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::protocol::JsonPacketStream;
use crate::actor::{Actor, ActorError, ActorRegistry};
use crate::protocol::{ClientRequest, JsonPacketStream};
use crate::resource::ResourceAvailable;
#[derive(Clone, Copy)]
@@ -68,30 +68,28 @@ impl Actor for WorkerActor {
}
fn handle_message(
&self,
mut request: ClientRequest,
_registry: &ActorRegistry,
msg_type: &str,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
stream_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
) -> Result<(), ActorError> {
match msg_type {
"attach" => {
let msg = AttachedReply {
from: self.name(),
type_: "attached".to_owned(),
url: self.url.as_str().to_owned(),
};
if stream.write_json_packet(&msg).is_err() {
return Ok(ActorMessageStatus::Processed);
}
// FIXME: we dont send an actual reply (message without type), which seems to be a bug?
request.write_json_packet(&msg)?;
self.streams
.borrow_mut()
.insert(stream_id, stream.try_clone().unwrap());
.insert(stream_id, request.try_clone_stream().unwrap());
// FIXME: fix messages to not require forging a pipeline for worker messages
self.script_chan
.send(WantsLiveNotifications(TEST_PIPELINE_ID, true))
.unwrap();
ActorMessageStatus::Processed
},
"connect" => {
@@ -101,8 +99,8 @@ impl Actor for WorkerActor {
thread_actor: self.thread.clone(),
console_actor: self.console.clone(),
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
// FIXME: we dont send an actual reply (message without type), which seems to be a bug?
request.write_json_packet(&msg)?;
},
"detach" => {
@@ -110,13 +108,14 @@ impl Actor for WorkerActor {
from: self.name(),
type_: "detached".to_string(),
};
let _ = stream.write_json_packet(&msg);
self.cleanup(stream_id);
ActorMessageStatus::Processed
// FIXME: we dont send an actual reply (message without type), which seems to be a bug?
request.write_json_packet(&msg)?;
},
_ => ActorMessageStatus::Ignored,
})
_ => return Err(ActorError::UnrecognizedPacketType),
};
Ok(())
}
fn cleanup(&self, stream_id: StreamId) {

View File

@@ -13,7 +13,6 @@
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::io::Read;
use std::net::{Shutdown, TcpListener, TcpStream};
use std::sync::{Arc, Mutex};
@@ -28,8 +27,8 @@ use devtools_traits::{
};
use embedder_traits::{AllowOrDeny, EmbedderMsg, EmbedderProxy};
use ipc_channel::ipc::{self, IpcSender};
use log::trace;
use resource::ResourceAvailable;
use log::{trace, warn};
use resource::{ResourceArrayType, ResourceAvailable};
use serde::Serialize;
use servo_rand::RngCore;
@@ -43,8 +42,9 @@ use crate::actors::performance::PerformanceActor;
use crate::actors::preference::PreferenceActor;
use crate::actors::process::ProcessActor;
use crate::actors::root::RootActor;
use crate::actors::source::{SourceActor, SourceData};
use crate::actors::source::SourceActor;
use crate::actors::thread::ThreadActor;
use crate::actors::watcher::WatcherActor;
use crate::actors::worker::{WorkerActor, WorkerType};
use crate::id::IdMap;
use crate::network_handler::handle_network_event;
@@ -59,6 +59,7 @@ mod actors {
pub mod device;
pub mod framerate;
pub mod inspector;
pub mod long_string;
pub mod memory;
pub mod network_event;
pub mod object;
@@ -120,6 +121,7 @@ struct DevtoolsInstance {
actor_workers: HashMap<WorkerId, String>,
actor_requests: HashMap<String, String>,
connections: HashMap<StreamId, TcpStream>,
next_resource_id: u64,
}
impl DevtoolsInstance {
@@ -182,6 +184,7 @@ impl DevtoolsInstance {
actor_requests: HashMap::new(),
actor_workers: HashMap::new(),
connections: HashMap::new(),
next_resource_id: 1,
};
thread::Builder::new()
@@ -252,10 +255,14 @@ impl DevtoolsInstance {
console_message,
worker_id,
)) => self.handle_console_message(pipeline_id, worker_id, console_message),
DevtoolsControlMsg::FromScript(ScriptToDevtoolsControlMsg::ScriptSourceLoaded(
DevtoolsControlMsg::FromScript(ScriptToDevtoolsControlMsg::CreateSourceActor(
script_sender,
pipeline_id,
source_info,
)) => self.handle_script_source_info(pipeline_id, source_info),
)) => self.handle_create_source_actor(script_sender, pipeline_id, source_info),
DevtoolsControlMsg::FromScript(
ScriptToDevtoolsControlMsg::UpdateSourceContent(pipeline_id, source_content),
) => self.handle_update_source_content(pipeline_id, source_content),
DevtoolsControlMsg::FromScript(ScriptToDevtoolsControlMsg::ReportPageError(
pipeline_id,
page_error,
@@ -284,11 +291,7 @@ impl DevtoolsInstance {
connections.push(stream.try_clone().unwrap());
}
let pipeline_id = match network_event {
NetworkEvent::HttpResponse(ref response) => response.pipeline_id,
NetworkEvent::HttpRequest(ref request) => request.pipeline_id,
};
self.handle_network_event(connections, pipeline_id, request_id, network_event);
self.handle_network_event(connections, request_id, network_event);
},
DevtoolsControlMsg::FromChrome(ChromeToDevtoolsControlMsg::ServerExitMsg) => break,
}
@@ -308,11 +311,23 @@ impl DevtoolsInstance {
fn handle_navigate(&self, browsing_context_id: BrowsingContextId, state: NavigationState) {
let actor_name = self.browsing_contexts.get(&browsing_context_id).unwrap();
self.actors
.lock()
.unwrap()
.find::<BrowsingContextActor>(actor_name)
.navigate(state, &mut self.id_map.lock().expect("Mutex poisoned"));
let actors = self.actors.lock().unwrap();
let actor = actors.find::<BrowsingContextActor>(actor_name);
let mut id_map = self.id_map.lock().expect("Mutex poisoned");
if let NavigationState::Start(url) = &state {
let mut connections = Vec::<TcpStream>::new();
for stream in self.connections.values() {
connections.push(stream.try_clone().unwrap());
}
let watcher_actor = actors.find::<WatcherActor>(&actor.watcher);
watcher_actor.emit_will_navigate(
browsing_context_id,
url.clone(),
&mut connections,
&mut id_map,
);
};
actor.navigate(state, &mut id_map);
}
// We need separate actor representations for each script global that exists;
@@ -474,17 +489,30 @@ impl DevtoolsInstance {
fn handle_network_event(
&mut self,
connections: Vec<TcpStream>,
pipeline_id: PipelineId,
request_id: String,
network_event: NetworkEvent,
) {
let netevent_actor_name = self.find_network_event_actor(request_id);
let browsing_context_id = match &network_event {
NetworkEvent::HttpRequest(req) => req.browsing_context_id,
NetworkEvent::HttpRequestUpdate(req) => req.browsing_context_id,
NetworkEvent::HttpResponse(resp) => resp.browsing_context_id,
};
let Some(id) = self.pipelines.get(&pipeline_id) else {
let Some(browsing_context_actor_name) = self.browsing_contexts.get(&browsing_context_id)
else {
return;
};
let Some(browsing_context_actor_name) = self.browsing_contexts.get(id) else {
return;
let watcher_name = self
.actors
.lock()
.unwrap()
.find::<BrowsingContextActor>(browsing_context_actor_name)
.watcher
.clone();
let netevent_actor_name = match self.actor_requests.get(&request_id) {
Some(name) => name.clone(),
None => self.create_network_event_actor(request_id, watcher_name),
};
handle_network_event(
@@ -492,37 +520,47 @@ impl DevtoolsInstance {
netevent_actor_name,
connections,
network_event,
browsing_context_actor_name.to_string(),
)
}
// Find the name of NetworkEventActor corresponding to request_id
// Create a new one if it does not exist, add it to the actor_requests hashmap
fn find_network_event_actor(&mut self, request_id: String) -> String {
/// Create a new NetworkEventActor for a given request ID and watcher name.
fn create_network_event_actor(&mut self, request_id: String, watcher_name: String) -> String {
let mut actors = self.actors.lock().unwrap();
match self.actor_requests.entry(request_id) {
Occupied(name) => {
//TODO: Delete from map like Firefox does?
name.into_mut().clone()
},
Vacant(entry) => {
let actor_name = actors.new_name("netevent");
let actor = NetworkEventActor::new(actor_name.clone());
entry.insert(actor_name.clone());
actors.register(Box::new(actor));
actor_name
},
}
let resource_id = self.next_resource_id;
self.next_resource_id += 1;
let actor_name = actors.new_name("netevent");
let actor = NetworkEventActor::new(actor_name.clone(), resource_id, watcher_name);
self.actor_requests.insert(request_id, actor_name.clone());
actors.register(Box::new(actor));
actor_name
}
fn handle_script_source_info(&mut self, pipeline_id: PipelineId, source_info: SourceInfo) {
fn handle_create_source_actor(
&mut self,
script_sender: IpcSender<DevtoolScriptControlMsg>,
pipeline_id: PipelineId,
source_info: SourceInfo,
) {
let mut actors = self.actors.lock().unwrap();
let source_actor_name = SourceActor::new_source(
let source_content = source_info
.content
.or_else(|| actors.inline_source_content(pipeline_id));
let source_actor = SourceActor::new_registered(
&mut actors,
source_info.content.clone(),
source_info.content_type.unwrap(),
pipeline_id,
source_info.url,
source_content,
source_info.content_type,
source_info.spidermonkey_id,
source_info.introduction_type,
script_sender,
);
let source_actor_name = source_actor.name.clone();
let source_form = source_actor.source_form();
if let Some(worker_id) = source_info.worker_id {
let Some(worker_actor_name) = self.actor_workers.get(&worker_id) else {
@@ -532,23 +570,17 @@ impl DevtoolsInstance {
let thread_actor_name = actors.find::<WorkerActor>(worker_actor_name).thread.clone();
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
thread_actor.source_manager.add_source(
source_info.url.clone(),
source_info.content.clone(),
source_actor_name.clone(),
);
let source = SourceData {
actor: source_actor_name,
url: source_info.url.to_string(),
is_black_boxed: false,
source_content: source_info.content,
};
thread_actor.source_manager.add_source(&source_actor_name);
let worker_actor = actors.find::<WorkerActor>(worker_actor_name);
for stream in self.connections.values_mut() {
worker_actor.resource_available(&source, "source".into(), stream);
worker_actor.resource_array(
&source_form,
"source".into(),
ResourceArrayType::Available,
stream,
);
}
} else {
let Some(browsing_context_id) = self.pipelines.get(&pipeline_id) else {
@@ -565,27 +597,36 @@ impl DevtoolsInstance {
let thread_actor = actors.find_mut::<ThreadActor>(&thread_actor_name);
thread_actor.source_manager.add_source(
source_info.url.clone(),
source_info.content.clone(),
source_actor_name.clone(),
);
let source = SourceData {
actor: source_actor_name,
url: source_info.url.to_string(),
is_black_boxed: false,
source_content: source_info.content,
};
thread_actor.source_manager.add_source(&source_actor_name);
// Notify browsing context about the new source
let browsing_context = actors.find::<BrowsingContextActor>(actor_name);
for stream in self.connections.values_mut() {
browsing_context.resource_available(&source, "source".into(), stream);
browsing_context.resource_array(
&source_form,
"source".into(),
ResourceArrayType::Available,
stream,
);
}
}
}
fn handle_update_source_content(&mut self, pipeline_id: PipelineId, source_content: String) {
let mut actors = self.actors.lock().unwrap();
for actor_name in actors.source_actor_names_for_pipeline(pipeline_id) {
let source_actor: &mut SourceActor = actors.find_mut(&actor_name);
if source_actor.content.is_none() {
source_actor.content = Some(source_content.clone());
}
}
// Store the source content separately for any future source actors that get created *after* we finish parsing
// the HTML. For example, adding an `import` to an inline module script can delay it until after parsing.
actors.set_inline_source_content(pipeline_id, source_content);
}
}
fn allow_devtools_client(stream: &mut TcpStream, embedder: &EmbedderProxy, token: &str) -> bool {
@@ -619,8 +660,8 @@ fn allow_devtools_client(stream: &mut TcpStream, embedder: &EmbedderProxy, token
fn handle_client(actors: Arc<Mutex<ActorRegistry>>, mut stream: TcpStream, stream_id: StreamId) {
log::info!("Connection established to {}", stream.peer_addr().unwrap());
let msg = actors.lock().unwrap().find::<RootActor>("root").encodable();
if let Err(e) = stream.write_json_packet(&msg) {
log::warn!("Error writing response: {:?}", e);
if let Err(error) = stream.write_json_packet(&msg) {
warn!("Failed to send initial packet from root actor: {error:?}");
return;
}

View File

@@ -9,32 +9,10 @@ use devtools_traits::NetworkEvent;
use serde::Serialize;
use crate::actor::ActorRegistry;
use crate::actors::browsing_context::BrowsingContextActor;
use crate::actors::network_event::NetworkEventActor;
use crate::resource::ResourceAvailable;
use crate::actors::watcher::WatcherActor;
use crate::resource::{ResourceArrayType, ResourceAvailable};
#[derive(Clone, Serialize)]
struct ResourcesUpdatedArray {
updates: Vec<UpdateEntry>,
}
#[derive(Clone, Serialize)]
struct UpdateEntry {
#[serde(rename = "updateType")]
update_type: String,
data: serde_json::Value,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct EventTimingsUpdateMsg {
total_time: u64,
}
#[derive(Serialize)]
struct SecurityInfoUpdateMsg {
state: String,
}
#[derive(Clone, Serialize)]
pub struct Cause {
#[serde(rename = "type")]
@@ -48,84 +26,61 @@ pub(crate) fn handle_network_event(
netevent_actor_name: String,
mut connections: Vec<TcpStream>,
network_event: NetworkEvent,
browsing_context_actor_name: String,
) {
let mut actors = actors.lock().unwrap();
let actor = actors.find_mut::<NetworkEventActor>(&netevent_actor_name);
let watcher_name = actor.watcher_name.clone();
match network_event {
NetworkEvent::HttpRequest(httprequest) => {
// Scope mutable borrow
let event_actor = {
let actor = actors.find_mut::<NetworkEventActor>(&netevent_actor_name);
actor.add_request(httprequest);
actor.event_actor()
};
actor.add_request(httprequest);
let event_actor = actor.event_actor();
let resource_updates = actor.resource_updates();
let watcher_actor = actors.find::<WatcherActor>(&watcher_name);
let browsing_context_actor =
actors.find::<BrowsingContextActor>(&browsing_context_actor_name);
for stream in &mut connections {
browsing_context_actor.resource_available(
watcher_actor.resource_array(
event_actor.clone(),
"network-event".to_string(),
ResourceArrayType::Available,
stream,
);
// Also push initial resource update (request headers, cookies)
watcher_actor.resource_array(
resource_updates.clone(),
"network-event".to_string(),
ResourceArrayType::Updated,
stream,
);
}
},
NetworkEvent::HttpRequestUpdate(httprequest) => {
actor.add_request(httprequest);
let resource = actor.resource_updates();
let watcher_actor = actors.find::<WatcherActor>(&watcher_name);
for stream in &mut connections {
watcher_actor.resource_array(
resource.clone(),
"network-event".to_string(),
ResourceArrayType::Updated,
stream,
);
}
},
NetworkEvent::HttpResponse(httpresponse) => {
// Scope mutable borrow
let resource = {
let actor = actors.find_mut::<NetworkEventActor>(&netevent_actor_name);
// Store the response information in the actor
actor.add_response(httpresponse);
ResourcesUpdatedArray {
updates: vec![
UpdateEntry {
update_type: "requestHeaders".to_owned(),
data: serde_json::to_value(actor.request_headers()).unwrap(),
},
UpdateEntry {
update_type: "requestCookies".to_owned(),
data: serde_json::to_value(actor.request_cookies()).unwrap(),
},
UpdateEntry {
update_type: "responseStart".to_owned(),
data: serde_json::to_value(actor.response_start()).unwrap(),
},
UpdateEntry {
update_type: "eventTimings".to_owned(),
data: serde_json::to_value(EventTimingsUpdateMsg {
total_time: actor.total_time().as_millis() as u64,
})
.unwrap(),
},
UpdateEntry {
update_type: "securityInfo".to_owned(),
data: serde_json::to_value(SecurityInfoUpdateMsg {
state: "insecure".to_owned(),
})
.unwrap(),
},
UpdateEntry {
update_type: "responseContent".to_owned(),
data: serde_json::to_value(actor.response_content()).unwrap(),
},
UpdateEntry {
update_type: "responseCookies".to_owned(),
data: serde_json::to_value(actor.response_cookies()).unwrap(),
},
UpdateEntry {
update_type: "responseHeaders".to_owned(),
data: serde_json::to_value(actor.response_headers()).unwrap(),
},
],
}
};
// Store the response information in the actor
actor.add_response(httpresponse);
let resource = actor.resource_updates();
let watcher_actor = actors.find::<WatcherActor>(&watcher_name);
let browsing_context_actor =
actors.find::<BrowsingContextActor>(&browsing_context_actor_name);
for stream in &mut connections {
browsing_context_actor.resource_available(
watcher_actor.resource_array(
resource.clone(),
"resources-updated".to_string(),
"network-event".to_string(),
ResourceArrayType::Updated,
stream,
);
}

View File

@@ -5,13 +5,14 @@
//! Low-level wire protocol implementation. Currently only supports
//! [JSON packets](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#json-packets).
use std::error::Error;
use std::io::{Read, Write};
use std::net::TcpStream;
use log::debug;
use serde::Serialize;
use serde_json::{self, Value};
use serde_json::{self, Value, json};
use crate::actor::ActorError;
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
@@ -29,42 +30,18 @@ pub struct Method {
}
pub trait JsonPacketStream {
fn write_json_packet<T: Serialize>(&mut self, obj: &T) -> Result<(), Box<dyn Error>>;
#[allow(dead_code)]
fn write_merged_json_packet<T: Serialize, U: Serialize>(
&mut self,
base: &T,
extra: &U,
) -> Result<(), Box<dyn Error>>;
fn write_json_packet<T: Serialize>(&mut self, message: &T) -> Result<(), ActorError>;
fn read_json_packet(&mut self) -> Result<Option<Value>, String>;
}
impl JsonPacketStream for TcpStream {
fn write_json_packet<T: Serialize>(&mut self, obj: &T) -> Result<(), Box<dyn Error>> {
let s = serde_json::to_string(obj)?;
fn write_json_packet<T: Serialize>(&mut self, message: &T) -> Result<(), ActorError> {
let s = serde_json::to_string(message).map_err(|_| ActorError::Internal)?;
debug!("<- {}", s);
write!(self, "{}:{}", s.len(), s)?;
write!(self, "{}:{}", s.len(), s).map_err(|_| ActorError::Internal)?;
Ok(())
}
fn write_merged_json_packet<T: Serialize, U: Serialize>(
&mut self,
base: &T,
extra: &U,
) -> Result<(), Box<dyn Error>> {
let mut obj = serde_json::to_value(base)?;
let obj = obj.as_object_mut().unwrap();
let extra = serde_json::to_value(extra)?;
let extra = extra.as_object().unwrap();
for (key, value) in extra {
obj.insert(key.to_owned(), value.to_owned());
}
self.write_json_packet(obj)
}
fn read_json_packet(&mut self) -> Result<Option<Value>, String> {
// https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html#stream-transport
// In short, each JSON packet is [ascii length]:[JSON data of given length]
@@ -102,3 +79,106 @@ impl JsonPacketStream for TcpStream {
}
}
}
/// Wrapper around a client stream that guarantees request/reply invariants.
///
/// Client messages, which are always requests, are dispatched to Actor instances one at a time via
/// [`crate::Actor::handle_message`]. Each request must be paired with exactly one reply from the
/// same actor the request was sent to, where a reply is a message with no type (if a message from
/// the server has a type, its a notification, not a reply).
///
/// Failing to reply to a request will almost always permanently break that actor, because either
/// the client gets stuck waiting for a reply, or the client receives the reply for a subsequent
/// request as if it was the reply for the current request. If an actor fails to reply to a request,
/// we want the dispatcher ([`crate::ActorRegistry::handle_message`]) to send an error of type
/// `unrecognizedPacketType`, to keep the conversation for that actor in sync.
///
/// Since replies come in all shapes and sizes, we want to allow Actor types to send replies without
/// having to return them to the dispatcher. This wrapper type allows the dispatcher to check if a
/// valid reply was sent, and guarantees that if the actor tries to send a reply, its actually a
/// valid reply (see [`Self::is_valid_reply`]).
///
/// It does not currently guarantee anything about messages sent via the [`TcpStream`] released via
/// [`Self::try_clone_stream`] or the return value of [`Self::reply`].
pub struct ClientRequest<'req, 'sent> {
/// Client stream.
stream: &'req mut TcpStream,
/// Expected actor name.
actor_name: &'req str,
/// Sent flag, allowing ActorRegistry to check for unhandled requests.
sent: &'sent mut bool,
}
impl ClientRequest<'_, '_> {
/// Run the given handler, with a new request that wraps the given client stream and expected actor name.
///
/// Returns [`ActorError::UnrecognizedPacketType`] if the actor did not send a reply.
pub fn handle<'req>(
client: &'req mut TcpStream,
actor_name: &'req str,
handler: impl FnOnce(ClientRequest<'req, '_>) -> Result<(), ActorError>,
) -> Result<(), ActorError> {
let mut sent = false;
let request = ClientRequest {
stream: client,
actor_name,
sent: &mut sent,
};
handler(request)?;
if sent {
Ok(())
} else {
Err(ActorError::UnrecognizedPacketType)
}
}
}
impl<'req> ClientRequest<'req, '_> {
/// Send the given reply to the request being handled.
///
/// If successful, sets the sent flag and returns the underlying stream,
/// allowing other messages to be sent after replying to a request.
pub fn reply<T: Serialize>(self, reply: &T) -> Result<&'req mut TcpStream, ActorError> {
debug_assert!(self.is_valid_reply(reply), "Message is not a valid reply");
self.stream.write_json_packet(reply)?;
*self.sent = true;
Ok(self.stream)
}
/// Like `reply`, but for cases where the actor no longer needs the stream.
pub fn reply_final<T: Serialize>(self, reply: &T) -> Result<(), ActorError> {
debug_assert!(self.is_valid_reply(reply), "Message is not a valid reply");
let _stream = self.reply(reply)?;
Ok(())
}
pub fn try_clone_stream(&self) -> std::io::Result<TcpStream> {
self.stream.try_clone()
}
/// Return true iff the given message is a reply (has no `type` or `to`), and is from the expected actor.
///
/// This incurs a runtime conversion to a BTreeMap, so it should only be used in debug assertions.
fn is_valid_reply<T: Serialize>(&self, message: &T) -> bool {
let reply = json!(message);
reply.get("from").and_then(|from| from.as_str()) == Some(self.actor_name) &&
reply.get("to").is_none() &&
reply.get("type").is_none()
}
}
/// Actors can also send other messages before replying to a request.
impl JsonPacketStream for ClientRequest<'_, '_> {
fn write_json_packet<T: Serialize>(&mut self, message: &T) -> Result<(), ActorError> {
debug_assert!(
!self.is_valid_reply(message),
"Replies must use reply() or reply_final()"
);
self.stream.write_json_packet(message)
}
fn read_json_packet(&mut self) -> Result<Option<Value>, String> {
self.stream.read_json_packet()
}
}

View File

@@ -2,12 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::net::TcpStream;
use serde::Serialize;
use crate::protocol::JsonPacketStream;
pub enum ResourceArrayType {
Available,
Updated,
}
#[derive(Serialize)]
pub(crate) struct ResourceAvailableReply<T: Serialize> {
pub from: String,
@@ -19,24 +22,29 @@ pub(crate) struct ResourceAvailableReply<T: Serialize> {
pub(crate) trait ResourceAvailable {
fn actor_name(&self) -> String;
fn resource_available<T: Serialize>(
fn resource_array<T: Serialize, S: JsonPacketStream>(
&self,
resource: T,
resource_type: String,
stream: &mut TcpStream,
array_type: ResourceArrayType,
stream: &mut S,
) {
self.resources_available(vec![resource], resource_type, stream);
self.resources_array(vec![resource], resource_type, array_type, stream);
}
fn resources_available<T: Serialize>(
fn resources_array<T: Serialize, S: JsonPacketStream>(
&self,
resources: Vec<T>,
resource_type: String,
stream: &mut TcpStream,
array_type: ResourceArrayType,
stream: &mut S,
) {
let msg = ResourceAvailableReply::<T> {
from: self.actor_name(),
type_: "resources-available-array".into(),
type_: match array_type {
ResourceArrayType::Available => "resources-available-array".to_string(),
ResourceArrayType::Updated => "resources-updated-array".to_string(),
},
array: vec![(resource_type, resources)],
};

View File

@@ -14,6 +14,9 @@ test = true
doctest = false
[features]
default = ["harfbuzz"]
harfbuzz = ["dep:harfbuzz-sys"]
harfrust = ["dep:harfrust"]
tracing = ["dep:tracing"]
[dependencies]
@@ -27,7 +30,8 @@ fnv = { workspace = true }
fonts_traits = { workspace = true }
fontsan = { git = "https://github.com/servo/fontsan" }
# FIXME (#34517): macOS only needs this when building libservo without `--features media-gstreamer`
harfbuzz-sys = { workspace = true, features = ["bundled"] }
harfbuzz-sys = { workspace = true, optional = true, features = ["bundled"] }
harfrust = { workspace = true, optional = true }
ipc-channel = { workspace = true }
itertools = { workspace = true }
libc = { workspace = true }
@@ -39,12 +43,14 @@ net_traits = { workspace = true }
num-traits = { workspace = true }
parking_lot = { workspace = true }
profile_traits = { workspace = true }
read-fonts = { workspace = true }
range = { path = "../range" }
serde = { workspace = true }
servo_arc = { workspace = true }
servo_config = { path = "../config" }
servo_url = { path = "../url" }
smallvec = { workspace = true, features = ["union"] }
skrifa = { workspace = true }
smallvec = { workspace = true }
stylo = { workspace = true }
stylo_atoms = { workspace = true }
tracing = { workspace = true, optional = true }
@@ -52,6 +58,7 @@ unicode-properties = { workspace = true }
unicode-script = { workspace = true }
url = { workspace = true }
webrender_api = { workspace = true }
servo-tracing = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
byteorder = { workspace = true }
@@ -70,8 +77,8 @@ fontconfig_sys = { package = "yeslogic-fontconfig-sys", version = "6" }
xml-rs = "0.8"
[target.'cfg(target_os = "windows")'.dependencies]
dwrote = "0.11.2"
truetype = { version = "0.47.3", features = ["ignore-invalid-language-ids"] }
dwrote = "0.11.4"
winapi = { workspace = true }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(ohos_mock)'] }

View File

@@ -4,6 +4,8 @@
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::hash::Hash;
use std::ops::Deref;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, OnceLock};
use std::time::Instant;
@@ -16,6 +18,7 @@ use euclid::num::Zero;
use log::debug;
use malloc_size_of_derive::MallocSizeOf;
use parking_lot::RwLock;
use read_fonts::tables::os2::{Os2, SelectionFlags};
use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use style::computed_values::font_variant_caps;
@@ -25,14 +28,14 @@ use style::values::computed::font::{
};
use style::values::computed::{FontStretch, FontStyle, FontWeight};
use unicode_script::Script;
use webrender_api::{FontInstanceFlags, FontInstanceKey};
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontVariation};
use crate::platform::font::{FontTable, PlatformFont};
pub use crate::platform::font_list::fallback_font_families;
use crate::{
ByteIndex, EmojiPresentationPreference, FallbackFontSelectionOptions, FontContext, FontData,
FontIdentifier, FontTemplateDescriptor, FontTemplateRef, FontTemplateRefMethods, GlyphData,
GlyphId, GlyphStore, LocalFontIdentifier, Shaper,
FontDataAndIndex, FontDataError, FontIdentifier, FontTemplateDescriptor, FontTemplateRef,
FontTemplateRefMethods, GlyphData, GlyphId, GlyphStore, LocalFontIdentifier, Shaper,
};
#[macro_export]
@@ -42,13 +45,15 @@ macro_rules! ot_tag {
};
}
pub const GPOS: u32 = ot_tag!('G', 'P', 'O', 'S');
pub const GSUB: u32 = ot_tag!('G', 'S', 'U', 'B');
pub const KERN: u32 = ot_tag!('k', 'e', 'r', 'n');
pub const SBIX: u32 = ot_tag!('s', 'b', 'i', 'x');
pub const CBDT: u32 = ot_tag!('C', 'B', 'D', 'T');
pub const COLR: u32 = ot_tag!('C', 'O', 'L', 'R');
pub const BASE: u32 = ot_tag!('B', 'A', 'S', 'E');
pub type OpenTypeTableTag = u32;
pub const GPOS: OpenTypeTableTag = ot_tag!('G', 'P', 'O', 'S');
pub const GSUB: OpenTypeTableTag = ot_tag!('G', 'S', 'U', 'B');
pub const KERN: OpenTypeTableTag = ot_tag!('k', 'e', 'r', 'n');
pub const SBIX: OpenTypeTableTag = ot_tag!('s', 'b', 'i', 'x');
pub const CBDT: OpenTypeTableTag = ot_tag!('C', 'B', 'D', 'T');
pub const COLR: OpenTypeTableTag = ot_tag!('C', 'O', 'L', 'R');
pub const BASE: OpenTypeTableTag = ot_tag!('B', 'A', 'S', 'E');
pub const LIGA: OpenTypeTableTag = ot_tag!('l', 'i', 'g', 'a');
pub const LAST_RESORT_GLYPH_ADVANCE: FractionalPixel = 10.0;
@@ -61,18 +66,11 @@ static TEXT_SHAPING_PERFORMANCE_COUNTER: AtomicUsize = AtomicUsize::new(0);
// resources needed by the graphics layer to draw glyphs.
pub trait PlatformFontMethods: Sized {
#[cfg_attr(
feature = "tracing",
tracing::instrument(
name = "PlatformFontMethods::new_from_template",
skip_all,
fields(servo_profiling = true),
level = "trace",
)
)]
#[servo_tracing::instrument(name = "PlatformFontMethods::new_from_template", skip_all)]
fn new_from_template(
template: FontTemplateRef,
pt_size: Option<Au>,
variations: &[FontVariation],
data: &Option<FontData>,
) -> Result<PlatformFont, &'static str> {
let template = template.borrow();
@@ -80,13 +78,14 @@ pub trait PlatformFontMethods: Sized {
match font_identifier {
FontIdentifier::Local(font_identifier) => {
Self::new_from_local_font_identifier(font_identifier, pt_size)
Self::new_from_local_font_identifier(font_identifier, pt_size, variations)
},
FontIdentifier::Web(_) => Self::new_from_data(
font_identifier,
data.as_ref()
.expect("Should never create a web font without data."),
pt_size,
variations,
),
}
}
@@ -94,12 +93,14 @@ pub trait PlatformFontMethods: Sized {
fn new_from_local_font_identifier(
font_identifier: LocalFontIdentifier,
pt_size: Option<Au>,
variations: &[FontVariation],
) -> Result<PlatformFont, &'static str>;
fn new_from_data(
font_identifier: FontIdentifier,
data: &FontData,
pt_size: Option<Au>,
variations: &[FontVariation],
) -> Result<PlatformFont, &'static str>;
/// Get a [`FontTemplateDescriptor`] from a [`PlatformFont`]. This is used to get
@@ -116,6 +117,32 @@ pub trait PlatformFontMethods: Sized {
/// Get the necessary [`FontInstanceFlags`]` for this font.
fn webrender_font_instance_flags(&self) -> FontInstanceFlags;
/// Return all the variation values that the font was instantiated with.
fn variations(&self) -> &[FontVariation];
fn descriptor_from_os2_table(os2: &Os2) -> FontTemplateDescriptor {
let mut style = FontStyle::NORMAL;
if os2.fs_selection().contains(SelectionFlags::ITALIC) {
style = FontStyle::ITALIC;
}
let weight = FontWeight::from_float(os2.us_weight_class() as f32);
let stretch = match os2.us_width_class() {
1 => FontStretch::ULTRA_CONDENSED,
2 => FontStretch::EXTRA_CONDENSED,
3 => FontStretch::CONDENSED,
4 => FontStretch::SEMI_CONDENSED,
5 => FontStretch::NORMAL,
6 => FontStretch::SEMI_EXPANDED,
7 => FontStretch::EXPANDED,
8 => FontStretch::EXTRA_EXPANDED,
9 => FontStretch::ULTRA_EXPANDED,
_ => FontStretch::NORMAL,
};
FontTemplateDescriptor::new(weight, stretch, style)
}
}
// Used to abstract over the shaper's choice of fixed int representation.
@@ -143,7 +170,7 @@ pub trait FontTableMethods {
fn buffer(&self) -> &[u8];
}
#[derive(Clone, Debug, Deserialize, MallocSizeOf, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub struct FontMetrics {
pub underline_size: Au,
pub underline_offset: Au,
@@ -199,18 +226,29 @@ pub struct FontDescriptor {
pub style: FontStyle,
pub variant: font_variant_caps::T,
pub pt_size: Au,
pub variation_settings: Vec<FontVariation>,
}
impl Eq for FontDescriptor {}
impl<'a> From<&'a FontStyleStruct> for FontDescriptor {
fn from(style: &'a FontStyleStruct) -> Self {
let variation_settings = style
.clone_font_variation_settings()
.0
.into_iter()
.map(|setting| FontVariation {
tag: setting.tag.0,
value: setting.value,
})
.collect();
FontDescriptor {
weight: style.font_weight,
stretch: style.font_stretch,
style: style.font_style,
variant: style.font_variant_caps,
pt_size: Au::from_f32_px(style.font_size.computed_size().px()),
variation_settings,
}
}
}
@@ -241,8 +279,9 @@ pub struct Font {
pub metrics: FontMetrics,
pub descriptor: FontDescriptor,
/// The data for this font. This might be uninitialized for system fonts.
data: OnceLock<FontData>,
/// The data for this font. And the index of the font within the data (in case it's a TTC)
/// This might be uninitialized for system fonts.
data_and_index: OnceLock<FontDataAndIndex>,
shaper: OnceLock<Shaper>,
cached_shape_data: RwLock<CachedShapeData>,
@@ -287,8 +326,12 @@ impl Font {
data: Option<FontData>,
synthesized_small_caps: Option<FontRef>,
) -> Result<Font, &'static str> {
let handle =
PlatformFont::new_from_template(template.clone(), Some(descriptor.pt_size), &data)?;
let handle = PlatformFont::new_from_template(
template.clone(),
Some(descriptor.pt_size),
&descriptor.variation_settings,
&data,
)?;
let metrics = handle.metrics();
Ok(Font {
@@ -296,7 +339,9 @@ impl Font {
template,
metrics,
descriptor,
data: data.map(OnceLock::from).unwrap_or_default(),
data_and_index: data
.map(|data| OnceLock::from(FontDataAndIndex { data, index: 0 }))
.unwrap_or_default(),
shaper: OnceLock::new(),
cached_shape_data: Default::default(),
font_instance_key: Default::default(),
@@ -331,17 +376,24 @@ impl Font {
/// Return the data for this `Font`. Note that this is currently highly inefficient for system
/// fonts and should not be used except in legacy canvas code.
pub fn data(&self) -> &FontData {
self.data.get_or_init(|| {
let FontIdentifier::Local(local_font_identifier) = self.identifier() else {
unreachable!("All web fonts should already have initialized data");
};
FontData::from_bytes(
&local_font_identifier
.read_data_from_file()
.unwrap_or_default(),
)
})
pub fn font_data_and_index(&self) -> Result<&FontDataAndIndex, FontDataError> {
if let Some(data_and_index) = self.data_and_index.get() {
return Ok(data_and_index);
}
let FontIdentifier::Local(local_font_identifier) = self.identifier() else {
unreachable!("All web fonts should already have initialized data");
};
let Some(data_and_index) = local_font_identifier.font_data_and_index() else {
return Err(FontDataError::FailedToLoad);
};
let data_and_index = self.data_and_index.get_or_init(move || data_and_index);
Ok(data_and_index)
}
pub fn variations(&self) -> &[FontVariation] {
self.handle.variations()
}
}
@@ -433,9 +485,8 @@ impl Font {
}
fn shape_text_harfbuzz(&self, text: &str, options: &ShapingOptions, glyphs: &mut GlyphStore) {
let this = self as *const Font;
self.shaper
.get_or_init(|| Shaper::new(this))
.get_or_init(|| Shaper::new(self))
.shape_text(text, options, glyphs);
}
@@ -464,14 +515,11 @@ impl Font {
None => continue,
};
let mut advance = Au::from_f64_px(self.glyph_h_advance(glyph_id));
if character == ' ' {
// https://drafts.csswg.org/css-text-3/#word-spacing-property
advance += options.word_spacing;
}
if let Some(letter_spacing) = options.letter_spacing {
advance += letter_spacing;
}
let mut advance = advance_for_shaped_glyph(
Au::from_f64_px(self.glyph_h_advance(glyph_id)),
character,
options,
);
let offset = prev_glyph_id.map(|prev| {
let h_kerning = Au::from_f64_px(self.glyph_h_kerning(prev, glyph_id));
advance += h_kerning;
@@ -554,12 +602,19 @@ impl Font {
/// Get the [`FontBaseline`] for this font.
pub fn baseline(&self) -> Option<FontBaseline> {
let this = self as *const Font;
self.shaper.get_or_init(|| Shaper::new(this)).baseline()
self.shaper.get_or_init(|| Shaper::new(self)).baseline()
}
}
pub type FontRef = Arc<Font>;
#[derive(Clone, MallocSizeOf)]
pub struct FontRef(#[conditional_malloc_size_of] pub(crate) Arc<Font>);
impl Deref for FontRef {
type Target = Arc<Font>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
/// A `FontGroup` is a prioritised list of fonts for a given set of font styles. It is used by
/// `TextRun` to decide which font to render a character with. If none of the fonts listed in the
@@ -922,7 +977,10 @@ pub struct FontBaseline {
/// ];
/// let mapped_weight = apply_font_config_to_style_mapping(&mapping, weight as f64);
/// ```
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[cfg(all(
any(target_os = "linux", target_os = "macos"),
not(target_env = "ohos")
))]
pub(crate) fn map_platform_values_to_style_values(mapping: &[(f64, f64)], value: f64) -> f64 {
if value < mapping[0].0 {
return mapping[0].1;
@@ -940,3 +998,25 @@ pub(crate) fn map_platform_values_to_style_values(mapping: &[(f64, f64)], value:
mapping[mapping.len() - 1].1
}
/// Computes the total advance for a glyph, taking `letter-spacing` and `word-spacing` into account.
pub(super) fn advance_for_shaped_glyph(
mut advance: Au,
character: char,
options: &ShapingOptions,
) -> Au {
if let Some(letter_spacing) = options.letter_spacing {
advance += letter_spacing;
};
// CSS 2.1 § 16.4 states that "word spacing affects each space (U+0020) and non-breaking
// space (U+00A0) left in the text after the white space processing rules have been
// applied. The effect of the property on other word-separator characters is undefined."
// We elect to only space the two required code points.
if character == ' ' || character == '\u{a0}' {
// https://drafts.csswg.org/css-text-3/#word-spacing-property
advance += options.word_spacing;
}
advance
}

View File

@@ -5,6 +5,7 @@
use std::collections::{HashMap, HashSet};
use std::default::Default;
use std::hash::{BuildHasherDefault, Hash, Hasher};
use std::ops::Deref;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
@@ -14,12 +15,12 @@ use compositing_traits::CrossProcessCompositorApi;
use fnv::FnvHasher;
use fonts_traits::StylesheetWebFontLoadFinishedCallback;
use log::{debug, trace};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use malloc_size_of_derive::MallocSizeOf;
use net_traits::request::{Destination, Referrer, RequestBuilder};
use net_traits::{CoreResourceThread, FetchResponseMsg, ResourceThreads, fetch_async};
use parking_lot::{Mutex, RwLock};
use servo_arc::Arc as ServoArc;
use servo_config::pref;
use servo_url::ServoUrl;
use style::Atom;
use style::computed_values::font_variant_caps::T as FontVariantCaps;
@@ -32,7 +33,7 @@ use style::shared_lock::SharedRwLockReadGuard;
use style::stylesheets::{CssRule, DocumentStyleSheet, FontFaceRule, StylesheetInDocument};
use style::values::computed::font::{FamilyName, FontFamilyNameSyntax, SingleFontFamily};
use url::Url;
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey};
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey, FontVariation};
use crate::font::{
Font, FontDescriptor, FontFamilyDescriptor, FontGroup, FontRef, FontSearchScope,
@@ -45,12 +46,27 @@ use crate::{FontData, LowercaseFontFamilyName, PlatformFontMethods, SystemFontSe
static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)
pub type FontParameters = (FontKey, Au, Vec<FontVariation>);
#[derive(MallocSizeOf)]
struct FontGroupRef(#[conditional_malloc_size_of] Arc<RwLock<FontGroup>>);
impl Deref for FontGroupRef {
type Target = Arc<RwLock<FontGroup>>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
/// The FontContext represents the per-thread/thread state necessary for
/// working with fonts. It is the public API used by the layout and
/// paint code. It talks directly to the system font service where
/// required.
#[derive(MallocSizeOf)]
pub struct FontContext {
#[conditional_malloc_size_of]
system_font_service_proxy: Arc<SystemFontServiceProxy>,
resource_threads: Mutex<CoreResourceThread>,
/// A sender that can send messages and receive replies from the compositor.
@@ -64,7 +80,7 @@ pub struct FontContext {
/// resolved [`FontGroup`] which contains information about all fonts that
/// can be selected with that style.
resolved_font_groups:
RwLock<HashMap<FontGroupCacheKey, Arc<RwLock<FontGroup>>, BuildHasherDefault<FnvHasher>>>,
RwLock<HashMap<FontGroupCacheKey, FontGroupRef, BuildHasherDefault<FnvHasher>>>,
web_fonts: CrossThreadFontStore,
@@ -74,7 +90,7 @@ pub struct FontContext {
/// A collection of WebRender [`FontInstanceKey`]s generated for the web fonts that
/// this [`FontContext`] controls.
webrender_font_instance_keys: RwLock<HashMap<(FontKey, Au), FontInstanceKey>>,
webrender_font_instance_keys: RwLock<HashMap<FontParameters, FontInstanceKey>>,
/// The data for each web font [`FontIdentifier`]. This data might be used by more than one
/// [`FontTemplate`] as each identifier refers to a URL.
@@ -83,26 +99,6 @@ pub struct FontContext {
have_removed_web_fonts: AtomicBool,
}
impl MallocSizeOf for FontContext {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
let font_cache_size = self
.fonts
.read()
.iter()
.map(|(key, font)| {
key.size_of(ops) + font.as_ref().map_or(0, |font| (*font).size_of(ops))
})
.sum::<usize>();
let font_group_cache_size = self
.resolved_font_groups
.read()
.iter()
.map(|(key, font_group)| key.size_of(ops) + (*font_group.read()).size_of(ops))
.sum::<usize>();
font_cache_size + font_group_cache_size
}
}
impl FontContext {
pub fn new(
system_font_service_proxy: Arc<SystemFontServiceProxy>,
@@ -116,7 +112,7 @@ impl FontContext {
compositor_api: Mutex::new(compositor_api),
fonts: Default::default(),
resolved_font_groups: Default::default(),
web_fonts: Arc::new(RwLock::default()),
web_fonts: Default::default(),
webrender_font_keys: RwLock::default(),
webrender_font_instance_keys: RwLock::default(),
have_removed_web_fonts: AtomicBool::new(false),
@@ -152,7 +148,7 @@ impl FontContext {
) -> Arc<RwLock<FontGroup>> {
let cache_key = FontGroupCacheKey { size, style };
if let Some(font_group) = self.resolved_font_groups.read().get(&cache_key) {
return font_group.clone();
return font_group.0.clone();
}
let mut descriptor = FontDescriptor::from(&*cache_key.style);
@@ -161,7 +157,7 @@ impl FontContext {
let font_group = Arc::new(RwLock::new(FontGroup::new(&cache_key.style, descriptor)));
self.resolved_font_groups
.write()
.insert(cache_key, font_group.clone());
.insert(cache_key, FontGroupRef(font_group.clone()));
font_group
}
@@ -268,22 +264,19 @@ impl FontContext {
/// Create a `Font` for use in layout calculations, from a `FontTemplateData` returned by the
/// cache thread and a `FontDescriptor` which contains the styling parameters.
#[cfg_attr(
feature = "tracing",
tracing::instrument(skip_all, fields(servo_profiling = true), level = "trace")
)]
#[servo_tracing::instrument(skip_all)]
fn create_font(
&self,
font_template: FontTemplateRef,
font_descriptor: FontDescriptor,
synthesized_small_caps: Option<FontRef>,
) -> Result<FontRef, &'static str> {
Ok(Arc::new(Font::new(
Ok(FontRef(Arc::new(Font::new(
font_template.clone(),
font_descriptor.clone(),
font_descriptor,
self.get_font_data(&font_template.identifier()),
synthesized_small_caps,
)?))
)?)))
}
pub(crate) fn create_font_instance_key(&self, font: &Font) -> FontInstanceKey {
@@ -292,11 +285,13 @@ impl FontContext {
font.template.identifier(),
font.descriptor.pt_size,
font.webrender_font_instance_flags(),
font.variations().to_owned(),
),
FontIdentifier::Web(_) => self.create_web_font_instance(
font.template.clone(),
font.descriptor.pt_size,
font.webrender_font_instance_flags(),
font.variations().to_owned(),
),
}
}
@@ -306,6 +301,7 @@ impl FontContext {
font_template: FontTemplateRef,
pt_size: Au,
flags: FontInstanceFlags,
variations: Vec<FontVariation>,
) -> FontInstanceKey {
let identifier = font_template.identifier().clone();
let font_data = self
@@ -325,10 +321,10 @@ impl FontContext {
font_key
});
let key = *self
*self
.webrender_font_instance_keys
.write()
.entry((font_key, pt_size))
.entry((font_key, pt_size, variations.clone()))
.or_insert_with(|| {
let font_instance_key = self.system_font_service_proxy.generate_font_instance_key();
self.compositor_api.lock().add_font_instance(
@@ -336,10 +332,10 @@ impl FontContext {
font_key,
pt_size.to_f32_px(),
flags,
variations,
);
font_instance_key
});
key
})
}
fn invalidate_font_groups_after_web_font_load(&self) {
@@ -369,10 +365,16 @@ impl FontContext {
}
if let FontFaceSourceFormat::String(string) = format_hint {
return string == "truetype" ||
string == "opentype" ||
string == "woff" ||
string == "woff2";
if string == "truetype" || string == "opentype" || string == "woff" || string == "woff2"
{
return true;
}
return pref!(layout_variable_fonts_enabled) &&
(string == "truetype-variations" ||
string == "opentype-variations" ||
string == "woff-variations" ||
string == "woff2-variations");
}
false
@@ -622,7 +624,7 @@ impl FontContextWebFontMethods for Arc<FontContext> {
});
let mut removed_instance_keys: HashSet<FontInstanceKey> = HashSet::new();
webrender_font_instance_keys.retain(|(font_key, _), instance_key| {
webrender_font_instance_keys.retain(|(font_key, _, _), instance_key| {
if removed_keys.contains(font_key) {
removed_instance_keys.insert(*instance_key);
false
@@ -867,11 +869,11 @@ impl RemoteWebFontDownloader {
let url: ServoUrl = self.url.clone().into();
let identifier = FontIdentifier::Web(url.clone());
let Ok(handle) = PlatformFont::new_from_data(identifier, &font_data, None) else {
let Ok(handle) = PlatformFont::new_from_data(identifier, &font_data, None, &[]) else {
return false;
};
let state = self.take_state();
let mut descriptor = handle.descriptor();
descriptor
.override_values_with_css_font_template_descriptors(&state.css_font_face_descriptors);

View File

@@ -3,6 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::collections::HashMap;
use std::ops::Deref;
use std::sync::Arc;
use log::warn;
@@ -21,7 +22,16 @@ pub struct FontStore {
web_fonts_loading_for_stylesheets: Vec<(DocumentStyleSheet, usize)>,
web_fonts_loading_for_script: usize,
}
pub(crate) type CrossThreadFontStore = Arc<RwLock<FontStore>>;
#[derive(Default, MallocSizeOf)]
pub(crate) struct CrossThreadFontStore(#[conditional_malloc_size_of] Arc<RwLock<FontStore>>);
impl Deref for CrossThreadFontStore {
type Target = Arc<RwLock<FontStore>>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl FontStore {
pub(crate) fn clear(&mut self) {

View File

@@ -315,7 +315,7 @@ impl<'a> DetailedGlyphStore {
// This struct is used by GlyphStore clients to provide new glyph data.
// It should be allocated on the stack and passed by reference to GlyphStore.
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub struct GlyphData {
id: GlyphId,
advance: Au,
@@ -606,7 +606,7 @@ impl GlyphStore {
pub fn iter_glyphs_for_byte_range(
&self,
range: &Range<ByteIndex>,
) -> impl Iterator<Item = GlyphInfo> + use<'_> {
) -> impl Iterator<Item = GlyphInfo<'_>> + use<'_> {
if range.begin() >= self.len() {
panic!("iter_glyphs_for_range: range.begin beyond length!");
}

View File

@@ -11,44 +11,20 @@ mod font_template;
mod glyph;
#[allow(unsafe_code)]
pub mod platform;
mod shaper;
mod shapers;
mod system_font_service;
use std::sync::Arc;
pub use font::*;
pub use font_context::*;
pub use font_store::*;
pub use font_template::*;
pub use fonts_traits::*;
pub use glyph::*;
use ipc_channel::ipc::IpcSharedMemory;
pub use platform::LocalFontIdentifier;
pub use shaper::*;
pub use shapers::*;
pub use system_font_service::*;
use unicode_properties::{EmojiStatus, UnicodeEmoji, emoji};
/// A data structure to store data for fonts. Data is stored internally in an
/// [`IpcSharedMemory`] handle, so that it can be send without serialization
/// across IPC channels.
#[derive(Clone)]
pub struct FontData(pub(crate) Arc<IpcSharedMemory>);
impl FontData {
pub fn from_bytes(bytes: &[u8]) -> Self {
Self(Arc::new(IpcSharedMemory::from_bytes(bytes)))
}
pub(crate) fn as_ipc_shared_memory(&self) -> Arc<IpcSharedMemory> {
self.0.clone()
}
}
impl AsRef<[u8]> for FontData {
fn as_ref(&self) -> &[u8] {
&self.0
}
}
/// Whether or not font fallback selection prefers the emoji or text representation
/// of a character. If `None` then either presentation is acceptable.
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -106,6 +82,7 @@ impl FallbackFontSelectionOptions {
}
}
#[cfg(feature = "harfbuzz")]
pub(crate) fn float_to_fixed(before: usize, f: f64) -> i32 {
((1i32 << before) as f64 * f) as i32
}

Some files were not shown because too many files have changed in this diff Show More