Commit graph

29393 commits

Author SHA1 Message Date
Narfinger
e64c53972a
Switch the majority of fxhash uses to rustc_hash which is maintained (#39168)
fxhash seems to be unmaintained (see
https://github.com/rustsec/advisory-db/issues/2185) so we should move
away from it.
Additionally, the new crate might be slightly faster.

There is still some cases depending on stylo that have the old fxhash
crate.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Changes in Hash should really not show any bugs. And
performance should be comparable.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-06 05:19:47 +00:00
Sebastian C
d3809c1024
fix: Store channel reference in CookieStore to prevent panic on unload (#39171)
CookieStore sets up a route with the resource threads to handle async
communication and needs to later unregister itself when the page
unloads. When attempting to do this in the `Drop` of CookieStore we
panic attempting to retrieve the channel via
`self.global().resource_threads()` because global is already null. This
change stores a reference to the core resource thread in the object to
send the unregister on `Drop`.

Testing: manual testing for crash fix, behavior should be unchanged

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-09-05 18:10:41 +00:00
Sebastian C
7ce0bd8575
script: Remove CookieListItem fields that were removed in the spec (#39170)
The spec removed all fields from CookieListItem except for name and
value

Testing: WPT tests cover this already.

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-09-05 17:47:42 +00:00
Oriol Brufau
5b9a23ebdb
layout: Add method to retrieve only the first LayoutBoxBase of a box (#39165)
A LayoutBox typically has one LayoutBoxBase, or none in the case of
`LayoutBox::DisplayContents`. However, `LayoutBox::InlineLevel` can
contain multiple inline items, each one with its base. But since things
like the style or the fragment flags should be the same for all of them,
getting the first base is sometimes enough.

Testing: not needed, no change in behavior.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-05 16:19:58 +00:00
Oriol Brufau
0f9f507b46
layout: Fix scrollParent to skip ancestors with display: contents (#39153)
When encountering such an ancestor, we were returning null instead of
skipping it.

Testing: Adding new subtest for this. And while I'm at it, another one
for the root element, unrelated to this fix.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-05 14:49:21 +00:00
Narfinger
ed66e0b0ca
servoshell: Replace getopts with bpaf for argument parsing (#37194)
This includes some small refactoring and some small breaking changes as
listed below. Other than these I tried to keep the functionality exactly
the same but because in the old code the parsing and settings of
preferences was intermingled it was difficult to figure out.

Small Breaking:
- Size and resources-path were unused but appeared in the help.
- soft-fail and hard-fail: Soft-fail flag got removed because it is too
  difficult to keep both. The default is now soft-fail and hard-fail can
be enabled.
- The help strings are obviously formatted differently now.
- -V does not work anymore but -v and --version.

Ideally, we want to have the ServoShellPreferences and Preferences be
directly the Argument structure but that needs a bit more discussion
because it would break backwards compatibility with the commandline.

This increases the binary size by ~280kb.

Testing: The testcases are still working but they do not cover much.
I added a unit test for the -p flag because it is the most difficult to
parse in general.
Fixes: This will fix a small number of various parsing misshaps. It will
also show if we are removing an option via unused lint.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-05 08:17:38 +00:00
Kingsley Yung
b29eab0ffe
script: Re-implement evaluate_key_path_on_value in IndexedDB (#38847)
The current implementation of evaluate_key_path_on_value was translated
from gecko, and it is incomplete. The unimplemented part occurs many
crashes in WPT tests.

This PR re-implements it according to the spec. It should eliminate many
crashed WPT tests, and increase the code readability.

Testing: Update WPT test expectation
Fixes: #38817 partially, and #25325

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-09-05 08:00:07 +00:00
Tim van der Lippe
deb7f802df
Refactor loading methods to align with specification (#39146)
This is in preparation of being able to do mime sniffing on the response
data. For that, we first need to introduce separate methods so that we
can decouple them from process_response. In doing so, we introduce a
NavigationParams which mimics what the spec intents. The spec stores
different data (policy container instead of csp list and response
instead of content-type), but it is similar enough.

Part of #14024

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-05 07:57:36 +00:00
shanehandley
989c0d8994
script: Implement document's active sandboxing flag set (#39079)
Implements document's active sandboxing flags. These are currently
populated only from CSP-derived sandboxing flags for a new document,
when defined in the CSP.

Testing: 1 new pass, and some new wpt's are added to test points in the
spec where these flags influence behaviour.

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2025-09-05 05:02:23 +00:00
Kingsley Yung
f722419861
webcrypto: Reduce usage of standalone helper functions for JWK format (#39084)
Reduce the reliance on standalone helper functions for handling JWK
format. Instead, those functionalities are now integrated into the
`JsonWebKey` type generated by script_binding, via the local trait
`JsonWebKeyExt`, for internal use.

The `parse_jwk` function remains for now. It will be removed when once
we refactor `SubtleCrypto::ImportKey` to support a more generic approach
across different cryptographic algorithms.

Testing: Refactoring. Existing WPT tests should suffice.

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-09-05 04:08:25 +00:00
Martin Robinson
e5fbb31452
script: Make get_property_jsval a safe function (#39137)
Accept the safe `JSContext` wraper to this function so that it can be
safe. Some callers also become safe as well.

Testing: This does not change behavior and is thus covered by existing
tests.
Fixes: #39129.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-04 23:11:15 +00:00
Oriol Brufau
589a750cac
Upgrade Stylo to 2025-09-02 (#39150)
This continues #38429

Changelog:
- Upstream:
ec21cec41c...fd700321cc
- Servo fixups:
30f8960428...64d8521f1b

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

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-04 21:28:24 +00:00
Shubham Gupta
40ced5bb61
Enable viewport <meta> tag support for mobile platforms only (#39133)
Enable viewport `<meta>` tag support for mobile platforms only.

_Reference:_
[web_preferences.h](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/common/web_preferences/web_preferences.h;l=158?)
_Todo: Enable for when requested desktop site:_
[web_contents_impl.cc](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/web_contents/web_contents_impl.cc;l=3752?)

Testing: Tested Manually
Fixes: #39002

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-09-04 19:14:53 +00:00
lumiscosity
c7ca281f44
script: implement setMatrixValue for DOMMatrix (#39148)
Even more progress on the geometry suite. Almost there!

Testing: Covered by WPT (css/geometry).

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-09-04 19:02:54 +00:00
Kingsley Yung
925b7c5dad
script: Queue a microtask in wait_for_all of promise type (#39108)
In the wait-for-all algorithm of the IDL promise type, we need to queue
a microtask to perform successSteps given « » if total is 0.

This step was previously implemented in a workaround, which perform
successSteps immediately.

This patch properly queue the microtask, and remove the workaround.

Testing: Refactoring only. Existing tests are enough.
Fixes: #37259

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-09-04 13:50:41 +00:00
Martin Robinson
fa7d6d4004
script: Modify Element::determine_scroll_into_view_position to take a ScrollingBox (#39107)
There is no need to separate the two kinds of scrolling boxes into
`Element` and `Viewport` more than once. This also eliminates a
potentially panicking `unwrap()`. 

Testing: This doesn't change behavior and is thus covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-04 08:44:57 +00:00
Tim van der Lippe
dab195ca80
Hookup mime classifier to main document loader (#39109)
While we don't perform any sniffing yet, it does now
check all relevant mime types. Before, we would only
check specific versions of specific mime types. However,
the specification is more elaborate, which MimeClassifier
already handles.

There are two new test failures, but they actually fail
in the same way in other browsers. These tests are still
being discussed what the correct behavior should be [1]

Part of #14024

[1]:
https://github.com/whatwg/mimesniff/issues/189#issuecomment-2081559661

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-04 08:30:55 +00:00
lumiscosity
a44b98c358
script: preserve 2D on DOMMatrix invert (#39113)
More small geometry fixes.

Testing: Covered by WPT
(css/geometry/DOMMatrix-invert-preserves-2d.html)

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-09-04 07:08:37 +00:00
Euclid Ye
ff8be71335
font: Remove unused FontTable constructor for Windows (#39130)
#39112 restricts accessibility for some font functions, exposing some
functions that haven't been used for a long time. Now it is detected by
Lint as dead code.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-09-04 06:25:59 +00:00
Tim van der Lippe
fc6bee8b81
Move Element::matches_environment to MediaList (#39034)
It more logically matches `MediaList`, and it allows us to
call this method with a document. This is required when
parsing Link headers, as they don't have an associated
element, but they do have a document.

Part of #35035

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-04 06:21:01 +00:00
Josh Matthews
aac6aa6c70
servoshell: Add button to toggle experimental web platform features. (#39125)
This makes it easier to experiment with the impact of experimental
features when browsing around in servoshell. The toggle is global and
causes all webviews to reload with the new preference values.

Testing: Manually tested; no UI testing for servoshell.

Not enabled:
<img width="317" height="82" alt="Screenshot 2025-09-03 at 9 34 30 PM"
src="https://github.com/user-attachments/assets/ca521ad5-ce1b-434e-a0c3-ea1b75d76d53"
/>

Enabled:
<img width="320" height="82" alt="Screenshot 2025-09-03 at 9 34 36 PM"
src="https://github.com/user-attachments/assets/7b6529b5-1055-4ae0-924a-96d57e115714"
/>

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-09-04 02:53:12 +00:00
Simon Wülker
73e39cf085
fonts: Reduce the public API surface (#39112)
This change marks all items that are not used by other crates as
`pub(crate)` instead of `pub`.

Additionally, I've removed all code that turned out to be unused. I
think most of it was used only by `layout-2013`.


Testing: The correctness of these changes is verified by the compiler,
so no tests are needed.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-03 20:15:51 +00:00
Andrei Volykhin
8a62984c2f
canvas: Use non rooted variant of HTMLCanvasElementOrOffscreenCanvas type (#38970)
Any RenderingContext/OffscreenRenderingContext type has readonly
"canvas" attribute
and associated native-code DOM context objects have reference to target
DOM canvas objects.
https://html.spec.whatwg.org/multipage/canvas.html#renderingcontext
https://html.spec.whatwg.org/multipage/canvas.html#offscreenrenderingcontext

And currently the reference to DOM canvas object is the rooting pointer
on the stack,
which leads to the circular reference problem.

The SpiderMonkey's (SM) garbage collector will not be able to free the
DOM canvas and context
objects (unreacheble from JS) because of the rooting pointer on stack
(see STACK_ROOTS).

And these objects will be stored until the associated script
runtime/thread will be terminated.

SM -> JS Roots -> DOM Canvas* (on heap) -> DOM Context (on heap)
SM -> Rust Roots -> Dom Canvas* (on stack) <- as "canvas" member field

Let's replace the rooting pointer to the traceble pointer (DomRoot ->
Dom)
in the "canvas" member field of DOM context object, which allows to
broke circular referencing problem.

Testing: No changes in existed tests

Signed-off-by: Andrei Volykhin <volykhin.andrei@huawei.com>
Co-authored-by: Andrei Volykhin <volykhin.andrei@huawei.com>
2025-09-03 19:24:48 +00:00
Martin Robinson
2c7866eb24
script/layout: Implement HTMLElement.scrollParent (#39110)
This new API allows getting the element which establishes an element's
scroll container. This will be used to properly implement
`scrollIntoView`. There is still work to do for this API and
`offsetParent` to properly handle ancestors which are
closed-shadow-hidden from the original query element.

In addition, fix an issue where inline boxes were establishing scrolling
containers (they shouldn't do that).

Testing: There are tests for this change.
Fixes: #39096.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-09-03 18:52:15 +00:00
Narfinger
5c7ea4bdee
constellation: Use FnvHashMap for hashmaps that use ids as keys (#39106)
FNV is faster for hashing less than 16 bytes of data and the
cryptographic properties of the default HashMap are not needed for the
various ids.

Testing: This does not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-03 18:15:19 +00:00
Martin Robinson
0ae9ee28d5
script: More consistently use f32 and have scrolling methods follow the specification more closely (#39104)
This clarifies the units for scrolling:

 - `f32` is used for internal Servo scrolling APIs as that is the unit
   used in WebRender.
 - `f64` is used for the web-exposed scrolling APIs as that is what the
   WebIDL code generator gives us.

Conversions are done consistently at the boundaries of the two APIs.

In addition, web-exposed scrolling methods are refactored a bit to more
closely follow the specification text. In addition, specification text
is added to those methods so that it is clearer that we are following
it.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-03 17:29:56 +00:00
Narfinger
b73c81630a
Change BrowingContextId from WebViewId explicitly (#39095)
There were still some accesses to the inner BrowsingContextId from the
WebViewId. This changes it to completely rely on the From trait for
these methods. This also means we can make the field private.

For testing we add a way to create arbitrary WebViewIds.

Testing: Does not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-03 12:18:08 +00:00
Ashwin Naren
4ea714e6d2
script: Calculate proper border box for resizeobserver (#38988)
Implements more of calculate_box_size, ensuring that the proper
rectangle is returned when the border box is requested.

Testing: WPT
Fixes: Partially #38811

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Jo Steven Novaryo <65610990+stevennovaryo@users.noreply.github.com>
2025-09-03 12:16:20 +00:00
Josh Matthews
433a461044
indexeddb: Serialize all cloned values when storing data. (#39081)
We were performing a structured clone but throwing away any serializable
DOM interfaces included in the result. We need to instead serialize the
full structured clone result so we can deserialize the DOM interfaces
when getting the data out of the object store.

Testing: Existing WPT coverage is sufficient.
Fixes: #38818
Fixed: #38842

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-09-03 12:06:14 +00:00
Martin Robinson
6b208124dc
script: Always dirty nodes when changing node state (#39102)
With incremental layout adding a restyle to a node isn't enough to force
its layout to update. We also need to explicitly mark the node as dirty
so that its contents are updated when layout is run. This change makes
this consistent for all node state changes. This might be a bit too
conservative as all node state may not affect layout, but should catch
issues in the future.

Testing: This is very hard to test as it requires moving the mouse over
the
WebView, and the moving it away, and then testing the rendered contents.
This
kind of coordination would be difficult to manage with unit tests.
Fixes: #38989.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-03 08:50:01 +00:00
Ashwin Naren
4dcf4ef07a
Fix step ordering for MicrotaskQueue checkpoint (#39099)
The steps were incorrectly numbered, this PR fixes that and copies over
the description of each step.

Testing: None, just expanding on the comments/fixing the step numbering

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-09-03 06:05:35 +00:00
Martin Robinson
2fc816d561
script: Make scrollIntoView more similar to the specification (#39094)
Rework the flow of code in `Element:scroll_into_view_with_options` to
more closely follow the specification. This also simplifies the code a
bit and adds some TODOs about future improvements.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-09-02 22:11:02 +00:00
Ashwin Naren
b0b70ec6b7
Throw SyntaxError from Location::SetHref (#39051)
It was originally throwing a TypeError, which was making WPT fail.

Testing: Many happy WPT subtests
Fixes: #39050

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Sam <16504129+sagudev@users.noreply.github.com>
2025-09-02 17:19:10 +00:00
Ashwin Naren
47551fc6fa
indexeddb: Finish implementation of key_type_to_jsval (#39008)
Uses clipped time to convert dates that are stored as `f64`s into JS
values.

Testing: WPT
Fixes: #25327

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-02 16:36:41 +00:00
Tim van der Lippe
a1f9e3e133
Move LinkProcessingOptions into separate file (#39033)
This makes future implementations easier where we will reuse most of
this code to parse Link headers.

Part of #35035

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-02 16:31:39 +00:00
Martin Robinson
efe9ea2306
layout: Gracefully handle script queries on nodes with uninvertible transforms (#39075)
Instead of panicking when doing a geometry script query on a node with
an uninvertible transform, return a zero-sized rectangle at the
untransformed position. This is similar to what Gecko and Blink do
(though it seems there are some differences in positioning this
zero-sized rectangle). Mostly importantly, do not panic.

Testing: This change adds a new WPT crash test.
Fixes: #38848.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-02 13:27:43 +00:00
Jerens Lensun
4de84b0ca5
script_bindings(python): Fix all the rest of type annotation in script_bindings codegen (#39070)
This will complete the type annotation on `codegen.py` so we can safely
remove the ignore from `pyproject` configurataion

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-09-02 12:47:38 +00:00
JoeDow
f8c0746c44
layout: Move hit testing for scrollable areas to display list construction (#39066)
Move the construction of hit test items for scroll nodes to the display
list construction stage. This way they respect the `z-index` of their
originating fragments and stacking context ordering in general.

Testing: We currently do not have great testing for this as this tests
the combination of hit testing of input events and scrolling at that
point. The completion of WebDriver support should make this easier to
test.
Fixes: #38967

Signed-off-by: coding-joedow <ibluegalaxy_taoj@163.com>
Co-authored-by: kongbai1996 <1782765876@qq.com>
2025-09-02 11:57:23 +00:00
Euclid Ye
802fdd9068
webdriver: Focus browsing context when switch frame (#39086)
#38889 adds back the mechanism to focus the window when [switch to
window](https://w3c.github.io/webdriver/#switch-to-window). After that,
it causes many flaky TIMEOUT. Turns out the real reason is same as the
phenomenon which I thought was unrelated:
https://github.com/servo/servo/pull/38889#issuecomment-3217512339: we
need to focus the browsing context as well according to spec. This is
important for Servo because it relies on
f4dd2960b8/components/constellation/constellation_webview.rs (L64)
to determine which pipeline to send `InputEvent` to.

Testing: Before, there are 9 ~ 13 flaky results. [Before
1](https://github.com/yezhizhen/servo/actions/runs/17379170889), [Before
2](https://github.com/yezhizhen/servo/actions/runs/17392219417), [Before
3](https://github.com/yezhizhen/servo/actions/runs/17379172612).
Now there are 2 ~ 4 flaky results. [After
1](https://github.com/yezhizhen/servo/actions/runs/17394359570), [After
2](https://github.com/yezhizhen/servo/actions/runs/17394358218), [After
3](https://github.com/yezhizhen/servo/actions/runs/17394357400).
Fixes: https://github.com/servo/servo/pull/38889#issuecomment-3218600566
Fixes: #38906, which is last blocking point to enable WebDriver CI.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-09-02 08:57:45 +00:00
Sam
069ddbfd12
script: Move canvas stuff into dom/canvas folder (#39071)
Move all canvas stuff to canvas folder and 2d canvas to canvas/2d
folder. Webgl and webgpu context remain in respective folders as
outlined in
https://github.com/servo/servo/issues/38901#issuecomment-3243020235

Testing: Just refactor.
Part of https://github.com/servo/servo/issues/38901

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-09-02 07:43:10 +00:00
Jonathan Schwender
f4dd2960b8
Add direct script to embedder channel (#39039)
This PR **removes** `ScriptToConstellationMessage::ForwardToEmbedder`,
and replaces it with an explicit `ScriptToEmbedderChannel`. This new
channel is based on `GenericCallback` and in single-process mode will
directly send the message the to the embedder and wake it. In
multi-process mode, the message is routed via the ROUTER, since waking
is only possible from the same process currently. This means in
multi-process mode there are likely no direct perf benefits, since we
still need to hop the message over the ROUTER (instead of over the
constellation).
In single-process mode we can directly send the message to the embedder,
which should provide a noticable latency improvement in all cases where
script is blocked waiting on the embedder to reply.

This does not change the way the embedder receives messages - the
receiving end is unchanged.

## How was sending messages to the embedder working before?

1. Script wraps it's message to the embedder in
`ScriptToConstellationMessage::ForwardToEmbedder` and sends it to
constellation.
2. The [constellation event loop] receives the message in
[handle_request]
3. If deserialization fails, [an error is logged and the message is
ignored]
4. Since our message came from script, it is handle in
[handle_request_from_script]
5. The message is logged with trace log level
6. If the pipeline is closed, [a warning is logged and the message
ignored]
7. The wrapped `EmbedderMsg` [is forwarded to the embedder]. Sending the
message also invokes `wake()` on the embedder eventloop waker.

[constellation event loop]:
2e1b2e7260/components/constellation/constellation.rs (L755)

[handle request]:
2e1b2e7260/components/constellation/constellation.rs (L1182)

[an error is logged and the message is ignored]:
2e1b2e7260/components/constellation/constellation.rs (L1252)

[handle_request_from_script]:
https://github.com/servo/servo/blob/main/components/constellation/constellation.rs#L1590
 
[a warning is logged and the message ignored]:
2e1b2e7260/components/constellation/constellation.rs (L1599)

[is forwarded to the embedder]:
2e1b2e7260/components/constellation/constellation.rs (L1701)

Testing: Communication between Script and Embedder is extensive, so this
should be covered by existing tests.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-09-02 06:33:44 +00:00
Ashwin Naren
97c8c83cbb
script: Add message to SyntaxError (#39056)
Adding an optional message to be attached to a SyntaxError. Unblocks
#39050.

The enum definition of Syntax is now `Syntax(Option<String>)`. Future
PRs should probably add more appropriate messages to some of the
`Syntax(None)`s.

Testing: Just a refactor
Fixes: Partially #39053

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-02 05:51:36 +00:00
Oriol Brufau
9264ef1a95
layout: Ensure IFC for abspos with inline-level original display (#39041)
Absolutely positioned elements get blockified, but their static position
still depends on the original display. Therefore, if we encounter an
abspos with an inline-level original display, we will now ensure that
it's handled in an inline formatting context. This way its static
position will correctly take into account things like `text-align`.

Testing: Several WPT tests are now passing.
Fixes: #39017

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-02 03:43:55 +00:00
Ashwin Naren
665ee150a6
indexeddb: Return error instead of panicking on structured clone failure (#39078)
Related to failures in #38847

Testing: WPT

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-02 01:22:19 +00:00
Jonathan Schwender
ce8b05738c
script: Migrate swmanager to GenericChannel (#39076)
Migrate `ServiceWorkerMsg` and `SWManagerMsg` to GenericChannel

Testing: Covered by service worker wpt tests
Part of #38912

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-09-01 19:23:16 +00:00
Jonathan Schwender
93aeac056b
base: Migrate PipelineNameSpaceInstaller to GenericChannel (#39073)
Testing: Covered by existing tests
Part of #38912

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-09-01 17:23:16 +00:00
Jonathan Schwender
eece4c24b0
script: Migrate JobResult to GenericCallback (#39074)
Use the new GenericCallback abstraction for serviceworker job results.

Testing: Covered by service worker wpt tests

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-09-01 17:22:39 +00:00
Martin Robinson
fc30a26005
layout: Lay out collapsed table rows and columns, but don't paint them (#39027)
It's expected that script queries be able to interact with collapsed
table rows and columns, so this change starts laying them out. They
still do not affect table dimensions, nor are they painted.

This does not fix all interaction with collapsed rows and columns. For
instance, setting scroll offsets of contained scrolling nodes does not
work properly. It does fix the panic though, which is the most important
thing.


Testing: this change includes a new WPT crash test.
Fixes: #37421.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-01 12:58:36 +00:00
Euclid Ye
236e28aeab
webdriver: Wait for navigation to complete when creating session with all WebViews closed (#39040)
In #37410 for webdriver mode, we introduced mechanism to keep program
alive when all webview are closed to comply with spec. But the test
fails with 90% probability, as the `browsing_context` is only registered
in constellation's `browsing_contexts` map when documents are ready.
This PR waits for navigation to complete without verifying browsing
context existence (as it's guaranteed from context) in this special case
by refactoring existing code.

Testing:
4571cc1b3b/tests/wpt/tests/webdriver/tests/classic/close_window/close.py (L87)
is no longer flaky. Previously, it has 90% probability to fail. Now it
always pass.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-09-01 08:56:51 +00:00
Jerens Lensun
fc5691a293
script_bindings(python): Add type around js jit class in codegen.py (#38998)
Add type around js jit class in codegen.py

Needed this PR: #38845

---------

Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
2025-09-01 07:00:03 +00:00