Commit graph

10949 commits

Author SHA1 Message Date
Tim van der Lippe
d94929dbed
script: Implement trusted types for DOMParser.parseFromString (#38872)
Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-27 06:10:16 +00:00
dependabot[bot]
c2f664d16e
build(deps): bump data-url from 0.3.1 to 0.3.2 (#38862)
Bumps [data-url](https://github.com/servo/rust-url) from 0.3.1 to 0.3.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/servo/rust-url/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=data-url&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>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-27 03:22:13 +00:00
Jo Steven Novaryo
10ca3b6fde
layout: Parameterize content box query (#38935)
Parameterize and rename both `Layout::content_box_query` and
`Layout::content_boxes_query` to support the query of rendered padding
area and content area that accounts for transform and scroll. Both of
these query have been misleading for a time since they are using border
box, instead of content box of a Node.

This PR adds a new type `layout_api::BoxAreaType` to be passed from
`ScriptThread` to `LayoutThread` to query the respective area. It is
then used for the query within `IntersectionObserver` to pass several
WPTs.

Testing: Existing WPT Coverage.

---------

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-08-27 02:27:53 +00:00
Simon Wülker
c4dcd17214
Update image to 0.25 (#38950)
Testing: These changes should be covered by existing web platform tests
and `image`'s own test suite.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-27 00:51:14 +00:00
Euclid Ye
26fb603d15
script: Fix wrong procedure when deserializing JSValue from mozjs HandleValue (#38943)
Spec: https://w3c.github.io/webdriver/#dfn-internal-json-clone

This PR 
1. moves [clone an
object](https://w3c.github.io/webdriver/#dfn-clone-an-object) to `fn
clone_an_object` to make things clearer.
2. Fixes the bug where we wrongly put `element` and `WindowProxy` as
part of [clone an
object](https://w3c.github.io/webdriver/#dfn-clone-an-object), which
leads to false-positive `JSError` before.
3. Update spec links to correct ones.

Testing: New passing in `{execute_async_script,execute_script}/node.py`

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-26 13:48:48 +00:00
Tim van der Lippe
d38533530b
script: Add remaining unique element event listeners (#38888)
This adds the remaining window as well as specific svg and animation
listeners. The test suite was erroring before, as we don't implement
`SVGAnimationElement` yet. Now, the test gracefully checks if the
interface exists before doing a lookup.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-26 06:51:27 +00:00
Gregory Terzian
ddf5f1eb2f
script: when handling page headers, stop if pipeline closed already (#38739)
Previously, the script-thread would assert the pipeline was closed if no
pending load was found, but it did not check whether the pipeline was
closed before processing the page headers. Since incomplete loads are
removed only when page headers are processed, this means the page
headers were processed even if the pipeline had been closed before the
page headers were available. If the pipeline had been closed as part of
exiting the constellation, it was possible for the constellation to have
exited by the time the page headers became available(since the
script-thread closes a pipeline independently from ongoing navigation
fetches), which would produce a panic on trying to communicate with the
constellation to obtain the browsing context info.

Note: due to the nature of the problem, I cannot verify that this fixes
the crash test, although logically this appears to make sense, and a
couple of days of WPT runs should tell us more.

Testing: A crash test was added; unfortunately the crash was
intermittent.
Fixes: https://github.com/servo/servo/issues/36747

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-25 19:04:39 +00:00
Euclid Ye
0b5bcfbf17
webdriver: Focus when "switch to window" (#38889)
Add logic that was accidentally removed in #38745. Otherwise it is very
weird when using webdriver as a human, as we still stays on the original
tab.

Testing: ~this should not affect any test. Even if the tab is not
"visible" previously, all programmatic interaction works fine.~ Stably
pass `test_history_pushstate` in `back.py` and `forward.py`.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-24 13:36:58 +00:00
dependabot[bot]
71db9494bb
build(deps): bump url from 2.5.3 to 2.5.6 (#38879)
Bumps [url](https://github.com/servo/rust-url) from 2.5.3 to 2.5.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/servo/rust-url/releases">url's
releases</a>.</em></p>
<blockquote>
<h2>v2.5.5</h2>
<h2>What's Changed</h2>
<ul>
<li>ci: downgrade crates when building for Rust 1.67.0 by <a
href="https://github.com/mxinden"><code>@​mxinden</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1003">servo/rust-url#1003</a></li>
<li>ci: run unit tests with sanitizers by <a
href="https://github.com/mxinden"><code>@​mxinden</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1002">servo/rust-url#1002</a></li>
<li>fix small typo by <a
href="https://github.com/hkBst"><code>@​hkBst</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1011">servo/rust-url#1011</a></li>
<li>chore: fix clippy errors on main by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1019">servo/rust-url#1019</a></li>
<li>perf: remove heap allocation in parse_query by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1020">servo/rust-url#1020</a></li>
<li>perf: slightly improve parsing a port by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1022">servo/rust-url#1022</a></li>
<li>perf: improve to_file_path() by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1018">servo/rust-url#1018</a></li>
<li>perf: make parse_scheme slightly faster by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1025">servo/rust-url#1025</a></li>
<li>update LICENSE-MIT by <a
href="https://github.com/wmjae"><code>@​wmjae</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1029">servo/rust-url#1029</a></li>
<li>perf: url encode path segments in longer string slices by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1026">servo/rust-url#1026</a></li>
<li>Disable the default features on serde by <a
href="https://github.com/rilipco"><code>@​rilipco</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1033">servo/rust-url#1033</a></li>
<li>docs: base url relative join by <a
href="https://github.com/tisonkun"><code>@​tisonkun</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1013">servo/rust-url#1013</a></li>
<li>perf: remove heap allocation in parse_host by <a
href="https://github.com/dsherret"><code>@​dsherret</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1021">servo/rust-url#1021</a></li>
<li>Update tests to Unicode 16.0 by <a
href="https://github.com/hsivonen"><code>@​hsivonen</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1045">servo/rust-url#1045</a></li>
<li>Add some some basic functions to <code>Mime</code> by <a
href="https://github.com/mrobinson"><code>@​mrobinson</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1047">servo/rust-url#1047</a></li>
<li>ran <code>cargo clippy --fix -- -Wclippy::use_self</code> by <a
href="https://github.com/mrobinson"><code>@​mrobinson</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1048">servo/rust-url#1048</a></li>
<li>Fix MSRV and clippy CI by <a
href="https://github.com/Manishearth"><code>@​Manishearth</code></a> in
<a
href="https://redirect.github.com/servo/rust-url/pull/1058">servo/rust-url#1058</a></li>
<li>Update <code>Url::domain</code> docs to show that it includes
subdomain by <a
href="https://github.com/supercoolspy"><code>@​supercoolspy</code></a>
in <a
href="https://redirect.github.com/servo/rust-url/pull/1057">servo/rust-url#1057</a></li>
<li>set_hostname should error when encountering colon ':' by <a
href="https://github.com/edgul"><code>@​edgul</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1060">servo/rust-url#1060</a></li>
<li>version bump to 2.5.5 by <a
href="https://github.com/edgul"><code>@​edgul</code></a> in <a
href="https://redirect.github.com/servo/rust-url/pull/1061">servo/rust-url#1061</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/mxinden"><code>@​mxinden</code></a> made
their first contribution in <a
href="https://redirect.github.com/servo/rust-url/pull/1003">servo/rust-url#1003</a></li>
<li><a href="https://github.com/hkBst"><code>@​hkBst</code></a> made
their first contribution in <a
href="https://redirect.github.com/servo/rust-url/pull/1011">servo/rust-url#1011</a></li>
<li><a href="https://github.com/wmjae"><code>@​wmjae</code></a> made
their first contribution in <a
href="https://redirect.github.com/servo/rust-url/pull/1029">servo/rust-url#1029</a></li>
<li><a href="https://github.com/rilipco"><code>@​rilipco</code></a> made
their first contribution in <a
href="https://redirect.github.com/servo/rust-url/pull/1033">servo/rust-url#1033</a></li>
<li><a href="https://github.com/tisonkun"><code>@​tisonkun</code></a>
made their first contribution in <a
href="https://redirect.github.com/servo/rust-url/pull/1013">servo/rust-url#1013</a></li>
<li><a
href="https://github.com/supercoolspy"><code>@​supercoolspy</code></a>
made their first contribution in <a
href="https://redirect.github.com/servo/rust-url/pull/1057">servo/rust-url#1057</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/servo/rust-url/compare/v2.5.4...v2.5.5">https://github.com/servo/rust-url/compare/v2.5.4...v2.5.5</a></p>
<h2>v2.5.4</h2>
<h2>What's Changed</h2>
<ul>
<li>Revert &quot;Normalize URL paths: convert /.//p, /..//p, and //p to
p (<a
href="https://redirect.github.com/servo/rust-url/issues/943">#943</a>)&quot;
by <a href="https://github.com/valenting"><code>@​valenting</code></a>
in <a
href="https://redirect.github.com/servo/rust-url/pull/999">servo/rust-url#999</a></li>
<li>Updates the MSRV to 1.63 required though the libc v0.2.164
dependency</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/servo/rust-url/compare/v2.5.3...v2.5.4">https://github.com/servo/rust-url/compare/v2.5.3...v2.5.4</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/servo/rust-url/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=url&package-manager=cargo&previous-version=2.5.3&new-version=2.5.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>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-24 11:27:40 +00:00
Servo WPT Sync
fa42968a61
Sync WPT with upstream (24-08-2025) (#38893)
Automated downstream sync of changes from upstream as of 24-08-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-08-24 01:41:18 +00:00
Josh Matthews
b7cdd88b8e
IndexedDB: Handle missing object stores in object store operations (#38115)
These changes fix a large number of panics that can manifest as
intermittent test failures. They also add more specification text to
various IDBObjectStore methods and implement missing steps that check
for whether an object store is deleted.

Testing: Existing test coverage.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-08-22 22:04:34 +00:00
Tim van der Lippe
f334a56b07
Remove event handlers when attribute is removed (#38734)
We wouldn't handle the AttributeMutation::Removed for
attribute event listeners and wouldn't remove the
corresponding event listener. Added the necessary
logic (using the newly EventTarget::is_content_event_handler
to correctly only do this for known event handlers) and
added links to the relevant parts of the spec.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-22 19:43:04 +00:00
Tim van der Lippe
10ac177aa5
Propagate Trusted Types errors for Node.textContent (#38871)
Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-08-22 19:41:50 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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