Commit Graph

12534 Commits

Author SHA1 Message Date
Euclid Ye
014fb968a8 webdriver: Consolidates synchronous and asynchrounous script execution (#41830)
Follow-up to #41823.
Now that we always execute JS with callback, we can safely remove the
obsolete sync script handler.

- Rename `ExecuteAsyncScript` to `ExecuteScriptWithCallback`
- Remove `ExecuteScript` related logic.
- Rewrite async callback wrapper to simplify things.

Testing: I expect no change in behaviour. See if WPT tests agree with
it.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-01-11 09:19:09 +00:00
Kingsley Yung
889749643f script: Implement encrypt and decrypt operations of AES-OCB (#41829)
Finish on adding AES-OCB support to WebCrypto API.

This patch implements the encrypt and decrypt operations of AES-OCB,
with the `ocb3` crate. The "get key length" operation of AES-OCB is also
implemented for internal use.

Specification:
-
<https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-encrypt>
-
<https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-decrypt>
-
<https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-get-key-length>

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-11 05:06:10 +00:00
Kingsley Yung
68688ac362 script: Implement generate key operation of AES-OCB (#41822)
Start adding AES-OCB support to WebCrypto API.

This patch implements the generate key operation of AES-OCB, with the
`aes` crate.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-generate-key

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-10 10:09:49 +00:00
WaterWhisperer
2a759ed6de Replace allow(crown::unrooted_must_root) with expect(crown::unrooted_must_root) (#41815)
Testing: `./mach build -d --use-crown` with no warnings
Fixes: #41761

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-01-10 08:05:49 +00:00
Kingsley Yung
2f640994d3 script: Implement export key operation of AES-OCB (#41813)
Start adding AES-OCB support to WebCrypto API.

This patch implements the export key operations of AES-OCB, with the
`aes` crate.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-export-key

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-10 07:17:04 +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
Narfinger
4089ece1fe constellation: Change most of the channels to be GenericChannels (#41806)
Changed most of the channels to be GenericChannels in constellation.

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

Testing: As usual this should be tested via the type system.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-09 15:19:05 +00:00
eri
310d49f462 devtools: Fix panic when getting AutoMargins of node without style (#41800)
Fix a panic when calling `determine_auto_margins` for nodes without
`.style()`. Now it returns an empty `AutoMargins` (all options set to
`None`), which matches the behaviour in Firefox:

```json
"autoMargins": {}
"autoMargins": {"top": "auto", "bottom": "auto", "left": "auto", "right": "auto"}
```

Refactor `GetLayoutReply` and `ComputedNodeLayout` to take advantage of
serde's flatten feature, making the serialization much cleaner.

Testing: Manual testing with the example provided in the issue.
Fixes: #41743

---------

Signed-off-by: eri <eri@igalia.com>
2026-01-09 15:16:34 +00:00
Sam
5173ea12cd script: More &mut JSContext in codegen (#41808)
Reviewable per commit. First commit adds `&mut JSContext` to
`call_default_constructor`. Second commit adds `&mut JSContext` to
Interface, which in unfortunately required many changes (a lot of
passing `&mut JSContext` down).

Testing: Just a refactor, but should be covered by WPT
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-09 14:50:54 +00:00
Narfinger
46011ff50c Script: Convert routed_promise to GenericCallback (#41380)
This changes routed_promise to use the GenericCallback functionality.
This mostly effected WebGPU but also Clipboard and Memory Reporting.

We also added a GenericCallback::new_blocking() functionality which
produces a callback and a channel
which then can be blocked on. This was used a couple of times in the
code.

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

Testing: This should not change functionality.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-09 10:09:45 +00:00
Kingsley Yung
b5aa03e97a script: Implement import key operation of AES-OCB (#41791)
Start adding AES-OCB support to WebCrypto API.

This patch implements the import key operations of AES-OCB, with the
`aes` crate.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-import-key

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 AES-OCB had not been implemented, and
requires other not-yet-implemented operations to pass.

Fixes: Part of #41762

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-09 08:06:38 +00:00
lumi
76b2b5aa3b fonts: Create resource timing entries when loading web fonts (#41660) (#41784)
Add a callback on `WebFontDocumentContext` to create resource timing
entries, this callback is then used to call `submit_timing`, using a
shim listener, as this function requires a listener.

Testing: Using `./mach test-wpt
tests/wpt/tests/preload/preload-resource-match.https.html`
Fixes: #41660

---------

Signed-off-by: lumi <lumi@suwi.moe>
2026-01-09 02:19:07 +00:00
Martin Robinson
cbb23c72af script: Implement all user agent widgets for form controls with shadow DOM (#41760)
This change makes it so that all form controls are implemented with
shadow DOM, completely removing the legacy text content and selection
code paths for form controls. The motivation for this change is:

- to allow properly hit testing against the text nodes of `<textarea>`
  and other widgets. This is important for implementing mouse-based
  selection on the page.
- to simplify the way that form controls are implemented in general and
  to prepare the way for proper implementations of the user interface of
  other controls.

Testing: This should not change observable behavior at the moment,so
should be covered by existing WPT tests.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-01-09 01:11:20 +00:00
Sam
b1245dce4c script: Use &mut JSContext in html_constructor (#41782)
Testing: Just refactor, but should be covered by WPT.
Part of #40600

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-08 21:09:48 +00:00
Domenico Rizzo
4d7e4a3b86 26488 - Moves CookieStore drop logic to a separate struct (#41783)
Refactors the `CookieStore` to use a separate `DroppableCookieStore`
struct for handling the drop logic.

Testing: No tests added
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-01-08 21:06:17 +00:00
Tim van der Lippe
020f339a3c script: Fix same origin restriction for document.domain (#41780)
Fixes a small WPT test and adds spec comments.

Testing: This change causes
`/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html`
to start passing.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-08 21:03:12 +00:00
Narfinger
13c875eeea Base: Dependency cleanup (#41777)
Removing some unused dependencies in components.

Like a rainforest
the dependencies are growing,
we need a machete.

Testing: Full mach try run here:
https://github.com/Narfinger/servo/actions/runs/20823235587

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-08 17:32:35 +00:00
Gregory Terzian
5c68a717ab indexeddb: implement connection queue (#41500)
Implement the connection queue concept from
https://w3c.github.io/IndexedDB/#connection-queue, as well as the
related logic to abort open requests.

Testing: WPT tests.
Fixes: Part of https://github.com/servo/servo/issues/40983

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2026-01-08 15:40:23 +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
Sam
89067e5450 script: Pass &mut JSContext to tasks (#41756)
This change is reviewable per commits:
In first commit we added `&mut JSContext` to `run_box` (it is very hard
to bring `&mut JSContext` to `remove_script_and_layout_blocker`).
In second commit we pass `&mut JSContext` to `run_once`.
In third commit we added support for accepting `&mut JSContext` in
closures of `task!` macro and lastly we demo new macro invocations (to
ensure they actually compile)

Testing: Just refactor, but should be covered by WPT
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-08 07:49:27 +00:00
Narfinger
8ec23eda46 webxr: Remove the ipc feature (#41736)
webxr/webxr-api have the feature flag "ipc". This is required by
important crates such as script and canvas. The only distinction was
made in servo which does not use the IPC for android/ohos but because
servo depends on script, this was essentially useless.

This PR removes the feature flag and cleans up the code related to it.

Testing: Compilation is the test.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-07 14:49:11 +00:00
Tim van der Lippe
e2d62531f5 script: Consolidate global initialization for fetch requests (#41663)
Rather than having each callside specifying the relevant
information from the GlobalScope, do this via a trait instead.
This would have saved us quite a bit of test debugging
since we would often forget to set relevant information
from the global context for a request.

Now, in the future when we need additional information from
the globalscope for a request, we only need to update this
method to make that happen.

Previously it would also sometimes use `document`, but
calling the relevant information on either `document` or
`globalscope` doesn't matter, since the `globalscope`
defers to the value from the `document` anyways.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-07 13:22:03 +00:00
Josh Matthews
c6f2fc2eb5 script: Capitalize Content-Type key in formdata. (#41722)
The tests were performing exact string matching on the contents of the
request body, so this change allows them to match.

Testing: Newly passing tests.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-01-07 06:05:41 +00:00
Domenico Rizzo
2bcad737fa 26488 - Moves WebGLRenderingContext cleanup to a dedicated struct (#41717)
Refactors the WebGLRenderingContext to manage resource cleanup via a
dedicated `DroppableWebGLRenderingContext` struct.

Testing: This task is only a refactor, no tests added
Fixes: partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-01-07 04:24:17 +00:00
Narfinger
384db99444 Base: Implement GenericReceiverSet (#41071)
This implements GenericReceiverSet similar to IpcReceiverSet. This
allows us to wait on a group of channels.

IpcReceiverSet was allowed to use IpcReceivers of different type, i.e.,
`IpcReceiver<Foo>` and `IpcReceiver<Bar>` in the same select query. This
changes with GenericReceiverSet to only allow one type, i.e.,
`GenericReceiver<Foo>`. As this functionality was only used in the
CoreResourceThread, we changed the setup slightly for the memory
reporter.

With this we also change the implementation of CoreResourceThread to now
use the GenericReceiverSet.

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

Testing: New testcases were added to GenericReceiverSet and browsing
works normally.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2026-01-07 01:27:42 +00:00
Sam
38306eaf7b script: Init and pass down &mut JSContext in script-related threads (#41692)
1. removed `ScriptThread::get_safe_cx` in favor of `Runtime::cx` (this
intentionally shadows
[RustRuntime::cx](https://doc.servo.org/mozjs/rust/struct.Runtime.html#method.cx),
which is not really safe with all other stuff that happen in servo).
2. passed down cx from `ScriptThread::new` to accommodate those changes
(we also need to pass cx for some other stuff).
3. we create JSContext in workers/worklets, so we can pass all the way
down to
6ccc47f4c9/components/script/dom/workers/workerglobalscope.rs (L1013)
(so we can get &mut JSContext in tasks).

So with this PR, we prepared all entry points of JSContext (or other
should actually be reentering via SM callback or passed down from the
root one in the thread).

Testing: No changes just safety, but it should be covered by WPT
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-06 18:27:10 +00:00
Narfinger
1b8d1bf63c libservo: Stop exporting ipc-channel for gamepad responders and use callbacks (#41412)
With this we stop exporting ipc-channel in libservo and switch to
GenericChannel/GenericCallback.

Testing: Generic Channels are tested all over the place.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-01-06 16:57:02 +00:00
Tim van der Lippe
3f37174b6d net: Remove NetworkError::Internal (#41693)
Rather than this catch-all (which I copy-pasted from a usage where I
should have introduced a specific enum value), we now should always use
one of the enum values. If one does not exist, then it should be added
as such.

Follow-up for #36434

Testing: it builds

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-06 16:07:19 +00:00
Martin Robinson
2efa7d5d96 script: Add a Rope type and use it for TextInput (#41650)
`TextInput` internally stores a rope of text content, one segment for
each line. This change separates out the rope into a separate `Rope`
data structure that can be shared with other parts of Servo.

`TextInput` needs to move through text content in a variety of ways,
depending on the keys pressed when interacting with a text area. This
change provides a unified movement API in both `Rope` and in
`TextInput` ensuring that selection is handled consistently (apart from
a few minor quirks [^1]). This simplifies the code an improves
interactive behavior.

[^1]: One of these quirks is that the edit point will move to
directional end of the motion when collapsing a selection, but only when
moving by grapheme or word (and not by line). These quirks existed in an
undocumented way previously and they are preserved with code comments.

Testing: This is covered by existing unit tests (updated for the new
API) and
the WPT suite.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-06 14:52:08 +00:00
Tim van der Lippe
2480eaac83 script: Fix fetch-later length and quota computation (#41665)
The specification isn't complete here and thus we
were missing WPT coverage. Spec will be updated.

Also, we are correctly throwing the QuotaExceededError with relevant
information, while Chrome sets both
fields to `null`. Therefore, the test now allows for both (since
providing relevant information is good for the developer and recommended
in the spec [1]).

[1]: https://webidl.spec.whatwg.org/#ref-for-quotaexceedederror%E2%91%A2

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-05 19:00:32 +00:00
Tim van der Lippe
d44c38998c net: Keep track of size of keep-alive records (#41457)
These keep-alive records live on the `CoreResourceManager` since the vec
of records must be modified by the fetch thread. The script thread
sometimes
requires this information as well, which is why it can send a message to
obtain the total size.

The keep-alive records must be tracked per global. That's why all code
needs
to specify the `pipeline_id`. Requests optionally have this field, which
is why
the code expects it to be present. The relevant information is added to
the
navigator request to ensure it can compute it.

Fixes #41230

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-05 18:22:58 +00:00
WaterWhisperer
6ccc47f4c9 Expose nested browsing context status in RequestClient (#41661)
implement step 2.2 of
<https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request>
by adding an is_nested_browsing_context field to RequestClient

Testing: `./mach test-wpt tests/wpt/tests/upgrade-insecure-requests` and
`./mach test-wpt tests/wpt/tests/mixed-content`
Fixes: #41639

---------

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-01-05 16:28:45 +00:00
Jeff Mendez
ad6c17dc22 script: Properly handle messaging errors in components/constellation/constellation.rs (#41419)
Fix panic on background_monitor_hang send, allowing graceful cleanups.

Url example
`https://cosihome.com/products/cooling-blanket/luxury-cooling-blanket-multi-season-lightweight-soft/`
- causes many redirects.

```
thread 'Script#4' panicked at /app/third_party/servo/components/script/dom/history.rs:357:24:
Unknown top-level browsing context`
thread 'Script#5' panicked at /app/third_party/servo/components/background_hang_monitor/background_hang_monitor.rs:138:14
```

---------

Signed-off-by: j-mendez <jeff@spider.cloud>
2026-01-05 15:22:12 +00:00
Narfinger
94eafd4ef9 script: Store a Weak handle to ScriptThread in both ScriptThread and Window (#40645)
We construct `ScriptThread` in an `Rc` which itself has the given `Weak`
for it. It then can give it to `Window` and other elements in the
future. We currently only use this for the microtask checkpoint function
in `Window`. This is the first step toward eliminating the usage of
thread local storage to access the `ScriptThread`.

Testing: This should not change behavior so is covered by existing
tests.
Fixes: Part of addressing:
https://github.com/servo/servo/issues/37969#issuecomment-3520463442

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-01-05 13:20:19 +00:00
Josh Matthews
07714b683a script: Remove pointless rename. (#41680)
There's no naming conflict, and nowhere else the name NetRequestInit.
All it does is increase confusion.

Testing: No runtime changes.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-01-05 06:55:36 +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
Tim van der Lippe
de27dc69e5 Implement pending preload responses with futures (#40059)
This implements waiting for pending preloads, where the preload request
is still fetching the result when the second "real" request is started.
It is
implemented by storing responses in the `SharedPreloadedResources`
which is communicated via `PreloadId` send to the `CoreResourceManager`.

Part of #35035

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2026-01-04 12:22:54 +00:00
Kingsley Yung
58070dd692 script: Implement generate key operation of ML-DSA (#41659)
Continue on adding ML-DSA support to WebCrypto API.

This patch implements the generate key operation of ML-DSA, with
`ml-dsa` crate.

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

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-04 08:52:23 +00:00
WaterWhisperer
af2370ec5c Retry EventSource after temporary failures using is_permanent_failure (#41651)
add `is_permanent_failure` method in `NetworkError` and call it from the
`EventSource` instead of the current match against the url's scheme

Testing: `./mach test-wpt tests/wpt/tests/eventsource`
Fixes: #41634

---------

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-01-04 04:00:33 +00:00
aquaThirsty
d808cc15d0 change #[allow]s to #[expect]s (#41635)
Changed most #[allow]s to #[expect]s, mainly for
clippy::too_many_arguments

Removed unfulfilled expectations

This is my first opensource contribution, so please let me know if
anything should
be done differently.

Testing: Refactor
Part of: #40838

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: TimurBora <timurborisov5561@gmail.com>
Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2026-01-03 10:54:27 +00:00
Kingsley Yung
0c91c3bc81 script: Implement export key operation of ML-DSA (#41647)
Continue on adding ML-DSA support to WebCrypto API.

This patch implements the export key operation of ML-DSA, with `ml-dsa`
crate.

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

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

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-03 07:42:55 +00:00
Simon Wülker
9ca7628dbd script: Skip some steps when determining encoding for XML document (#41637)
XML documents do not use the "determine the encoding" algorithm. As far
as I can tell, it is unspecified how they should determine the encoding
instead. We now check the BOM, `Content-Type` header and prescan for an
xml encoding declaration (but don't inherit encodings from iframes or
attempt to determine the encoding from heuristics).

Testing: New tests start to pass
Part of https://github.com/servo/servo/issues/6414

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-01-02 17:53:11 +00:00
Usman Yahaya Baba
6decaaefa9 Replace NetworkError::Internal with structured enum variants for calls with literal strings (#36599)
Replace NetworkError::Internal with structured enum variants
- Adds
UnsupportedScheme,CorsViolation,ConnectionFailure,Timeout,RedirectError,InvalidMethod,ResourceError,SecurityBlock,MixedContent,CacheError,InvalidPort,
LocalDirectoryError, variants in NetworkError enum.
- Refactored the usage of NetworkError::Internal(String) to use the
appropriate new variant

Testing: Changes does not require test.
Fixes: https://github.com/servo/servo/issues/36434

---------

Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
Signed-off-by: Usman Yahaya Baba <91813795+uthmaniv@users.noreply.github.com>
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Co-authored-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-02 10:28:17 +00:00
Kingsley Yung
df9877a94c script: Implement import key operations of ML-DSA (#41628)
Start adding ML-DSA support to WebCrypto API.

This patch implements the import key operations of ML-DSA, with `ml-dsa`
crate.

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

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 operations of ML-DSA had not been implemented, and
requires other not-yet-implemented operations to pass.

Fixes: Part of #41626

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-02 09:59:00 +00:00
Kingsley Yung
00792e098e script: Fix alg field of exported ML-KEM key in JWK format (#41627)
We wrongly use the object identifier of ML-KEM for the `alg` field of
exported ML-KEM key in JWK format. We should use the values specified in
Section 8 of [draft-ietf-jose-pqc-kem-01] (Figure 1) instead.

[draft-ietf-jose-pqc-kem-01] (Figure 1):

https://www.ietf.org/archive/id/draft-ietf-jose-pqc-kem-01.html#direct-table

Testing: WPT currently does not have relevant tests for ML-KEM keys in
JWK format since The JWK format for ML-KEM is not standardized yet. We
strive to remain compliant with the current specification.

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-02 09:33:35 +00:00
Wayne Van Son
5b9263690d Refactor allow to expect (#41586)
Replace `allow` with `expect` lints for `unused`, `unsafe_code`,
`dead_code`, and `non_upper_case_globals`.

Testing: So far just check it compiled on `x86_64-linux` on NixOS. Need
to use the module `system.fontconfig.enable = true;` I think in my NixOS
config.
Part of: #40383 

Searching `allow\(.*\)` for `.rs` files shows the following. for
(total_results:total_files) went from `707:386` to `675:368`, a
reduction of `32:18`.

How many files is too many files per PR? I feel like the 20-30 I have is
too big.

---------

Signed-off-by: Wayne Van Son <waynevanson@gmail.com>
2026-01-01 13:40:20 +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
883f8b4a6c script: Implement generate key operation of ML-KEM (#41615)
Continue on adding ML-KEM support to WebCrypto API.
Specification: https://wicg.github.io/webcrypto-modern-algos/#ml-kem

This patch implements generate 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>
2026-01-01 08:46:15 +00:00
Kingsley Yung
c7cd8fcef8 script: Implement export key operation of ML-KEM (#41604)
Continue on adding ML-KEM support to WebCrypto API.
Specification: https://wicg.github.io/webcrypto-modern-algos/#ml-kem

This patch implements export 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-31 14:27:47 +00:00
Narfinger
15aa6ee8c0 Base: Rename IpcSharedMemory to GenericSharedMemory (#41198)
In the future, servo components should depend on the generic channels in
base instead of IpcChannels to correctly optimize for multiprocess vs
non-multiprocess mode.
This reexports IpcSharedMemory as GenericSharedMemory in GenericChannel
and changes all dependencies on it.

Currently this is only a type/name change and does not change
functionality. But in the future we would want want to use non-ipc
things for the data.

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

Testing: This changes types and does not need testing.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-12-31 13:07:59 +00:00