Commit Graph

463 Commits

Author SHA1 Message Date
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
Tim van der Lippe
cb37480071 script: Fix last remaining base element test (#42339)
This was the last failure in this directory. To fix it, I had to spelunk
into a couple of places:

1. We shouldn't use the `base_element()` of the document, but select the
first base element, regardless if it has an empty href or not
2. We didn't implement target checking for elements. Only some values
are valid and an empty target (which the test also confusingly uses) is
not valid. Hence, it should fallback to the base element
3. We weren't sanitizing the value in case it contains an ASCII tab or
newline + U+003C. This is true for both the form target as well as for
other link elements.

All in all, added a lot more specification text to figure out what was
going on.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-07 03:36:34 +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
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
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
Jonathan Schwender
b5df4bc90a mach: use uv run --frozen (#42169)
This will avoid updating the lockfile during regular operations. Also
ignore the `servo.egg-info` directory, which
the new python requirement installation mechanism via setuptools
creates.
To update the lockfile one can run `uv lock`. This is also done
automatically, when syncing requirements from WPT.

This PR also updates the uv version in CI to a newer one. If you
encounter any issues with the lockfile after this PR, it might be
necessary to update your local instance of uv.

Testing: Build still works. [mach try
full](https://github.com/servo/servo/actions/runs/21624364040)

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-02-03 12:43:04 +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
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
6237aa4677 Merge DomObject proc-macro into #[dom_struct] (#42262)
DomObject derive should not be used standalone so let's just inline it
into dom_struct macro. This will help me with
https://github.com/servo/servo/issues/26488#issuecomment-3824301234

This should (I did not test) also improve compile times, because we do
one macro expansion less on dom_struct.

Testing: It compiles.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-31 18:06:25 +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
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
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
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
Jonathan Schwender
702c8e930d build.rs: try harder to find a suitable python (#42131)
Other embedders might not want to use `uv` and manage python in a
different way. This is not recommended by us, and we add warning
messages that clearly recommend using uv, but allow using regular
python. This will work if the embedder installs the necessary python
dependencies.

We provide more information in the output as to what exactly failed,
e.g. if `uv` was not installed, or if `uv run python` executed, but
failed at runtime.

The documentation of `find_python` was also updated. The link to the
book was outdated, and I don't think we currently document the set of
python dependencies needed for building servo. This can be improved by
follow-up PRs, e.g. using `uv run --script`.

Testing: No changes to the default `uv run` flow - The new python
fallback is not particularly tested, and may have issues. However, the
newly added warnings would help debugging any issues.

This might help shine a bit more light on #42122

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-01-25 10:34:40 +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
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
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
Simon Wülker
94e71e7ec0 Implement html5ever hooks for customizable <select> elements (#42036)
Do not merge yet - we need to create a new html5ever release.
The html5ever bump also includes encoding indicators, which we handle in
the most minimal way possible here. They will be handled properly by
https://github.com/servo/servo/pull/41730

Companion PR for https://github.com/servo/html5ever/pull/719

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-01-22 13:34:12 +00:00
Jonathan Schwender
82df609833 mach: Use uv to manage the virtual environment (#41861)
Instead of attempting to manage the virtual environment ourselves, use
`uv` to manage the installation of dependencies.
Since we still have dependencies coming from upstream wpt, we use
`[tool.setuptool]` in our pyproject.toml to ensure that `uv` dynamically
installs our dependencies according to the requirements.txt files.

Additionally, this PR also reverts `--no-project` usage. `--no-project`
was added as a temporary workaround in
https://github.com/servo/servo/pull/37741.
It's not 100% clear to me what exactly the issue was, but
[apparently](https://github.com/servo/servo/pull/37741#pullrequestreview-2985666234)
the issue caused the build to break.
Removing the arg seems to work fine, except that we get a warning about
a missing `requiress-python` value in `pyproject.toml`.
Apparently it is good practice to specify the requirement as `>=` in th
pyroject, and lock the exact version via `uv pin` (which writes to
`.python_version`, where we already pin 3.11.


Testing: Should be covered by existing tests, which compile code on all
platforms.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-01-22 05:51:44 +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
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
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
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
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
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
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
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
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
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
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
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