Commit Graph

234 Commits

Author SHA1 Message Date
Sam
3cde83447e script: always let cx = &mut cx in codegen and support cx in Constructor (#42712)
#42681 did not actually allowed using cx in Constructor, but it did most
heavy lifting. Now we need to pass cx to Constructor call (and skip
CanGc) if cx is requested in Bindings.conf. This PR also test this on
testbindings.

Also we now always use `let cx = &mut cx`, so we can always use just cx
(compiler will automatically deref it into &cx if needed). This is
important because codegen stuff is called from many places to it make
sense/easier to just unify this.

Testing: It compiles

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-19 08:57:40 +00:00
Domenico Rizzo
24f2303811 script: Defers GPUComputePipeline drop to a helper struct (#42690)
Moves the drop implementation for `GPUComputePipeline` to a separate
`DroppableGPUComputePipeline` struct.

Removes `allowDropImpl` from the bindings configuration.

Testing: No tests added because of webgpu tests existent coverage
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-02-18 04:22:50 +00:00
Narfinger
45eb43c1a7 canvas: Change canvas to use JSContext instead of CanGc (#42662)
This changes the methods in dom/canvas to use the new JSContext/&mut
JSContext instead of CanGc.

Part of https://github.com/servo/servo/issues/40600

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

Testing: This is a refactor, hence, compilation is the test.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-02-17 16:12:01 +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
Sam
f623081537 script: Pass &mut JSContext to Constructor and Wrap (#42681)
Testing: Just refactor, but should be covered by WPT
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-17 13:15:24 +00:00
Tim van der Lippe
e413d45982 script: Move ImportScripts to &mut JSContext (#42665)
Part of #42638

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-17 05:37:59 +00:00
Tim van der Lippe
3665659dbe script: Move attribute-related methods to &mut JSContext (#42667)
Part of #42638

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-17 05:36:38 +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
Domenico Rizzo
8a16d8ca7d script: Refactors GPUComputePassEncoder to manage drop logic (#42656)
Moves the drop logic for `GPUComputePassEncoder` to a separate
`DroppableGPUComputePassEncoder` struct.

Testing: Tests that coverages webgpu just exist
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-02-16 11:10:27 +00:00
Gae24
c13d8a2eff script: Start using &mut JSContext in devtools and webdriver code (#42640)
This is a first step to compile scripts using `&mut JSContext`.

Testing: Refactor, covered by existing WPT tests.
Part of #40600

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-16 08:32:08 +00:00
Sam
3283fcfb3d script: Move CSSStyleSheetMethods to &mut JSContext (#42637)
Demonstrate how to change some methods:
- [from `InRealm` to `&mut
CurrentRealm`](0132fc0fbe)
- [from `CanGc` to `&mut
JSContext`](36e5b32ee1)

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

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-15 15:30:27 +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
Sam
e7c35d5445 script: &mut JSContext in native functions and make them safer (#42619)
Testing: Just refactor, should be covered by WPT
Part of #40600

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-14 12:11:14 +00:00
Sam
62ae12b6a5 script: Pass &mut JSContext to timers, abort controller, some transfers and some streams (#42616)
I just wanted to do abort signal, but then this happend.

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

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-14 10:03:25 +00:00
Sam
3f3c6a5d90 script: Pass more CStr(ing) instead of rust strings (#42135)
This is companion to https://github.com/servo/mozjs/pull/703 which makes
mozjs to use CStr(ing) in the API (where we would silently do conversion
in mozjs). This way we can avoid rust string -> c string allocations.

In the followup PR we should switch Error::Type and Error::Range to also
use CStrings internally, as they are converted to CString for throwing
JS exceptions (other get thrown as DomException object, which uses rust
string internally - although this gets converted to JSString somewhere).

Testing: It should be just refactor without any side effects so there
should be no changes to WPT results.
Try run: https://github.com/sagudev/servo/actions/runs/21328878448
Part of #42126

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-12 08:46:14 +00:00
Domenico Rizzo
ddb31c180f script: Move GPUCommandBuffer drop logic to separate struct (#42511)
Moves the `Drop` implementation for `GPUCommandBuffer` to a separate
struct, `DroppableGPUCommandBuffer`. Updates bindings config to remove
`allowDropImpl` which is no longer needed.

Testing: No tests added
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-02-10 17:29:36 +00:00
Oriol Brufau
e0212b38e8 Enable layout.css.attr.enabled pref for css-values tests (#42410)
The implementation of `attr()` in Stylo is not complete, but this way we
can start testing for it.

Bumps Stylo to https://github.com/servo/stylo/pull/306

Testing: Various tests pass, also a few failures. No impact on users,
even with experimental features enabled.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-02-08 13:51:07 +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
Bryan Smith
a6a3b1a0e5 Script: Use &mut JSContext in BroadcastChannel::PostMessage (#42417)
Replace `crate::script_runtime::JSContext` with `js::context::JSContext`
in `BroadcastChannel::PostMessage` and update interface binding.

Testing: Builds and runs locally.
Part of: https://github.com/servo/servo/issues/42347

---------

Signed-off-by: BryanSmith00 <bryansmith8023@tuta.com>
2026-02-07 19:53:00 +00:00
TIN TUN AUNG
0fa52e7791 script_bindings: add generic type to webidl record typedefs containing dom interfaces (#42388)
when generating rust bindings for webidl typedef, the `<D>` generic Type
would not be added for record<Key, DomInterface> because
`containsDomInterface` does not take record into account. This change
add the is_Record check in `containsDomInterface`, so `typedef
record<Key, DomInterface>` can be successfully build.

Testing: Manually tested with
https://github.com/servo/servo/issues/42362, and building from scratch
with `./mach build` is successful.
Fixes: https://github.com/servo/servo/issues/42362

---------

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2026-02-06 16:41:50 +00:00
pralkarz
9e02b0ce65 script: use &mut JSContext in Window::PostMessage (#42370)
Replace `crate::script_runtime::JSContext` with `js::context::JSContext`
in `Window::PostMessage`'s API.

Testing: Builds and runs locally.
Part of: https://github.com/servo/servo/issues/42347

Signed-off-by: pralkarz <pralkarz@tuta.com>
2026-02-05 20:13:11 +00:00
Gae24
97aac6e70a script: use &mut JSContext inside workers PostMessage api (#42342)
Switch `PostMessage` of `Worker`, `DedicatedWorkerGlobalScope` and
`ServiceWoker` to use `&mut JSContext`, propagating it to
`post_message_impl`.

Testing: A successful build is enough

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-04 18:40:32 +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
Sam
0f9f601eb9 script: Correctly handle Reflector with AssociatedMemory and remove associated memory in finalize instead of drop (#42271)
Reviewable per commits:

As noted in
https://github.com/servo/servo/pull/42180#discussion_r2749861902
transmuting `&Reflector<AssociatedMemory>` to `&Reflector<()>` will
ignore AssociatedMemory information and thus it will not remove extra
associated memory. By returning `&Reflector<Self::ReflectorType>` from
`DomObject::reflector()` we will preserve this information and thus
correctly handle cases with associated memory. We also do not need
`overrideMemoryUsage` in bindings.conf anymore. 🎉

Instead of removing associated memory in drop code we should do it as
part of finalizers, otherwise we have problems in nested (inherited)
structs, where drop is run for both parent and child, but we only added
associated memory for child (on init_reflector) which already included
size of parent. The only exception here is promise, because it is RCed
and not finalized.

Testing: Tested locally that it fixes speedometer.
Fixes #42269

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-01 10:57:08 +00:00
Sam
8ed35f1ce9 script: Add basic memory pressure reporting to SpiderMonkey (#42180)
By reporting memory usage of rust objects back to SM it can trigger GC
sooner and release more memory (I hope that we could use this to avoid
OOB in webgpu in the future).

Currently we use simple `size_of::<DomStruct>() +
size_of::<Box<DomStruct>>()` but it's possible to override reported
memory with `update_memory_size(self, nbytes);` on reflector. This is
mostly useful for canvases and buffers which usually have large
associated data.

Testing: None, but I am wondering if we can connect this to
`about:memory`.
Fixes: #42168

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-30 18:11:06 +00:00
Domenico Rizzo
2c770c162c [26488] Refactors GPUCanvasContext to manage context dropping. (#42243)
Moves the `Drop` implementation for `GPUCanvasContext` to a new
`DroppableGPUCanvasContext` struct.

This ensures the context destruction logic is correctly handled, as the
`GPUCanvasContext` struct itself is a DOM struct and should not have a
drop implementation. This change aligns with the requirement that DOM
types should not implement Drop.

Testing: No tests added
Fixes: #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-01-29 18:02:31 +00:00
Steven Novaryo
45c39d7496 script: Notify PinchZoom resizes to ScriptThread's VisualViewport (#41754)
Continuing the implementation of `VisualViewport`, the resizing of
`PinchZoom` should be notified to `ScriptThread` to update the
`VisualViewport` interface and to fire the appropriate JS event. Top
level `Window`/`Pipeline` would have a `VisualViewport` interface that
mirrors the `PinchZoom` viewport, while nested `Window` would have a
default value that represent layout viewport of the relevant iframe. The
`VisualViewport` of an iframe is updated after each reflow that
calculate the rectangle of the iframe.

The updates of DOM's `VisualViewport` occurs immediately (instead of
waiting for the event loop like the viewport) but integrates with the
event loop for the JS events. This behavior would helps with the fact
that `VisualViewport` needs to be updated both when it is scrolled or
resized.

Testing: Existing WPTs and new unit test.
Part of: https://github.com/servo/servo/issues/41341

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2026-01-28 09:33:55 +00:00
Sam
3047b9946f script: Remove AsVoidPtr and AsCCharPtrPtr traits (#42153)
We migrated most uses some years ago, so let's finally remove them. It's
more clear what we are doing if we inline stuff then hiding dangerous
cast behind trait.

Testing: Covered by WPT, try run:
https://github.com/sagudev/servo/actions/runs/21350967668

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-26 10:47:35 +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
Sam
2503cc2ab7 script: Pass &CStr insted of &str in {set,get}_dictionary_property (#42125)
It's stupid to create rust strings in the first place to only convert
them into C-style for SM anyway. Furthermore most of those strings are
const literals (comp time strings), so now we will just store additional
null byte within them and able to avoid any runtime conversions.
We should do this in more places.

Testing: Just refactor.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-24 13:03:41 +00:00
Sam
6525cd99b6 script: Port indexddb to &mut JSContext (#42123)
Welp, this just happened while I tried to so something else. cc
@arihant2math and @janvarga just so you are aware of these changes.

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

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-24 09:36:10 +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
Josh Matthews
cadcc605e0 script: Replace uses of RootedVec<JSVal> with Rooted<Vec<JSVal>>. (#41921)
This replaces uses of our custom RootedVec type that were storing JS GC
values with stack rooting that is better integrated with the engine.
This ensures that storing nursery-allocated objects in these vectors is
handled correctly during GC, unlike our RootedVec implementation which
trips an assertion in debug mozjs builds.

Testing: No observable difference in non-mozjs builds.
Fixes: part of #40141

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-01-22 03:28:19 +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
webbeef
f13b8e6ed5 chore: suppress warnings when building without the testbinding feature (#42003)
When building without the `testbinding` feature of `libservo`, we end up
with these compilation warnings (and one error):

```
warning: unused import: `native_from_handlevalue`
   --> components/script_bindings/import.rs:108:9
    |
108 |         native_from_handlevalue, native_from_object_static,
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused imports: `DomSlice` and `Dom`
   --> components/script_bindings/import.rs:131:34
    |
131 |     pub(crate) use crate::root::{Dom, DomSlice, MaybeUnreflectedDom, Root};
    |                                  ^^^  ^^^^^^^^

warning: unused import: `crate::root::DomRoot`
 --> /home/webbeef/servo/target/debug/build/script_bindings-9c5650a8d750af8f/out/DomTypes.rs:3:5
  |
3 | use crate::root::DomRoot;
  |     ^^^^^^^^^^^^^^^^^^^^

warning: unused import: `Maplike`
   --> components/script_bindings/import.rs:124:34
    |
124 |     pub(crate) use crate::like::{Maplike, Setlike};
    |                                  ^^^^^^^

warning: `script_bindings` (lib) generated 4 warnings (run `cargo fix --lib -p script_bindings` to apply 3 suggestions)
error[E0412]: cannot find type `IdentityHub` in this scope
  --> components/script/dom/debuggerglobalscope.rs:76:63
   |
76 |         #[cfg(feature = "webgpu")] gpu_id_hub: std::sync::Arc<IdentityHub>,
   |                                                               ^^^^^^^^^^^ not found in this scope
   |
help: consider importing this struct
   |
 5 + use crate::dom::identityhub::IdentityHub;
   |

warning: method `worklet_id` is never used
   --> components/script/dom/worklet.rs:121:19
    |
 95 | impl Worklet {
    | ------------ method in this implementation
...
121 |     pub(crate) fn worklet_id(&self) -> WorkletId {
    |                   ^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
```

Testing: No test needed, this won't change the default builds.

Signed-off-by: webbeef <me@webbeef.org>
2026-01-19 07:44:15 +00:00
Domenico Rizzo
162c697248 [26488] - Moves drop logic to inner struct for GPUBindGroupLayout (#41984)
Moves the drop logic for `GPUBindGroupLayout` to an inner struct
`DroppableGPUBindGroupLayout`.

Testing: No tests added
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-01-18 17:20:14 +00:00
Domenico Rizzo
0417968ee9 [26488] - Refactors GPUBindGroup drop implementation (#41977)
Moves the drop implementation for `GPUBindGroup` to a separate
`DroppableGPUBindGroup` struct.

Testing: No tests added
Fixes: partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-01-17 17:53:56 +00:00
Sam
89cfe15b3e script: use &mut CurrentRealm in cross_origin_has_own (#41955)
Testing: Just refactor, but covered by existing WPT tests.
Part of #40600

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-16 11:05:26 +00:00
Domenico Rizzo
380884523a script: Move adapter dropping to a dedicated struct (#41911)
Moves the adapter dropping logic from the `GPUAdapter` struct to a new
`DroppableGPUAdapter` struct.

Testing: No tests added.
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-01-15 07:13:52 +00:00
Sam
2def1fbdce script: &mut JSContext in cross_origin_own_property_keys and append_cross_origin_allowlisted_prop_keys (#41879)
Testing: Just refactor, but should be covered by WPT tests.
Fixes: #40600

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-13 15:49:09 +00:00
Sam
5b11f7619e script: add &mut JSContext to codegened toJSON (#41878)
Testing: Just refactor, but should be covered by WPT tests
Part of #40600

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-13 14:48:57 +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
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
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
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