Commit graph

50943 commits

Author SHA1 Message Date
Oriol Brufau
bc6926d1fe
Implement CSSNestedDeclarations (#36248)
This is the CSSOM interface that represents a nested declarations rule.
https://drafts.csswg.org/css-nesting/#the-cssnestrule

Testing: `/_mozilla/mozilla/interfaces.https.html`. And once
`CSSStyleRule` becomes a `CSSGroupingRule` subclass, this will be
further covered by `/css/css-nestting/`.
This is part of #36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-01 11:20:46 +00:00
Oriol Brufau
e8d5a019a4
Enable CSS parent selector (&) (#36249)
Bumps Stylo to servo/stylo#164
Changelog:
bc4717c784...600b5c4297

Testing: covered by WPT
This is part of https://github.com/servo/servo/issues/36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-01 09:08:18 +00:00
Delan Azabani
30b712aaf9
devtools: Fix id collisions by using incrementing counters (#35971)
Devtools clients need a `browserId`, `browsingContextID`, and
`outerWindowID`, which correspond to WebViewId, BrowsingContextId, and
PipelineId in Servo. These u32 values were previously derived from our
sharded (u32,u32) id values by taking only the `index` (second u32) and
ignoring the `namespace_id` (first u32), leading to collisions.

This patch fixes that by mapping those Servo ids to sequential u32
values.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #35954

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-04-01 09:00:40 +00:00
Josh Matthews
fcef1dff9d
Fix null realm assertion when activating a service worker (#36256)
Ensure there is an active realm when dispatching the `activation` DOM
event to the ServiceWorker global.

Testing: Existing WPT coverage.
Fixes: #36114
Fixes: #36235
Fixes: #36231

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-01 08:13:02 +00:00
MDCODE247
be38c5478f
script: Use RegExpFlag_UnicodeSets when validating regular expressions in HTMLInputElement (#36236)
Changed `RegExpFlag_Unicode` to `RegExpFlag_UnicodeSets` in all
instances.

Testing: Ran `./mach test-wpt
tests/wpt/tests/html/semantics/forms/constraints/form-validation-validity-patternMismatch.html`
and all tests passed successfully.
Fixes: #36075

---------

Signed-off-by: MDCODE247 <ammedabubakard500@gmail.com>
2025-04-01 07:29:24 +00:00
Usman Yahaya Baba
fab7bbcd38
Add SimulateColorScheme command and script thread handling (#36253)
Implements Steps 2-3 of #35867:
- Adds `SimulateColorScheme` to `DevtoolScriptControlMsg` for light/dark
mode simulation.
- Handles it in `ScriptThread` with `handle_theme_change` to toggle
themes.

Testing: This PR does not require testing because it only adds
infrastructure (command and handler) but doesn’t yet integrate with
devtools actors.
Fixes: Part of #35867 (https://github.com/servo/servo/issues/35867)

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-04-01 02:08:27 +00:00
Simon Wülker
8b23801a24
Remove ServoParser::do_parse_sync (#36255)
The indirection through ServoParser::parse_sync does nothing, so the
method can simply be called directly.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-04-01 01:24:56 +00:00
Oriol Brufau
77525cef84
Enable css-nesting WPT tests (#36246)
So that we can see the improvement when enabling the feature.

Testing: This PR enables tests
This is part of #36245

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-31 19:07:27 +00:00
dependabot[bot]
7c691b6d59
build(deps): bump darling from 0.20.10 to 0.20.11 (#36244)
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.10 to
0.20.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/TedDriggs/darling/releases">darling's
releases</a>.</em></p>
<blockquote>
<h2>v0.20.11</h2>
<ul>
<li>Support <code>#[darling(with = ...)]</code> on the <code>data</code>
field when deriving <code>FromDeriveInput</code>. This allows the use of
simpler receiver types, such as a <code>Vec</code> of enum
variants.</li>
<li>Bump version of <code>proc-macro2</code> to 1.0.86.</li>
<li>Accept closures for <code>#[darling(with = ...)]</code> on fields in
<code>FromDeriveInput</code>, <code>FromMeta</code>,
<code>FromField</code>, etc. <a
href="https://redirect.github.com/TedDriggs/darling/issues/309">#309</a></li>
<li>Add <code>darling::util::Callable</code> to accept a path or closure
as a meta-item expression</li>
<li>Add <code>#[darling(from_word = ...)]</code> and
<code>#[darling(from_none = ...)]</code> to control shorthand and
fallback behaviors for structs and enums deriving <code>FromMeta</code>
<a
href="https://redirect.github.com/TedDriggs/darling/issues/320">#320</a></li>
<li>Add <code>FromMeta</code> impl for <code>syn::ExprRange</code> <a
href="https://github.com/TedDriggs/issues/329">#329</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md">darling's
changelog</a>.</em></p>
<blockquote>
<h2>v0.20.11 (March 28, 2025)</h2>
<ul>
<li>Support <code>#[darling(with = ...)]</code> on the <code>data</code>
field when deriving <code>FromDeriveInput</code>. This allows the use of
simpler receiver types, such as a <code>Vec</code> of enum
variants.</li>
<li>Bump version of <code>proc-macro2</code> to 1.0.86.</li>
<li>Accept closures for <code>#[darling(with = ...)]</code> on fields in
<code>FromDeriveInput</code>, <code>FromMeta</code>,
<code>FromField</code>, etc. <a
href="https://redirect.github.com/TedDriggs/darling/issues/309">#309</a></li>
<li>Add <code>darling::util::Callable</code> to accept a path or closure
as a meta-item expression</li>
<li>Add <code>#[darling(from_word = ...)]</code> and
<code>#[darling(from_none = ...)]</code> to control shorthand and
fallback behaviors for structs and enums deriving <code>FromMeta</code>
<a
href="https://redirect.github.com/TedDriggs/darling/issues/320">#320</a></li>
<li>Add <code>FromMeta</code> impl for <code>syn::ExprRange</code> <a
href="https://github.com/TedDriggs/issues/329">#329</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="82a51e0b65"><code>82a51e0</code></a>
Bump version to 0.20.11</li>
<li><a
href="61834da6a2"><code>61834da</code></a>
Impl FromMeta for syn::ExprRange (<a
href="https://redirect.github.com/TedDriggs/darling/issues/332">#332</a>)</li>
<li><a
href="f18d5d5388"><code>f18d5d5</code></a>
Add explicit implementations of <code>FromMeta</code> methods to
<code>SpannedValue</code> and `Ove...</li>
<li><a
href="a6e5f524b2"><code>a6e5f52</code></a>
Move generation of from_word body for unit variants</li>
<li><a
href="c8c8201521"><code>c8c8201</code></a>
Add from_word and from_none options</li>
<li><a
href="3a848ca282"><code>3a848ca</code></a>
Extract path-or-closure to darling::util::Callable</li>
<li><a
href="fa552e4fd7"><code>fa552e4</code></a>
Error if <code>attrs</code> field is declared and
<code>forward_attrs</code> is missing.</li>
<li><a
href="af24bdf87a"><code>af24bdf</code></a>
Reject extra data passed to unit enum variants</li>
<li><a
href="b7a248f8ee"><code>b7a248f</code></a>
Fix clippy violations by removing unnecessary iifetimes</li>
<li><a
href="b746a0c4a9"><code>b746a0c</code></a>
Accept a closure for <code>with</code> in lieu of a path for fields (<a
href="https://redirect.github.com/TedDriggs/darling/issues/310">#310</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/TedDriggs/darling/compare/v0.20.10...v0.20.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=darling&package-manager=cargo&previous-version=0.20.10&new-version=0.20.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-03-31 18:01:57 +00:00
dependabot[bot]
fe6b296a00
build(deps): bump socket2 from 0.5.8 to 0.5.9 (#36243)
Bumps [socket2](https://github.com/rust-lang/socket2) from 0.5.8 to
0.5.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/rust-lang/socket2/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=socket2&package-manager=cargo&previous-version=0.5.8&new-version=0.5.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-03-31 17:52:32 +00:00
Usman Yahaya Baba
f9831f2bea
Track the active tab and browsing context for devtools (#36168)
<!-- Please describe your changes on the following line: -->


---Part of #35867, per Step 5 suggestion. This PR:
- Adds active_tab (via RefCell) to RootActor, updated in
get_tab_msg_by_browser_id.
- Adds browsing_context() helper to TabDescriptorActor.
- Adds actor()`getter to TabDescriptorActorMsg for  access in root.rs.
-Creates the chain (Root - Tab - BrowsingContext) for routing
colorSchemeSimulation.
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [X ] `./mach build -d` does not report any errors
- [X ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they’re structural
setup for the actor chain and don’t change the system's behavior yet.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
2025-03-31 17:51:28 +00:00
dependabot[bot]
05e48c3d46
build(deps): bump iana-time-zone from 0.1.62 to 0.1.63 (#36242)
Bumps [iana-time-zone](https://github.com/strawlab/iana-time-zone) from
0.1.62 to 0.1.63.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/strawlab/iana-time-zone/blob/main/CHANGELOG.md">iana-time-zone's
changelog</a>.</em></p>
<blockquote>
<h2>[0.1.63] - 2025-03-31</h2>
<h3>Changes</h3>
<ul>
<li>Bump MSRV (minimum supported rust version) to 1.62 (<a
href="https://redirect.github.com/strawlab/iana-time-zone/pull/131">#131</a>)</li>
<li>Bump <code>windows-core</code> to <code>0.56-0.61</code> range (<a
href="https://redirect.github.com/strawlab/iana-time-zone/pull/131">#131</a>,
<a
href="https://redirect.github.com/strawlab/iana-time-zone/pull/133">#133</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6adcd016a8"><code>6adcd01</code></a>
Bump version number to 0.1.63</li>
<li><a
href="16f281a63e"><code>16f281a</code></a>
Merge pull request <a
href="https://redirect.github.com/strawlab/iana-time-zone/issues/133">#133</a>
from MarijnS95/windows-0.56</li>
<li><a
href="798e431925"><code>798e431</code></a>
Bump <code>windows-core</code> range to <code>0.56-0.61</code> and
regenerate with <code>0.59</code></li>
<li><a
href="66033d9a0f"><code>66033d9</code></a>
Bump <code>windows-core</code> to <code>0.56</code></li>
<li><a
href="10c843db67"><code>10c843d</code></a>
Merge pull request <a
href="https://redirect.github.com/strawlab/iana-time-zone/issues/131">#131</a>
from MarijnS95/windows-core-0.54</li>
<li><a
href="a26e540edb"><code>a26e540</code></a>
Bump <code>windows-core</code> to <code>0.53-0.54</code> range</li>
<li><a
href="5bad55850b"><code>5bad558</code></a>
WIP: Bump MSRV to 1.62</li>
<li><a
href="343f31b804"><code>343f31b</code></a>
Merge pull request <a
href="https://redirect.github.com/strawlab/iana-time-zone/issues/164">#164</a>
from strawlab/dev/astraw-fix-aix</li>
<li><a
href="995347ff2b"><code>995347f</code></a>
AIX: remove unused code</li>
<li>See full diff in <a
href="https://github.com/strawlab/iana-time-zone/compare/v0.1.62...v0.1.63">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=iana-time-zone&package-manager=cargo&previous-version=0.1.62&new-version=0.1.63)](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-03-31 17:50:24 +00:00
dependabot[bot]
c5efb063d8
build(deps): bump once_cell from 1.21.2 to 1.21.3 (#36241)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.21.2 to
1.21.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's
changelog</a>.</em></p>
<blockquote>
<h2>1.21.3</h2>
<ul>
<li>Outline more initialization in <code>race</code>: <a
href="https://redirect.github.com/matklad/once_cell/pull/284">#284</a>,
<a
href="https://redirect.github.com/matklad/once_cell/pull/285">#285</a>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="29e3d93cf0"><code>29e3d93</code></a>
Merge pull request <a
href="https://redirect.github.com/matklad/once_cell/issues/286">#286</a>
from briansmith/b/once-ref-dry</li>
<li><a
href="a206950676"><code>a206950</code></a>
Prepare for 1.21.3 release.</li>
<li><a
href="17d4a9b433"><code>17d4a9b</code></a>
DRY <code>race::OnceRef::{get_or_try_init, set}</code>.</li>
<li><a
href="01b1d560f4"><code>01b1d56</code></a>
Merge pull request <a
href="https://redirect.github.com/matklad/once_cell/issues/285">#285</a>
from briansmith/b/once-ref-cold</li>
<li><a
href="a851cc4788"><code>a851cc4</code></a>
Mark initialization of <code>OnceRef::get_or_try_init</code> cold.</li>
<li><a
href="2447a93fbe"><code>2447a93</code></a>
Merge pull request <a
href="https://redirect.github.com/matklad/once_cell/issues/281">#281</a>
from briansmith/b/init-inner</li>
<li><a
href="c294d64f9c"><code>c294d64</code></a>
Merge pull request <a
href="https://redirect.github.com/matklad/once_cell/issues/280">#280</a>
from briansmith/b/self</li>
<li><a
href="5f0fdd427a"><code>5f0fdd4</code></a>
Merge pull request <a
href="https://redirect.github.com/matklad/once_cell/issues/283">#283</a>
from briansmith/b/cast_mut</li>
<li><a
href="899e319523"><code>899e319</code></a>
Merge pull request <a
href="https://redirect.github.com/matklad/once_cell/issues/284">#284</a>
from briansmith/b/dry-get</li>
<li><a
href="90da60ba44"><code>90da60b</code></a>
Mark initialization of <code>OnceBox::get_or_try_init</code> cold.</li>
<li>Additional commits viewable in <a
href="https://github.com/matklad/once_cell/compare/v1.21.2...v1.21.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=once_cell&package-manager=cargo&previous-version=1.21.2&new-version=1.21.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-03-31 17:45:26 +00:00
Andrei Volykhin
f48c3a5e2a
dom: Set "composed" flag on construction for some event types (#36239)
"Composed" flag (https://dom.spec.whatwg.org/#composed-flag) should be
properly set on event construction phase from optional "EventInit"
dictionary
(https://dom.spec.whatwg.org/#dom-eventinit-composed).

The limited set of event types (Custom/Error/Focus/Mouse) will be
affected by this CL (used in WPT tests).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

- [X] There are WPT shadow-dom tests which have new issues related to
event "relatedTarget" property
tests/wpt/tests/shadow-dom/event-composed-path-with-related-target.html
  tests/wpt/tests/shadow-dom/event-with-related-target.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-03-31 17:15:48 +00:00
Josh Matthews
7382efa209
script: Fix resize observer depth calculation for Shadow DOM. (#36230)
Follow the specification more closely by using the flat tree when
calculating depth for the resize observer.

Testing: Newly passing WPT test.
Fixes: #36092

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-31 16:01:16 +00:00
Simon Wülker
aca5c3b7ca
Remove interior mutability from ResizeObservation (#36233)
This is struct is always already wrapped in a RefCell by `ResizeObserver`. It is not exposed to JS itself,
so it doesn't need `RefCell`s.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-31 11:00:51 +00:00
Simon Wülker
bc898da5de
Refuse to provide partial response from earlier ranged request to API that did not make a range request (#36227)
Part of https://github.com/servo/servo/issues/33616

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-31 10:34:32 +00:00
Bi Fuguo
272da2981d
Fixed the crash issue when the openharmony web component is adapted. (#36229)
Signed-off-by: kongbai1996 <1782765876@qq.com>
2025-03-31 09:46:49 +00:00
Josh Matthews
ee95ef53fb
Enable service worker WPT tests. (#36221)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-31 08:31:24 +00:00
Simon Wülker
5f4624d8d5
Only invoke resize observer callback when the observed element changed its size (#36226)
This change also adds a bunch of spec comments, because our
ResizeObserver implementation deviates from the spec significantly in
ways that are not immediately intuitive.

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

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-31 01:59:59 +00:00
Alex Touchet
1aac377e62
Organize component Cargo.toml dependencies (#36224)
Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-03-30 19:03:54 +00:00
Josh Matthews
b445053a7c
More miscellaneous script splitting changes (#36220)
* script: Move HasParent to script_bindings and update imports for InheritTypes.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make principal creation generic over DOM interface.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move a bunch of proxy-related code to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make some proxy-related code generic over the DOM interface.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move DomSlice to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move some utility bindings code to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make enumerating and resolving globals generic over the DOM interface.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make realm helpers generic over the DOM interface.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move implementations on concrete DOM types to concrete bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make additional codegen helpers generic over the DOM interface.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make iterator creation generic over the DOM interface.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make reporting an exception a generic operation.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move AsCCharPtrPtr to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Address clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-30 11:06:30 +00:00
Martin Robinson
971490084e
Use a simpler GitHub pull request template (#36203)
The idea here is that we can use the pull request description as the
commit message, so that the git history is cleaner. This requires:

1. Removing comments from the message, as GitHub doesn't remove them
   from the pull request descriptions when committing.
2. Remove the checklist, which is now verified by the CI instead, so
   is less important.
3. Ask the contributor to remove the lines expicitly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-03-30 10:14:13 +00:00
Servo WPT Sync
c593e15fa8
Update web-platform-tests to revision b'efce5c7cd31b0e1add4f41758504c767b56abeed' (#36222)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-03-30 01:40:11 +00:00
Alex Touchet
44faff0474
Cargo.toml cleanup (#36219)
Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
2025-03-29 17:45:06 +00:00
Bi Fuguo
fa6463dc1b
Fixed an incorrect touchmove event triggered when the second finger is pressed. (#36218)
Signed-off-by: kongbai1996 <1782765876@qq.com>
2025-03-29 14:32:50 +00:00
chocolate-pie
987716ca4b
layout: Implement support for image-set() notation (#36210)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
2025-03-29 13:20:16 +00:00
Kunga Derick Abongho
40133ce29a
Propagate CanGc arguments through HTMLCollection constructors (#36180)
Signed-off-by: dericko681 <abonghoderick@gmail.com>
2025-03-29 13:12:14 +00:00
Kunga Derick Abongho
83da63f638
resolve issue #36074 new_js_regex and matches_js_regex need a CanGc argument (#36111)
* new_js_regex and matches_js_regex need a CanGc argument

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* new_js_regex and matches_js_regex need a CanGc argument

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* edit Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

* Propagate CanGc arguments through new_js_regex and matches_js_regex

Signed-off-by: dericko681 <abonghoderick@gmail.com>

---------

Signed-off-by: dericko681 <abonghoderick@gmail.com>
2025-03-29 13:09:56 +00:00
Martin Robinson
b5c8164e99
layout: Simplify and generalize the usage of pseudo-elements (#36202)
- Remove the last remaining Servo-specific PseudoElement enum from
  layout. This was made to select `::before` and `::after` (both eager
  pseudo-elements), but now `traverse_pseudo_element` is called
  `traverse_eager_pseudo_element` and should work on any eager pseudo
  element.
- Expose a single way of getting psuedo-element variants of
  ThreadSafeLayoutElement in the Layout DOM, which returns `None` when
  the pseudo-element doesn't apply (not defined for eager
  pseudo-elements or when trying to get `<details>` related
  pseudo-elements on elements that they don't apply to).
- Ensure that NodeAndStyleInfo always refers to a node. This is done by
  making sure that anonymous boxes are all associated with their
  originating node.

These changes are prepatory work for implementation of the `::marker`
pseudo-element as well as ensuring that all anonymous boxes can be
cached into the box tree eventually.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-03-29 12:41:04 +00:00
Josh Matthews
c30ad5a30e
Miscellaneous script splitting preparation changes (#36216)
* script: Move num module to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make JS reflector creation generic over DOM trait.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move bindings-specific lock to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move DOM proto array code to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move finalizer implementations to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move some error routines to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move some DOM interface conversion routines to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make is_array_like generic over DOM trait.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Use generic interfaces for conditional exposure functions.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Move a bunch of routines used by codegen to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Formatting.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix clippy warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-29 08:11:27 +00:00
Delan Azabani
2c94110952
Devtools parser: reassemble fragmented messages (#36033)
* Devtools parser: reassemble fragmented messages

Co-authored-by: Aria Edmonds <8436007+ar1a@users.noreply.github.com>
Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Enable devtools parser tests on Linux only for now

Signed-off-by: Delan Azabani <dazabani@igalia.com>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Aria Edmonds <8436007+ar1a@users.noreply.github.com>
2025-03-29 05:44:43 +00:00
Greg Morenz
5d1c64dba9
Remove redundant rooted_vec macro (#36214)
This macro was copied into mozjs in 2023, in servo/mozjs#352

The two versions are identical, and rooting infrastructure generally
lives in mozjs. Let's not keep this redundant copy around.

The mozjs version is already imported evyerwhere via `#[macro_use]`.

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
2025-03-29 02:00:07 +00:00
Andrei Volykhin
5f5bf87eee
dom: Track "removed" event listener status (#36163)
The DOM event listener "removed" status should be supported to track
the following situations (with immediate effect of listener removal):
- Removing a later event listener while an earlier listener
  for the same event is running
- Nested usage (recursively dispatch another event) of "once" listeners
https://dom.spec.whatwg.org/#event-listener-removed

During event dispatching requires to clone event listeners list
on "invoke" step https://dom.spec.whatwg.org/#concept-event-listener-invoke
and the lowercase "event listener" concept in Servo is EventListenerEntry
https://dom.spec.whatwg.org/#concept-event-listener

Bug: #25479, #25090

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-03-28 23:34:04 +00:00
TIN TUN AUNG
ed3dd8fbe0
Animation: Aggregate Animated Image Info to Document (#36141)
Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-03-28 23:19:49 +00:00
Bi Fuguo
53f7c7b1de
Fixed the problem that touchmove cannot be disabled when preventDefault is invoked on touchstart. (#36200)
Signed-off-by: kongbai1996 <1782765876@qq.com>
2025-03-28 23:00:52 +00:00
Andreu Botella
95c3033456
Consume BOM in the text() method of fetch bodies (#36192)
In the fetch spec, the `text()` method of `Body` (an interface mixin
implemented by both `Request` and `Response`) consumes the body with
the Encoding spec "UTF-8 decode" algorithm, which skips the UTF-8 BOM
if it is present at the beginning of the body. Servo's implementation
does not do that. This patch fixes this.

Signed-off-by: Andreu Botella <abotella@igalia.com>
2025-03-28 19:02:48 +00:00
dependabot[bot]
94bcab177e
build(deps): bump icu_plurals_data from 1.5.0 to 1.5.1 (#36213)
Bumps [icu_plurals_data](https://github.com/unicode-org/icu4x) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/compare/icu@1.5.0...ind/icu_capi@1.5.1)

---
updated-dependencies:
- dependency-name: icu_plurals_data
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 17:08:01 +00:00
dependabot[bot]
4091d9a7b8
build(deps): bump icu_decimal_data from 1.5.0 to 1.5.1 (#36212)
Bumps [icu_decimal_data](https://github.com/unicode-org/icu4x) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/compare/icu@1.5.0...ind/icu_capi@1.5.1)

---
updated-dependencies:
- dependency-name: icu_decimal_data
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 17:07:53 +00:00
dependabot[bot]
c81cf0eb0c
build(deps): bump icu_properties_data from 1.5.0 to 1.5.1 (#36211)
Bumps [icu_properties_data](https://github.com/unicode-org/icu4x) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/compare/icu@1.5.0...ind/icu_capi@1.5.1)

---
updated-dependencies:
- dependency-name: icu_properties_data
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 17:04:24 +00:00
dependabot[bot]
83e51dfc05
build(deps): bump icu_datetime_data from 1.5.0 to 1.5.1 (#36208)
Bumps [icu_datetime_data](https://github.com/unicode-org/icu4x) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/compare/icu@1.5.0...ind/icu_capi@1.5.1)

---
updated-dependencies:
- dependency-name: icu_datetime_data
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 17:04:19 +00:00
dependabot[bot]
6b55aa62a0
build(deps): bump icu_timezone_data from 1.5.0 to 1.5.1 (#36209)
Bumps [icu_timezone_data](https://github.com/unicode-org/icu4x) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/compare/icu@1.5.0...ind/icu_capi@1.5.1)

---
updated-dependencies:
- dependency-name: icu_timezone_data
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 17:04:09 +00:00
dependabot[bot]
3059769c37
build(deps): bump bytemuck_derive from 1.9.2 to 1.9.3 (#36207)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from 1.9.2 to 1.9.3.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/commits)

---
updated-dependencies:
- dependency-name: bytemuck_derive
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 16:57:52 +00:00
dependabot[bot]
3f95d5e1e0
build(deps): bump once_cell from 1.21.1 to 1.21.2 (#36206)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.21.1 to 1.21.2.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.21.1...v1.21.2)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 16:54:38 +00:00
dependabot[bot]
b0bda0493e
build(deps): bump clap from 4.5.32 to 4.5.34 (#36205)
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.32 to 4.5.34.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.32...clap_complete-v4.5.34)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 16:52:24 +00:00
dependabot[bot]
c6b6fb9532
build(deps): bump string_cache from 0.8.8 to 0.8.9 (#36204)
Bumps [string_cache](https://github.com/servo/string-cache) from 0.8.8 to 0.8.9.
- [Release notes](https://github.com/servo/string-cache/releases)
- [Commits](https://github.com/servo/string-cache/commits/v0.8.9)

---
updated-dependencies:
- dependency-name: string_cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-28 16:48:12 +00:00
Tom Overlund
cd2ed0c275
Check for existence of 'sudo' on Linux in ./mach bootstrap (#35739)
* Check for existence of sudo command in ./mach bootstrap on Linux (#35736)

Signed-off-by: Tom Overlund <tomov@dilacero.org>

* Remove extraneous semicolon from previous commit (test-tidy fix).

Signed-off-by: Tom Overlund <tomov@dilacero.org>

---------

Signed-off-by: Tom Overlund <tomov@dilacero.org>
2025-03-28 14:58:25 +00:00
Andreu Botella
482d28e4ff
Fix content-type when creating a Request with FormData body (#36194)
When you create a `Request` object with a `FormData` body, the spec
says that the `Content-Type` header should start with
`multipart/form-data; boundary=`. However, in Servo's implementation
it started with `multipart/form-data;boundary=`, without the space.

While all reasonable servers should be able to that headers whether
the space is present or not, this brings Servo closer to the spec, and
also makes some WPT tests pass.

Note that submitting a form with `enctype="multipart/form-data"` does
produce a `Content-Type` header with the space (see
`HTMLFormElement::submit_entity_body`).

Signed-off-by: Andreu Botella <abotella@igalia.com>
2025-03-28 13:33:07 +00:00
Greg Morenz
c728f31a10
Stop using RootedGuard's DerefMut impl (#36158)
* Stop using RootedGuard's DerefMut impl

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* Update mozjs version

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

* `self.bytes` should not be mutably borrowed over GC pause

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>

---------

Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
2025-03-28 12:39:42 +00:00
Josh Matthews
96277c5688
net: Add missing feature required for unit tests. (#36193)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-03-28 12:04:02 +00:00