Commit graph

10697 commits

Author SHA1 Message Date
Oriol Brufau
4ee7a34f32
layout: Unify logic for laying out replaced and non-replaced in a BFC (#37864)
The logic for laying out block-level replaced elements wasn't taking
floats into account when resolving a `stretch` inline size. By handling
them with the same logic as non-replaced elements, we fix that problem,
and reduce the amount of code.

Testing: Adding new tests
Fixes: #37861

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-04 17:47:40 +00:00
Andrei Volykhin
9bd8d4f026
canvas: Add OffscreenCanvas 'transferToImageBitmap' method (#37880)
Follow the HTML speficication and add missing 'transferToImageBitmap'
method to OffscreenCanvas interface.

https://html.spec.whatwg.org/multipage/#dom-offscreencanvas-transfertoimagebitmap

Testing: Improvements in the following tests
- html/canvas/offscreen/compositing/2d.composite.grid*
- html/canvas/offscreen/fill-and-stroke-styles/2d.gradient*
- html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas*
- html/canvas/offscreen/reset/2d.reset*
- html/canvas/offscreen/text/2d.text*

Fixes (partially): #34111

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-04 16:25:36 +00:00
Euclid Ye
a81ddd5c18
Rename original window_resizeTo.html to window_resize_event.html & Fix wrong usage of innerHeight & add new test (#37856)
1. rename original `window_resizeTo.html` to `window_resize_event.html`
to reflect the purpose. Also change {innerWidth, innerHeight} to
{outerWidth, outerHeight} to match spec.
2. Add a new test `window_resizeTo.html` for
https://github.com/servo/servo/pull/37848

Testing: new test always fails because of
https://github.com/servo/servo/issues/37824, which gives inaccurate
outerHeight.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-04 15:41:11 +00:00
Jan Varga
934b3341d7
storage: Isolate sessionStorage per top-level browsing context and copy sessionStorage when creating a new auxiliary browsing context (#37803)
This pull request introduces changes to the storage subsystem to:
- Isolate sessionStorage per top-level browsing context (WebViewId), in
  addition to origin.
- Copy sessionStorage when creating a new auxiliary browsing context
without
  noopener, as required by the corresponding spec
 
These changes bring Servo closer to spec compliance, matching expected
browser
behavior.

Testing: This work affects observable behavior. As a result, some
previously
failing WPT tests now pass. No new tests are added, since the behavior
is
already covered by existing web-platform-tests.

Fixes: #21291

---------

Signed-off-by: Jan Varga <jan.varga@gmail.com>
2025-07-04 09:15:12 +00:00
Kenzie Raditya Tirtarahardja
a990ff82b9
Webdriver: Implement calculate the absolute position for Get Element Rect (#37847)
Implementing [calculate the absolute
position](https://w3c.github.io/webdriver/#dfn-calculate-the-absolute-position)
and make [Get Element
Rect](https://w3c.github.io/webdriver/#get-element-rect) conforms the
spec .

Testing: Covered in webdriver WPT, especially for pointer test that
needs to find the element rect.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-04 07:22:29 +00:00
Andrei Volykhin
6ba54e4d79
canvas: Add OffscreenCanvas 'convertToBlob' method (#37786)
Follow the HTML speficication and add missing 'convertToBlob' method
to OffscreenCanvas interface.

https://html.spec.whatwg.org/multipage/#dom-offscreencanvas-converttoblob

Testing: Improvements in the following tests
-
html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob*
-
html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html

Fixes: #24272

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-04 06:58:12 +00:00
Narfinger
ca47cc2fa3
Add a basic caching mechanism for ImageKeys. (#37369)
This creates a new method in shared/compositing/lib to generate image
keys that are send over the webview. This does not immediately return
the keys but goes over the constellation to receive the keys from the
IOCompositor. To make this more efficient, we now cache the keys in
image_cache in a simple FIFO order. The old blocking method stays intact
for now but got renamed to make the blocking clear.
The blocking calls that are left are in:
- `components/canvas/canvas_data.rs`
- `components/script/dom/htmlmediaelement.rs`

Testing: WPT tests should cover this as this doesn't change any
functionality.
Fixes: Was mentioned in
https://github.com/servo/servo/issues/37161#issuecomment-2915750051 and
part of https://github.com/servo/servo/issues/37086

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-07-03 13:16:43 +00:00
Euclid Ye
06cc4bdae7
layout: Ensure that the last transition for a property take precedence (#37176)
This change bumps stylo to servo/stylo#214, to fix an issue where
transition
properties defined earlier on the list of transitions were taking
preference over
those defined later.

Testing: This fixes a couple WPT tests.
Fixes: #37164

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-03 11:28:14 +00:00
Oriol Brufau
00472dec8e
layout: Implement list-style-position quirk (#37837)
In quirks mode, the ::marker of a bare `<li>` should be
`list-style-position: inside`,

Testing: Some WPT improvement

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-03 09:16:54 +00:00
Oriol Brufau
26f5eb476a
Upgrade Stylo to 2025-07-01 (#37822)
This continues #37444

Changelog:
- No-op change because of https://github.com/servo/stylo/pull/186:
7e2201c32c..0a5440a8af
- Upstream:
0a5440a8af...fe9eadf47b
- Servo fixups:
e8dbccb254...31a2c9cfa9

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

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 16:38:58 +00:00
Oriol Brufau
da364f7a61
script: Remove the quirk of flooring rowSpan by 1 (#37831)
Only Firefox has this quirk, Chrome and Safari don't. So it's simpler to
just remove it.

Testing: tested by WPT

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 12:16:28 +00:00
Oriol Brufau
95d9d3a412
script: Only enforce rowSpan >= 1 in actual quirks mode (#37820)
We were also enforcing that in limited-quirks mode, but no other browser
does that. In fact, Blink and WebKit don't have this quirk at all, so we
should consider removing it too, but for now restrict it to quirks mode
like Firefox.

Testing: adding new tests
Part of #37813

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 09:52:00 +00:00
Andrei Volykhin
4cbadde144
htmlimageelement: Reject decode promises on the current request mutation (#37828)
Follow the HTML specification and reject the pending image decode
promises
on any current request mutation.
https://html.spec.whatwg.org/multipage/#updating-the-image-data (step
18)
https://html.spec.whatwg.org/multipage/#dom-img-decode (step 3)

Fulfill and reject image decode promises by queueing
a global tasks on the DOM manipulation task source.

Testing: Improvements in the following tests
- html/semantics/embedded-content/the-img-element/decode/*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-02 09:29:47 +00:00
Kenzie Raditya Tirtarahardja
45fb0bac82
webdriver: enable getting closed shadow root (#37826)
Previously, when getting element shadow root, we are using
[GetShadowRoot](https://dom.spec.whatwg.org/#dom-element-shadowroot).
This is a getter which only allows javascript to access shadow root with
`open` mode.

In [webdriver
spec](https://www.w3.org/TR/webdriver2/#dfn-get-element-shadow-root),
particularly step 5, it seems that they imply for us to get the shadow
root without going through the above getter.

P.S. Other browser seems to also allows getting closed shadow root, like
Chromium here:
https://chromium-review.googlesource.com/c/chromium/src/+/5923865.

Testing: Covered in webdriver WPT test that access closed shadow root.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
2025-07-02 08:51:50 +00:00
Andrei Volykhin
d0579256bb
canvas: Unify retrieving image data from the HTMLImageElement (#37809)
Currently, HTMLImageElement uses as an image source
(ImageBitmapSource, CanvasImageSource, TexImageSource)
in various canvas2D/WebGL operations, and there is a small
inconsistency in how we get the image data of the 'img' element:
usability checking and retrieving the image data from the image cache.

To simplify and avoid state inconsistency between the window's image
cache and the 'img' element, let's retrieve the image data (as a raster)
from the HTMLImageElement itself.

Testing: No expected changes in testing results, except the
'drawimage_svg_image_with_foreign_object_does_not_taint.html'
which is 'false' passed because drawing of the non supported vector
image
is silently skip instead of throwing the 'InvalidState' exception
anymore.

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-07-02 08:13:30 +00:00
Oriol Brufau
83213ac16b
Fix testharnessreport-servo.js to stop polluting with global variables (#37817)
For example, if a test uses `let props = ...` then this was triggering
an exception because testharnessreport-servo.js already created a global
variable named `props`.

Testing: some wpt tests no longer result in ERROR

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 00:04:43 +00:00
Oriol Brufau
1c46e39d7a
Fix typo in test name (#37821)
quiks -> quirks

Testing: just renaming a test

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-02 00:03:44 +00:00
Oriol Brufau
227aecad51
layout: Only include quirks-mode.css in actual quirks mode (#37814)
This stylesheet was being included both in quirks mode and in limited
quirks mode. It should only be the former.

Testing: adding new test.
Part of #37813

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-07-01 18:48:35 +00:00
Euclid Ye
9543482f51
webdriver: Greatly improve execution speed for all tests using SetWindowSize (#37712)
1. Remove the unnecessary new thread which use GetWindowRect command and
blocks for 500ms. Previously this is necessary because constellation
forward "resize" to embedder, and WebDriver wait for a constant
sufficient time to `GetWindowRect` in the new thread. This caused long
delay because there are many subtests and SetWindowRect is called
between each.
2. Remove `resize_timeout`
3. Return current dimension instead of 0 from embedder when it fails to
resize.
4. Do resizing as long as one of width/height is `Some`, according to
spec.

Testing: All Conformance test with new passing cases.
Fixes: https://github.com/servo/servo/pull/37663#issuecomment-2999120615

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-07-01 06:26:01 +00:00
Euclid Ye
d781d1b1cb
[WebDriver] Implement XPath Locator Strategy (#37783)
1. Implement XPath Locator Strategy
2. Use it for "Find Element(s)", "Find Element(s) from Element", "Find
Element(s) from Shadow Root"

Testing: `tests\wpt\tests\webdriver\tests\classic\find_element*\find.py`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-30 17:20:52 +00:00
Oriol Brufau
4cd7c5196b
layout: Fix block SizeConstraint for replaced elements (#37758)
#37433 didn't handle intrinsic contributions. This patch computes the
correct SizeConstraint to be used as the ConstraintSpace's block size
when computing intrinsic inline sizes.

Testing: Adding new test
Fixes: #37478

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-30 12:07:37 +00:00
Servo WPT Sync
9a0f2be162
Sync WPT with upstream (29-06-2025) (#37774)
Automated downstream sync of changes from upstream as of 29-06-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-06-29 01:47:33 +00:00
Tim van der Lippe
e1c037815c
Fix skipping CSP checks for styles when cloning nodes (#37465)
Cloned nodes were re-parsing already-parsed style attributes. As such,
they were also checking CSP, which shouldn't happen as the original node
already was checked for it.

Testing: The existing WPT test now mostly passes. It had two cases which
were passing in no browsers.
Fixes: Part of #4577

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-28 17:31:03 +00:00
Oriol Brufau
ee7cb80213
Fix intermittent align-content tests (#37760)
These tests use the Ahem font, so wait until fonts have been loaded.

Testing: This is a test fix.
Fixes: #37360, #37361

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-28 12:13:47 +00:00
Simon Wülker
cbb0407ae6
Determine the initial state for fragment parsing using the scripting flag of the context element (#37704)
When parsing a html fragment, the initial parser state depends on
whether or not scripting is enabled. So far we've used the scripting
flag of the parser, but that is wrong - the parser's scripting flag is
always false, because the fragment document has no browsing context.
Instead we should use the scripting flag of the context element.

Testing: A new web platform test passes

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-26 20:40:13 +00:00
Andrei Volykhin
3c16db2642
canvas: Add CanvasPattern 'setTranform(transform)' method (#37731)
Follow the HTML canvas specification and add missing
'setTransform(transform)' method to CanvasPattern interface.
https://html.spec.whatwg.org/multipage/#dom-canvaspattern-settransform

Testing: Improvements in the tests
- html/canvas/element/fill-and-stroke-styles/2d.pattern.transform*
- html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-26 14:38:30 +00:00
Oriol Brufau
a9dc2ac83a
layout: Let align-content: stretch fall back to unsafe flex-start (#37708)
This aligns Servo with other browsers, and adopts this CSSWG resolution:
https://github.com/w3c/csswg-drafts/issues/11641#issuecomment-3005385155

Testing: adding new WPT test, and some expectation changes for existing
tests.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 13:53:28 +00:00
Oriol Brufau
c67b0ab538
Fix scrollWidthHeight-negative-margin-002.html (#37721)
Since we don't support `writing-mode` yet, we got different testcases
with the same title, some passing and some failing. So we had to expect
both PASS and FAIL, making the test useless to detect regressions.

This changes the test to only generate testcases for supported values of
`writing-mode`.

Testing: This is just a test change.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 12:08:30 +00:00
Euclid Ye
f9880637e9
[WebDriver] Fully implement "switch to (parent) frame" (#37685)
1. Separate the handling of ["switch to parent
frame"](https://w3c.github.io/webdriver/#switch-to-parent-frame) from
the rest as the processing is a bit different
2. Implement "Select frame by 16-bits numbered ID" for ["switch to
frame"](https://w3c.github.io/webdriver/#switch-to-frame)
3. Implement other missing steps

Testing: All WebDriver Conformance test with new passing cases

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-26 07:44:16 +00:00
sagudev
6f53d422b0
Make ImageData more spec compliant (#37620)
I updated webidl, and all changes that bring, currently we still not
support float16array (there is no support in FF either). Most notable
change is refactored new_*/Constructors methods, that should now handle
HeapBufferSource more properly (with less unsafe).

Testing: Existing WPT tests
try run: https://github.com/sagudev/servo/actions/runs/15806083404
Fixes: #37618 (although not tested)

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-25 16:48:58 +00:00
Andrei Volykhin
59b99de90a
canvas: Add CanvasTransform 'setTransform(transform)' method (#37692)
Follow the HTML canvas specification and add missing
'setTransform(transform)' method to CanvasTransform interface.

https://html.spec.whatwg.org/multipage/#dom-context-2d-settransform-matrix

The third-party WebIDL doesn't support different extended attributes
on different overloads of methods, so 'Throws' attribute was added
to another 'setTransform(...)' method.
https://bugzilla.mozilla.org/show_bug.cgi?id=1020975

Testing: Improvements in the tests
- css/geometry/DOMMatrix*
-
html/canvas/element/transformations/2d.transformation.setTransform.multiple.html
-
html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple

New failing tests due to disabled 'paint worklet' feature
- css/css-paint-api/setTransform-00*.https.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-25 16:11:54 +00:00
Andrei Volykhin
4ee348a202
imagebitmap: Add 'none' image orientation option (#37634)
The 'none' image orientation option was temporarily deprecated (in 2022)
according to HTML specification with the remark about going to be reused
with
a different meaning in future as the same semantics as CSS 'none'
image-orientation.

https://html.spec.whatwg.org/multipage/#dom-imagebitmapoptions-imageorientation-none
https://www.w3.org/TR/css-images-3/#valdef-image-orientation-none

Official MDN documentation added it back with new meaning (in 2024),
but it wasn't added back to HTML specification (still pending).

https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap#none

At current moment this option is poor supported on all major browsers,
but there are some
existed WPT tests (ImageBitmap/WebGL) which are actively use it in
createImageBitmap() options.

Chromium (supported):
- stable: same as 'from-image' (but with deprecation warning)
- experimental: ignoring any orientation metadata

Firefox (supported as default option):
- stable: ignoring any orientation metadata ('from-image' do the same)

Testing: Improvements and fails (expects 'from-image' behaviour from
'none' option) in the following tests
-
html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation_none.html
- webgl/tests/conformance/textures/misc/exif-orientation.html

Fixes (partialy): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-25 07:20:12 +00:00
Ashwin Naren
d114feb0fa
[IndexedDB] Reduce heed related panics (#37652)
Allows indexeddb backends to return errors on certain operations.
Currently the errors are not demarcated, as the result type is
`Result<(), ()>`. If this is not appropriate then perhaps having a
string error might be better.

Testing: Some tests might perhaps move from PANIC to FAIL
Fixes: Partially fixes a bit of #37647, more work needs to be done
however

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-06-25 00:22:19 +00:00
Josh Matthews
72e0baa997
Disable IndexedDB wpt tests in CI. (#37679)
Per a zulip thread, the tests have too many intermittent results right
now.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-24 19:51:14 +00:00
Andrei Volykhin
3f496f8225
canvas: Reset the current path on canvas context resetting (#37671)
Follow the HTML canvas specification and empty the list of subpaths
in context's current default path (step 2) on canvas context reseting
(reset() or set bitmap dimestion).

https://html.spec.whatwg.org/multipage/#reset-the-rendering-context-to-its-default-state

Testing: Improvements in the tests
- html/canvas/element/canvas-host/2d.canvas.host.initial.reset.path.html
- html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-24 11:09:25 +00:00
Euclid Ye
94a7428912
[WebDriver] Grant top_level_script_command and browsing_context_script_command freedom to not verify existence of pipeline (#37632)
Sometimes, it is redundant to verify existence of pipeline over and over
again.
Sometimes, it is just wrong to check it. See [Switch to Parent
Frame](https://w3c.github.io/webdriver/#switch-to-parent-frame), where
we only care about existence of parent frame.
1. This PR adds a constant compile-time bool flag to enable this. This
will be essential to fix "no_browsing_context" next.
2. Fix some wrong usage of `top_level_script_command` in `is_selected`
and `is_enabled`.
3. Add and unify some WARN info related to pipeline in Constellation

Testing: All WebDriver test with new passing cases

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-24 06:42:34 +00:00
Ngo Iok Ui (Wu Yu Wei)
25fe003af2
Fix IndexedDB WPT coverage (#37607)
The settings for WPT IndexedDB coverage is incorrect. We never ran the
IndexedDB tests actually.

Testing: `tests/wpt/tests/IndexedDB`

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-06-24 03:47:45 +00:00
Euclid Ye
5e252d0ef6
[WebDriver: Release Action] Fix panic by work around buggy spec (#37624)
1. Narrow the lifetime of `input_cancel_list` to avoid Runtime multiple
BorrowMut error.
2. Work around the buggy spec by removing matching item in
`input_cancel_list` when dispatch `keyUp` and `mouseUp`. See
https://github.com/servo/servo/issues/37579#issuecomment-2990762713

Testing: All WebDriver WPT test.
Fixes: #37579

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-23 08:33:18 +00:00
Servo WPT Sync
2b209449b5
Sync WPT with upstream (22-06-2025) (#37606)
Automated downstream sync of changes from upstream as of 22-06-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-06-22 01:41:56 +00:00
Tim van der Lippe
d2a688d798
Use undefined as this in trusted type callbacks (#37594)
As discussed in w3c/trusted-types#468 the spec will be aligned to the
other browsers, which call the callback with undefined as this.

That also allows us to cleanup the JSContext arguments across a couple
of methods.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-06-21 18:29:09 +00:00
Ngo Iok Ui (Wu Yu Wei)
927573de97
script: complete resolve_module_specifier (#37552)
Implement whole spec of `resolve_module_specifier`. Servo can now
support script element with import map type!

Testing: `tests/wpt/tests/import-map`
Fixes: #37316 #36394

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2025-06-21 06:17:27 +00:00
Euclid Ye
ce4da2bf97
[WebDriver] Implement "Find Element(s) From ShadowRoot" (#37578)
Also renamed all "CSS" selector variants of `WebDriverScriptCommand` to
avoid confusion.

Testing: Mostly `./mach test-wpt -r
tests\wpt\tests\webdriver\tests\classic\find_*_from_shadow_root\find.py
--product servodriver`
But many other test also relies on finding element(s) from shadow root,
so I ran the entire test.
All deleted lines are from test expectations.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-06-20 11:54:39 +00:00
Martin Robinson
3774ef00d4
script: Get scroll offsets from layout (#37509)
No longer store scroll offsets for elements in the DOM. Instead
consistently get and set these in layout's `ScrollTree`. This more
consistently requires layout to run when querying scroll offsets, which
ensures that they are up-to-date and properly bounded by scrollable
overflow area.

Testing: This causes several WPT tests to start passing, and one to
start
failing. In the case of
`/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html`, I believe the
issue
is that we don't properly handle scrolling and shadow DOM elements.
Before, the
faulty scrolling was hiding this issue.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 09:39:12 +00:00
Andrei Volykhin
a426a2e884
imagebitmap: Add support of Blob as ImageBitmapSource (#37560)
Follow to the HTML specification and support of Blob as
ImageBitmapSource
to able use it as intermediate instance in "fetch() -> Blob ->
ImageBitmap" execution sequence.
https://html.spec.whatwg.org/multipage/#imagebitmapsource

The specification says what these steps must run in parallel
(outside the createImageBitmap task), but currently loading bytes from
Blob
and later image decoding happen in synchronous order while
promise is fullfilled or rejected on bitmap task source.
https://html.spec.whatwg.org/multipage/#the-imagebitmap-interface:blob-4

Testing: Improvements in the following WPT tests
- html/canvas/element/compositing/2d.composite*
- html/canvas/element/drawing-images-to-the-canvas/2d.drawImage*
- html/canvas/element/manual/imagebitmap/createImageBitmap*
- html/canvas/offscreen/compositing/2d.composite
- html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage
- webgl/tests/conformance/textures/image_bitmap_from_blob/*

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-06-20 06:53:04 +00:00
Josh Matthews
9dc1dde7cb
script: Store result value in IDBRequest. (#37568)
While this introduces many new crashes in the test results, that's
actually progress. Previously a huge number of tests were failing early
because we never persisted the load-bearing `result` value for
upgradeneeded events, so now we get to see much more interesting
failures in our IndexedDB implementation.

Testing: Existing WPT testsuite for IndexedDB.
Fixes: part of #6963

Depends on #37567.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-20 04:51:56 +00:00
Josh Matthews
52dc1fa88d
script: Support creating a DOMStringList for any global. (#37567)
There were a lot of crashing IndexedDB tests caused by code in
DOMStringList that required a Window object despite being exposed to
non-Window globals.

Testing: Lots of existing tests no longer crash.
Fixes: part of #6963

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-06-20 03:16:46 +00:00
Oriol Brufau
b394727ff6
Upgrade Stylo to 2025-06-03 (#37444)
This continues #36835

Changelog:
- Upstream:
ca369cbc83...7e2201c32c
- Servo fixups:
f387e6396c...2e1f66b068

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

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-06-19 12:30:32 +00:00
Martin Robinson
e5c328d660
canvas: Don't do operations on paths with uninvertible transforms (#37551)
When the path is created with an uninvertible transform, don't do any
path-based operations. Now `ensure_path()` returns a `Path` object and
this change adds early returns which prevent trying to use it.

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

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-19 10:48:20 +00:00
Simon Wülker
a27c9ee691
Handle nonmappable code points in Document::encoding_parse_a_url (#37541)
This is a followup to https://github.com/servo/servo/pull/33825. Using
`Encoder::encode` introduced a subtle bug: That function will silently
replace nonmappable code points (such as `㐀` in euc-jp). The url spec
however expects nonmappable characters to be treated differently. There
is actually an open bug in the `rust-url` repo about this:
https://github.com/servo/rust-url/issues/649, with the conclusion
apparently being that this should not be implemented by the url crate
itself.

Gecko implementation of the equivalent algorithm for reference:
https://searchfox.org/mozilla-central/rev/d52edf7ea4236446e118a2edc815023c5479663f/netwerk/base/nsStandardURL.cpp#116-172.

Testing: More web platform tests pass

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

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-19 10:14:45 +00:00
Rodion Borovyk
3a54ddd034
script Exclude CDATASection nodes from Node::normalize() (#37550)
Exclude CDATASection nodes from Node::normalize. I made it under the
assumption that CDATAs can't have children so we don't need to go into
the `else node.Normalize()` branch on line 3485 with them, hope this is
correct.

Testing: covered by `dom/nodes/Node-normalize.html`
Fixes: https://github.com/servo/servo/issues/37006

---------

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2025-06-19 10:08:07 +00:00