Commit Graph

12897 Commits

Author SHA1 Message Date
Tim van der Lippe
af256bd6e5 script: Check for render-blocking documents before continuing (#43150)
The spec expects us to check for render blocking (among some other
state) before we start procesing a document. Therefore, add those checks
and also check in the
stylesheet loader that we should only do so when we are allowed to do
so.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-03-13 09:54:03 +00:00
Martin Robinson
5fec1395c9 prefs: Move Opts::print_pwm to DiagnosticsLogging::progressive_web_metrics (#43209)
This option controls whether progressive web metrics are printed to the
system console, which is essentially the purpose of
`DiagnosticsLogging`. This makes the API a bit more uniform.

Testing: We do not really have automated testing for this kind of
feature of the API.
Fixes: This is part of #34967.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-13 09:45:39 +00:00
Domenico Rizzo
b2ac181091 script: Move GPUSampler drop logic to a helper struct (#43222)
Implementing `Drop` for DOM types is being forbidden. This moves the
resource cleanup logic for `GPUSampler` to a separate
`DroppableGPUSampler` struct and removes the `allowDropImpl` flag from
the bindings configuration.

Testing: WebGpu tests just cover its cases
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-03-13 05:36:23 +00:00
Euclid Ye
97225f5537 script: Free memory earlier in hot path of input handling (#43226)
This is a hot path. This way we free the unused memory earlier.
Didn't realize the difference in #43202.

Testing: This is a memory optimization that does not change visible
behaviour.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-13 04:33:15 +00:00
Uiniel
0f5e02099b script: Move BlobMethods to &mut JSContext (#43215)
Move from CanGc to &mut js::context:JSContext. `ArrayBuffer` and `Bytes`
require many changes in `dom/stream` for which I'm going to create a
seperate pull request before porting the two methods.

Testing: Just a refactor, `./mach test-unit` still passes.
Fixes: Part of #42638

---------

Signed-off-by: Uiniel <174327181+uiniel@users.noreply.github.com>
2026-03-12 21:58:56 +00:00
Simon Wülker
020c651f21 script: Mark canvas as dirty after updating image data (#43218)
This makes https://theintraclinic.com/archive/minecraft4k-js/ work
correctly in servo.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-12 20:04:21 +00:00
Martin Robinson
c80bdd9c92 prefs: Remove Opts::nonincremental_layout (#43207)
This setting is used to control whether or not incremental legacy layout
was enabled. Nowadays incremental layout is always enabled as it is a
fundamental feature of how layout works. The setting also controls
whether or not nodes are traversed in Style, but that's also something
that's much less interesting today. This change just removes this
setting as it just controls the Stylo setting. A corresponding change in
Stylo will also remove the setting there.

Testing: This just removes a setting so existing tests should suffice.
Fixes: This is part of #34967.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-12 16:03:43 +00:00
Simon Wülker
c0ff7c1fc9 Everywhere: Remove instances of clippy::redundant-clone (#43212)
This change fixes all instances where
[`clippy::redundant-clone`](https://rust-lang.github.io/rust-clippy/master/index.html?groups=complexity%2Ccorrectness%2Cnursery%2Csuspicious&levels=allow#redundant_clone)
would trigger. It's allowed by default

I've also changed the lint to warn-by-default for servo.

Testing: Covered by WPT

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-12 13:28:21 +00:00
Bruno Nicoletti
3a680c5389 script: Use the shared task canceller in DedicatedWorkerGlobalScope::run_worker_scope (#43213)
Replaces the default task canceler with the shared task canceler found
in the global scope.

Testing: #42536 specifies that building is enough.
Fixes: #42536

Signed-off-by: Bruno Nicoletti <1868608+bruno-j-nicoletti@users.noreply.github.com>
2026-03-12 13:20:00 +00:00
eri
f53a259216 devtools: Handle getEnvironment message (#43167)
Initial work to support scopes in the debugger. They don't show at the
moment since we are not processing variables yet. Depends on #43166.

Testing: Ran `mach test-devtools` and manual testing.
Part of: #36027

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-03-12 13:13:03 +00:00
Euclid Ye
e88c5dd752 script: Notify embedder coalesced events to resolve potential WebDriver deadlock (#43202)
Notify embedder the coalesced wheel/mousemove event.

We also stop cloning every single entry in `pending_input_event`.

Testing: This should unblock the potential WebDriver thread deadlock
when receiving simultaneous wheel or pointer inputs from multiple
sources.
We added a new test that stably deadlock on
74c16ffd8a.
Firefox/Safari/Chrome all pass the new test.
Fixes:
https://github.com/servo/servo/issues/43136#issuecomment-4031702204

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-12 12:40:04 +00:00
Luke Warlow
a27bd9dde7 prefs: Remove dom_command_invokers_enabled (#43190)
Remove command invokers preference

This now passes most of the relevant tests. Most of the remaining
failures are due to missing functionality such as the popover API,
element reflection properties (see
https://github.com/servo/servo/issues/42884), and issues with the event
retargeting code that doesn't handle shadow dom correctly.

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-03-12 06:03:26 +00:00
Simon Wülker
333e195845 script: Log uncaught JS exceptions to the console (#43191)
The script execution code has changed a bit in the last months so some
things that used to work don't anymore.

This change ensures that when an exception is thrown it is logged to the
console.

Testing: Regressions are covered by wpt, but we can't run tests for the
presence of `log::error!` calls

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-11 21:40:54 +00:00
Luke Warlow
e752359bbd script: Account for multiple in <input type=file> text (#43186)
File input button and description text now accounts for multiple file
support.

Testing: Manual test via https://demo.lukewarlow.dev/css-forms.html

<img width="214" height="131" alt="image"
src="https://github.com/user-attachments/assets/4894bca6-2d56-4d48-ac10-96f23fd70f2c"
/>

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-03-11 19:03:51 +00:00
Martin Robinson
4659dacf64 script: Simplify the KeyboardEvent constructor (#43187)
Simplify the `KeyboardEvent` constructor by taking the actual
`keyboard_types` `KeyboardEvetnt` as an argument. This means that we do
not have to repeat the logic for extracting all the data from the
platform event.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-11 19:01:52 +00:00
Tim van der Lippe
aae5c4cd97 script: Move Trusted Types interfaces to script/dom/trustedtypes (#43181)
Part of #38901 

Testing: it compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-03-11 16:26:56 +00:00
Simon Wülker
c84edc0403 script: Fire an error event when event handler fails to compile (#43178)
For the longest time we've had a `dispatch_event` boolean flag in our
error reporting code that determines whether or not to fire an `error`
event. It was only set to `false` in the event handler code due to a
double borrow that would occur otherwise. It seems that this is no
longer a problem, so we can remove the flag and correctly fire the event
in that case too.

Testing: A new test starts to pass and
`html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html`
does not crash
Fixes: https://github.com/servo/servo/issues/13152

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-11 15:52:38 +00:00
eri
948859b2fe devtools: Allow registering environment actor from debugger.js (#43166)
This functionality will be used in a follow up patch to implement the
getEnvironment message.

Testing: Check `mach test-devtools` and manual test
Part of: #36027

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-03-11 15:45:35 +00:00
Luke Warlow
307ee6a1c5 layout: Paint the <select> chevon using an SVG (#43175)
Previously there were two issues:

1. The select chevron had a 4px margin which should have just applied to
the inline axis.
2. The chevron character had odd font metrics, so even once the margin
is fixed the select is still too tall.

This is fixed by using an SVG as a background-image instead of using the
▾ character.

Testing: Tested with https://demo.lukewarlow.dev/css-forms.html (and the
test case added in https://github.com/servo/servo/pull/42085).

| Before | After |
| ------|------|
| <img width="522" height="267" alt="image"
src="https://github.com/user-attachments/assets/7cc2d840-3384-4a6c-8945-0277cfb4096d"
/> | <img width="509" height="250" alt="image"
src="https://github.com/user-attachments/assets/99742dca-3ce6-4964-98bd-0cdbf3e14937"
/> |

---------

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-03-11 13:56:32 +00:00
Euclid Ye
0153f2ff0a embedder_traits: Upgrade InputEventHandled to InputEventsHandled to batch IPC response (#43169)
We send back input events handling results in batch. This reduces IPC,
and make the following **TODO** possible in a follow-up.

Testing: I hope existing tests results won't change.
Part of
https://github.com/servo/servo/issues/43136#issuecomment-4031915873
**TODO**: We have not done 
> collect ids and send back a reply for each of them once the coalesced
event has been handled.

yet.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-11 10:14:25 +00:00
Tim van der Lippe
c1c5e9373c script: Complete basic implementation of delete command (#43082)
While we are not there yet, this is the majority of the implementation
of the delete command.

What's missing:
1. Handling of style attributes (most of the test failures)
2. Handling of lists

Since these are quite complicated on their own, deferring that to their
own PR.

Also added more assertions regarding parent nodes, which should always
exist in the spec. By adding those, discovered that the logic for
`is_visible` was wrong where its display value wasn't checked for
`"none"`.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-03-11 06:06:51 +00:00
Martin Robinson
f6aa72146d script: Correct equality check when detecting whether element has access key assigned (#43144)
The equality check used to detect whether an element has an access key
assigned was reversed. This meant that access keys did not work on
non-form control elements. This change fixes the equality sign and adds
a test for this behavior.

Testing: A new Servo-specific test is added. Access key behavior
activation
behavior is very lightly specified so the way we deal with it is
Servo-specific at the moment.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-11 01:19:29 +00:00
Oriol Brufau
517262fb34 deps: Bump Stylo to "Share Device logic among Gecko and Servo" (#43146)
Stylo PR: https://github.com/servo/stylo/pull/330

Testing: Not needed, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-03-10 21:08:29 +00:00
Simon Wülker
2697f3a91a script: Accurately measure timing of DOMContentLoaded event (#43151)
We should measure the time it takes to fire the `DOMContentLoaded`
event, but we were including the time it takes for the task on the
relevant task source to be run.

Testing: The timing should be slightly more accurate but that is hard to
measure or test for. Therefore this PR does not include a test.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-10 20:58:10 +00:00
Gae24
4ef22ed227 script: Pass &mut JSContext to VirtualMethods::cloning_steps and Node::clone (#43130)
Continuation of #43108, two new `temp_cx()` calls were required:
- inside `maybe_clone_an_option_into_selectedcontent` since it's part of
a markup5ever trait
- inside `serialize_and_cache_subtree` replacing a `CanGc::note()` call,
propagating it inside reflow code will require even more effort.

Testing: No behaviour change, a successful build is enough.
Part of #40600

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-03-10 17:05:34 +00:00
Gae24
bc1cd2ceeb script: bump mozjs to use SpiderMonkey 140.8 and set more compile options (#43020)
Set `mutedErrors_`, `noScriptRval`, `isRunOnce` compile options.

Testing: A test now passes
Part of #38378

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-03-10 17:02:19 +00:00
Simon Wülker
c37ae57a0d script: Only send objects with ESClass::Object to devtools (#43133)
We should only send previews of ordinary objects[^1] (i think that's the
correct term) objects to the devtools. The code is not designed to
handle other objects, which currently causes crashes.

Testing: This change adds a devtools test that crashes without this
change.

[^1]: https://tc39.es/ecma262/#ordinary-object

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-03-10 15:19:03 +00:00
Euclid Ye
67e54cc61d script: Replace the InputEventId of existing_constellation_wheel_event when coalescing wheel events (#43138)
Basically, any testdriver tests with scroll duration 
more than `16ms` can be intermittent due to this.

Fixes: #43136
Fixes: #43110
Testing: This fixes the issue where newly added test 
in #43126 randomly TIMEOUT with very high probability: 
https://github.com/servo/servo/actions/runs/22906496902

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-10 14:41:58 +00:00
Taym Haddadi
877502e86f WebCryptoAPI: implement Ed25519 and split Handle::Ed25519 into Ed25519PrivateKey and Ed25519PublicKey (#43115)
Testing: Ed25519 test passed.
Fixes: Part of https://github.com/servo/servo/issues/43072

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-03-09 17:51:52 +00:00
Luke Warlow
62e72b027f script: Implement node.moveBefore() (#41238)
Implement node.moveBefore()

This implements the atomic move method for DOM nodes. This allows moving
elements within the DOM without running the full remove and insertion
steps, allowing more seamless behaviour such as CSS transitions
continuing from where they are rather than restarting.

Spec: https://dom.spec.whatwg.org/#dom-parentnode-movebefore

Testing: Existing WPTs

---------

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2026-03-09 16:39:56 +00:00
Narfinger
9062952bf9 script: Add UnrootedSimpleNodeIterator (#42978)
In the same vein as https://github.com/servo/servo/pull/42781 we
implement a UnrootedSimpleNodeIterator that takes a no_gc and does not
root the required nodes.

We include an example usage in 'dom/text.rs' WholeText.

This requires https://github.com/servo/servo/pull/42781 to be merged
first.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-03-09 12:28:07 +00:00
Kingsley Yung
c3060385bc script: Implement "getPublicKey" operations of ECDSA and ECDH (#43106)
Implement "getPublicKey" operations of ECDSA and ECDH. The steps are
implemented at the new submodule `ec_common` shared by ECDSA and ECDH.

To make the operations functioning, they are also registered at
`GetPublicKeyAlgorithm`.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-getPublicKey
Testing: Pass WPT tests that were expected to fail.
Fixes: Part of #43072

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-03-09 12:01:27 +00:00
Gae24
fa86bbedbe script: Pass &mut JSContext to DOM apis that call Element::create (#43108)
Testing: No behaviour change, a successful build is enough.
Part of #40600

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-03-09 10:07:13 +00:00
Shubham Gupta
c32d9f51af script: Add missing steps for parsing a legacy font size (#43103)
In this change clamps legacy font size value of the `<font>` element to
the range [1,7] according to steps 10, 11 of
[rules-for-parsing-a-legacy-font-size](https://html.spec.whatwg.org/multipage/rendering.html#rules-for-parsing-a-legacy-font-size).

Testing: This causes a WPT test to start passing.

---------

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
2026-03-09 09:40:54 +00:00
Zain
2cc8ae3897 script: Add error messages in HTMLDialogElement (#43101)
Adds specific InvalidStateError messages in HTMLDialogElement for
`show()` and `showModal()` error paths.

A fix part of #40756.

---------

Signed-off-by: xzaisk <zkhalid99v@gmail.com>
Signed-off-by: Zain <39714482+xZaisk@users.noreply.github.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-03-09 06:47:32 +00:00
Steven Novaryo
ab83e6e448 layout: Make ::placeholder public and add property restriction for ::placeholder and ::marker (#43053)
Servo side of https://github.com/servo/stylo/pull/322.

Update the WPT expectation following the changes to make `::placeholder`
public and adding property restriction to `::placeholder` and
`::marker`. Additionally ensure that `getComputedStyle` works for
`::placeholder`.

Testing: Existing WPTs
Fixes: #43034 
Fixes: #43035 
Fixes: #19808

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2026-03-08 23:22:36 +00:00
Oriol Brufau
a2ca667041 script,layout: Use Stylo's logic for registering custom properties from script (#43085)
Stylo PR: https://github.com/servo/stylo/pull/325

Testing: Not needed, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-03-08 22:06:19 +00:00
Kingsley Yung
d472788f10 script: Implement "getPublicKey" operations of RSA algorithms (#43093)
Implement "getPublicKey" operations of RSASSA-PKCS1-v1_5, RSA-PSS and
RSA-OAEP. The steps are implemented at `rsa_common.rs` shared by the
three RSA algorithms.

To make the operations functioning, they are also registered at
`GetPublicKeyAlgorithm`.

Specification:
https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-getPublicKey
Testing: Pass WPT tests that were expected to fail.
Fixes: Part of #43072

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-03-08 17:36:02 +00:00
Martin Robinson
e725fdbfdf script_bindings: Eliminate DOMString::from_string (#43089)
This method is the same as `DOMString::from` with a `String` argument
and `From` and `Into` are preferred when writing modern Rust.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-08 11:46:42 +00:00
webbeef
cea658e2c0 script: Coalesce wheel input events (#43074)
This follows the same principle used for mouse move events, but we have
to update the event parameters since we receive the delta from the
previous event.

Testing: Load
https://docs.rs/iced-x86/1.21.0/iced_x86/code_asm/struct.CodeAssembler.html
and try to scroll with the trackpad with and without this patch.
Fixes: Partial fix for https://github.com/servo/servo/discussions/43062

---------

Signed-off-by: webbeef <me@webbeef.org>
2026-03-07 16:56:13 +00:00
Kingsley Yung
1c449ed53b script: Implement SubtleCrypto.getPublicKey method with X25519 support (#43073)
Implement the `getPublicKey` method of the `SubtleCrypto` interface.

This patch includes:

- Implementing the steps of the `getPublicKey` method.
- Adding the new "getPublicKey" operation to the internal object
`supportedAlgorithms`, for registering cryptographic algorithms that
support "getPublicKey" operation, and used by the `getPublicKey` method
to check whether the cryptographic algorithm supports "getPublicKey"
operation and perform the operation if it is supported.
- Implementing the "getPublicKey" operation of X25519 for demonstrating
and testing the functionality of the `getPublicKey` method.

Specification:
<https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-getPublicKey>
Testing: Pass WPT tests that were expected to fail.
Fixes: Part of #43072

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-03-07 09:13:40 +00:00
Domenico Rizzo
229d89042f script: Refactor GPURenderPipeline's drop implementation (#43071)
Moves the `Drop` logic for `GPURenderPipeline` into a dedicated helper
struct, `DroppableGPURenderPipeline`.
The associated `Bindings.conf` entry is
removed as direct `Drop` is no longer needed for this type.

Testing: WebGpu tests just cover its cases
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-03-07 06:53:15 +00:00
Jacob Adam W.
d6fdd30c19 script: Implement HTMLSelectElement.selectedOptions (#43017)
This introduces a `CollectionSource` trait as an alternative to
`CollectionFilter` in `HTMLCollection`, allowing collections to provide
elements directly via a custom iterator rather than filtering a full
subtree traversal, which would otherwise be rather inefficient for
smaller iterable sequences of options that can be determined without
traversing the whole subtree again.

The newly implemented `selectedOptions` attribute on the `<select>`
element uses this to iterate only the element's list of options that are
marked as selected.

Testing: 14 assertions in the existing WPT went from failing to passing.

Fixes #15522.

---------

Signed-off-by: Jacob Adam <software@jacobadam.net>
2026-03-07 06:16:33 +00:00
Oriol Brufau
42d228dcc7 Upgrade Stylo to 2026-03-01 (#43045)
This continues  #42361

Changelog:
- Upstream:
7cd2a178d3...74ddab4091
- Servo fixups:
a5eabbdfc2...ecf17b5425

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

In particular, this includes some performance optimizations, improves
`attr()`, and adds support for `none` keywords in `clamp()`.

Testing: Some WPT tests pass.

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2026-03-06 23:39:55 +00:00
Martin Robinson
401d327b96 script: Clean up attribute access a little bit in Element (#43064)
- Use modern Rust conveniences such as `unwrap_or_default`
 - Unabbreviate `attr`
- Unify the lowercase ASCII name assertion and make it a debug assertion
 - Use `unreachable!` instead of panic
- Expose two attribute getters that follow the behavior of two
specification concepts and what we expect internally in Servo:
- One that takes a namespace, but does not require lowercase attribute
names. ([specification
concept](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace>))
- One that does not take a namespace, but does require lowercase
attribute names. ([specification
concept](https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name))
Testing: This should not really change behavior so should be covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-06 20:02:37 +00:00
Martin Robinson
291e9e57cb script: Readily accept all event names as Atoms (#43066)
Accepting the name of the event as a `DOMString` means that when events
are constructed from within Servo (for instance via input event
handling), the static strings are converted to an owned `String`
wrapped in a `DOMString` and then finally converted to an `Atom` in
`Event`. This makes it so that all non-generated `Event` constructors
accept `Atom`, which can avoid a conversion entirely when the atom
already exists on the Stylo atoms list and eliminate one in-memory copy
in the case that it isn't on the atom list.

Eventually, all event names can be on the atom list and we can eliminate
all copies. This is a tiny optimization, but also makes the code much
friendlier everywhere.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-06 19:25:33 +00:00
Martin Robinson
df3e895e1b script: Allow focusing boxes with overflow with the keyboard (#43067)
This change makes it possible to focus boxes with overflow via the
keyboard. These boxes should be focusable areas, yet are not focusable
via the mouse. Instead they can be focused via sequential tab
navigation.

Testing: This fixes a WPT test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2026-03-06 19:22:45 +00:00
Tim van der Lippe
160e458a51 script: Implement miscellaneous commands related to delete (#43028)
These two commands are intertwined with the delete command. By
implementing them now, it becomes easier to triage actual
implementation issues in the delete command.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-03-06 19:02:14 +00:00
Tim van der Lippe
c8c213650b script: Append CSP policies from meta elements (#43063)
Rather than overwriting the CSP list from a fetch header response, we
should add a policy from a meta element to the global CSP list (if it
exists).

Fixes #36822
Supersedes and closes #36828

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Co-authored-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
2026-03-06 15:53:27 +00:00
Martin Robinson
e2f6852a45 script: Align focusable area logic to be closer to the specification (#43058)
This abstracts out a common helper to determine focusable area kind
which is used by `Element::is_click_focusable`,
`Element::is_sequentially_focusable`, and `Element::is_focusable_area`.
This avoid having the latter depend on the former two, which was the
reverse of what the specification said. The helper is necessary because
the specification defines click and sequential focusability as subsets
of focusable elements, but going from "This is a focusable element" to
determining what kind of focusable element something is requires
duplicating a lot of the logic that was used to determine that something
is a focusable area.

It's likely that the specification needs more work here to improve the
definition (and indeed to unify all of the places that talk about what
elements are focusable areas). For now, this just tries to make our code
more similar to the text.

See: whatwg/html#4607
Testing: This shouldn't change behavior, so should be tested by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-03-06 14:53:36 +00:00