Commit graph

29393 commits

Author SHA1 Message Date
Simon Wülker
de6feb469a
script: Move operations in window_named_properties::get_own_property_descriptor & webdriver_handlers::clone_an_object into unsafe blocks (#38951)
Testing: Covered by existing tests
Part of https://github.com/servo/servo/issues/35955

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-08-26 21:48:25 +00:00
Martin Robinson
87fe202ded
script: Integrate animated image updates into ScriptThread event loop (#38941)
Instead of manually triggering `ScriptThread::update_the_rendering`,
have animated images trigger rendering updates via the `ScriptThread`
event loop. This should result in fewer calls to
`ScriptThread::update_the_rendering`.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-26 17:24:12 +00:00
Martin Robinson
e7a963cca0
script: Generate only a single frame during "update the rendering" (#38858)
Instead of generating a frame for every display list, which might be one
rendered frame per `<iframe>`, generate only a single frame per call to
"update the rendering." This should make rendering more efficient when
there are `<iframe>`s present and also open up optimizations for
non-display list frames.

Testing: This could potentially reduce flashing of content during
rendering
updates, but that is very difficult to test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-26 16:09:10 +00:00
Martin Robinson
4f68508624
script: Move FontContext from Window to GlobalScope (#38918)
This change makes it so that every `GlobalScope` can contain an optional
`FontContext`. This will be necessary for every `GlobalScope` that
accesses canvas. Currently, `FontContext` is created and accessed via
the canvas worker thread, but this means that web fonts are not
available to canvas. This change will eventually make it possible for
canvas to share web fonts with the `Document` that owns them.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-26 15:56:50 +00:00
Gregory Terzian
909ceee830
constellation: send EmbedderMsg::ShutdownComplete as last (#38923)
To help ensure our internal threads have shut-down before we deinit
Servo, the last thing the constellation should do, is sending the
`EmbedderMsg::ShutdownComplete`.

Testing: Manual testing by starting Servo and then closing the window. 
Fixes: Part of https://github.com/servo/servo/issues/30849

---------

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-26 15:22:11 +00:00
Mukilan Thiyagarajan
c75995ec87
Revert "GenericChannel: Migrate compositor channels to GenericChannel (#38782)" (#38940)
This reverts commit fb1c0a4c48.

Previously in `create_compositor_channel`, the [routing callback][1] was
setup so that a message received on the Compositor's IPC receiver will
be
forwarded to the local receiver using the `CompositorProxy` which also
takes care of waking up the event loop. In #38782, this was changed so
that the routing callbacks simply forwards the message directly without
going via the `CompositorProxy`. This breaks behaviours that rely on the
event loop being woken up on message sending, e.g. updating image frames
for animated gifs.

Since the GenericChannel API doesn't allow custom routing callbacks,
revert this change until we figure out a better solution.

[1]:
d2ccce6052/components/servo/lib.rs (L1114)

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

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-08-26 14:16:58 +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
Gregory Terzian
08b9eb818c
layout: Shut down style thread-pool when exiting a content process / shutting down the Constellation (#38924)
To ensure a clean-shutdown of Servo, we need to shutdown our internal
threading before deinit. This shuts down the style thread pool either
using the constellation(in single-process mode), or when a content
process exits.

Testing: Manual testing by opening a window, opening and closing
multiple tabs, and closing the window, with a sleep added before deinit
and a sample taken to ensure the loose threads previously noticed are
gone.
Fixes: part of https://github.com/servo/servo/issues/30849

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-08-26 13:10:03 +00:00
criskell
7339e2b421
Add scroll tree measurement in IOCompositor (#38922)
Adds a new memory report that aggregates the size of all scroll trees
from within all pipelines for each web view.

Testing: Acessing `about:memory`
Fixes: #38726

---------

Signed-off-by: criskell <96352451+criskell@users.noreply.github.com>
2025-08-26 12:47:04 +00:00
shuppy
7aad72838a
devtools: Reland test improvements from #38614 minus CI changes (#38933)
#38614 was reverted due to CI flakiness, but it also included several
improvements to the devtools tests. this patch relands those
improvements, described below.

we make three changes that speed up the devtools tests from 73 → 65 → 56
→ 51 seconds:

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

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

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

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

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

Testing: this patch improves the devtools tests, but does not change
their coverage
Fixes: part of #36325

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2025-08-26 10:06:51 +00:00
Rodion Borovyk
3f6e2679dc
indexeddb: Initialize DB version to zero in unit tests (#38911)
Continuation of https://github.com/servo/servo/pull/38819

Testing: Fixes indexeddb unit tests

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-08-26 08:02:40 +00:00
Euclid Ye
8683f97fcc
webdriver: Raise WebView to top when focus (#38909)
- Add a helper function `focus_and_raise_to_top` to `WebView`.
- For webdriver, raise webview to top when focus, to make it consistent
with user interaction.

Testing: Should reduce some flaky TIMEOUT when combined with another PR
later.
Fixes: A small patch before the PR for #38906.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-26 07:48:38 +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
Jonathan Schwender
c4b2f3af56
script: send StorageThreadMsg directly (#38921)
Remove the intermediate clone of an IpcSender, by directly sending.

Testing: No functional changes

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-26 06:12:28 +00:00
criskell
9082217272
Move unsafe to the wrap method for global objects (#38896)
The method now doesn't need unsafe in its signature because it no longer
accepts unsafe pointers as arguments. We move the unsafe marker to the
method itself.

Testing: I opened the browser and went to google.com; I ran some WPT
(IndexedDB) tests.
Fixes: #38361

---------

Signed-off-by: criskell <96352451+criskell@users.noreply.github.com>
2025-08-25 22:02:55 +00:00
Jonathan Schwender
b9dc228e51
script: Clean-up IpcSend .sender().send() pattern (#38919)
The IpcSend trait defines a `send()` method, so doing .sender().send()
seems like it just adds a useless clone of the sender, when we could
just `send()` directly.
This only cleans up the direct usages of this pattern, there are more
instances, where a helper method is defined, which returns the
IpcSender, and the only usages also just directly call send.

Testing: No functional changes

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-25 19:16:12 +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
Jonathan Schwender
ebf8a35c84
webdriver: Port WebDriverLoadStatus to Generic Channel (#38915)
Ports the channel for WebDriverLoadStatus to GenericChannel.

Testing: No functional changes - Covered by existing webdriver tests
Part of #38912

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-25 18:11:03 +00:00
JoeDow
4a19f66c31
script: mark image-related node dirty only when image resource loaded (#38916)
Previously, we would always mark the image-related nodes as dirty
whenever the fetch status of the image resources changed. However, the
corresponding `ImageDisplayItem`s for these image resources are only
generated after the image resources have been fully fetched and decoded.
Therefore, we only mark the corresponding DOM nodes as dirty when the
image resources are completely loaded, thereby reducing the occurrence
of reflows.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-08-25 16:22:05 +00:00
Jonathan Schwender
cf13fd4628
constellation: Migrate namespace channel to GenericChannel (#38913)
Migrates the namespace sender and receiver to use GenericChannel

Testing: Covered by existing tests
Part of #38912

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-25 14:12:27 +00:00
Martin Robinson
e21ea2a135
script: Wrap unsafe code in globalscope.rs in unsafe {} blocks (#38908)
This is a step toward fixing Rust warnings about unsafe code needing to
be wrapped in `unsafe {}` blocks.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-25 12:31:51 +00:00
Jonathan Schwender
fb1c0a4c48
GenericChannel: Migrate compositor channels to GenericChannel (#38782)
Besides migrating the channel to GenericChannel, this PR adds
`routed_channel_with_local_sender()` to `generic_channel`. This is for
existing use-cases, where we want to provide both an IPC capable
GenericSender, as well as a crossbeam Sender, for efficient sending if
the sender is in the same process.

Testing: All of our channels should send / receive at least some
messages during WPT tests.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-25 11:05:21 +00:00
Jonathan Schwender
7441944e36
generic_channel: Support sending GenericChannel::Crossbeam over IPC (#38873)
In Single-process mode, sending crossbeam channels over an ipc channel
is perfectly safe to do (since everything is in the same process) and
allows us to more easily incrementally port channels.

In Multi-process mode, GenericChannels will always be IPC channels, so
we won't hit the "serialize crossbeam channels" branch (since the only
way to construct channels, checks the process mode). This property is
ensured by `channel()` being the only way to construct a `GenericSender`
and Receiver pair. To achieve this, we make the previously `pub` enum
private, and wrap it in a newtype, so that the type can't be constructed
from outside the module.
To be extra safe, we still check if we are in multiprocess mode or not
during (de-)serialization and emit an error.


Testing: Add a new unit-test to ensure sending GenericSender / Receivers
over an ipc_channel works.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-25 08:11:09 +00:00
Martin Robinson
11bea7303d
canvas: Make clippy allow statements more fine-grained in canvas_paint_thread.rs (#38897)
Move `allow(too_many_arguments)` to the functions that have that issue
and remove `allow(unreachable_pattern)`. Since the `Canvas` enum is also
using conditional compilation the default pattern is not necessary.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-25 05:12:19 +00:00
Jonathan Schwender
ea5d786506
generic_channel: Preserve IPC errors (#38854)
We should not be using `route_ipc_receiver_to_new_crossbeam_receiver` or
similar methods, that `unwrap()` on the ROUTER thread if they encounter
IPC errors. Instead, we now propagate the error to the crossbeam
receiver.
In the GenericChannel::Crossbeam case this means, that we need to use a
`Result<T>` as the data type, even though the Result variant is always
okay, so that the receiver type is the same regardless of `IPC` or not.
This is required, so we have the same channel type, and can pass the
inner crossbeam channel into e.g. `select!`, without having to wrap or
re-implement select.

This also means, that as we switch towards GenericChannel, we will
gradually improve our error handling and eventually remove the existing
panics on IPC errors.

These changes were extracted out of
https://github.com/servo/servo/pull/38782

Testing: Covered by existing tests. No new panics were introduced.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-25 04:19:41 +00:00
Martin Robinson
3a97d4eed2
fonts: Add more types to fonts_traits (#38898)
This is necessary so that `constellation_traits` can get these types via
a
dependency on `fonts_traits`. This will allow sending IPC channels to
shared
workers so that they can have access to a shared `FontContext` from
`script`.

Testing: This just moves code between crates, so is covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-24 19:36:59 +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
Ashwin Naren
b4a454aaea
script: Move webaudio DOM interfaces to script/dom/audio/ (#38894)
Moves interfaces defined by the webaudio spec (27 files) to the new
`script/dom/audio/` module from the `script/dom/` module.

Testing: Just a refactor shouldn't need any testing
Fixes: N/A

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-24 05:15:44 +00:00
Nico Burns
1fc857865f
Use Tag type from font-types crate to represent opentype tags (#38870)
The `font-types` crate is the tiny type-only base crate of `fontations`.
This uses a strongly typed representation of open type tags, and allows
us to remove our custom macro for creating them.

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-08-23 20:32:47 +00:00
Fuguo
7dc48460d2
layout: Skip adding ScrollFrameHitTestItem to stacking context tree if the BoxFragment has inherited style pointer-events: none (#38884)
**fix some page cannot slide**
In the refactoring of https://github.com/servo/servo/pull/38480, a
segment of logic was missing.

11844ca5af/components/layout/display_list/mod.rs (L405-L410)
Testing: The page can be scrolled on the OpenHarmony device.
Fixes: https://github.com/servo/servo/pull/38480#issuecomment-3213734994

---------

Signed-off-by: kongbai1996 <1782765876@qq.com>
Signed-off-by: Fuguo <1782765876@qq.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-08-23 07:00:14 +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
Martin Robinson
2f44ba5168
script: Do not iterate through all image frames when advancing animated images (#38857)
Instead of iterating through all frames every time we are looking for a
particular frame, just index into the `Vec` of frames directly. This
should do less work on every frame transition.

Testing: This is just a small optimization, so shouldn't change
observable
behavior.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-08-22 17:44:57 +00:00
Euclid Ye
f323e67024
webdriver: Simplify webview related steps that are guaranteed to succeed (#38855)
Testing: Semantically it is the same. But still run the test locally and
in [try](https://github.com/yezhizhen/servo/actions/runs/17159323926) as
I was worried about some unexpected side effect from
176e42d36d. But seems everything is good.

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-08-22 17:19:12 +00:00
Nico Burns
4082f57003
Upgrade vello, vello_cpu, skrifa, and read-fonts (#38860)
Bumps `vello`, `vello_cpu`,`skrifa`, and `read-fonts` dependencies.

Notes:
- The primary motivation for this is so that our version of `read-fonts`
matches the version used by current releases of `harfrust`
- `vello_cpu` now defaults to `RenderMode::OptimizeSpeed` so we don't
need to pass this explicitly.

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-08-22 17:05:51 +00:00
Martin Robinson
bf5da330e1
fonts: Stop using deprecated functions in dwrote (#38856)
The new version of the functions return `Result` types.

Testing: No tests because this should not change behavior.

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

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

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

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

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

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

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

This depends on servo/dwrote-rs#68.

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

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

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

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

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

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

Fixes: #38799

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

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

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

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

---------

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

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

---------

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

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

Testing: WPT
Fixes: #38814

---------

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

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

---------

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

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

Testing: Existing WPT coverage

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

Testing: Tested. No behaviour change.

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

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-08-22 04:12:41 +00:00