Commit graph

29393 commits

Author SHA1 Message Date
Tim van der Lippe
3ef3ba9378
Add spec steps and comments for fetch abort steps (#39283)
While trying to figure out what the status of this implementation was, I
added steps and comments to
see what we are missing. Also updated some links,
since I couldn't find an implementation of
`window.fetch`, since the spec URL was pointing
to the chapter instead of the algorithm.

Part of #34866

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-13 18:34:14 +00:00
Tim van der Lippe
2f252c9b78
Remove the dom_trusted_types_enabled preference (#39281)
Everything related to Trusted Types has been implemented. Failing WPT
tests are related to other features such as SVG scripts.

Fixes #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-13 09:57:15 +00:00
Oriol Brufau
c11670b067
layout: Take text-indent into account in min/max-content inline sizes (#39230)
The min-content and max-content inline sizes of an inline formatting
contentext need to take `text-indent` into account. Note it can be set
to a negative amount, so the `ContentSizesComputation` logic needs some
tweaks to handle it well.

Testing: Fixes various WPT tests

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-13 06:20:39 +00:00
Tim van der Lippe
d1c3e5f58f
Add trusted type checks for eval arguments (#39263)
Also bumps mozjs to the latest version that has support for
`GStackVector` which is what this callback uses.

Part of #36258

Fixes #38877

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-12 19:08:26 +00:00
Narfinger
033da09800
Move signals_slots to ScriptMutationObservers (#39275)
Both places where we access signals_slots already have a reference to
ScriptMutationObserver. This saves us another access to
with_script_thread.


Testing: This does not change functionality.
Fixes: Part of addressing: https://github.com/servo/servo/issues/37969

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-12 18:43:59 +00:00
Kingsley Yung
250c4cda00
indexeddb: Implement openCursor and openKeyCursor for object store (#39080)
Continue on implementing indexeddb's cursor.

This patch focuses on implementing the `openCursor` [1] and
`openKeyCursor` [2] methods of the `IDBObjectStore` interface, which
create and initialize cursors by running the iterate-a-cursor algorithm
[3].

It also adds struct `IndexedDBRecord` to
`components/shared/net/indexeddb_thread.rs`. This struct can later be
used to implement the new `IDBRecord` interface [4].

[1] https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor
[2] https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor
[3] https://www.w3.org/TR/IndexedDB-2/#iterate-a-cursor
[4] https://w3c.github.io/IndexedDB/#record-interface

Testing: Pass WPT tests that were expected to fail.
Fixes: Part of #38111

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-09-12 16:54:07 +00:00
Euclid Ye
1f63116bdd
webdriver: Add ScrollBehavior::Instant for scroll_into_view (#39265)
There is a recent spec change which adds instant as default scroll
behaviour: https://github.com/w3c/webdriver/pull/1924. This PR reflects
the change.

Testing: No behaviour change as `ScrollBehavior` is ignored right now.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-09-12 15:49:40 +00:00
Kingsley Yung
a4c6108cbe
script: Check if IndexedDB key path is ECMAScript identifier name (#39255)
From IndexedDB spec, when we check whether a key path is valid, we have
to check whether it is an ECMAScript identifier name. We have not yet
implemented this logic, and always return true.

This patch uses the function `js::rust::wrappers::JS_IsIdentifier` to
achieve this checking.

Testing: Pass WPT tests that were expected to fail.
Fixes: #25324

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-09-12 15:02:28 +00:00
Rodion Borovyk
4aabc67e57
constellation: Use one image cache thread pool in the single-process mode (#38783)
Previously, each ScriptThread was creating a new image cache with a
separate thread pool. These changes add an image cache to the
constellation and create new image caches by calling the
`create_new_image_cache` method. It reuses the original image cache's
thread pool and reduces the number of spawned threads in the
single-process mode.

Testing: Tested manually, using `ps -M` to see the number of spawned
threads with multiple tabs open in servoshell before and after these
changes.
Fixes: #37770

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-09-12 12:35:26 +00:00
Andrei Volykhin
965e87d006
html: Ignore a parse error on 'srcset' attribute parsing (#39260)
Parsing the 'srcset' attribute of an image element may result in a parse
error
indicating a non-fatal mismatch between the input and the requirements.
https://html.spec.whatwg.org/multipage/#concept-microsyntax-parse-error
https://html.spec.whatwg.org/multipage/#parse-a-srcset-attribute

This error should not be a reason to stop parsing and may be used by the
user agent to signal a syntax error.

Other browsers generally ignore this error, and we do the same.

Testing: Improvements in the following tests
-
html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-09-12 06:45:01 +00:00
Kenzie Raditya Tirtarahardja
097a69169a
webdriver: Support "scroll into view" for commands (#38508)
Implement scroll into view steps for all WebDriver command that requires
it (element click, element send keys, element clear, and take element
screenshot).

Testing: `element_send_keys/scroll_into_view.py`,
`element_click/scroll_into_view.py`, `element_clear/clear.py`

---------

Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
2025-09-12 06:07:58 +00:00
Oriol Brufau
9e9bd80bba
layout: Add style to ConstraintSpace and IndefiniteContainingBlock (#39229)
They only had the writing mode, now they will have the entire computed
style.
This is needed for #39230.

Testing: Not needed, no behavior change

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-11 21:53:14 +00:00
Shubham Gupta
dfdcba88d4
fixup: Enable viewport <meta> tag support for mobile platforms only (#39207)
1. Adds a pref viewport_meta_enabled.
2. Enable pref for mobile platforms.

Testing: Tested Manually
Fixes: #39157
Fixes: #39002

---------

Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
2025-09-11 17:21:04 +00:00
Ashwin Naren
96592dce44
Invalid return type for key conversion (#39252)
`convert_value_to_key` returns a `ConversionResult` now, so keys can be
considered "Invalid" rather than throwing an exception.

Testing: WPT
Unblocks: #38288

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-11 12:48:18 +00:00
Narfinger
19f70dccf6
Combine some access to the thread local variable for script thread. (#38752)
This combines some access to the thread local variable for script
thread.

- We introduce a new UserInteractingScriptGuard which on drop handles
  the resetting of was_interacting to the previous value. Sometimes
throughout the code `ScriptThread::is_user_interacting` was reset to the
previous value while sometimes just set to false. This should
remove this footgun.
- This also reduces the amount of thread local access for
MutationObservers and task queue.

Testing: WPT tests should cover this.
Fixes: This addresses part of
https://github.com/servo/servo/issues/37969 but there is probably still
stuff to be done.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-09-11 09:40:32 +00:00
Kingsley Yung
5de041e6ef
script: Unwrap imported key in JWK format after normalizing (#39234)
In our current implementation, the `importKey` method and `unwrapKey`
method of `SubtleCrypto` interface unwrap JsonWebKey before running the
normalized algorithms. Therefore, all cryptography algorithms share the
same unwrapping mechanism. Our current unwrapping mechanism is not
compatible with some cryptography algorithms, which we have not yet
implemented such as Ed25519.

Following the WebCrypto API spec, this patch moves the JsonWebKey
unwrapping mechanism to normalized algorithms so that each cryptography
algorithm can unwrap JsonWebKey in its own way.

This does not introduce behavioral changes, but makes implementing the
unwrap operation for new cryptography algorithms easier in the future.

Remark: Step 8 and 13 of `SubtleCrypto::ImportKey` require the crypto
task source in the script task manager, but we don't have it yet. So,
they're marked as TODO.

Testing: Existing tests should suffice.

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-09-11 09:38:21 +00:00
Ashwin Naren
97690b1cba
script: Ensure autoincrement and keypath are passed in correctly from IDBTransaction (#38738)
Previously, the correct autoincremented and keypath parameters were only
being passed if the object store is being created. This PR queries this
info from the backend and passes it onto the constructor in
IDBTransaction. Furthermore it exposes keypath and index_names from
IDBObjectStore, mainly for WPT.

Testing: WPT
Fixes: None

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-11 09:13:15 +00:00
Simon Wülker
3b294d0856
net: Add spec comments to "cors_preflight_fetch" (#39246)
I added these comments while debugging `cors/request-headers.htm`.
Ultimately the bug turned out to be outside of servo, so we have to wait
for https://github.com/hyperium/headers/pull/219.
Since that PR might take a while to merge I'd like to add these on their
own.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-11 01:31:51 +00:00
Simon Wülker
93ad2cf62a
script: Set validation anchor to target element in ElementInternals::SetValidity when anchor is not given (#39247)
Testing: Covered by existing web platform tests

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-11 01:26:09 +00:00
webbeef
bc496b08e7
Enable the zstd decoder (#36530)
Uses the `zstd` support from `async-compression` to support zstd
Content-Encoding.

Testing: Covered by wpt tests.

Signed-off-by: webbeef <me@webbeef.org>
2025-09-10 14:58:45 +00:00
Narfinger
84465e7768
Removed FnvHash and transformed the rest to FxHashmap (#39233)
This should be the final PR for the Hash Function series that is
trivial.

Of note: I decided to transform `HashMapTracedValues<Atom,..>` to use
FxBuildHasher. This is likely not going to improve performance as Atom's
already have a unique u32 that is used as the Hash but it safes a few
bytes for the RandomState that is normally in the HashMap.

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

Testing: Hash function changes should not change functionality, we
slightly decrease the size and unit tests still work.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-10 13:34:54 +00:00
Euclid Ye
726b456120
webdriver: Focus WebView asynchronously (#39241)
#38160 added a webdriver-specific API to support waiting on focus
operations to complete. Later, #38243 added a unique id to track each
focus operation.

Back then we wait on focusing webview in webdriver hoping to improve
stability, but it does not matter as it turns out later. #39086 also
focuses browsing context asynchronously.

This PR would make webdriver's focusing-webview behaviour same as human
interaction.

Testing: 
[Before 1](https://github.com/yezhizhen/servo/actions/runs/17598288280),
[Before 2](https://github.com/yezhizhen/servo/actions/runs/17598289360),
[Before 3](https://github.com/yezhizhen/servo/actions/runs/17598290532)
[After 1](https://github.com/yezhizhen/servo/actions/runs/17598282988),
[After 2](https://github.com/yezhizhen/servo/actions/runs/17598280603),
[After 3](https://github.com/yezhizhen/servo/actions/runs/17589228530)

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-09-10 07:36:53 +00:00
Oriol Brufau
433a6bf47b
layout: Set baseline even if line box has no fragment (#39235)
`InlineFormattingContextLayout::finish_current_line_and_reset()` has an
early return in case the line has no fragment. However, if the line only
has a forced line break, then we still need to set the baseline.

Testing: Adding new test.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-10 05:17:25 +00:00
JasonHonKL
839878c743
script: Make root_from_handle_value a safe function by accepting SafeJSContext (#39193)
Change from unsafe pointer of root_from_handle_value  to SafeJSContext. 

#39131

---------

Signed-off-by: JasonHonKL <j2004nol@gmail.com>
Signed-off-by: Jason <jason@198-61-252-113-on-nets.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Jason <jason@198-61-252-113-on-nets.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-09-09 19:26:02 +00:00
lumiscosity
721fc01c30
script: Fix building with webgl_backtrace feature (#39231)
I think this is the correct solution? GlobalScope::get_cx() doesn't take
a self parameter anymore.

Testing: WebGL tests should suffice.
Fixes: #39228

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-09-09 14:09:20 +00:00
Martin Robinson
ebfb5b1abb
libservo: Make Servo (and servoshell) more resilient against extreme sizes (#39204)
Make several changes which should address panics and inconsistent
behavior around attempts to set extreme sizes:

1. Limit the minimum size of the `RenderingContext` to 1 pixel by 1
   pixel. This should address problems where users of the API try to
   directly set the size to a zero or negative dimension. In addition,
   improve the documentation around `WebView::resize` to mention this.
2. Clamp values sent in the `WebViewDelegate::request_resize_to` method
   to be at least 1x1. This prevents Servo from sending nonsense values
   to embedders. Improve documentation in this method.
3. In servoshell:
    - More consistently clamp inner and outer window size values.
    - Clamp all resize values to the available screen size, so that
      large screen sizes aren't processed directly.

Testing: This change fixes an existing WPT and adds two new API tests.
Fixes: #36763.
Fixes: #36841.
Fixes: #39141.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-09-09 12:51:30 +00:00
Simon Wülker
406eab4ec2
script: Remove three duplicated log functions from webgl (#39227)
We have the standard library at our disposal, let's use it.

Testing: Covered by existing tests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-09 11:31:55 +00:00
Narfinger
177f6d6502
Replace Hash Algorithm in HashMap/Set with FxHashMap/Set for simple types (#39166)
FxHash is faster than FnvHash and SipHash for simple types up to at
least 64 bytes. The cryptographic guarantees are not needed for any
types changed here because they are simple ids.
This changes the types in script and net crates.
In a future PR we will change the remaining Fnv to be also Fx unless
there is a reason to keep them as Fnv.

Testing: Should not change functionality but unit test and wpt will find
it.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-09 08:33:46 +00:00
Sam
1deb7b5957
script: Document need for always sending an image update to compositor (#39210)
I hit this many times while working on #38717

Testing: Not needed because we just update the docs

---------

Signed-off-by: Sam <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-09-09 08:19:57 +00:00
lumiscosity
ccecb18a9c
script: Propagate CanGc argument through DictionaryFromJSVal trait (#39223)
Testing: Internal changes only, shouldn't change behaviour.
Fixes: #39206

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-09-09 06:46:53 +00:00
Sam
1f0f079203
webgpu: Simplify presentation and handle cleared in script (#38717)
There are many important changes here:

- Generalize the presentation buffer into standalone staging buffers
that hold their own state. This allow them to be used by getImage.
- Move all clear handling to the ScriptThread and send the configuration
on each request present/getimage, thus avoiding any recreate/clearing
messages. This means that we prepare staging buffers lazily, on the
first request.

Try run for this change:
https://github.com/sagudev/servo/actions/runs/17341982368
Testing: This is covered by existing WebGPU CTS tests. There are some
bad expectations updates, but they are also on main (presumably from
last update the rendering work) although I think CTS is actually wrong
(see https://github.com/gpuweb/cts/issues/4440).
Fixes: #36820
Fixes: #37705
Fixes: #33368 (we now keep reference alive in hashmap)

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-09-09 03:35:12 +00:00
Jo Steven Novaryo
8d2723b2c9
layout: Fix Textual <input> Vertical Align Style (#39014)
Reincorporate the styles to help with the vertical alignment of textual
`<input>` element that was removed by #38775. Followed by adding Servo
specific WPTs to help with these kinds of problem.

Testing: New WPT

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
2025-09-09 03:09:38 +00:00
Simon Wülker
eec56acd12
net: Don't prompt for credentials when 401 response has no WWW-Authenticate header (#39215)
Testing: Includes a new unit test
Fixes: https://github.com/servo/servo/issues/39214

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-09 00:56:49 +00:00
Simon Wülker
fcf4beeac0
Seperate freetype face and named instance indices (#39213)
In servo, each `LocalFontIdentifier` has an `fn index() -> u32`, which
returns the index of the font within the font file in case it is a font
collection (`.ttc` instead of `.ttf`). The way this index is obtained is
platform-dependent.

On systems using `fontconfig`, we get the index by querying `FC_INDEX`:


d2c78db981/components/fonts/platform/freetype/font_list.rs (L109-L112)

There is a sneaky bug here: In addition to the aforementioned face
index, the value for `FC_INDEX` contains the index of the named instance
of the face in the upper 16 bits. This behaviour is completely
undocumented, but FreeType uses the same format:
https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_open_face.

This wasn't a problem for the longest time, because the only consumer of
the `index` value coming from fontconfig was FreeType. However, sometime
after
29e618dcf7,
we started also passing it to`read-fonts` . `read-fonts` expects only
the face index, causing it to return errors as seen in
https://github.com/servo/servo/issues/39209.

The fix is to seperate the two indices when storing them in a
`LocalFontDescriptor` and pass only the lower 16 bits to `read-fonts`.
I'm unsure whether we should continue passing the named instance index
to FreeType since we don't actually support variable fonts, but I've
opted to keep the current behaviour for now.

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

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-09-08 22:29:33 +00:00
Narfinger
d2c78db981
Moves to FxHashMap for Allocator, BHM, Canvas, Media, Servo, WebGL and WebGPU (#39202)
This moves more of HashMap/FnvHashMap to FxHashmap. Again we only
changed instances that do not look security related and have small keys.

Additionally, allocator used the fnv feature which did not seem to be
used.

Testing: Unit Tests and WPT should cover this and functionality change
is highly unlikely.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-09-08 16:06:03 +00:00
Sam
228b240635
layout: Convert animated image delays < 10ms into 100 ms delays (#39189)
Some animated images in the wild have delays <10ms and browsers usually
change them into 100ms as such small timings are unusual.

Relevant code in FF:
https://searchfox.org/firefox-main/source/image/FrameTimeout.h#35

Testing: Manually tested
Fixes: #39187

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-09-08 14:16:21 +00:00
JoeDow
30d3706a2b
layout: allow only repaint when css background and border image loaded (#39201)
This change allows that only new display list is built when css
background and border image loaded.

Testing: This change should not change any behaviors so covered by
existing WPT tests.

Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
2025-09-08 13:23:11 +00:00
Josh Matthews
e00bfb525b
script: Replace webcrypto-specific macro with trait abstraction. (#39205)
The value_from_js_object macro exists to paper over differences between
dictionary types that require rooting (via `RootedTraceableBox`) and
those that do not. However, I need to read the macro source every time I
look at the code that uses it because I can never remember what it's
doing. These changes replace the macro with a trait abstraction that is
clearer, and should be a code size win as well.

Testing: Existing WPT tests suffice.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-09-08 10:45:40 +00:00
lumiscosity
9584b9e57d
script: Add can_gc to WebIDL dictionary constructors (#39195)
More progress on can_gc!

Testing: Internal change only, shouldn't change behavior.
Fixes: #38708

---------

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-09-08 09:21:42 +00:00
Narfinger
ec8b5fc70b
Elaborate documentation of notify_history_changed in WebViewDelegate (#39134)
Elaborate documentation of on_history_changed in WebViewDelegate

Testing: Just documentation.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-09-08 00:42:45 +00:00
Martin Robinson
9f4f598f44
script: Use HTMLElement.scrollParent to implement Element.scrollIntoView (#39144)
To find scrolling ancestors, we need to walk up the flat tree and only
consider the elements that are in the chain of containing block
ancestors of an element. `scrollParent` now does this so we can use it
to properly implement `scrollIntoView`.

Testing: There are WPT tests for this change.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-09-07 21:44:11 +00:00
Tim van der Lippe
a672ffb850
Add resource header for mime sniffing (#39167)
The concept of a "resource header" is not well specced, since it is
unclear what a "resource" is. That said, it most closely matches a
"response" as part of the navigation params.

With this change, we now delay loading the document until either two
things happen:
1. We reached the end of the file
2. We processed 1445 bytes (as defined by spec)

We initially store bytes in the resource header and then after loading
parse the stored bytes. Any subsequent loading will process as before.

Part of #14024

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-07 12:31:57 +00:00
Tim van der Lippe
e3de39893f
Disable scripting when sandbox flag is set (#39163)
While I adding spec comments to the CSP crate, I discovered two issues:
1. We should only use the last sandbox value (WPT test added)
2. We weren't checking for the scripting sandbox flag in document

Also, the autoplay test should have allowed scripts to run, otherwise
the test doesn't run. Since we weren't checking the flag before, the
test ran fine for Servo. However, it wouldn't run for other browsers.

Also realized that an existing test was pointing to a non-existent file
(since it doesn't have `.sub`). Updated that and confirmed that in other
browsers it now properly works (it no longer shows a 404). However,
Servo now fails that test as we don't fire an load event.

Part of #913

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-09-07 12:31:40 +00:00
lumiscosity
088d16d634
script: Make set_dictionary_property a safe function (#39191)
Makes `set_dictionary_property` safe.

Testing: Changes are internal, this shouldn't affect behavior.
Fixes: #39128

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
2025-09-07 11:56:20 +00:00
Ashwin Naren
3ac8875697
script: Initial stubs for Credential Management API (#38839)
Stubs `Credential`, `CredentialContainer`, and `PasswordCredential` and
adds the credentials attribute to navigator.

Testing: WPT
Fixes: Partially #38788

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-06 19:48:38 +00:00
Sam
643ac08cf0
canvas: Implement strokeText (#39183)
Mostly it's just reusing/copy&edit fillText stuff.

Testing: Existing WPT tests
Fixes: #29973

Try run: https://github.com/sagudev/servo/actions/runs/17511337550

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-09-06 18:01:21 +00:00
Euclid Ye
bd3231847e
webdriver: Serialize as i64 if the JS Number has no fractional part (#39186)
JavaScript Number does not have Integer type, except for recently added
`BigInt`. That's why we removed `Int` variant from `JSValue` earlier in
#38748. However, the Serde deserialization is strict: when it expects
`u64`, it cannot deserialize "3.0". But when it expects `f64`, it can
still deserialize "3".

Now, we serialize as i64 if the JS Number has no fractional part. This
not only fixes regression, but also improves the case where we have an
integer not representable by i32 and previously would be parsed as f64
again.

Testing: `./mach test-wpt -r
/infrastructure/testdriver/actions/eventOrder.html --headless --product
servodriver` no longer fails when deserializing HTTP request.
Fixes: #39181

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
2025-09-06 14:38:32 +00:00
Oriol Brufau
506e186d03
layout: Simplify effective_overflow() a little (#39172)
This implements the Default trait for `AxesOverflow`, to avoid having to
manually set both axes to `Overflow::Visible`.

Also implements the conversion from `&ComputedValues` to `AxesOverflow`,
which is the also used for overflow viewport propagation.

And moves the `is_inline_box()` checkinto the `ignores_overflow` logic.

Testing: Not needed, no change in behavior

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-09-06 09:10:15 +00:00
Josh Matthews
c490033c52
indexeddb: Support enabling IndexedDB after startup (#39177)
The servodriver harness requires preference-gated web platform features
to be toggleable at any point in the browsing session's lifetime, rather
than at startup. To support toggling IndexedDB, we need to ensure the
IDB manager thread is always started.

Testing: Verified when running `./mach test-wpt /IndexedDB --headless
--product servodriver`. We don't run servodriver in CI yet.
Fixes: #39175

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-09-06 06:55:20 +00:00
Ashwin Naren
b5d6555238
indexeddb: Implement getAll and getAllKeys (#38885)
Implement getAll and getAllKeys for IDBObjectStore.

Testing: WPT & Unit testing
Fixes: Part of #6963.

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-09-06 05:48:11 +00:00