Commit Graph

12681 Commits

Author SHA1 Message Date
Sebastian C
c330c7c436 script: cookiestore: Normalize cookie name and value in Get and Set (#42427)
Trims leading and trailing spaces and tabs for names and values in
Get/GetAll/Set. The specification does this in the query/set cookie
methods but those functions are split across the script, resource
thread, and cookie storage. Instead I'm normalize the values at the API
entry points so we have the normalized values everywhere.

Testing: Cookiestore WPT tests cover this

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2026-02-07 19:48:04 +00:00
webbeef
5b54abeac7 websocket: resolve relative urls in constructor (#42425)
Implement steps 1. and 2. of the websocket constructor to resolve the
url against the current settings API base URL.

Testing: Some WPT tests are now passing

Signed-off-by: webbeef <me@webbeef.org>
2026-02-07 15:58:35 +00:00
Kingsley Yung
05d1bb60e1 script: Combine import key operations of RSA algorithms (#42422)
The import key operations of

- RSASSA-PKCS1-v1_5 (`rsassa_pkcs1_v1_5_operation::import_key`)
- RSA-PSS (`rsa_pss::import_key`)
- RSA_OAEP (`rsa_oaep::import_key`)

only differ from each other by a few steps. This patch combines them
into a single function (`rsa_common::import_key`) shared among them.

The enum variant `RsaAlgorithm::RsaSsaPkcs1v15` is also renamed as
`RsaAlgorithm::RsassaPkcs1v1_5` for clarity.

Testing: Refactoring. Existing tests suffice.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-02-07 12:20:09 +00:00
Tim van der Lippe
cc0e98d3a9 script: Start implementation of shared attribute processing for iframes (#42254)
Start with implementing the new algorithms per the spec. This fixes the
case where the load event should be fired, but only if a src exists and
it is about:blank and it is connected for the very first time.

Part of #31973

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-07 08:48:35 +00:00
Sebastian C
639fccd03f Fix cookiestore defaults propagation (#42418)
Also fixes propagating expiry clamping to underlying cookie object. This
matters when attempting to inspect expiry time from a retrieved cookie.
According to the WPT tests, setting max-age in a cookie string is
supposed to be visible in the retrieved expiry.


Testing: cookiestore WPT tests cover this behavior

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2026-02-07 07:10:01 +00:00
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
Martin Robinson
eeb31a3cec deps: Merge the servo/media repository (#42369)
This change merges http://github.com/servo/media into this repository.
It is only used by Servo and version upgrades are complicated by having
two repositories. In addition, this avoids the need to refer to
individual commit hashes in the Servo `Cargo.toml`. The hope is that
merging these two repositories will lead to better code organization /
simplification like we have seen with the WebXR support. Initiailly, the
idea was that this media support could be shared with the wider Rust
ecosystem, but I think that hasn't worked out as planned due to the fact
that it is difficult to use the various media packaes outside of the
Servo project and the fact that no one seems to be doing this.

Some changes were made when importing the code:
- The second commit in this PR addresses new clippy warnings from the
imported code.
 - GStreamer Packages are no longer renamed in the media code, so that
   they are named the same as they are currently in Servo.
 - Some examples are not ported as they require being run interactively
   and depend on older version of important libraries like winit.
   Having these dependencies in the core part of Servo isn't very
   convenient. Removed examples:
   - `audio_decoder.rs`: This is meant to be run interactively with a
     file so isn't very useful for testing.
   - Depended on winit GUI (`player` subdirectory):
     - `media_element_source_node.rs`
     - `play_media_stream.rs`
     - `simple_player.rs`
     - `muted_player.rs`
   - `siple_webrtc.rs`: Depended on `webrtc` library:

Testing: This is covered by existing tests. In addition, the job which
runs
the media examples is added to the unit test workflow.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-02-06 17:00:03 +00:00
Simon Wülker
b6be493876 script: Call ElementStylesheetLoader::load_with_element directly (#42406)
When a `<link>` element loads a stylesheet then it calls
`ElementStylesheetLoader::new`, followed immediately by
calling `load` on the new loader. This is the only place where these
functions are used, so we can coalesce them together and avoid an
unreachable assertion in the process.

This should have no impact on the end user, it's just a cleanup.

Testing: Regressions should be covered by existing tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-06 16:30:03 +00:00
Narfinger
4e85b9946f script: Add check for IntersectionObserver to not connect to the same document multiple times. (#42366)
Previous IntersectionObserver had only connect_to_owner_unchecked
method. We replace this with a checked method to not add the same
IntersectionObserver to the same document multiple times.

This should improve performance as the same IntersectionObserver was
tested multiple times.

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

Testing: Compilation and println statements to see if we do not add us
again to the document.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-02-06 12:40:23 +00:00
Steven Novaryo
936aaf1ec5 script: Check whether window is top level before looking for it in the ScriptThread (#42390)
Instead of immediately looking for the top-level browsing context's
`Document` in the `ScriptThread`, check whether `Window` is top-level
beforehand. This is a small optimization.

Testing: Existing WPTs (no behavior changes)

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2026-02-06 10:24:40 +00:00
webbeef
86403fa4e5 layout: get rid of some collect() calls (#42327)
Profiling a speedometer run showed significant time spent in some layout
function in vector allocations. The main change is to switch the result
of `query_box_areas()` from a Vec<T> to and iterator.

Testing: refactoring with no expected test changes

Signed-off-by: webbeef <me@webbeef.org>
2026-02-06 09:38:49 +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
Mukilan Thiyagarajan
79ed814ec1 libservo: Expand the UserContentManager API. (#42288)
The patch adds the following functionality to the per-WebView
`UserContentManager` API.
- Removing a `UserScript` at that was previously added.
- Adding a new `UserStyleSheet` representing a user-origin style sheet.
allow removing user script
- Removing a previously added `UserStyleSheet`.

There might be scope for some improvements in the API:
- `UserScript` and `UserStyleSheet` have different ways of representing
the source location - a `PathBuf` and `Url` respectively. This is due to
how those values are used by the underlying evaluation APIs in script
and stylo. More investigation is needed here and could be addressed in
future patches.

Testing: New unit tests are added for the user stylesheet APIs. Existing
tests have been updated to test the removal of user scripts.
2026-02-05 13:26:54 +00:00
Gae24
3748667775 chore: move ClassicScript related code to a new module (#42363)
As discussed on a [Zulip
thread](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Code.20organization/with/571886607),
move `ClassicScript` code to a new module.

Testing: A successful build is enough

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-05 12:32:38 +00:00
Josh Matthews
e2dba87301 script: Remove named window proxy map entry when destroying nested browsing context (#42344)
Leaving the entries sitting around both unnecessarily increases memory
usage and breaks code that looks up window proxies by name and reuses
names for iframes within the same page.

Testing: Newly-passing tests.
Fixes: #15258

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2026-02-04 19:46:06 +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
Luke Warlow
7bf00ecb51 script: Match :modal when dialog is modal (#42201)
In addition, clean-up the UA stylesheet for dialogs.

Stylo PR: servo/stylo#301
Testing: change causes several WPT tests to start passing.

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-02-04 15:00:50 +00:00
Martin Robinson
445e04ddad script: Move WebVTT interfaces into a webvtt directory (#42326)
This change organizes the rest of the media-related interfaces by moving
the WebVTT-related[^1] interfaces into their own directory and two more
media-related interfaces into the `media` directory.

Testing: This just moves source files around, so a successful build
should be a good enough test.
Fixes: This is part of #38901.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-02-04 08:15:12 +00:00
Kingsley Yung
db95883dc0 script: Move more steps of AES algorithms to aes_common module (#42323)
Move some common/similar steps of the import key operations of AES-CTR,
AES-CBC, AES-GCM, AES-KW and AES-OCB to the shared module `aes_common`.

Some comments are also added to the shared module `aes_common` to
explain the small difference in the specification of AES-OCB operations.

Testing: Refactoring. Existing tests suffice.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-02-04 07:05:27 +00:00
Gae24
fe932a4d1f script: Start using &mut JSContext and wrappers2 functions inside module script code (#42294)
Start using `&mut JSContext` and wrappers2 functions for module script
code.


Testing: A successful build should be enough

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-04 06:01:23 +00:00
Taym Haddadi
b18d119261 fetch: implement multipart/form-data parsing for Request::formData() (#42041)
Testing: More test passed in `fetch/api/abort/request.any.js.ini`

fixes: #25106

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-02-03 23:31:41 +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
Osoro Bironga
8d4f2db3c9 script: Start a performance timeline entry for iframe documents (#42270)
Added resource timing that was missing for an iframe document.

Testing: Added
Fixes: https://github.com/servo/servo/issues/41666

---------

Signed-off-by: Osoro Bironga <fanosoro@gmail.com>
2026-02-03 16:07:10 +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
Tim van der Lippe
19c2f93cab script: Fix handling changes to relevant attributes for stylesheets (#42273)
We weren't removing stylesheets when we should be doing so. This most
notably happens when the stylesheet no longer has a href or its "rel"
changes.

The crash is also fixed, since the issue was that we were passing the
value of the attribute that was changed as if it were an href. However,
if we set the type attribute, then that's not the href.

To fix that, we now retrieve the href inside the method so we always
have the correct value.

Fixes #42259

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
2026-02-02 13:37:38 +00:00
Tim van der Lippe
e8aa7d51ba script: Set host for template content (#42276)
A template element should set the host of a DocumentFragment. However,
it didn't have a host yet. That's because ShadowRoot declares a host
attribute which returns Element, but its property is declared on
DocumentFragment.

Therefore, define the host on DocumentFragment instead and use it in all
relevant points for shadow roots. Then, update the pre-insert validity
check to use the correct host-including variant of inclusive ancestors.
Lastly, set the host of the template to wire it all up.

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-02 08:25:54 +00:00
TIN TUN AUNG
17f7c87088 script: add force option for assign-slottables for a tree (#42250)
In the case of node removal, if the subtree of the removed node contains
`<slot>` element, force traverse down to each `<slot>` element is needed
to reset the assignment of the slottables that currently being assigned
to the `<slot>` element. This changes add this force option to
`assign_slottables_for_a_tree`, and only set true to node removal.

Testing: Should be covered by current WPT test, [try
run](https://github.com/rayguo17/servo/actions/runs/21504337658)
Fixes: https://github.com/servo/servo/issues/35188
https://github.com/servo/servo/issues/42182

cc @TimvdLippe @simonwuelker @xiaochengh

---------

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
Signed-off-by: rayguo17 <rayguo17@gmail.com>
2026-02-02 07:25:13 +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
Gregory Terzian
91ee834195 Indexeddb: connection lifecycle (#42082)
Implement the full connection lifecycle, from opening and potentially
upgrading a database, waiting on existing connections to close, firing
the versionchange and blocked events, and updating pending open requests
when connections close.

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

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2026-02-02 06:14:27 +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
Simon Wülker
2204bb23eb script: Allow any valid CSS color for color input values (#42275)
Testing: New tests start to pass
Closes: https://github.com/servo/servo/issues/42117

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-01 20:05:33 +00:00
WaterWhisperer
f405ddeaf7 script: Implement base-uri CSP check (#42272)
Testing: `./mach test-wpt /content-security-policy/base-uri`
Fixes: #42261

Signed-off-by: WaterWhisperer <waterwhisperer24@qq.com>
2026-02-01 17:03:23 +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
Martin Robinson
1900ebc447 script: Do not consider a node an ancestor of itself in Node::is_ancestor_of (#42263)
This change fixes a crash in options collections due to the fact that a
`<select>` element was being considered an ancestor of itself. This
regression likely introduced in #40776.

This change also fills in the specification text for
`HTMLOptionCollect::Add`.

Testing: This change adds a WPT crash test.
Fixes: #41080.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-31 10:22:23 +00:00
Tim van der Lippe
e5af3ee964 script: Fix timing of frozen base URL (#42255)
Make it runs at the correct time and then also performs checks for its
scheme. The CSP check is left for a follow-up PR.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-01-31 05:34:59 +00:00
Gae24
9c4d17e9e1 script: support JSON modules (#42138)
With import attributes enabled we can now support non javascript
modules, for now we are limited to json ones.
Switch `GlobalScope` `modulemap` to be keyed by the tuple url and
module's type.

Testing: Enabled a new directory, new tests should pass

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2026-01-31 01:18:51 +00:00
webbeef
58b56edf97 dom: reduce traversal in CompareDocumentPosition (#42260)
We can avoid doing 2 traversals and stop at the first matching child we
find. This ensures we are never doing the longest iteration.

Testing: covered by WPT

Signed-off-by: webbeef <me@webbeef.org>
2026-01-31 01:18:30 +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
Narfinger
db052c4990 script: Change some HashSets to FxHashSet (#42257)
This changes 3 occurences of HashSet to FxHashSet for speed
improvements:
- dom/notifications::pending_request_ids: Pending Request ids are
Uuid::new_v4, hence, not user assignable.
- script_thread: painters_generating_frames: These are pipeline ids and,
hence, ideal for FxHash.
- script_thread:: docs_with_no_blocking_loads: These are Dom<Document>
and their hash is the ptr address, so ideal for FxHash.

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

Testing: These do not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-30 17:02:58 +00:00
Narfinger
8173d821be script/storage: Switch remaining instances of bincode to postcard (#42236)
Because of the deprecation of bincode we are switching to postcard
(which will already be used by ipc-channel).
This changes all usages to postcard.

Sadly there are still some dependencies using bincode, so we are
probably increasing the binary size.

Currently we do not modify the deny.toml because we have dependencies
that depend on bincode.

Testing: Compilation should be enough for test.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-01-30 07:23:38 +00:00
minghuaw
611f3ef162 script: Ensure web fonts in shadow root stylesheets are downloaded (#42151)
Added calls to download web font from stylesheet when stylesheets are
added to shadow root.

Testing: Manual testing. Added a new WPT testcase

---------

Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
2026-01-30 02:14:43 +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
Luke Warlow
bd779d141a script: Add support for :open pseudo-class (#42195)
Add support for `:open` pseudo-class. This is supported on dialog,
details and select elements.


Stylo PR: servo/stylo#297
Testing: WPTs but also
`data:text/html,<select><option>123</option></select><style>:open {
background-color: red; }</style>`. There are some tests that now error,
these previously failed due to missing `:open` and now make it further
along hitting test_driver.send_keys() which causes them to error
Fixes: #41277.

---------

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-01-29 17:08:51 +00:00
Martin Robinson
d6197ee2f0 script: Clear layout data on shadow root during attachShadow (#42237)
When a node has `attachShadow()` successfully called on it, its
descendants are no longer in the flat tree. This change makes it so that
the layout data of these descendants is cleared during `attachShadow()`
so that the node is no longer considered to have a layout box.

Testing: This change includes a new WPT crash test.
Fixes: #42215.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-29 13:08:39 +00:00
Martin Robinson
9a48e7b9d5 base: When normalizing RopeIndex ensure it does not intersect a character (#42240)
When doing operations on `RopeIndex` that need to make slices of lines,
this change makes it so that the resulting index does not intersect a
character. This is important because Rust will panic if you attempt to
slice a string that way.

Testing: This change adds a WPT crash test and a `Rope` unit test.
Fixes: #42217.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-01-29 12:01:39 +00:00
Steven Novaryo
c90d7d0a64 script: Ensure UA shadow DOM is initialized on <textarea> bind to tree (#42233)
Ensure that the UA shadow DOM for `<textarea>` is initialized when we
are binding to a tree.

Testing: New WPT.
Fixes: #42231

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2026-01-29 08:37:53 +00:00