Commit Graph

12439 Commits

Author SHA1 Message Date
Tim van der Lippe
3ac02bc6ac script: Mark fetch-later requests as keep-alive (#41345)
This implements the required plumbing for the keep-alive flag on
requests. The flag already exists on the request object, but now also
exists on the builder itself.

The flag is then passed into a canceller. While we could make canceller
optional, in many cases it isn't and would require a whole lot more
changes. To follow the spec more closely, opted to put the keep_alive
flag on the canceller as well.

Note that this doesn't pass any extra fetch-later tests since we are not
correctly unloading iframe documents. That will be fixed in a follow-up
PR.

Part of #41230

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-12-18 19:49:13 +00:00
Taym Haddadi
25a626cf3d script: retarget dblclick from input UA shadow DOM to host (#41319)
dblclick on text inputs was being dispatched to an internal element used
for the input, not to the <input> itself. As a result, page scripts
listening for dblclick on the input never received the event.

Testing: tested manually.
Fixes: #41303

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-18 13:09:35 +00:00
Simon Wülker
581723c338 script: Remove redundant call to Node::adopt in Node::replace_all (#41373)
All the new nodes will be `adopt`-ed inside the respective calls to
`Node::insert` anyways.

Testing: Hopefully no regressions?

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-12-18 12:03:41 +00:00
Taym Haddadi
f794a2480d IndexedDB: Handle error of creating new db Step 6 of (#41014)
I added error handling for handle_open_db but I also added it to
SqliteEngine::new and handle_sync_operation because we also open db
there, so I am not sure about these two.

part of #40983

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-17 19:11:46 +00:00
atbrakhi
ba1122b4f5 Add ServoDelegate and WebViewDelegate methods for Console API (#41351)
Route console messages through the embedding API instead of printing
directly, giving embedders control over console output handling.

Testing: Should be covered by exsisting tests
Fixes: #41145

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-12-17 19:06:27 +00:00
Kingsley Yung
0261ab1ef9 script: Implement encrypt/decrypt operations of RSA-OAEP (#41316)
Finish adding RSA-OAEP support to WebCrypto API, by implementing the
encrypt and decrypt operations of RSA-OAEP.

Testing: Pass some WPT tests that were expected to fail.
Fixes: Part of #41113

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-17 11:21:31 +00:00
Taym Haddadi
5a8278aad0 Fix hashchange only queue when fragment actually changes (#41325)
Fix hashchange only queue when fragment actually changes

Testing: tested it manually for now. 
Fixes: #41304

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-17 05:59:59 +00:00
Tim van der Lippe
3199477f01 script: Implement storing deferred fetches (#41232)
This is the first part of preparation for implementing the keepalive
flag for requests. It requires implementation of the concept of a task
group, which we already sort of have with `DocumentLoader`. Therefore,
we currently already cancel any loads, which should be updated to
ignored kept-alive requests.

However, termination also requires storing of deferred fetches, which
are also kept-alive. Therefore, to distinguish the two, we need to store
them separately as stated with the TODO.

In a follow-up, we can then skip canceling keep-alive requests for both
`navigator.sendBeacon` (which aren't deferred) and `fetchLater` (which
are deferred).

Part of #41230

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-12-16 19:32:52 +00:00
César Danilo Pedraza Montoya
db8e01076a script: Add error message text to errors in aes_operation.rs (#41292)
add error messages for `encrypt_aes_ctr`, `encrypt_aes_cbc`, and
`decrypt_aes_cbc`

Related issue: #40756

For some of the messages I just used the `fmt::Display` of `UnpadError`,
but maybe these messages should be more specific?

---------

Signed-off-by: César Pedraza <cpedraza@unal.edu.co>
2025-12-16 12:56:43 +00:00
atbrakhi
f3488b25a8 Move devtools_traits::LogLevel to embedder_traits (#41311)
This PR moves devtools_traits::LogLevel to embedder_traits in
preparation of upcoming work on creating a ServoDelegate and
WebViewDelegate method for Console API output. Also see
https://github.com/servo/servo/issues/41145

Testing: only moves code, no functional change
Fixes: part of https://github.com/servo/servo/issues/41145

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2025-12-16 10:38:30 +00:00
Simon Wülker
9cbb522606 script: Support legacy "background" presentational hint on more elements (#41272)
Testing: New tests start to pass
Fixes https://github.com/servo/servo/issues/41269

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-12-16 04:22:42 +00:00
Kingsley Yung
706e06315d script: Implement sign/verify operations of RSA-PSS (#41287)
Finish adding RSA-PSS support to WebCrypto API, by implementing the sign
and verify operations of RSA-PSS.

Testing: Pass some WPT tests that were expected to fail.
Fixes: Part of #41113

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-15 16:54:44 +00:00
Kingsley Yung
a36e3dbe19 script: Implement sign/verify operations of RSASSA-PKCS1-v1_5 (#41267)
Finish adding RSASSA-PKCS1-v1_5 support to WebCrypto API, by
implementing the sign and verify operations of RSASSA-PKCS1-v1_5.

Testing: Pass some WPT tests that were expected to fail.
Fixes: Part of #41113

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-15 06:48:52 +00:00
Taym Haddadi
b2aa0ac859 Fix RefCell double-borrow in Window::remove_reporting_observer (#41261)
lot of RefCell already borrowed crashes are because of code like this:
```
if let Some(index) = self
    .array
    .borrow()
    .iter()
    .position(|p| &**p == r_p)
{
    self.array.borrow_mut().remove(index);
}
```
this will always panic whenever the position() finds an index, because
the immutable borrow from borrow() is still alive when we call
borrow_mut().

Fix by ensuring the borrow is dropped before taking a mutable borrow (by
computing the index in a separate scope / temporary), then remove
safely.



Testing: added crash test.
Fixes: #41260

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-14 21:11:32 +00:00
WaterWhisperer
bed16a236e script: Replace borrow_mut() with borrow() in AudioBuffer::restore_js_channel_data (#41253)
Avoid borrow hazard in `AudioBuffer::restore_js_channel_data`

Testing: `./mach check` and `./mach test-wpt
tests/wpt/tests/webaudio/the-audio-api/the-analysernode-interface/test-analyser-output.html
--pref js_mem_gc_zeal_level=2 --pref js_mem_gc_zeal_frequency=1
--timeout-multiplier=5 --product=servo`
<img width="2661" height="1385" alt="截图 2025-12-14 11-32-13"
src="https://github.com/user-attachments/assets/830ec4a7-17b8-4931-951f-1eb60d373d82"
/>
now it won't crash
Fixes: #41248

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2025-12-14 06:42:00 +00:00
Kingsley Yung
e8edc8146e script: Remove unused helper functions for RsaOtherPrimesInfo (#41243)
The import and export key operations of RSA algorithms have been
implemented. We actually don't need some helper functions for
RsaOtherPrimesInfo in JsonWebKey, for those operations. This patch
removes those unused helper functions.

Testing: Existing tests suffices.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-13 13:48:43 +00:00
Busy Beaver
0a4dd17566 script: Do not conflate shadow roots and the Document element in element.scrollLeft and similar methods (#41234)
This PR fixes an issue where the Shadow DOM roots were incorrectly
identified as the document roots in scroll and dimension calculations.
The previous check `*self.root_element() == *self` returned true for
shadow roots which caused `scrollTop`, `scrollLeft`, `clientWidth` to
return viewport dimensions instead of actual dimensions. The previous
check was replaced with the already existing
`self.is_document_element()` to check for actual roots.

Testing: 
 - This causes `shadow-dom/scroll-restore-shadow.html` to start passing.
- It was also locally tested on the tests given by @rayguo17 (
[clientWidth
Test](https://github.com/servo/servo/issues/41002#issue-3684265503) and
[scrollTop
Test](https://github.com/servo/servo/issues/41002#issuecomment-3605214797)
)

   Test results: 
   ```
   No build type specified so assuming `--dev`.
   shadow_host_client_width:  300
   shadow_root_element_client_width:  300
   
   No build type specified so assuming `--dev`.
   shadow host scrollTop:  0
   shadow_root_element_scrollTop:  0
   document root element scrollTop:  536
   Button in shadow DOM clicked
   ```

Fixes: #41002

---------

Signed-off-by: zen-zap <pandaashutosh340@gmail.com>
2025-12-13 10:37:19 +00:00
Luke Warlow
803743a920 Fire toggle events for dialog methods (#40412)
Fire toggle events for dialog methods

Testing: Existing WPTs

Depends on #40405

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2025-12-13 08:46:36 +00:00
Kingsley Yung
84e8194434 script: Implement generate key operations of three RSA algorithms (#41240)
This patch implements generate key operations of three RSA algorithms
(RSASSA-PKCS1-v1_5, RSA-OAEP, RSA-OAEP), with `rsa` crate.

The three operations are very similar to each other, so we can implement
them as a single function, located at the sub-module `rsa_common`,
shared among the three RSA algorithms. The enum `RsaAlgorithm` is used
differentiate the behavior of a few steps (Step 1, 5, 13 and 18) that
are slightly different among the three RSA algorithms.

Testing: Pass some WPT tests that were expected to fail.
Fixes: Part of #41113

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-12-13 05:10:34 +00:00
Josh Matthews
d86d2a90aa script: Use rooted typed arrays in generated code and buffer source APIs (#41228)
There are two flavours of the mozjs `TypedArray<T>` wrapper for typed
array objects: one stores a `Box<Heap<*mut JSObject>>`, while the other
just has a bare `*mut JSObject`. The second one must only be stored
inside the `CustomAutoRoot` rooting values, but we were using it in many
other places like WebIDL dictionaries without rooting it safely. These
changes make our typed array APIs always use
`RootedTraceableBox<TypedArray<T>>` with the `Box<Heap<*mut JSObject>>`
flavour, which ensures that the JS object stored inside the typed array
wrapper is always visible to the SpiderMonkey GC.

Testing: Adds a new test that crashes without these changes.
Fixes: #41206

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-12-12 14:33:45 +00:00
Kingsley Yung
df8484e6a4 script: Implement export key operations of three RSA algorithms (#41225)
This patch implements export key operations of three RSA algorithms
(RSASSA-PKCS1-v1_5, RSA-OAEP, RSA-OAEP), with `rsa` crate.

The three operations are very similar to each other, so we can implement
them as a single function, located at a new sub-module `rsa_common`,
shared among the three RSA algorithms. An enum `RsaAlgorithm` is also
added to the sub-module `rsa_common`, in order to slightly differentiate
the behavior of the step (Step 3.4 of "jwk" format) that are different
among the three RSA algorithms.

Testing:
- Pass some WPT tests that were expected to fail.
- Some new FAIL expectations are added. They were skipped by WPT when
the export key operations of RSASSA-PKCS1-v1_5, RSA-PSS and RSA-OAEP had
not been implemented, and requires other not-yet-implemented operations
to pass.

Fixes: Part of #41113

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-12 14:13:18 +00:00
Kingsley Yung
ec5a6dacca script: Implement import key operation of RSA-OAEP (#41217)
Start adding RSAS-OAEP support to WebCrypto API.

This patch implements import key operation of RSA-OAEP, with `rsa`
crate.

Testing:
- Pass some WPT tests that were expected to fail.
- Some new FAIL expectations are added. They were skipped by WPT when
the import key operation of RSA-OAEP had not been implemented, and
requires other not-yet-implemented operations to pass.

Fixes: Part of #41113

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2025-12-12 06:25:05 +00:00
Josh Matthews
c62fbe7250 script: Add unsafe block in set_gc_zeal_options. (#41215)
Fixes the following warning:
```
warning[E0133]: call to unsafe function `js::jsapi::SetGCZeal` is unsafe and requires unsafe block
    --> components/script/script_runtime.rs:1144:5
     |
1144 |     SetGCZeal(cx, level, frequency);
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
     |
     = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>
     = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
    --> components/script/script_runtime.rs:1132:1
     |
1132 | unsafe fn set_gc_zeal_options(cx: *mut RawJSContext) {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: `#[warn(unsafe_op_in_unsafe_fn)]` (part of `#[warn(rust_2024_compatibility)]`) on by default
```

Testing: Build-time only.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-12-12 04:25:13 +00:00
Martin Robinson
d9cf03a4e5 Fix all Android build warnings and make the CA verifier preference more flexible (#41179)
This change fixes a variety of build warnings on Android. In a related
change, the CA verifier preference allows using a list of certificate
overrides and the `rust-webpki` verifier regardless of platform. Whether
to use a list of certificate overrides and whether to use the platform
verifier are orthagonal, so this change unlinks those two and in the
process
fixes a build warning on Android.

Testing: This preference is untested (and quite hard to test honestly),
so this change
does not have tests. There should be no behavior change unless using a
combination
of forcing the webpki verifier and providing a list of CA overrides.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-12-11 12:56:12 +00:00
Gregory Terzian
5c777abc63 indexeddb: move database open and upgrade transaction to in parallel. (#40939)
The spec concept of [opening a
database](https://www.w3.org/TR/IndexedDB-2/#open-a-database), and the
conditional [upgrade of a
database](https://w3c.github.io/IndexedDB/#upgrade-a-database), should
be run in-parallel, meaning on the backend indexeddb thread, and not on
the script-thread.

This implements the move, but retains a blocking wait on the upgrade
transaction finish. It is the first step towards a larger
refactoring(see https://github.com/servo/servo/issues/40983), which will
see concepts like transaction lifecyle and connection queues be
implemented on the indexeddb thread, and which will make any waiting
non-blocking as well.

Other smaller changes to support the above are: 
- returning whether a physical db was created when instantiating the db
engine.
- using a global counter to produce transaction ids.

Testing: New failures on WPT tests: to be fixed as part of several
follow-ups.
Fixes: The parts of
https://github.com/servo/servo/issues/38942#issuecomment-3270223903 that
were not addressed when the issue was closed.

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Signed-off-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-11 12:22:49 +00:00
Josh Matthews
fac1067ec7 script: Add newlines after each value in formdata body. (#41199)
Fixes logging in to lichess.org, since our request body now matches what
other browsers send.

Testing: Newly passing WPT tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-12-11 11:08:22 +00:00
Gae24
f4d8c4569e script: Bring creating and running classic scripts closer to spec (#40938)
Use the algorithms introduced in #41109 in more places.
Follow more closely the spec when executing classic scripts, introducing
the concepts of rethrowing and muting errors.
Muting errors is not actually implemented, and will be done in a
followup.

Testing: More tests start passing 
Fixes #34199
Fixes #27260
Fixes #15188

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-12-10 18:14:34 +00:00
Martin Robinson
824f551f03 Rename IOCompositor to Paint (#41176)
For a long time, the "Compositor" hasn't done any compositing. This is
handled by WebRender. In addition the "Compositor" does many other
tasks. This change renames `IOCompositor` to `Paint`.

`Paint` is Servo's paint subsystem and contains multiple `Painter`s.
This change does not rename the crate; that will be done in a
followup change.

Testing: This just renames types and updates comments, so no new tests
are necessary.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-12-10 15:09:49 +00:00
Kingsley Yung
0e1ab937b3 script: Update spec text of WebCrypto API (#41180)
Update a few spec texts of WebCrypto API with respect to recent changes
in the [Web Cryptography](https://w3c.github.io/webcrypto/) and [Modern
Algorithms in WICG](https://wicg.github.io/webcrypto-modern-algos/) that
refines some expressions. No behavioral changes.

Commits of the changes in the specifications:
-
0213b32f7e
-
3b9d192f52
-
0d5f58606c

Testing: No behavioral changes. Existing tests suffice.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-10 14:49:19 +00:00
Kingsley Yung
64dd55ccc3 script: Implement import key operation of RSASSA-PKCS1-v1_5 (#41172)
Start adding RSASSA-PKCS1-v1_5 support to WebCrypto API.

This patch implements import key operation of RSASSA-PKCS1-v1_5, with
`rsa` crate.

Testing:
- Pass some WPT tests that were expected to fail.
- Some new FAIL expectations are added. They were skipped by WPT when
the import key operation of RSASSA-PKCS1-v1_5 had not been implemented,
and requires other not-yet-implemented operations to pass.

Fixes: Part of #41113

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-10 14:48:03 +00:00
Andrei Volykhin
807979b40a script: Decouple ownership of the media element from IPC router callback (#41131)
Added new invocation struct `HTMLMediaElementEventHandler` that allows
to decouple ownership of the `HTMLMediaElement` from the IPC router
callback (break cyclic reference dependency) by replacing a `Trusted`
wrapper with more suitable `WeakRef`.
Note that `WeakRef` is not thread-safe and MUST be rooted and/or deleted
on the script thread.
    
Testing: Regressions in the following tests caused by overly aggressive
GC on document activity change to `Inactive` and will be follow up in
https://github.com/servo/servo/issues/41138
-
html/semantics/embedded-content/media-elements/autoplay-allowed-by-feature-policy.https.sub.html
-
html/semantics/embedded-content/media-elements/autoplay-default-feature-policy.https.sub.html
-
html/semantics/embedded-content/media-elements/autoplay-disabled-by-feature-policy.https.sub.html

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

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-12-10 14:41:42 +00:00
Martin Robinson
87eeae7047 script: Remove reference to closed bug #18998 (#41162)
This bug was closed a while ago, so we should also remove in in code
reference to it.

Testing: This just removes an out-of-date comment so no tests necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-12-09 17:46:06 +00:00
Kingsley Yung
56d9e24bff script: Implement import key operation of RSA-PSS (#41157)
Start adding RSA-PSS support to WebCrypto API.

This patch implements import key operation of RSA-PSS, with `rsa` crate.

Testing:
- Pass some WPT tests that were expected to fail.
- Some new FAIL expectations are added. They were skipped by WPT when
the import key operation of RSA-PSS had not been implemented, and
requires other not-yet-implemented operations to pass.

Fixes: #34362, and part of #41113

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-09 15:34:01 +00:00
Narfinger
c2f546da01 Base: Implement GenericOneshot channels (#41143)
This implements a GenericOneshot channel. The size in the crossbeam
channel is restricted while in the Ipc case we use the same
IpcChannel(for now).

We also use these channels in WebDriver to prove they work.

Testing: Unit Tests and compilation still works.
Fixes: https://github.com/servo/servo/issues/39019

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-12-09 10:36:59 +00:00
Narfinger
6f62269c8c Devtools: Switch to GenericChannel and GenericCallback (#41051)
Switch the devtools part to GenericCallback and GenericSender.
To keep the diff small the names where not changes as a Sender almost
fills the same requirement as a callback.

Testing: As this is mostly type changes, the compilation is the test but
also devtools seem to work fine with these changes. ./mach try run is
here: https://github.com/Narfinger/servo/actions/runs/19931697694

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-12-08 11:03:45 +00:00
Domenico Rizzo
34160f994c script: Move WebGLProgram Drop implementation to a member type (#37622)
Testing: No new tests introduced
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2025-12-07 22:18:46 +00:00
Gae24
3b205ad8f2 script: Implement creating and running classic scripts according to spec (#41109)
Implemented spec algorithms [create a classic
script](https://html.spec.whatwg.org/multipage/#creating-a-classic-script)
and [run a classic
script](https://html.spec.whatwg.org/multipage/#run-a-classic-script).
Classic script now gets unminified on creation.

Testing: Behaviour hasn't changed much, but we pass a new test instead
of crashing.

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-12-07 19:06:41 +00:00
Taym Haddadi
371e7fc9f6 Expose window.clientInformation as a navigator alias (#41111)
Expose window.clientInformation as a navigator alias.

Testing: clientInformation test expectations are updated. 
Fixes: https://github.com/servo/servo/issues/41089

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-07 12:25:10 +00:00
webbeef
c217cbb5a6 dom: Avoid crashing on empty favicon href attribute (#41056)
Add a check to handle_favicon_url() similar to the ones done in similar
functions: handle_stylesheet_url() and fetch_and_process_prefetch_link()

Testing: Check that loading http://chiptune.com/  doesn't crash anymore.
Fixes: https://github.com/servo/servo/issues/41047

Signed-off-by: webbeef <me@webbeef.org>
2025-12-06 20:00:23 +00:00
Taym Haddadi
d10d481016 Guard MediaElementAudioSourceNode against closed contexts and add crash test (#41092)
Guard MediaElementAudioSourceNode against closed contexts and add crash
test

Testing: Added crash test.
Fixes: #41083

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-06 16:39:36 +00:00
Gae24
ae62ab7fa7 script: Expose a single interface to run js code on globalscope (#41078)
Small cleanup, avoid repeating some code, since in these cases we use
the defaults provided by `GlobalScope`

Testing: Covered by existing tests, no behaviour change.

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-12-05 15:27:52 +00:00
César Danilo Pedraza Montoya
6e8384896a script: add error messages (#41039)
script: add error messages for conditions in `encrypt_aes_ctr`

Testing: No tests needed (?) let me know if I should add tests for this
somewhere.
Fixes: #40756

Followed the
[MDN](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-ctr)
and [w3c](https://w3c.github.io/webcrypto/#aes-ctr-operations-encrypt)
docs to write the messages.

I'm thinking on adding more messages, so any feedback would be
appreciated! :)

---------

Signed-off-by: César Pedraza <cpedraza@unal.edu.co>
2025-12-05 09:20:50 +00:00
Anonmiraj
b207be05d9 change some allows to expects (#41040)
Changed some allow to expects and removed the unfulfilled expectations.

Testing: Refactor
Part of: #40383

Signed-off-by: anonmiraj <nabilmalek48@gmail.com>
2025-12-05 07:23:32 +00:00
Andrei Volykhin
9a1d86cc88 html: Change the play state of the media player if the old is opposite (#41027)
It's important to check the media player's `paused` state to avoid
unnecessary changes to its internal state (via `play`, `pause`),
including configuration the `playback rate` and `volume` properties.

Depends on https://github.com/servo/media/pull/467

Testing: The expected test results are unchanged because it is the
implicit performance improvements of the media stack, with the exception
of the following test, which is affected by the `playback rate` state
caching mechanism (the `seek` position is not overridden for default
playback rate (1.0)).
- html/semantics/embedded-content/media-elements/preserves-pitch.html

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4762

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-12-04 12:19:48 +00:00
Andrei Volykhin
f935174981 html: Enhance image update the image data, environment changes algorithms (#41046)
The following image processing algorithms were updated (with
description)
- https://html.spec.whatwg.org/multipage/#update-the-image-data
- https://html.spec.whatwg.org/multipage/#img-environment-changes

Added missing `image request phase` switching cases and non-spec
handling of the `last selected source`.

Testing: Improvements in the following tests
-
html/semantics/embedded-content/the-img-element/current-pixel-density/error.html
-
html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html

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

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-12-04 12:18:41 +00:00
batu_hoang
1aab8186b7 selectors::Element::parent() shouldn't cross shadow tree boundary (#40977)
ServoLayoutElement::parent_element() method shouldn't cross shadow tree
boundary.
`inheritance_parent` uses `traversal_parent`

Testing: 
`tests/wpt/meta/css/css-lists/counter-list-item-slot-order.html.ini`
`tests/wpt/meta/css/css-nesting/host-nesting-003.html.ini`
`tests/wpt/meta/css/selectors/is-where-shadow.html.ini`
and manual test in the below issue
The regression in
`tests/wpt/meta/html/rendering/the-details-element/details-blockification.html.ini`
has 1 more cause
https://github.com/servo/servo/pull/40977#issuecomment-3608471378

Fixes: [#40896](https://github.com/servo/servo/issues/40896)

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2025-12-04 05:57:34 +00:00
Narfinger
a841eb49d5 IndexedDB: Use GenericSender, GenericReceiver and GenericCallback for IndexedDB (#41031)
Moving IndexedDB to use the generic channel methods.

Of note is the change in 'IDBRequest::execute_async'. This method
previously added a channel that was constructed from the callsite in put
into the AsyncOperation. Now we do not take a function but take a
'FnOnce(GenericCallback<BackendResult<T>>) -> AsyncOperation'. With this
the callsite can construct the AsyncOperation to give in the
'IndexedDBThreadMsg::Async'.

The rest are mostly just type changes.

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

Testing: WPT tests on the IndexedDB subset still pass.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-12-04 05:25:17 +00:00
webbeef
27a776b060 script: shorten script thread name (#41033)
On Linux thread names are limited to 15 characters: that caused all the
script threads to be named 'ScriptScriptEve' and show up with the same
name in tooling.

That changes turns the name to 'Script#{script id}' instead.

Testing: No test coverage for that very internal detail.

Signed-off-by: webbeef <me@webbeef.org>
2025-12-03 19:43:04 +00:00
Taym Haddadi
94e09277e2 Script Implement ReadableByteStreamTee (#35991)
<!-- Please describe your changes on the following line: -->


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

<!-- Either: -->
All stream tee tests are passing now.

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

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

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2025-12-03 13:19:21 +00:00
Kingsley Yung
f19bffd186 script: Add error messages to operations of ChaCha20-Poly1305 (#41030)
Error messages in the import/export key operations of ChaCha20-Poly1305
are missing. This patch adds those error messages.

Testing: No behavioral change. Existing tests suffice.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-03 12:59:35 +00:00