Commit Graph

256 Commits

Author SHA1 Message Date
Martin Robinson
e7ee1171d8 script: Remove some proprietary Servo-only testing methods from Window (#42728)
These three methods date back from the very early history of Servo and
are no longer necessary:

1. `Window.debug`: `console.log` is a better replacement for this method
   now. A manual test that tests the very basics of JavaScript used
   this. This test is removed as well.
2. `Window.gc`: This can be replaced with `TestUtils.gc`, which is part
    of a W3C specification.
3. `Window.js_backtrace`: This method is moved to `ServoTestUtils`.

Testing: Tests are updated to reflect these changes.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-02-20 17:32:34 +00:00
Luke Warlow
853fcf4fda script: Introduce ServoTestUtils and a forceLayout() function (#42714)
This introduces a new `ServoTestUtils` namespace with a `forceLayout()`
function. This `forceLayout()` function returns an object which
currently has an array of the phases ran by layout. Also moves
`panic()`, `crashHard()` and `advanceClock()` from `TestBinding` to this
new namespace.  `TestBinding` is meant to test the bindings generation,
but these are more generic helpers for Servo-only tests.

Testing: This change adds a series of Servo-only tests that verify the
behavior of the new `forceLayout()` function. Tests that rely on the
moved interfaces are updated and should continue to pass.

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-02-20 13:00:06 +00:00
atbrakhi
3c8c46d32f devtools: implement pause and resume in debugger (#42580)
When a breakpoint is hit, the script thread now pauses execution and
notifies devtools clients with a "paused" event. The script
thread enters a loop that processes devtools messages until
a Resume command is received.

This change does not implement manual pause

Testing: Added new test
Fixes: part of https://github.com/servo/servo/issues/36027




https://github.com/user-attachments/assets/c619db20-4579-4f77-aa60-0e43e6e7e575

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2026-02-18 10:08:46 +00:00
aquaThirsty
87ff2021a2 script: Turn scrollParent into a function and change wpt tests (#42689)
Turn `scrollParent` into a function as the CSSWG resolved in
https://github.com/w3c/csswg-drafts/issues/12731#issuecomment-3885728833

Testing: updating wpt tests
`tests/wpt/tests/css/cssom-view/scrollParent.html` and
`tests/wpt/tests/css/cssom-view/scrollParent-shadow-tree.html`
Fixes: #42547

Signed-off-by: TimurBora <timurborisov5561@gmail.com>
2026-02-17 21:21:12 +00:00
Tim van der Lippe
92e2d00083 script: Implement check for supported and enabled commands (#42634)
The first step of `execCommand` commands is to figure out
if they are supported and enabled. Therefore, implement
these two pieces with only 1 command: delete.

The implementation of `delete` is currently mostly dummy,
to have at least something going. But the main part of
this change is to setup the infrastructure to figure out
when commands are supported and enabled.

For the first part, its simply the list of commands we
currently have implemented, which is only delete.

For the second part, we need to consider the active range
of the current selection and do various checks, as well as
check the presence of `contenteditable`.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-17 13:19:41 +00:00
Tim van der Lippe
e23c14aabd script: Implement support for contenteditable (#42633)
This is required for `document.execCommand`, since it needs to check the
active range of the selection whether it has the attribute or not.

It also turns on the relevant WPT tests, with 1
pre-existing failure for absolute positioned pseudo elements. These
currently do not render correctly, regardless of the existence of
contenteditable.

Fixes #12776

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-16 18:55:42 +00:00
Tim van der Lippe
2eeaf05af9 script: Check trusted types for execCommand (#42626)
We should only do this for the `insertHTML` command.
All other commands are unaffected.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-15 12:55:05 +00:00
Tim van der Lippe
ae390d8bf8 script: Add baseline for editing/ WPT tests (#42621)
In preparation of the actual implementation.

Also had to update the codegen to be able to handle default values for
DOMString.

Part of #25005

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-14 20:36:49 +00:00
Onur Şahin
fb9bef66fd script: Implement DocumentOrShadowRoot.FullscreenDocument (#42401)
Implement
[DocumentOrShadowRoot.FullscreenDocument](https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement).

## Changes
- Update IDL definition by removing `Document.fullscreenElement` and
declaring it in `DocumentOrShadowRoot` mixin as per the
[spec](https://fullscreen.spec.whatwg.org/#api)
- Implement [fullscreenElement
getter](https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement)
as a method in `DocumentOrShadowroot.get_fullscreen_element` which is
used by `Document` and `ShadowRoot`.
- Changedbubble and composed flags for fullscreen enter and exit events
to true.
- Delete `shadowroot-fullscreen-element.html.ini` since the test now
passes.

## Testing
Enable `shadowroot-fullscreen-element.html` WPT test.

Passing WPT run: https://github.com/onsah/servo/actions/runs/21872882492

## Fixes
https://github.com/servo/servo/issues/42234

Signed-off-by: Onur Sahin <sahinonur2000@hotmail.com>
2026-02-12 09:55:11 +00:00
Ashwin Naren
232d434701 Add servo:config page (#40324)
Similar to about:config from firefox. All preferences are editable;
editing them mid-runtime is not guaranteed to cause any effects. This is
separate from servo:preferences, which selectively groups and exposes
preferences. This probably would become more useful if/when preferences
become persistent.

<img width="1136" height="880" alt="Screenshot 2025-10-31 at 10 19
57 PM"
src="https://github.com/user-attachments/assets/2ef759d8-06a4-457f-b9df-331cc3525338"
/>


Followup work:
- Remove `getStringPreference`, `getIntPreference`, and
`getBoolPreference`. Using `getPreference` and `preferenceType` is more
flexible.
- Make more of these config options work on the fly.
- Allow for reverting config options.

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-09 17:31:59 +00:00
atbrakhi
d6097d1967 devtools: Implement debugger Eval event (#42306)
Replace the `EvaluateJS` function to use `debugger.js` `Eval` event and
the proper context. This takes the global context and calls
[executeInGlobal](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Object.html#executeinglobal-code-options).

In future we also add the version that takes a frame and calls
[eval](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Frame.html#eval-code-options).

Testing: No new tests added yet, Old tests are not impacted by this
change.
Fixes: Part of https://github.com/servo/servo/issues/36027

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
2026-02-09 12:58:51 +00:00
Ashwin Naren
3442a91766 indexeddb: Implement index retrieval (#42440)
Retrieve already stored indexes from the backend when querying for other
object store data.

Also removes the extraneous blocking IPC call when creating an
`IDBObjectStore` object by batching all the info into a single struct.

Testing: WPT
Fixes: #42438

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-08 09:22:50 +00:00
Ashwin Naren
7a810eda0a indexeddb: Expose keypath in idbindex (#42431)
Implements `IDBIndex.keypath`.

Testing: WPT
Fixes: Partially #38100

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-08 05:25:57 +00:00
Ashwin Naren
879f3e1451 indexeddb: IDBIndex creation and deletion (#38840)
Implements `createIndex` and `deleteIndex`, they have already been
implemented in the backend.

Testing: WPT
Fixes: Partially #38100

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-07 21:41:25 +00:00
Shubham Gupta
60fc5c3e52 script: Expose toJSON on PerformancePaintTiming (#42396)
This PR targets on adding JSON to `IDL`.

Testing: `components/servo/tests/performance_paint_timing.rs`
Fixes: Updated expectations for Existing WPT Tests.

---------

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
2026-02-07 07:06:39 +00:00
Shubham Gupta
2ca7808083 script: Remove Worker scope from PerformancePaintTiming (#42409)
This will align `PerformancePaintTiming` interface according to `W3C`
specifications.

Specifiactions:
[PerformancePaintTiming](https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming)

Testing: `_mozilla/mozilla/interfaces.worker.html`

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2026-02-06 16:32:05 +00:00
Steven Novaryo
42359b26a2 script: Impl UserActivation interface (#42060)
User activation is a concept used to prevents annoying usage of specific
API (Fullscreen API, Virtual Keyboard) to the user by states that the
API needs to have in order to process. This PR implements the
`UserActivation` interface and keep track of the last user interaction.
Each `Window` will keep track the [last activation time
stamp](https://html.spec.whatwg.org/multipage/interaction.html#last-activation-timestamp),
which will be set if there are a triggering input event firing in the
`Window` and propagating across the browsing contexts ancestors and
descendants. These timestamp could be consumed, and the timestamp will
be set to negative infinite.

It is then used to gate some APIs within browser that is determined as
transient activation consuming-gated APIs, which needs transient
activation to be true and consumes the activation. For the purpose of
testing, this PR would implement this behavior on fullscreen API which
is used to test activation consuming behavior.

Spec:
https://html.spec.whatwg.org/multipage/interaction.html#the-useractivation-interface

Testing: Existing WPT

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2026-02-03 23:20:54 +00:00
Ashwin Naren
2c96178ff1 geolocation: Support errorCallback (#42295)
Support `errorCallback` in geolocation position request functions and
throw the necessary errors.

Testing: Passes 3 more WPT tests
Fixes: Partially #38903

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2026-02-03 02:33:39 +00:00
Simon Wülker
10563019bb script: Implement HTMLInputElement.alpha (#42293)
Testing: New tests start to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-02 23:38:45 +00:00
Simon Wülker
83bf475370 script: Support different colorspaces for <input type=color> (#42279)
This change adds support for the `colorspace` attribute on color inputs
and implements serialization of the input value accordingly.

The color picker from servoshell doesn't yet support non-rgb colorspaces
(and neither does the embedding API), so we convert to and from rgb when
communicating with the embedder.

Testing: New tests start to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-02 06:21:41 +00:00
Simon Wülker
f822959d7e script: Add navigator.pdfViewerEnabled (#42277)
Servo doesn't have a pdf viewer, so we simply set the property to
`false`.

Testing: New tests start to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-01 20:58:06 +00:00
Euclid Ye
624e9b49e1 css: Enable registered custom properties with CSSOM but stay unanimatable (#42136)
Many websites use Tailwind CSS script which utilizes registered custom
properties.
This PR makes such websites look as expected, such as #42129.

Before: 
<img width="485" height="120" alt="image"
src="https://github.com/user-attachments/assets/428000b1-eed1-4f10-bbf8-eca9e7b630f5"
/>

After:
<img width="487" height="82" alt="image"
src="https://github.com/user-attachments/assets/ab016cbf-9c00-4bd8-adc8-be28f13e42e5"
/>


Testing: Updated existing WPT results.
Fixes: #42129
Fixes: #41417 

Stylo Companion: https://github.com/servo/stylo/pull/293

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-01-31 14:11:35 +00:00
atbrakhi
e28a0f6d6c devtools: implement clearBreakpoint (#42154)
Add an event listener for `clearBreakpoint` to `debugger.js` and the
necessary glue to access it from the `devtools` crate.

Testing: `./mach test-devtools` and manual testing.
Fixes: Part of: https://github.com/servo/servo/issues/36027

---------

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
2026-01-27 15:46:54 +00:00
Tim van der Lippe
13472304a5 script: Support blocking attribute for style and link elements (#42096)
Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2026-01-26 09:12:38 +00:00
Shubham Gupta
5504a05158 script: Expose toJSON on LargestContentfulPaint (#42004)
This PR targets on adding JSON to `IDL` to show all supported values in
JS API.

This was missed during implementation. Screenshot Attached for JS API 

Testing: `components/servo/tests/largest_contentful_paint.rs` 
Fixes: None, this is just an refinement.

<img width="772" height="360" alt="Screenshot from 2026-01-19 17-13-20"
src="https://github.com/user-attachments/assets/1730f3f6-423c-466c-b0d4-976d35d82827"
/>

---------

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
2026-01-24 10:40:22 +00:00
Gae24
b7ccf86cb8 script: remove more unused code (#42081)
This commit remove more unused code from `script_module`,
`inline_module_map` and `dynamic_modules` fields from `GlobalScope` and
the now unused custom interface `DynamicModuleOwner`.

Testing: No functional change, a successful build is enough.

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-01-22 15:12:09 +00:00
Simon Wülker
c1830173e9 script: Move RGBA8 constant from WebGL2RenderingContext to WebGLRenderingContext (#42048)
Testing: New tests start to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-01-21 14:08:47 +00:00
eri
151074e9a1 devtools: Handle pause in the debugger (#42007)
Add an event listener for `pause` to `debugger.js` and the necessary
glue to access it from the `devtools` crate. This returns important
information to know where we are paused, such as the source location and
frame state.

Fix frame and object actor encoding into messages. Use information from
`debugger.js` to correctly fill the fields.

Add a new `frames` list to the thread actor and handle the `frames`
message.

Fix `getEnvironment` reply in the frame actor. It is out of form (has a
`type` field but it doesn't require a followup empty message, it already
counts as a reply), so we need to handle it specially.

Note: For now we are focusing on the protocol side of the debugger, and
this patch only shows where the pause would happen. Pausing Servo itself
will happen in a followup.

![Debugger showing the line where execution would be
paused](https://github.com/user-attachments/assets/c007f205-0ccd-47f1-ad0b-81b7415e8211)

Testing: `mach test-devtools` and manual testing. No errors (apart from
#42006).
Part of: #36027

---------

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2026-01-19 19:27:52 +00:00
eri
9d35414386 devtools: Handle the setBreakpoint message. (#41925)
Listen for `setBreakpoint` on `debugger.js` and add the relevant WebIDLs
and Servo counterparts to trigger this event and notify SpiderMonkey.

Implement `find_source` for `SourceManager` and `find_offset` for
`SourceActor`.

Testing: Manual testing and `./mach test-devtools` (note, the latter
seems to have some failing tests, we are investigating this, but this
patch doesn't add any new failure).
Fixes: Part of #36027

---------

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-01-16 10:17:55 +00:00
WaterWhisperer
705e76d379 script: Set keepalive flag in Request's constructor (#41811)
Testing: 
- `./mach test-wpt
tests/wpt/tests/fetch/api/request/request-keepalive.any.js`
- `./mach test-wpt
tests/wpt/tests/fetch/api/request/request-keepalive-quota.html`

Fixes: #41724

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-01-09 17:28:55 +00:00
WaterWhisperer
56bc26a7cc script: Implement Origin API (#41712)
Testing: `./mach test-wpt /html/browsers/origin/api/`
Fixes: #41106

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-01-08 15:35:39 +00:00
Tim van der Lippe
2988ba5a08 script: Ship navigator.sendBeacon (#41694)
With keep-alive requests implemented, this feature is now fully working.
Some tests still fail on
header parsing, which is #36801

Fixes #38302

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-05 20:17:50 +00:00
Kingsley Yung
259b3985ee script: Implement sign and verify operations of ML-DSA (#41676)
Finish adding ML-DSA support to WebCrypto API.

This patch implements the sign and verify operations of ML-DSA, with
`ml-dsa` crate.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#ml-dsa-operations-sign
https://wicg.github.io/webcrypto-modern-algos/#ml-dsa-operations-verify

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-05 06:12:58 +00:00
Kingsley Yung
96ddb0bbf0 script: Implement WebCrypto encapsulation and decapsulation with ML-KEM (#41617)
Complete the ML-KEM support in WebCrypto API, with the implementation of
the "encapsulate" and "decapsulate" operations of ML-KEM, as well as
four new methods `encapsulateKey`, `encapsulateBits`, `decapsulateKey`
and `decapsulateBits` of `SubtleCrypto`.

Specification:

https://wicg.github.io/webcrypto-modern-algos/#ml-kem-operations-encapsulate

https://wicg.github.io/webcrypto-modern-algos/#ml-kem-operations-decapsulate

https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-encapsulateKey

https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-encapsulateBits

https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-decapsulateKey

https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-decapsulateBits

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

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-01 13:30:04 +00:00
Kingsley Yung
5d6d2c67bb script: Implement import key operation of ML-KEM (#41585)
Start adding ML-KEM support to WebCrypto API.
Specification: https://wicg.github.io/webcrypto-modern-algos/#ml-kem

This patch implements import key operation of ML-KEM, with `ml-kem`
crate.

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-30 11:46:10 +00:00
Gregory Terzian
9cd480f7ee indexeddb: implement databases concept(detete and databases method) (#41322)
Moves the concept of databases closer to the 3.0 spec, by implementing
the delete functionality, and the method returning current databases to
script.

Testing: WPT tests with new passes
Fixes: The "Implement databases deletion and `databases`" item of
https://github.com/servo/servo/issues/40983

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-12-23 14:09:48 +00:00
Steven Novaryo
b68d277c55 script: Add stub VisualViewport Interface (#41372)
Add placeholder implementation of DOM `VisualViewport` according to the
spec https://drafts.csswg.org/cssom-view/#visualviewport. This is the
first step of implementing the interface and syncing it with the
`PinchZoom` struct that we had in the `Embedder`.

Since this interface's is not accurate and couldn't fulfill it's
purpose, it would be gated behind a preference
`dom_visual_viewport_enabled` and would be open after the interface had
been integrated with `PinchZoom`, viewport resizing, and viewport
scroll.

Testing: Existing WPT Test.
Part of: #41341

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2025-12-23 09:56:13 +00:00
WaterWhisperer
6623cc1dbb feat: gamepad feature flag (#41451)
Put the Gamepad API and its supporting infrastructure behind a `gamepad`
feature flag. This allows embedders to opt-out of gamepad support at
compile time to save on binary size and reduce dependencies.

Testing:
1. `./mach build -d` (Gamepad enabled by default)
2. `cargo build -p servoshell --no-default-features --features
"libservo/clipboard,js_jit,max_log_level,webgpu"` (Gamepad Disabled)
3. `cargo build -p servoshell --features "gamepad,webxr,..."` (Gamepad &
WebXR Enabled)

Fixes: #40897

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2025-12-21 13:18:06 +00:00
Tim van der Lippe
5b6509f279 script: Implement customElementRegistry support for document.importNode (#41385)
This method now allows you to pass in a custom registry. The registry
isn't used yet for callers, since we don't support scoped registries.
However, as we now pass in the registry to `Node::clone`, we set the
registry when creating elements and cloning them.

As such, various tests start passing where we set the registry. Some
tests started failing, but they rely on scoped registries which we don't
support yet. These tests thus flipped: those that were erroneously
failing are now passing and vice versa.

Part of #34319

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-12-19 09:01:08 +00:00
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
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
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
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
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
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
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
ff8211275d script: Implement encrypt/decrypt operation of ChaCha20-Poly1305 (#41003)
Finish adding ChaCha20-Poly1305 support to WebCrypto API.

This patch implements encrypt operation and decrypt operation of
ChaCha20-Poly1305, using the crate `chacha20poly1305` to support the
cryptographic calculation. The get key length operation of
ChaCha20-Poly1305 is also included in this patch.

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-12-02 07:42:51 +00:00
Kingsley Yung
a15861cb41 script: Finishing implementation of Argon2 in WebCrypto (#40936)
Finish adding Argon2 support to WebCrypto API, using the crate `argon2`
to support the cryptographic calculation.

This patch implements "derive bits" operation and the "get key length"
operation of Argon2. Actual error messages are also provided for the
existing "import key" operation of Argon2.

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-11-28 10:18:25 +00:00
Kingsley Yung
2982929210 script: Add new KeyFormat and KeyUsage for modern algorithms (#40857)
The specification of Modern Algorithms in the Web Cryptography API
(https://wicg.github.io/webcrypto-modern-algos/) adds new key formats
and key usages to support modern cryptographic algorithms.

This patch adds those new key formats and key usages, preparing for the
implementation of the new algorithms.

Testing: No behavioral changes in existing cryptographic algorithms.
Existing tests suffice.
Fixes: Part of #40687

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-11-28 03:55:10 +00:00