Commit Graph

13192 Commits

Author SHA1 Message Date
atbrakhi
77458b2312 devtools: implement ArrayPreview in console (#44196)
Show preview of `ArrayItems` in console

Testing: Current tests are passing
Fixes: Part of #39858 
<img width="941" height="795" alt="image"
src="https://github.com/user-attachments/assets/e121265c-3987-4e37-a97d-b7cef0e05f4b"
/>

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
2026-04-15 10:06:10 +00:00
rovertrack
134beac3f0 Match on NonNull::new instead of using is_null() and expect() (#44221)
The code was doing repetitive work by checking if `compiled_script` is
null and then assigning and expecting the same, combined and replaced
with condition based working
Testing: The flow remains the same no new tests needed
Fixes: #44210

Signed-off-by: Rover track <rishan.pgowda@gmail.com>
2026-04-15 09:32:33 +00:00
Alice
31be152bfa layout: Send accessibility updates directly to embedder from layout. (#44208)
This introduces a `ScriptToEmbedderChan` property on `LayoutThread`,
which is used to send accessibility updates directly to the embedder.

Follow-up to https://github.com/servo/servo/pull/42338.

Testing: Covered by existing tests.

Signed-off-by: Alice Boxhall <alice@igalia.com>
2026-04-15 09:14:40 +00:00
Taym Haddadi
90c8bc3163 Indexeddb: fix upgrade transaction completion ordering (#44215)
Fixes: #44200

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-15 05:29:16 +00:00
niya
0260fe8869 webgl: replace WebGLCommandSender with WebGLChan (#44214)
Remove the `WebGLCommandSender` wrapper and return `Option<WebGLChan>`
directly from the `webgl_chan` method.

Testing: no tests required as runtime behavior is not affected 
Fixes: #44193

Signed-off-by: Niya Gupta <niyabits@disroot.org>
2026-04-15 03:41:06 +00:00
Kelechi Ebiri
a2213091c4 script: Implement wake lock api (#43617)
Implement the WakeLock API

Fixes: #41493

---------

Signed-off-by: Kelechi Ebiri <ebiritg@gmail.com>
2026-04-15 03:39:07 +00:00
niya
8bdfb998b0 canvas: fix unrecognized offscreen webgl context (#44159)
fix unrecognized type error on `OffscreenCanvas`

Testing: existing WPT:
- `tests/wpt/webgl/tests/conformance/offscreencanvas`
- `tests/wpt/webgl/tests/conformance2/offscreencanvas`

Fixes: #43540

---------

Signed-off-by: Niya Gupta <niyabits@disroot.org>
2026-04-14 23:58:39 +00:00
Alice
d11fc3a1c6 layout: Add a basic accessibility tree implementation for web contents (#42338)
This change introduces the `accessibility_tree` module, containing code
to build an in-memory representation of a very basic accessibility tree
for web contents. Currently, the tree for a given document contains:
- a `RootWebArea` which has the document root node as its sole child,
- an `Unknown` node for the root DOM node,
- a `GenericContainer` node for each DOM element, and
- a `TextRun` node for each text node.

This allows us to make basic assertions about the tree contents in the
`accessibility` test by doing a tree walk to find text nodes and
checking their contents.

Right now, the tree is rebuilt from scratch when accessibility is
enabled and when a navigation occurs (via
`Constellation::set_frame_tree_for_webview()` sending
`ScriptThreadMessage::SetAccessibilityActive`); it's not responsive to
changes in the page.

This change also changes the way we handle updating the graft node
between the webview's accessibility tree and its top level pipeline's
accessibility tree.

Previously, `Constellation::set_frame_tree_for_webview()` would send a
`ConstellationToEmbedderMsg::DocumentAccessibilityTreeIdChange` method
informing the webview of the accesskit TreeId of the top-level pipeline.
However, this resulted in flaky timing as we couldn't depend on that
message being handled before the message containing the TreeUpdate from
the WebContents, which would lead to a panic as the new TreeId wasn't
grafted into the combined tree yet.

This change introduces an epoch value which flows from the
ConstellationWebview, where it's updated every time the
`active_top_level_pipeline_id` changes, to the layout accessibility
tree, and finally to the webview with each TreeUpdate. Whenever a
TreeUpdate arrives at the webview which has a newer epoch than the last
known epoch, the webview-to-contents graft node is updated before the
TreeUpdate is forwarded. If a TreeUpdate arrives at the webview with an
epoch _older_ than the last known epoch, it's dropped, as it must be for
a no-longer-active pipeline.

Fixes: Part of #4344

---------

Signed-off-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
Co-authored-by: delan azabani <dazabani@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
2026-04-14 13:36:57 +00:00
Simon Wülker
2930beb4d1 script: Don't traverse O(the whole DOM tree) nodes when inserting elements into Vec in tree order (#44120)
Previously the code was computing a prefix sum over the number of
preceding elements in tree order to get the index that the node should
be inserted in.

That's not great if the DOM tree is big. Instead, we can compare two
nodes individually by looking at their ancestor chain and then find the
correct position with binary search.

On https://262.ecma-international.org/16.0/index.html, this reduces the
time it takes for content to appear from around 33s to 16s.

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

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-14 13:16:55 +00:00
Martin Robinson
5d28862c7b script: Expose a LayoutNode::is_root_of_user_agent_widget method (#44197)
The main goal here is to have layout not depend on `ServoLayoutElement`
directly and instead use the layout DOM interface exposed by
`layout-api`. 

This change allows layout to determine if replaced content
is the root of a user agent widget without having to access
`ServoDangerousStyleShadowRoot` which isn't really safe to use in layout
code. `LayoutElement::shadow_root()` is now no longer exposed to layout.

Testing: This should not change behavior, so should be covered by
existing test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-14 10:35:00 +00:00
Shubham Gupta
4ff29fecc8 script : Return PerformanceMark object from the Performance.mark() (#44199)
This returns the `PerformanceMark` object from Performance.mark()

Testing: More WPT tests passed

---------

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
2026-04-14 09:47:05 +00:00
Martin Robinson
e0fd559105 script: Simplify the way that layout flushes shadow root stylesheets (#44165)
This change is a minor cleanup of the way that layout flushes the
stylesheets of shadow roots. This avoids exposing so many public methods
in our and gradually to stop using Stylo's `TShadowRoot` in layout
entirely.

Testing: This should not change behavior, so should be covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-14 09:15:05 +00:00
Tim van der Lippe
143d7fe25e script: Add initial implementation of underline command (#44194)
This puts in most of the required machinery for underline. There are
still remaining test failures, but tackling these in separate PR's to
keep things manageable.

Part of #25005

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-04-14 08:03:18 +00:00
batu_hoang
4ecf8be867 net: Remove duplicate CoreResourceMsg::GetCookiesDataForUrl (#44167)
In https://github.com/servo/servo/pull/43600, we introduce the new
`CoreResourceMsg::GetCookiesForUrl`.
However after some updates, it is exactly the same with an existing one
`CoreResourceMsg::GetCookiesDataForUrl` which is used by `webdriver`.
This PR removes the duplication.

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
2026-04-14 06:14:46 +00:00
Taym Haddadi
5d3ef741b3 Indexeddb: fix IDBKeyRange lowerBound/upperBound open flags (#44183)
Testing: covered by idbkeyrange.any.html test
part of https://github.com/servo/servo/issues/40983

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-13 22:08:05 +00:00
elomscansio
97901de941 script: Pass down &mut JSContext/CurrentRealm to AudioContext methods (#44175)
Refactor AudioContext methods to use &mut JSContext 

Testing:  Just refactor.
Fixes: Part of #42638

---------

Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
2026-04-13 19:50:18 +00:00
atbrakhi
7b2c95030c devtools: implement objectPreview in console (#44181)
Show `objectPreview` in console. This preview is limited to 10. And only
when we expand, we see all items.

Testing: manual testing
Fixes: Part of #39858 

<img width="1008" height="607" alt="image"
src="https://github.com/user-attachments/assets/79fd6c18-f3a7-4f5e-8c21-61634153c362"
/>

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: eri <eri@igalia.com>
2026-04-13 18:48:11 +00:00
Taym Haddadi
a7ef47a46e Indexeddb: Cache IDBCursor.key conversion to preserve object identity (#44161)
Testing: Covered by idbcursor-key.any.html test.
part of https://github.com/servo/servo/issues/40983

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-13 18:14:26 +00:00
atbrakhi
fce9b10bf7 devtools: Implement showing ArrayItems in preview (#44172)
implement showing `ArrayItems` in preview

Testing: Current tests are passing.
Fixes: Part of #36027 

<img width="1146" height="913" alt="image"
src="https://github.com/user-attachments/assets/af5b009c-5983-4949-a30b-39ea32b24d20"
/>

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2026-04-13 16:05:05 +00:00
eri
d58f2d4dd5 devtools: Create UUID for objects created by console logging (#44164)
Testing: Existing tests pass
Part of: #36027

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-04-13 10:07:10 +00:00
Abubakar Abdulazeez Usman
65c0ed97a8 script: Avoid forwarding body event handlers without a browsing context (#44046)
When mutating window-reflecting event handler attributes on <body>,
HTMLBodyElement::attribute_mutated forwarded handlers to owner_window()
even for documents without a browsing context.
    
This caused handlers such as onload to be attached to the wrong window
in cases involving createHTMLDocument() and node cloning.
    
Only forward these handlers when the owner document has a browsing
context. This matches the has_browsing_context() check used by
window_event_handlers!(ForwardToWindow) and the spec algorithm.
    
The Range WPT expectations added for this issue are removed, as those
tests now pass. The onerroreventhandler.html test is marked as TIMEOUT
as its failure is a separate issue tracked in #44157 .



Testing: 
- ./mach fmt
- ./mach test-tidy
- ./mach test-wpt -r dom/ranges
- ./mach test-wpt -r
html/webappapis/scripting/events/onerroreventhandler.html
- ./mach try linux-wpt ( Try run
[#24328414549](https://github.com/arabson99/servo/actions/runs/24328414549))

Reproduced locally with the parent.html/child.html testcase from #36561.
Before this change, Servo logged "foo is not defined".
After this change, the error no longer appears.

Fixes: #36561

Signed-off-by: arabson99 <arabiusman99@gmail.com>
2026-04-13 06:20:43 +00:00
Simon Martin
625b53adb6 webgl: fix incorrect specification links (#44156)
I noticed that those links' fragments are all "off-by-one". This is due
to https://github.com/KhronosGroup/WebGL/pull/3762, that added a section
at the top of the specification. This patch fixes those links.

Testing: This is a comment-only change, so not covered by any automated
test. I manually navigated to a random subset of those links and checked
they do take to the correct section.

Signed-off-by: Simon Martin <simon@nasilyan.com>
2026-04-13 05:41:51 +00:00
Babalola Taiwo J
b7dcfdcf1c script: Remove unused has_sent_idle_message field from Window (#44154)
\`has_sent_idle_message\` was declared and initialized in \`Window\` but
never read anywhere. Removed the field and its initialization.

Fixes #44151

Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
2026-04-13 04:09:49 +00:00
Simon Wülker
25d3f4b7a9 script: Don't re-parse link relations when binding element to tree (#44139)
The parsed relations of a element don't depend on its position in the
DOM tree at all, so this does nothing.

Testing: This should not change observable behaviour, WPT should catch
regressions

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-12 21:49:31 +00:00
Tim van der Lippe
7c5df4e45b script: Implement recording and restoring of values (#44137)
It fixes two new tests, but also regresses 4. That's because we don't
handle xx-small (we shouldn't, at least browsers are inconsistent on
what to do with that) and pre-existing issues where a `<font>` element
is already present as parent of the selected node. These are
pre-existing issues that are now correctly exposed.

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-12 18:50:27 +00:00
Taym Haddadi
1908220198 Indexeddb: Follow the spec and make IDBRequest result/error getters throw while pending (#44128)
Testing: idbrequest WPT test.
part of https://github.com/servo/servo/issues/40983

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-12 15:23:05 +00:00
Martin Robinson
8eafa6e9ad script: Remove the duplicate implementation of selectors::Element (#44134)
Servo has had two implementations of `selectors::Element`, one used
during layout and one used for `Element#matches()` and
`Element#closest()`. The DOM APIs can trivially use the version that's
exposed to the layout interface, which allows removing the duplicated
implementation. This will eliminate code and prevent the two
implementations from drifting apart.

Testing: This should not change behavior in a testable way so should
be covered by existing tests.

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
Co-authored-by: Martin Robinson <mrobinson@fastmail.fm>
2026-04-12 08:26:13 +00:00
Simon Martin
78305123bf script: Invalidate texture if there's a bound framebuffer in WebGLRenderingContext (#43608)
This should be done for CopyTexImage2D, like it is already done for
TexImage2D and CompressedTexImage2D.

Testing: Regular testsuite. I was unable to add a dedicated case because
all I could think of it check the bound buffer's status before and after
copyTexImage2D, but I could not find a way to change it from say
complete to something else.
Fixes: #23264

---------

Signed-off-by: Simon Martin <simon@nasilyan.com>
Signed-off-by: Martin Robinson <martin@abandonedwig.info>
Co-authored-by: Martin Robinson <martin@abandonedwig.info>
2026-04-12 07:21:38 +00:00
Abbas Olanrewaju Sarafa
040aa2a3a5 script: Move devtools_wants_updates from GlobalScope to Window (#44121)
Moved devtools_wants_updates from GlobalScope to Window

Testing: Compiles cleanly. ```./mach test-devtools``` gives different
results each time, ```./mach test-devtools
test_sources_list_with_data_inline_classic_script``` always pass though.
Fixes: #44106

Signed-off-by: Sabb <sarafaabbas@gmail.com>
Signed-off-by: Abbas Olanrewaju Sarafa <109840351+sabbCodes@users.noreply.github.com>
2026-04-12 05:36:59 +00:00
Martin Robinson
45972e07ab script: Rewrite the layout DOM wrappers (#44114)
This change reworks the layout DOM wrappers so that they are simpler and
easier to reason about. The main changes here:

**Combine layout wrappers into one interface:**

 - `LayoutNode`/`ThreadSafeLayoutNode` is combined into `LayoutNode`:
   The idea here is that `LayoutNode` is always thread-safe when used in
   layout as long as no `unsafe` calls are used. These interfaces
   only expose what is necessary for layout.
 - `LayoutElement`/`ThreadSafeLayoutElement` is combined into
   `LayoutElement`: See above.

**Expose two new interfaces to be used *only* with `stylo` and
`selectors`:**

`DangerousStyleNode` and `DangerousStyleElement`. `stylo`
and `selectors` have a different way of ensuring safety that is
incompatible with Servo's layout (access all of the DOM tree anywhere,
but ensure that writing only happens from a single-thread). These types
only implement things like `TElement`, `TNode` and are not intended to
be used by layout at all.

All traits and implementations are moved to files that are named after
the struct or trait inside them, in order to better understand what one
is looking at.

The main goals here are:

 - Make it easier to reason about the safe use of the DOM APIs.
 - Remove the interdependencies between the `stylo` and `selectors`
   interface implementations and the layout interface. This helps
   with the first point as well and makes it simpler to know where
   a method is implemented.
 - Reduce the amount of code.
 - Make it possible to eliminate `TrustedNodeAddress` in the future.
 - Document and bring the method naming up to modern Rust conventions.

This is a lot of code changes, but is very well tested by the WPT tests.
Unfortunately, it is difficult to make a change like this iteratively.
In addition, this new design comes with new documentation at
servo/book#225.

Testing: This should not change behavior so should be covered by
existing
WPT tests.

Signed-off-by: Martin Robinson <mrobinson@fastmail.fm>
2026-04-12 04:22:06 +00:00
Simon Wülker
64f4f080dd script: Unbind <script> elements properly from the tree (#44127)
Necessary for https://github.com/servo/servo/pull/44120

Testing: After https://github.com/servo/servo/pull/44120 we would crash
on WPT without this change. Given that this is a pretty obscure bug with
next to no chance of regressing, I think its okay to wait for that PR
for test coverage?

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-11 20:22:18 +00:00
rovertrack
5fb69ec3f8 Push GlobalScope::crypto down into Window and WorkerGlobalScope (#44122)
Fixes: #44105 
moved member and initialization of crypto in Globlalscope to window and
workerGlobalScope
Testing: required tests passed 
` 
web-platform-test
Ran 80 checks (78 subtests, 2 tests)
Expected results: 80
Unexpected results: 0
OK
`

Signed-off-by: Rover track <rishan.pgowda@gmail.com>
2026-04-11 19:29:40 +00:00
Tim van der Lippe
ec513ff851 script: Split up contenteditable.rs into multiple files (#44110)
This file was getting way too big and too cluttered. Instead, split it
up into multiple files in a dedicated folder.

Part of #25005
Part of #43709

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-11 15:18:36 +00:00
Domenico Rizzo
93c9918cd5 script: Replace WebGLShader Drop implementation with a droppable substruct (#26488) (#44119)
Implementing Drop for DOM types is being forbidden. This change moves
the shader deletion logic into a separate DroppableWebGLShader struct,
allowing WebGLShader to comply with this restriction while still
ensuring GPU resources are released when the object is finalized.

Testing: Covered by existing WebGL tests.
Fixes: #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-04-11 13:30:48 +00:00
Simon Wülker
84ce5a6c14 script: Don't associate form elements with forms across shadow boundaries (#44117)
Step 4 of [`reset the form
owner`](https://html.spec.whatwg.org/multipage/#reset-the-form-owner)
says to search for matching `<form>` elements in the same tree. We were
searching in the owner document, which is not the same when the form
element is in a shadow tree.

Testing: A new test starts to pass
Part of https://github.com/servo/servo/issues/44113 (unblocks my patch
that would otherwise crash)

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-11 13:05:22 +00:00
Kelechi Ebiri
3cb97fc17b script: Move cookie_store from GlobalScope into Window (#44115)
Push GlobalScope::cookie_store down into Window

Testing: ./mach test-wpt tests/wpt/tests/cookiestore
Fixes: #44107

Signed-off-by: Kelechi Ebiri <ebiritg@gmail.com>
2026-04-11 11:27:39 +00:00
Martin Robinson
12a655d42c script: Move StyleData to Element from Node (#44074)
Many things are nodes, such as `CharacterData` and attributes. They
don't need style data at all. This saves 16 bytes on every attribute and
text node.

Testing: This should not change testable behavior (only save some
memory),
so it should be covered by existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-04-11 07:46:28 +00:00
niya
9fff951a5e storage: fix incorrect data sharing by passing document origin to storage thread (#43988)
Changes all the uses of `ServoUrl` to `ImmutableOrigin` in
`WebStorageThreadMsg`

Testing: Adds a test case as described in the issue.

```html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title></title>
</head>

<body>
  <main>
    <h1>Tab and Program crashes!</h1>
    <iframe srcdoc="
          <body>
            <p>Hello Web users! <br/> I am an iframe, <br /> I set a key and then retreive it. </p> 
            <script>
              for (let i = 0; i < 1000; i++) {
                window.localStorage.setItem('truth', 'Servo is awesome! 🌐')
                const example = window.localStorage.getItem('truth')
                
                console.log(example === 'Servo is awesome! 🌐')
              }
            </script>
          </body> 
          "></iframe>
  </main>
</body>

</html>

```

Fixes: #44001

---------

Signed-off-by: Niya Gupta <niyabits@disroot.org>
2026-04-11 07:26:24 +00:00
Euclid Ye
99c53f8cdf layout/script: Remove unused layout optimization heuristics (#44103)
`dom_count` was used to determine whether it is worth it to run layout
parallel algorithm.
Now this is based on `layout_threads` pref.

Testing: Just removing dead code.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-04-11 05:58:01 +00:00
webbeef
80e8441231 script: make all keyboard events composed (#44094)
Adjust event targeting for keyboard events when a shadow host is
involved. This is needed to not interfere with keyboard default action
like tabindex focusing.

Testing: Updated WPT tests expectations
Fixes: #43809

---------

Signed-off-by: webbeef <me@webbeef.org>
2026-04-11 01:16:05 +00:00
Martin Robinson
1444aa942b script: Make DocumentFocusHandler hold a FocusableArea (#44029)
Make Servo match the focus bits of the HTML specification a bit more by
storing a `FocusableArea` as the currently focused thing in a
`Document` instead of an optional `Element`. There is always a focused
area of a `Document`, defaulting to the viewport. This is important to
support the case of focused navigables and image maps parts in the
future.

Some focus chain debugging code has been removed as the focus chain
concept needs to be reworked to match the specification more closely.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-04-10 21:37:42 +00:00
Messi II Innocent R.
74de42f4f7 canvas: Make ImageBitmapRenderingContext render to the canvas (#43984)
I noticed that the transferFromImageBitmap() was running without errors
but the canvas stayed blank and this was becacuse of two issues:

The mark_as_dirty was empty meaning the canvas never knew it needed to
repaint
The BitmapRenderer context had no rendering pipeline as such no ImageKey
was allocated and update_rendering always returned false, so the way I
fixed it is by

1. Implemented mark_as_dirty to call self.canvas.mark_as_dirty()
2. Allocated an ImageKey for BitmapRenderer contexts
3.Implemented set_image_key and update_rendering that sends the bitmap's
pixel data to WebRender via the paint API
4, Calling mark_as_dirty after set_bitmap in TransferFromImageBitmap

Now the reason we are setting an ImageKey on the
ImageBitmaRenderingContext is because it needs one to render to the
screen and without it the canvas was always blank

Also I noticed that for some reasons I don't understand yet, the
createImageBitmap hangs or is slow to render but after loading servo on
an open tab, if I then go ahead and open another tab and paste the file
link there, the previous tab which had the bitmap image now renders
properly

Fixes: #43565

<img width="383" height="238" alt="Screenshot from 2026-04-06 13-44-28"
src="https://github.com/user-attachments/assets/4c5096ba-ee84-4e7a-a3c6-673cc12276c4"
/>
<img width="389" height="292" alt="Screenshot from 2026-04-06 15-38-55"
src="https://github.com/user-attachments/assets/43b45e60-61d8-48de-b53e-6da5ab988768"
/>

Signed-off-by: Messi002 <rostandmessi2@gmail.com>
2026-04-10 19:20:30 +00:00
Simon Wülker
0fef52f10c script: Remove layout helper traits (#44092)
Servo has lots of `LayoutXYZHelper` traits that are used to define
additional methods on `LayoutDom<XYZ>`. We can replace them with `impl
LayoutDom<XYZ>` blocks, reducing the number of LoC and making it easier
to add or modify methods.

Testing: These should be covered by existing tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-10 18:31:10 +00:00
Kelechi Ebiri
a670c7a52b script: implement missing steps for form submission (#43700)
Implement missing history handling steps for form submission 
Test: ./mach test-wpt
tests/wpt/tests/html/semantics/forms/form-submission-0
Fixes: #43670

---------

Signed-off-by: Kelechi Ebiri <ebiritg@gmail.com>
2026-04-10 18:13:46 +00:00
Narfinger
a80744cc32 script: Move more iterators to unrooted iterators (#44018)
This is another part of moving more operations safely to unrooted
iterators.
- Some uses of inclusively_*_siblings
- Some uses of children()
- Some uses of child_elements()

Testing: Compilation is the test as we only use previously made iterator
functions.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-04-10 18:03:03 +00:00
Babalola Taiwo J
3bf38ef7ea script: Fix panic in compressedTexSubImage2D when no base image exists (#44050)
Calling `compressedTexSubImage2D` without a prior `compressedTexImage2D`
for the same texture target and level caused the panic at
`tex_image_2d.rs:633` because `image_info_for_target` returned `None`
and `.unwrap()` was called on it.

Per the WebGL spec, this should generate `GL_INVALID_OPERATION` instead
of panicking. So this PR replaces the unwrap with proper error handling.
And also includes a WPT crash test that reproduces the original panic.

Fixes #43527

---------

Signed-off-by: thebabalola <t.babalolajoseph@gmail.com>
2026-04-10 17:08:55 +00:00
Taym Haddadi
daf15e8e07 IndexedDB: Implement storage-key checks for IDBFactory entry points (#44088)
Testing: idbfactory-databases-opaque-origin.html test passed.
Fixes: part of https://github.com/servo/servo/issues/40983

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-04-10 17:00:11 +00:00
Tim van der Lippe
6118b0e5e4 script: Further implement fontsize command (#44075)
Several more TODO's are now implemented:

1. We correctly restore values for fontsize now
2. We implement relevant logic in wrap_node_list
3. We implement simple modifiable
4. We clear overrides whenever the selection changes
(which is triggered for both the selection itself and
any containing  ranges).

Part of #25005

Testing: WPT

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-10 15:59:38 +00:00
Simon Wülker
80c6846dfb script: Accept names of PerformanceTiming members as marks in Performance.measure (#43990)
This change allows users to pass a mark like `"navigationStart"` to
`Performance.measure` and that will resolve to the value of
`navigationStart` on the `PerformanceTiming` interface.

Testing: New tests start to pass
Part of https://github.com/servo/servo/issues/43821 - we no longer throw
an exception in the case above.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-04-10 14:36:10 +00:00
Tim van der Lippe
c8029ea092 script: Rename CanGc::note() to CanGc::deprecated_note() (#44081)
Per the suggestion in

https://servo.zulipchat.com/#narrow/channel/263398-general/topic/PSA.3A.20avoid.20new.20usages.20of.20CanGc.20whenever.20possible/near/583995807
to mark this method as deprecated and make clear it shouldn't be used
anymore, as alternatives exist.

Part of #40600

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-04-10 06:07:52 +00:00