Commit Graph

12777 Commits

Author SHA1 Message Date
Onur Şahin
16d2a8d72b script: use &mut JSContext in DissimilarOriginWindowMethods (#42780)
Replace `crate::script_runtime::JSContext` with `js::context::JSContext`
in:
- `DissimilarOriginWindowMethods::PostMessage`
- `DissimilarOriginWindowMethods::SetOpener`
- `DissimilarOriginWindowMethods::Opener`

Testing: Builds and runs locally. WPT [test
passed](https://github.com/onsah/servo/actions/runs/22342635066)

Fixes: part of https://github.com/servo/servo/issues/42347

Signed-off-by: Onur Sahin <sahinonur2000@hotmail.com>
2026-02-24 14:43:46 +00:00
Simon Wülker
d68760964c script: Cleanup the terminology around parser/main thread in async html parser (#42792)
The variable names and comments around the code refer to the main thread
as the "tokenizer" and the parser thread as the "html tokenizer". This
confuses me every time I look at the code, because both tokenize html
and neither can do it without the other.

I've renamed things to be a bit more clear, mostly referring to things
as the "main thread" and the "parser thread".

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-24 10:49:47 +00:00
Tim van der Lippe
5853926db0 script: Move contenteditable implementation to dedicated file (#42749)
In preparation of introducing traits for some of these methods,
let's separate them from the basecommand trait. They are not
related to each other and it was making reasoning about where
lives what more difficult.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-24 09:00:43 +00:00
Steven Novaryo
ad358de589 libservo: Add allow_virtual_keyboard flag for InputMethodControl (#42467)
Following the convention of other major UAs of gating the virtual
keyboard by certain user activation, adding a flags to let the embedder
knows about the user activation. This would be used to determine whether
the virtual keyboard needs to be shown or not in android and ohos.

Testing: Manual testing.

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-02-24 07:30:49 +00:00
Gae24
ea7703c39d script: Preserve the order of entries when parsing an import map (#42754)
Unless the feature `preserve_order` is enabled, serde_json will sort the
map's entries in an alphanumerical order.
The specification instead expect the entries to be visited by the order
they are listed, a latter entry should replace a previous one when they
are resolved to the same url.

I've also removed a couple of `CanGc` introduced in #37405, unless I've
missed something there is not code that can trigger a GC.

Testing: A subtest now pass
Part of #37553

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-23 21:39:37 +00:00
webbeef
a4c5ca1070 net: Use the user locale for the Accept-Language header and navigator language (#41919)
That respects the user locale better than hardcoding en-US. This can
also be manually set with the `LANG` environment variable.

Testing: Manual testing with the devtools to check the header sent and
the value of `navigator.language`

Signed-off-by: webbeef <me@webbeef.org>
2026-02-23 13:05:21 +00:00
Narfinger
c6a5eb584a script: Do not unnecessary clone CSP list in Document::get_csp_list (#42716)
We previously clonsed the CSP list unnecessarily which consisted of
roughly 2.7%. 1.2% spend in Document::get_csp_list.
We can easily avoid it with Ref and cloning it deliberately when needed.

Testing: This is functionally identical to the previous code as it is a
change from clone to a Ref<>.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-02-23 11:49:58 +00:00
eri
92259af702 devtools: Unify pause handling for breakpoints and interrupt (#42599)
The pause debugger screen should be shown for both pausing manually
(interrupt) and hitting a breakpoint.

Reuse the logic for pausing breakpoints to pause the debugger when the
user manually clicks the pause button.

Rename the pause event to interrupt to match the language of the
DevTools client and to avoid confusion with paused frames, which can
happen on interrupt or on a breakpoint.


https://github.com/user-attachments/assets/ceb0007d-0e57-44d6-a159-55980ff8b517

Testing: New DevTools test and manual testing.
Part of: #36027

cc @atbrakhi

---------

Signed-off-by: eri <eri@igalia.com>
Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2026-02-23 09:29:59 +00:00
Taym Haddadi
6fece59b5a Indexeddb: Move IDBFactory to global scope(away from specific globals like window and worker) (#42757)
Move IDBFactory to global scope(away from specific globals like window
and worker)


Testing: no effect on WPT test.
part of https://github.com/servo/servo/issues/40983

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-02-22 23:36:44 +00:00
Kingsley Yung
91c717ccc8 script: Simplify IDL dictionary conversion in SubtleCrypto (#42655)
In `NormalizedAlgorithm::from_object_value`, we use
`dictionary_from_jsval` to convert `HandleValue` into IDL dictionary
types generated by `script_bingings`, and immediately use `From`,
`TryFrom`, `TryFromWithCx` trait implementation to convert them into
webcrypto's subtle dictionary types.

Since our webcrypto implementation doesn't directly use the dictionary
types generated by `script_bingings`, this patch combines the 2 steps of
this conversion into one step, by using `TryFromWithCx` trait
implementation for those dictionaries and moving the
`dictionary_from_jsval` calls into `try_from_with_cx`.

Testing: Refactoring. Existing tests suffice.
Fixes: Preparation for #42579

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-02-22 23:14:22 +00:00
Simon Wülker
742c8f8ef6 script: Don't crash when logging self-referential objects with devtools (#42752)
Testing: This change adds a test
Fixes https://github.com/servo/servo/issues/42742

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-22 22:21:44 +00:00
Tim van der Lippe
f8552ed214 script: Implement remaining query command methods (#42748)
This implements a baseline for these tests. By implementing these dummy
methods, we avoid a lot of test expectation clutter when debugging these
tests to figure out why they aren't passing yet.

For the delete command, since it doesn't have any state or is
indeterminate, we always return the same.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-22 21:35:51 +00:00
Taym Haddadi
1e01b04cc5 FIx Intermittent transaction-scheduling-mixed-scopes test (#42732)
Queue the "complete" event before unblocking later transactions in the
backend. This preserves event ordering for overlapping transactions
created on the same connection.
       
Fixes #42730
Fixes #42718

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-02-22 16:26:25 +00:00
Sam
43bdd3818d script: Pass &mut JSContext to more dom methods (#42751)
split from https://github.com/servo/servo/pull/42635, some dom methods
are also called from other function, which require passing down cx from
many more places :(

Testing: Just refactor, but should be covered by WPT.
Part of #42638

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-22 13:22:33 +00:00
Euclid Ye
75418e7ace script: Rectify update_active_touch_points_when_early_return (#42733)
- Use `FxHashMap` for `active_pointer_ids`
- Refactor and fix logging message for touch, especially
`update_active_touch_points_when_early_return`
- Randomly fix some typos

Testing: This changes logging message but no other observable
behaviours. The logging should be more accurate, but I didn't test.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-22 13:08:19 +00:00
Tim van der Lippe
c6c29fcd33 script: Implement focus support for contenteditable elements (#42734)
There is no specification for this, but there are relevant
WPT tests in `selection/contenteditable`. This PR implements
the required changes to make sure that when such an element
is focused (programmatically), it selects the correct node.

The implementation is therefore entirely reverse-engineered
based on existing browser behavior and commented to hopefully
make it make sense.

Part of #7492
Part of #12776
Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-22 09:26:15 +00:00
Philipp Albrecht
adee703046 Move run_a_module_script() to GlobalScope (#41459)
Prerequisite for #40365.

Moving `run_a_module_script()` to `GlobalScope` will allow us to execute
module scripts on `WorkerGlobalScope`.

---

Relates to #23308

Signed-off-by: pylbrecht <pylbrecht@mailbox.org>
2026-02-22 09:14:39 +00:00
Tim van der Lippe
e505275744 script: Implement queryCommandSupported (#42731)
This method was already present on the document, but
wasn't implemented yet. Note that now more tests are
failing, since before they weren't running. The tests
check if a command is enabled before they started
running.

The selection API doesn't yet take into account
contenteditable containers, which is why these
tests don't consider a command enabled, since the
range of the selection is empty.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-21 20:36:26 +00:00
Kingsley Yung
00a36b27b8 script: Use reflect_dom_object_with_cx in CryptoKey::new (#42738)
Use the new `reflect_dom_object_with_cx` introduced in #42725 in
`CryptoKey::new`.

Testing: Refactoring. Existing tests suffice.

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-02-21 10:57:43 +00:00
Sam
1bf985a92a script: Use reflect_dom_object_with_cx and without proto if possible (#42737)
This was left over from
https://github.com/servo/servo/pull/42725#pullrequestreview-3832117437

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-21 08:44:18 +00:00
aquaThirsty
235dd18b79 fixup: inline CanGc and use CurrentRealm in get_gatt_children (#42735)
Follow-up PR to #42720 (addressing nits by @sagudev)

Testing: It compiles without any errors
Fixes: Part of issue #42638 and PR #42720

Signed-off-by: TimurBora <timurborisov5561@gmail.com>
2026-02-21 05:24:42 +00:00
Tim van der Lippe
32936858df script: Implement canonicalize whitespace (#42704)
What I thought would be a small algorithm turns out required tons of
other implementations of various definitions, most of it around nodes.

Therefore, to keep things manageable, it only implements this algorithm
and relevant parts, but leaves the other parts of the delete command
untouched. For now, it is good if tests keep on working without
crashing. Later, once the full delete command is implemented, more tests
should be passing.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-20 18:42:50 +00:00
Martin Robinson
e7ee1171d8 script: Remove some proprietary Servo-only testing methods from Window (#42728)
These three methods date back from the very early history of Servo and
are no longer necessary:

1. `Window.debug`: `console.log` is a better replacement for this method
   now. A manual test that tests the very basics of JavaScript used
   this. This test is removed as well.
2. `Window.gc`: This can be replaced with `TestUtils.gc`, which is part
    of a W3C specification.
3. `Window.js_backtrace`: This method is moved to `ServoTestUtils`.

Testing: Tests are updated to reflect these changes.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2026-02-20 17:32:34 +00:00
Sam
f69ee078d2 script: Add reflect_dom_object_with_cx (#42725)
Just to complement existing with_proto method introduced in #42699.

Justification for arg ordering: reflect_dom_* have arguments reversed,
so first one is Box (the most important) then global, proto and lastly
cx.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-20 16:19:15 +00:00
Sam
9f1e5d084e script: Pass &mut JSContext in FetchResponseListener::process_response_eof (#42729)
`process_response_eof` is the only method that needs cx at least right
now. This PR removes one temp_cx and introduces one, removing that one
will is hard (needs VirtualMethods and a lot of work)

Testing: Just refactor
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-20 16:03:21 +00:00
Taym Haddadi
0bc3b61a74 indexeddb: propagate legacy didThrow from version-change event dispatch (#42669)
indexeddb: propagate legacy didThrow from version-change event dispatch

Testing: fire-upgradeneeded-event-exception.any.js,
upgrade-transaction-deactivation-timing.any.js are passing.

depends on https://github.com/servo/servo/pull/41508

part of https://github.com/servo/servo/issues/40983

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-02-20 15:50:46 +00:00
Luke Warlow
853fcf4fda script: Introduce ServoTestUtils and a forceLayout() function (#42714)
This introduces a new `ServoTestUtils` namespace with a `forceLayout()`
function. This `forceLayout()` function returns an object which
currently has an array of the phases ran by layout. Also moves
`panic()`, `crashHard()` and `advanceClock()` from `TestBinding` to this
new namespace.  `TestBinding` is meant to test the bindings generation,
but these are more generic helpers for Servo-only tests.

Testing: This change adds a series of Servo-only tests that verify the
behavior of the new `forceLayout()` function. Tests that rely on the
moved interfaces are updated and should continue to pass.

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2026-02-20 13:00:06 +00:00
Kingsley Yung
b6f714c73d script: Pass &mut JSContext to methods of SubtleCrypto (#42726)
This patch changes the methods of `SubtleCrypto` to use the new `&mut
JSContext` and `&mut CurrentRealm`, Those methods are `Encrypt`,
`Decrypt`, `Sign`, `Verify`, `GenerateKey`, `DeriveKey`, `DeriveBits`,
`Digest`, `ImportKey`, `ExportKey`, `WrapKey`, `UnwrapKey`,
`EncapsulateKey`, `EncapsulateBits`, `DecapsulateKey`,
`DecapsulateBits`.

The change also propagate to the all internal methods within the
`subtlecrypto` module.

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

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2026-02-20 11:18:29 +00:00
Aki
58994df9c9 script: Use decode_with_bom_removal for UTF-8 decoding in Blob, Worker, and Module (#42265)
This PR replaces decode with decode_with_bom_removal when decoding UTF-8
text in several places. Some UTF-8 files start with a BOM (Byte Order
Mark). The specification says this should be removed when decoding.
decode_with_bom_removal does this correctly, so this change makes the
behavior more spec-compliant.

Testing: The project builds successfully.
Fixes: #42239

---------

Signed-off-by: lunlunsan <210350985+lunlunsan@users.noreply.github.com>
Signed-off-by: act2510akitake <210350985+act2510akitake@users.noreply.github.com>
Signed-off-by: Aki <210350985+act2510akitake@users.noreply.github.com>
Signed-off-by: act2510akitake <210350985+act2510akitake@users.noreply.github.com.>
Co-authored-by: lunlunsan <210350985+lunlunsan@users.noreply.github.com>
Co-authored-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-20 10:47:43 +00:00
Euclid Ye
e98e4c9d30 script: Use touchstart element as event target for touchmove/touchend/touchcancel (#42654)
[Spec](https://w3c.github.io/touch-events/#dfn-touchend:~:text=screen%2E-,The,element,-%2E)
for touchmove/touchend/touchcancel:
> The target of this event must be the same Element on which the [touch
point](https://w3c.github.io/touch-events/#dfn-touch-point) started when
it was first placed on the surface, even if the [touch
point](https://w3c.github.io/touch-events/#dfn-touch-point) has since
moved outside the interactive area of the target element.

Also, previously `touchend` can be fired after `touchcancel`, which was
wrong and fixed in this PR.

Testing: Fully passes `/touch-events/multi-touch-interfaces.html` (511
subtests) and new passes in
`pointerevents\compat\pointerevent_touch_target_after_pointerdown_target_removed.tentative.html`.

We also take the chance to update `pointercancel` related tests
introduced in https://github.com/servo/servo/pull/41937: `touchcancel`
should not be followed by `touchend` according to
[spec](https://w3c.github.io/touch-events/#dfn-touchcancel).

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2026-02-20 09:42:43 +00:00
aquaThirsty
47bd830c8b script/dom/bluetooth: Move to &mut js::context::JSContext (#42720)
Move from `InRealm` to `&mut CurrentRealm` and from `CanGc` to `&mut
js::context::JSContext`

Testing: `/mach build`, `/mach test-unit` and `/mach test-tidy`
Fixes: Part of #42638

Signed-off-by: TimurBora <timurborisov5561@gmail.com>
2026-02-20 08:25:14 +00:00
shuppy
c07682f222 libservo: Allow the embedder to activate accessibility (#42336)
this patch adds a Servo::set_accessibility_active() method that
embedders can use to tell Servo to start building and sending
accessibility trees to the platform, as long as the pref is enabled
(#42333). doing so sets a global flag in the constellation, which is
then propagated to the layout of all existing and future pipelines.

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

---------

Signed-off-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Alice Boxhall <alice@igalia.com>
Co-authored-by: Alice Boxhall <alice@igalia.com>
2026-02-20 05:56:15 +00:00
Martin Robinson
042d95220a layout: Replace dirty root approach with flexible box tree layout (#42700)
Replace the old dirty root box tree layout approach with one that works
based on independent formatting contexts. Instead of just allowing a
single dirty root to be the source of box tree reconstruction, allow box
tree reconstruction to happen anywhere in the tree that can isolate box
tree damage from ancestors. This essentially combines damage propagation
and box tree construction into a single step.

There is currently one downside to this approach compared to the dirty
root approach which is that we currently cannot detect and start box
tree layout when the dirty has a compatible `display` and `position`
value. This can mean the scope of box tree layout extends further up the
tree. We will address this in a followup -- but have not noticed any
major performance implications (currently fragment tree layout is much
more expensive than box tree layout).

Benefits:
 1. Damage propagation now only happens under the dirty root.
 2. Future changes can limit the scope of damage up the tree and perhaps
    preserve the inline content size cache between box tree rebuilds.

Testing: This should not change behavior in a testable way (we currently
do
not have robust performance tests), so WPT test results should not
change.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
2026-02-19 14:31:13 +00:00
Taym Haddadi
590ae85779 Indexeddb: transaction lifecycle (#41508)
Indexeddb: transaction lifecycle

Testing: more Indexeddb test should pass
part of #40983

---------

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2026-02-19 11:05:33 +00:00
Sam
3cde83447e script: always let cx = &mut cx in codegen and support cx in Constructor (#42712)
#42681 did not actually allowed using cx in Constructor, but it did most
heavy lifting. Now we need to pass cx to Constructor call (and skip
CanGc) if cx is requested in Bindings.conf. This PR also test this on
testbindings.

Also we now always use `let cx = &mut cx`, so we can always use just cx
(compiler will automatically deref it into &cx if needed). This is
important because codegen stuff is called from many places to it make
sense/easier to just unify this.

Testing: It compiles

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-19 08:57:40 +00:00
Sam
366f34d4a3 script: Introduce reflect_dom_object_with_proto_and_cx and use it in 2d canvas (#42699)
Testing: Should be covered by WPT tests.
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-18 12:07:11 +00:00
atbrakhi
3c8c46d32f devtools: implement pause and resume in debugger (#42580)
When a breakpoint is hit, the script thread now pauses execution and
notifies devtools clients with a "paused" event. The script
thread enters a loop that processes devtools messages until
a Resume command is received.

This change does not implement manual pause

Testing: Added new test
Fixes: part of https://github.com/servo/servo/issues/36027




https://github.com/user-attachments/assets/c619db20-4579-4f77-aa60-0e43e6e7e575

Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2026-02-18 10:08:46 +00:00
Martin Robinson
8fe9c2dd49 script: Gracefully handle lack of threadpool in ElementStylesheetLoader (#42685)
If the number of layout threads is set to 1, then there sometimes is no
style thread pool. Instead of panicking in this case, we should just run
the code in question on the main thread with no thread pool. This fixes
a crash when `-y 1` is passed to servoshell.

Testing: This fixes a crash, but we currently do not run any automated
tests
with a single layout thread.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Luke Warlow <lwarlow@igalia.com>
2026-02-18 09:02:08 +00:00
Domenico Rizzo
24f2303811 script: Defers GPUComputePipeline drop to a helper struct (#42690)
Moves the drop implementation for `GPUComputePipeline` to a separate
`DroppableGPUComputePipeline` struct.

Removes `allowDropImpl` from the bindings configuration.

Testing: No tests added because of webgpu tests existent coverage
Fixes: Partially #26488

Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
2026-02-18 04:22:50 +00:00
aquaThirsty
87ff2021a2 script: Turn scrollParent into a function and change wpt tests (#42689)
Turn `scrollParent` into a function as the CSSWG resolved in
https://github.com/w3c/csswg-drafts/issues/12731#issuecomment-3885728833

Testing: updating wpt tests
`tests/wpt/tests/css/cssom-view/scrollParent.html` and
`tests/wpt/tests/css/cssom-view/scrollParent-shadow-tree.html`
Fixes: #42547

Signed-off-by: TimurBora <timurborisov5561@gmail.com>
2026-02-17 21:21:12 +00:00
Narfinger
45eb43c1a7 canvas: Change canvas to use JSContext instead of CanGc (#42662)
This changes the methods in dom/canvas to use the new JSContext/&mut
JSContext instead of CanGc.

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

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

Testing: This is a refactor, hence, compilation is the test.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2026-02-17 16:12:01 +00:00
Gae24
e2e93a214a script: remove unused code inside globalscope.rs (#42686)
- `resolved_module_set_mut()` was replaced by
`add_module_to_resolved_module_set`
- `send_to_constellation()`, all code use
`script_to_constellation_chan()` and optionally handle errors
- `from_object_maybe_wrapped` one usage was removed in #36966, not clear
if that was the only one or more were removed later on

Testing: A successful build is enough
Part of #40882

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-17 16:08:54 +00:00
Gae24
09bb43ed8d script: check if resolved module specifier starts with the specifier of the imported maps (#42668)
After debugging some of the failing tests, it appears spec text is
wrong.
Inside [merge existing and new import
maps](https://html.spec.whatwg.org/multipage/#merge-existing-and-new-import-maps)
algorithm, when checking which imports needs to be ignored,
specification will check if each _specifier_ of _newImportMap's imports_
will override any specifier of [resolved module
set](https://html.spec.whatwg.org/multipage/#resolved-module-set), by
checking if specifier starts with `record.specifier`.

Since each specifier gets normalized before they are inserted in the
resolved module set, the are cases where the check fails and we end up
overriding a module resolution.

This was an oversight, since for _newImportMap's scopes_ specification
performs the right check:
`specifierKey is a code unit prefix of record's specifier;`

Testing: More tests are now passing
Part of #37553

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-17 14:07:03 +00:00
Gae24
8a3738dc43 script: pass down &mut JSContext in post_connection_steps (#42679)
Pass down `&mut JSContext` in `post_connection_steps` 

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

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2026-02-17 13:20:52 +00:00
Tim van der Lippe
92e2d00083 script: Implement check for supported and enabled commands (#42634)
The first step of `execCommand` commands is to figure out
if they are supported and enabled. Therefore, implement
these two pieces with only 1 command: delete.

The implementation of `delete` is currently mostly dummy,
to have at least something going. But the main part of
this change is to setup the infrastructure to figure out
when commands are supported and enabled.

For the first part, its simply the list of commands we
currently have implemented, which is only delete.

For the second part, we need to consider the active range
of the current selection and do various checks, as well as
check the presence of `contenteditable`.

Part of #25005

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-17 13:19:41 +00:00
Sam
f623081537 script: Pass &mut JSContext to Constructor and Wrap (#42681)
Testing: Just refactor, but should be covered by WPT
Part of #40600

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-17 13:15:24 +00:00
Simon Wülker
a60f9370c7 devtools: Apply attribute modifications in the inspector to the DOM tree (#42601)
The inspector view allows modifying the attributes of DOM elements.
However, we lie to the devtools client: While it looks like the
attributes change, the changes are never actually applied to the DOM.

This change fixes that, and also makes it so attribute modifications
from non-inspector sources are shown in the inspector.

Testing: This change adds two tests

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2026-02-17 13:05:41 +00:00
Tim van der Lippe
e413d45982 script: Move ImportScripts to &mut JSContext (#42665)
Part of #42638

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-17 05:37:59 +00:00
Tim van der Lippe
3665659dbe script: Move attribute-related methods to &mut JSContext (#42667)
Part of #42638

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2026-02-17 05:36:38 +00:00
Sam
97990a2615 webgl: correctly handle corner case of active texture (the one at MAX_COMBINED_TEXTURE_IMAGE_UNITS) (#42660)
#42639 was actually the real issue, just solved less ideally. Instead of
doing negative checks, which are easy to go wrong like before, we know
do positive check which is more clear IMO. Because counting of units is
0-based, we need to not include upper limit.

WebGL spec is a mess, so I will rather link this MDN:
https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/activeTexture#exceptions

Testing: Added test to WebGL CTS:
https://github.com/KhronosGroup/WebGL/pull/3757, live at:
https://sagudev.github.io/WebGL/sdk/tests/conformance/textures/misc/texture-active-bind.html
Fixes: #42639

Co-authored-by: Weixie Cui <cuiweixie@gmail.com>

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2026-02-16 18:58:39 +00:00