Commit Graph

12595 Commits

Author SHA1 Message Date
Simon Wülker
80555eb7e7 script: Don't let LossyDecoder handle the BOM (#41732)
We already handle BOMs when detecting the encoding. The decoder itself
should not touch the BOMs in any way.

Depends on https://github.com/servo/html5ever/pull/704

Testing: New tests start to pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-01-23 07:56:08 +00:00
Simon Wülker
c023d8edc7 script: Prevent activation of disabled select elements (#42079)
This change also adjusts the styles of disabled select elements such
that the text appears grayed out, like in firefox:
<img width="480" height="84" alt="image"
src="https://github.com/user-attachments/assets/d36325f5-c811-492b-9510-7a32efd5fd7b"
/>


Testing: No tests. I think it would be possible to write a webdriver
test for this? It didn't seem worth the effort, if someone can point me
to the relevant resources then I'm happy to write one ^^

Fixes: https://github.com/servo/servo/issues/42075

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-01-23 00:40:28 +00:00
Martin Robinson
b3db9cf9d3 script: Do not assume that every textual <input> is a focusable area (#42078)
An input text might not be a focusable area if it is disabled. In this
case return `None` from `find_focusable_shadow_host_if_necessary` which
causes no focus to occur.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Testing: This change includes a test.
Fixes: #42074.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-22 19:21:11 +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
Gae24
a953ba954a script: revamp module script loading to follow current spec (#41779)
Rewrite module script fetching logic to follow current spec.

Testing: Covered by existing wpt tests
Fixes: #31397

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-01-22 11:40:53 +00:00
Martin Robinson
ceedfec729 script: Allow selecting text in input fields with the mouse (#42049)
This change adds basic support for selecting text via dragging the mouse
in text inputs. This is currently handled entirely inside of text
inputs, but will be integrated into a more global drag handler when that
is implemented in the `DocumentEventHandler`. This means that events
that happen outside of the text input currently don't update the
selection.

Testing: This adds Servo-specific WPT-style tests. There are WPT tests
that test this sort of behavior, but I believe they rely on selection
events, which we have no implemented yet (we will soon).

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-22 07:51:51 +00:00
Oliver Medhurst
168cd3efde script: Fix unneeded .to_owned() (#42057)
`.to_owned()` is unneeded with `.to_string()`, tiny cleanup
(plus ~meaningless perf/mem win).

Testing: `./mach build --use-crown`

Signed-off-by: Oliver Medhurst <honk@goose.icu>
2026-01-22 05:52:25 +00:00
Osoro Bironga
87f00aa098 script: Include font-variation-settings on parse_font_face_descriptors (#41968)
Implementation for parsing the font-variation-settings and including
them in the fontface rule-set, currently they are discarded and
annotated with a TODO
Related: https://github.com/servo/servo/issues/41591

Testing: Tests are included for the changes to be implemented, as
suggested they currently fail and thats the starting point.

Signed-off-by: Osoro Bironga <fanosoro@gmail.com>
2026-01-22 04:10:58 +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
Oliver Medhurst
24fe746d3f script: Fix unfulfilled lint expectation in htmlstyleelement.rs (#42059)
Unfulfilled after #41986, causes lint warning in main.

Testing: `./mach build --use-crown`

Signed-off-by: Oliver Medhurst <honk@goose.icu>
2026-01-22 03:26:36 +00:00
Martin Robinson
4a9c95ac8e layout: Handle selection during display list construction (#41963)
Instead of handling selection in text input during box tree / fragment
tree construction, fully handle it during display list construction.
This means that when the selection changes in script, it updates
automatically in the `FragmentTree` and only a new display list is
necessary. This avoids a layout while changing the selection in text
fields.

Testing: This fixes a few rendering issues, but these are very hard
to isolate and test for. It causes one test to start failing, but this
is
because a cursor that wasn't rendered properly now starts showing
up.
Fixes: #41920.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-01-21 08:04:15 +00:00
Narfinger
71cc3b2382 WebGPU: Use GenericChannel (#42032)
Switching WebGPU component to use GenericChannel.

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

Testing: Compilation is the test.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-21 05:59:18 +00:00
Tim van der Lippe
6f9a0831bd script: Implement full logic for script-blocking stylesheets (#41988)
We only implemented the first part (parser_inserted), but
weren't checking any of the other cases.

Testing: WPT
Part of #22715

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-20 19:15:00 +00:00
Martin Robinson
983482b5f3 script: Ignore platform mouse move events that do not change the cursor location (#42034)
winit on macOS seems to send a mousemove event right before mouse button
up events. This interferes with interactive use of text boxes -- for
instance double-clicking to select the hovered word. This change makes
it so
that mouse move events that do not change the cursor location are
ignored.

Testing: This change adds a Servo-specific WPT-style test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-20 18:30:59 +00:00
Tim van der Lippe
3fedd1df53 script: Fix timing of update-a-style-block (#41986)
Updates it according to the spec and adds a big explanation why it
differs from the spec. It took me a while to figure out what's going on
here and why the code was actually correct.

Testing: WPT
Part of #22715
Fixes #42009

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-01-20 17:58:36 +00:00
Taym Haddadi
8cd7d9d640 fetch: Preserve AbortError on repeated body consumption for errored stream (#42016)
Testing: more tests/wpt/meta/fetch/api/abort/general.any.js.ini pass.

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-01-20 16:43:56 +00:00
Gregory Terzian
19b26b7e6e indexeddb: track open requests by id (#41933)
Track open requests by their ID, so that specific requests can be
aborted instead of aborting all request for a given db name. This is
important because worker and windows at the same origin could be opening
databases and aborting their opening, but this should not affect other
scopes at the origin.

Testing: Existing WPT test suites. 
Fixes: None, but part of https://github.com/servo/servo/issues/40983

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2026-01-20 14:04:16 +00:00
Martin Robinson
8e7249b625 script: Set MouseEvent properties according to the UI Events specification (#42013)
The UI Events specification has a table of UIEvents which describes the
properties that they must have. Importantly, this includes whether the
event should bubble, be cancelable, and be composed. The code was not
following this specification, so this changes centralizes where they are
set.

In addition, it makes the code that finds the event target consistent
with whether or not it is `ShadowIncluding`.

Finally the `MouseEvent` constructors are renamed so that it is clear
what they are used for.

Testing: This change causes one WPT test to start passing.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-19 21:17:04 +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
Martin Robinson
90f568f962 fonts: Store ByteIndex as a usize (#42012)
This value is supposed to represent a UTF-8 code point offset or
length. It should never be negative and we often need to convert it to a
`usize`, so we can store it as a `usize`.

Testing: This should not change behavior so existing tests should
suffice.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-19 18:30:04 +00:00
Martin Robinson
e8f88468d0 script: Consider a selection collapsed when the edit point equals the selection origin (#41978)
In text inputs, the edit point can be equal to a non-`None` selection
origin for a variety of reasons such as when the selection is set by a
DOM API or when a composition event inserts a zero length string. In
both of these cases, we should treat the selection as collapsed. It is
important to do this because for the purposes of arrow key movement and
context menu entries, we should think of the text input as not having a
selection at all.

Testing: This change adds a Servo-specific WPT test, as key press
behavior is
platform specific.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-19 15:08:40 +00:00
Rod Borovyk
eacdbd9a34 layout: Accept lengths in arbitrary units for SVG width and height (#40761)
Previously it was only possible to set width and height of SVG elements
in pixels. These changes allow parsing other units like em using a CSS
parser in SVGSVGElement and resolving them to computed values in the
layout code.

Testing: Tested manually
Fixes: -

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2026-01-19 13:31:27 +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
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