Commit Graph

12571 Commits

Author SHA1 Message Date
Tim van der Lippe
13cfaddbbc script: Implement link fetch resource steps for stylesheet (#41987)
These were missing. It also lists why some of these steps are actually
present in the `StylesheetLoader` instead.

Testing: WPT
Part of #22715

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-18 20:32:46 +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
atbrakhi
9882024c18 devtools: Fix devtools source content being empty for small documents (#41983)
When the network decoder's `finish()` returns decoded content in
`parse_sync`, it was being added to the parsing input but not captured
for devtools. This ensures the content is also captured for the devtools
Sources panel.

Testing: We have tests for this in devtools_tests.py. They were failing
before this change. I ran locally and it passed now. With this all
DevTools tests are passing!

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2026-01-18 14:16:44 +00:00
Sam
4b71136fcb script: Update mozjs to include with more safe wrappers and debugmozjs artifacts (#41971)
This bump includes
some new safe wrappers: https://github.com/servo/mozjs/pull/699
https://github.com/servo/mozjs/pull/700
debugmozjs artifacts: https://github.com/servo/mozjs/pull/544
rooted macros with vectors: https://github.com/servo/mozjs/pull/697

Testing: Done in mozjs repo.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-01-18 13:47:27 +00:00
César Danilo Pedraza Montoya
e153020f8f script: Add error messages for cSHAKE and HKDF (#41964)
Add all the missing error messages for `hkdf_operation.rs` and
`cshake_operation.rs` (one message only). Tried to follow the style of
existing messages and used an existing message for the HKDF-expand
operation. Related to #40756.

Testing: No tests added.

Signed-off-by: César Pedraza <cpedraza@unal.edu.co>
2026-01-18 13:30:14 +00:00
Martin Robinson
93fa5d3e0a layout: Properly account for transforms when finding glyph index (#41931)
This change makes it so that tranforms (including CSS transform and
scrolling) are properly accounted for when calculating glyph indices.
Containing block sizes are moved to `BaseFragment`. This should reduce
the size of the StackingContextTree a little.

Testing: A Servo-specific WPT-style test is added for this change.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-01-18 13:07:25 +00:00
Josh Matthews
a97a345d6e script: Check same-origin-domain when evaluating javscript: URLs. (#41969)
These changes introduce a new OriginSnapshot type, which is an immutable
version of MutableOrigin (ie. an origin that includes an optional domain
modifier). This is now propagated as part of LoadData's origin, allowing
us to perform the same-origin-domain check for javascript: URLs as
needed.

Testing: Newly-passing tests.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-01-18 02:32:51 +00:00
Martin Robinson
7f092596a9 script: Ignore empty composition events in text inputs (#41979)
Some platforms send empty composition events (winit on Linux, for
example). These should be ignored appropriately as they can cause
unecessary rendering updates even when the content of the text area does
not change.

Testing: This is mainly an optimization, so no tests are added. It does
prevent
some misbehavior, but that is a secondary effect fixed by #41978.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-17 22:35:48 +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
Martin Robinson
1a92d62a97 script: Simplify TextInput::new (#41975)
This constructors takes more arguments than it needs to. The three
arguments removed are almost always the default values. The exception is
in the unit tests. In this change those calls are modified to use
`set_max_length` like is done in the actual script code.

Testing: This is just a simplification of the code, so should be covered
by existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-17 14:04:28 +00:00
Martin Robinson
37cef428de script: Do not adjust the edit point in text fields when non-primary buttons are pressed (#41974)
We should not move the text cursor or change the text selection when
non-primary (such as the right) mouse buttons are pressed. Doing so
interferes with the common operations:

1. Select text
2. Open context menu
3. Copy text

This change fixes that.

Testing: New WPT-style tests are added.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-17 13:30:59 +00:00
Martin Robinson
e8f9976f35 script: Reset form controls immediately after parsing them (#41962)
This change brings Servo closer to the specification by removing the
unspecified sanitization flags used during parsing of input elements.
Instead we implement the lines of the specification that say to reset
resettable elements after parsing them. This forces a re-sanitization of
the default value (from the `value` attribute), clearing up the
confusion in parser comments.

In addition, specification text is added in the element creation code.

Testing: This just brings our code closer to the specification, so it is
covered by existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-17 09:05:28 +00:00
Josh Matthews
c941575096 script: Check node document instead of current global when getting iframe's content document. (#41970)
Updates the implementation of HTMLIFrameElement::GetContentDocument to
match the latest specification text.

Testing: Since each script thread only contains documents that are
same-origin-domain, I don't think it's possible to construct a testcase
with an observable difference here.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-01-17 08:48:53 +00:00
Josh Matthews
6e948ee9a9 script: Use document origin instead of URL when manipulating blobs. (#41966)
Retrieving the origin from the document's URL means the wrong origin can
be returned for documents like about:blank or about:srcdoc.

Testing: Newly-passing test involving a srcdoc and blob.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-01-17 07:31:41 +00:00
PaulTreitel
1fa5fdc2f9 script: Add error messages for the ECDH cryptographic functions (#41468)
Adding error messages across
`script/dom/subtlecrypto/ecdh_operation.rs`.

Testing: No tests as this is just adding error messages
Fixes: (part of) #40756

---------

Signed-off-by: PaulTreitel <paul.treitel@gmail.com>
2026-01-17 05:50:34 +00:00
Martin Robinson
ee8c727944 script: Add selection behavior for double and triple click in text fields (#41926)
This change adds support for updating the selection when double and
triple clicking in text fields. Double clicking selects the most
relevant word while triple clicking selects the entire line.

Testing: This change adds unit tests for `Rope` as well as a
Servo-specific WPT style test. These behaviors are platform
dependent.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-16 23:03:05 +00:00
Martin Robinson
075ecd6107 script: Do not allow pasting newlines in single line text boxes (#41934)
This change moves all single versus multiline input handling to script.
It didn't really belong in `Rope`. In addition, it ensures that all
insertions into single line text boxes are sanitized by replacing
linebreaks with spaces.

Testing: As pasting is hard to test with a WPT-style test, this changes
includes new unit tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-16 15:32:09 +00:00
shuppy
c2530a49ee Plumb accessibility tree updates from layout to embedder (#41924)
this patch adds some new methods and messages that allow layout to send
the embedder [accessibility tree
updates](https://docs.rs/accesskit/0.22.0/accesskit/struct.TreeUpdate.html):

- layout —[ ScriptThreadMessage::AccessibilityTreeUpdate ]→ script
- script —[ EmbedderMsg::AccessibilityTreeUpdate ]→ libservo
- libservo —[ WebViewDelegate::notify_accessibility_tree_update() ]→
servoshell
- servoshell —[ PlatformWindow::notify_accessibility_tree_update() ]→
servoshell
- servoshell —[ Gui::notify_accessibility_tree_update() ]→ servoshell

Testing: none yet, no functional change
Fixes: part of #4344

---------

Signed-off-by: delan azabani <dazabani@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Alice Boxhall <alice@igalia.com>
2026-01-16 12:32:08 +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
Tim van der Lippe
62d57d9833 script: Implement navigate to fragment algorithm (#41834)
Part of the navigate algorithm, it now performs the
fragment navigation after the history_behavior is
determined. It also updates the scrolling algorithm
to reflect what the specification expects.

With these changes, the test from the issue now
correctly scrolls to `Target`, but it doesn't update
the `scrollY` value for `window` and hence still
fails the test.

Part of #41807

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-16 07:15:35 +00:00
Kingsley Yung
5261e160c0 script: Move AES-KW to individual submodule (#41949)
We previously introduced new infrastructure for sharing code in
`aes_common.rs` among AES algorithms.

This patch makes AES-KW algorithm adapt the new infrastructure, by
moving the relevant code away from `aes_operation.rs` to its own
`aes_kw_operation.rs`, and calling AES common steps in the new
`aes_common.rs`.

Since all AES algorithms have been moved away from `aes_operation.rs`,
the file `aes_operation.rs` is also removed. The key handle variants
`Handle::Aes128`, `Handle::Aes192` and `Handle::Aes256` used by the old
AES infrastructure is also removed.

Testing: Refactoring. Existing tests suffice.
Fixes: Part of #41763

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-16 06:56:13 +00:00
Kingsley Yung
7f2abe4bdb script: Extend AES-GCM in WebCrypto to support more tag lengths (#41950)
We currently only support 128-bit tags for AES-GCM authenticated
decryption. This patch expands support to 96-bit, 104-bit, 112-bit, and
120-bit tags.

The specification recommends supporting 32-bit and 64-bit tags as well.
However, the `aes-gcm` crate currently does not support them. We may
need to look for a workaround or wait for updates from the upstream
project.

Testing: Pass some WPT tests that were expected to fail.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-16 06:55:35 +00:00
eri
8cf4955731 devtools: Correctly cache console messages (#41895)
Fix caching before the console is opened and stop sending messages
prematurely.

Fix line numbers not showing in console messages because of a missing
`rename_all`.

Remove `getCachedMessages` in favour of sending a list of messages as a
reply to the `watchResources` for `console-message`/`error-message` in
the watcher.

Remove `startListeners` and `stopListeners`. These are legacy methods of
watching properties before the watcher actor. It is preferred to enable
properties in `supported_resources` in the watcher than to use these
messages.

Remove `clearMessagesCache`, only `clearMessagesCacheAsync` seems to be
used now. Add a reply to `clearMessagesCacheAsync`.

Simplify a bit the structs for console messages and prefer serde's
annotations to manual serialization. Merge `handle_console_message` and
`handle_page_error`, and improve the usability of `ConsoleResource`.

Fix some fields in console messages. We are missing `source_id` for now.
This will be easier to add after better support for source actors. We
are also missing stack traces.

| Before | After |
| --- | --- |
| ![Console message list starting at 5 and counting up, showing the file
location but not the line
number](https://github.com/user-attachments/assets/b21159b4-1a95-46aa-9337-0004a922837c)
| ![Console message list starting at 1, showing both the file location
and line number. It says "Connected here" at message number
4](https://github.com/user-attachments/assets/f8ea1a7c-9262-4fa2-a882-cad35af9c2dc)
|

Testing: Manual testing
Fixes: #26666

---------

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-01-15 21:41:07 +00:00
Oriol Brufau
a5752da7d6 Upgrade Stylo to 2026-01-01 (#41916)
This continues #41696

Changelog:
- Upstream:
ab77635ba3...360787fff5
- Servo fixups:
0c47f9cb52...71737ad5c8

Stylo tracking issue: https://github.com/servo/stylo/issues/286

Testing: Various tests are now passing

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-01-15 10:58:48 +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
Martin Robinson
d5dcdd6e06 script: Add support for setting the edit point with the mouse in <input> and <textarea> (#41906)
This change updates and implements the old `query_text_index` layout
query to properly look for the glyph index of a point within a node's
`Fragment`s. This should work properly with the shadow DOM of both
`<input>` and `<textarea>` elements. In particular, multiple lines are
supported.

Caveats:
 - `<input>` and `<textarea>` that are transformed are currently not
   supported. This will happen in a followup.
 - For multi-line inputs, we should be finding the text offset of the
   nearest line that is within the block range of the click. This will
   happen in a followup.

Testing: This change adds two Servo-specific WPT-style tests. These are
Servo-specific because the behavior of clicking in text fields isn't
fully specified.

Fixes: #35432
Fixes: #10083

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-01-14 13:23:43 +00:00
Laurent Belmonte
0dc28296e0 script: Some failed requests should record resource timing entries (#41804)
Some failed requests should record resource timing entries

Testing: ./mach test-wpt
tests/wpt/tests/resource-timing/entries-for-network-errors.sub.https.html
Fixes: https://github.com/servo/servo/issues/41667

---------

Signed-off-by: bellau <laurent.belmonte@gmail.com>
2026-01-14 13:20:12 +00:00
César Danilo Pedraza Montoya
77a1a2546c script: Add error messages in ed25519_operation.rs (#41902)
Add all the missing error messages in `ed25519_operation.rs`. Followed
the other implementations of `importKey`, `exportKey` and others to try
and follow the same style. Related to #40756.

Testing: No tests added, did some manual tests

---------

Signed-off-by: César Pedraza <cpedraza@unal.edu.co>
2026-01-14 13:15:25 +00:00
Kingsley Yung
b7d0503d60 script: Move AES-GCM to individual submodule (#41908)
We previously introduced new infrastructure for sharing code in
`aes_common.rs` among AES algorithms.

Similar to #41856 on AES-CTR and #41883 on AES-CBC, this patch makes
AES-GCM algorithm adapt the new infrastructure, by moving the relevant
code away from `aes_operation.rs` to its own `aes_gcm_operation.rs`, and
calling AES common steps in the new `aes_common.rs`.

The patch also re-wrote the encrypt and decrypt operations of AES-GCM to
properly handle different tag lengths. This helps extend our support on
more tag lengths later, in order pass more WPT tests.

Testing: Refactoring. Existing tests suffice.
Fixes: Part of #41763

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-14 13:08:10 +00:00
Kingsley Yung
91843d928e script: Move AES-CBC to individual submodule (#41883)
We previously introduced new infrastructure for sharing code in
`aes_common.rs` among AES algorithms.

Similar to #41856 on AES-CTR, this patch makes AES-CBC algorithm adapt
the new infrastructure, by moving the relevant code away from
`aes_operation.rs` to its own `aes_cbc_operation.rs`, and calling AES
common steps in the new `aes_common.rs`. The patch also does some
refactoring on the encrypt and decrypt operations to get closer to
specification.

Testing: Refactoring. Existing tests suffice.
Fixes: Part of #41763

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-14 07:03:25 +00:00
Martin Robinson
30fa32714e Remove Servo's custom Range implementation (#41880)
Servo `Range` type probably predates the `Range` type in the standard
library. The fact that there are two `Range` types in Servo is often
very confusing. The internal type is only used for byte indices in glyph
runs. This change removes the internal generic `Range` in favor of a
small wrapper around a native Rust `Range`.

It's likely that there are more improvements that could be done here,
such as reusing `Utf8CodePointIndex`, but this code is going to change a
lot soon and these ranges might soon be replaced with actual glyph
ranges. We are going to be looking to remove `TextByteRange` entirely.
This is just an intermediate step.

Testing: This should not change behavior and is thus covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-13 15:31:47 +00:00
Narfinger
9cef653e78 webxr: Switch most of the uses of ipc-channel to GenericChannel (#41774)
Switch most of the uses of IpcChannel to GenericChannel.

Currently there is still one major usage of IpcChannel in the
frame_sender. This will be a more complicated change,
hence, should have extra scrutinee.


Requires https://github.com/servo/servo/pull/41771

Testing: Like all GenericChannels, this is mostly type changes

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-13 13:24:27 +00:00
Tim van der Lippe
9d2715fb3d script: Implement "Location-navigate a location" (#41805)
The existing implementation in `Location::navigate` differs
a lot from the existing spec. Therefore, let's incrementally
make it closer match the spec by implementing the first
step for `SetHref`.

Testing: WPT
Part of #41807

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-13 08:15:21 +00:00
Kingsley Yung
c3fafb2f25 script: Move AES-CTR to individual submodule (#41856)
#41762 introduced new infrastructure for sharing code in `aes_common.rs`
among AES algorithms.

This patch makes AES-CTR algorithm adopt the new infrastructure, by
moving the relevant code away from `aes_operation.rs` to its own
`aes_ctr_operation.rs`, with refactoring for adaptation.

Testing: Refactoring. Existing tests suffice.
Fixes: Part of #41763

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-01-13 04:46:19 +00:00
aquaThirsty
d9ef15ea3a script/dom: Remove unused creator-related methods from WindowProxy. (#41860)
Methods were unused and removed from the HTML spec.

Testing: Verified with ./mach build and ./mach test-unit. Without errors
or warnings.
Fixes: #41835

Signed-off-by: TimurBora <timurborisov5561@gmail.com>
2026-01-12 20:43:55 +00:00
Narfinger
a0372662d8 bluetooth: Use GenericChannel (#41809)
Bluetooth component is now switched away from IpcChannel to
GenericChannel.

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

Testing: Mostly type changes so a compilation should be the testing.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-12 13:01:42 +00:00
Martin Robinson
3cda70dbbb script: Include click count as the detail of mouseup and mousedown events (#41833)
This change improves the counting of clicks for mouse button events by
ensuring that `detail` property of those events includes the click
count. This `detail` differs from that of `dblclick` events where the
`detail` is always 2. In addition, it ensures that the click count can
increase for mouse buttons that do not cause `click` and `dblclick`
events (such as the right mouse button).

Testing: This change adds two Servo-specific WPT-style tests. While this
behavior is specified a bit, the details are implementation specific.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-12 08:47:20 +00:00
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