Commit graph

10405 commits

Author SHA1 Message Date
Josh Matthews
9aa09d73b5
Fix crash when setting custom property on Location (#36494)
The JS engine uses types like `Handle<Maybe<PropertyDescriptor>>` in
various places and our automated bindings are not able to handle the
Maybe type. We have hand-written bindings that use outparams to indicate
a PropertyDescriptor value is actually the Nothing type, but that data
was getting lost when we passed the property descriptor to
SetPropertyIgnoringNamedGetter, which assumed that the property
descriptor was always valid.

Depends on https://github.com/servo/mozjs/pull/579.

Testing: Manual testing on testcase from
https://github.com/servo/servo/issues/34709, and new crashtest added.
Fixes: #34709

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-16 06:52:48 +00:00
TIN TUN AUNG
f5e6eb289a
media element: support seekable attribute (#36541)
support seekable attribute in `htmlmediaelement`, modify `seek`
algorithm to use `seekable` attribute.

related
[specs](https://html.spec.whatwg.org/multipage/media.html#dom-media-seekable)
Testing: Run WPT Test
Fixes: https://github.com/servo/servo/issues/22297

Will wait for https://github.com/servo/media/pull/435 before turning
this to ready for review.
cc @jdm @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-04-16 05:52:19 +00:00
webbeef
98884a5081
Switch to data_url::mime for document content type (#36522)
The data_url Mime parser has a more conformant behavior in most cases,
including dealing with charsets.

Testing: wpt expectations with new passes are updated.

Signed-off-by: webbeef <me@webbeef.org>
2025-04-15 17:12:48 +00:00
Andrei Volykhin
6b38289584
canvas: Add "EnforceRange" attribute to CanvasImageData interface (#36546)
Add missing "EnforceRange" attribute to interface methods
https://html.spec.whatwg.org/multipage/canvas.html#canvasimagedata

--
- [x] ./mach build -d does not report any errors
- [x] ./mach test-tidy does not report any errors
- [x] There are tests for these changes
tests/wpt/tests/html/canvas/element/pixel-manipulation/2d.imageData*
tests/wpt/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData*

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-04-15 14:44:44 +00:00
Oriol Brufau
10f6f50c61
script: Implement CSSStyleSheet constructor (#36521)
https://drafts.csswg.org/cssom/#dom-cssstylesheet-cssstylesheet

Testing: covered by WPT
This is part of #36162

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-15 14:05:13 +00:00
Kingsley Yung
dacd951c9f
Make DOMException serializable (#36535)
Follow the implementation of making DOMPoint and DOMPointReadOnly
serializable in PR #35989

Testing: Passed a test previously expected to fail.
Fixes: #36463

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-04-15 13:25:31 +00:00
Gregory Terzian
f8b6b9f7b6
Transfer ReadableStream (#36181)
<!-- Please describe your changes on the following line: -->

Add transfer support to ReadableStream. Part of
https://github.com/servo/servo/issues/34676

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
2025-04-15 07:39:26 +00:00
Oriol Brufau
7171d18e96
Run all tests with --enable-experimental-web-platform-features (#36335)
Fixes: #36315

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-14 23:14:47 +00:00
Oriol Brufau
428e8f7dd8
Enable all experimental web platform features on all testsuites (#36519)
This affects the following testsuites:
 - tests/wpt/tests/
 - tests/wpt/mozilla/tests/
 - tests/wpt/webgl/tests/
 - tests/wpt/webgpu/tests/

Testing: Several tests improve
This is part of #36315

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-14 18:33:38 +00:00
Oriol Brufau
c7502a99f0
layout: Floor the max-content size by the min-content size (#36518)
It's typically a given that the min-content size can't exceed the
max-content size. However, it was possible to break that assumption when
an inline formatting context had contents with a negative outer size
(due to margins). This could lead to assert failures.

This patch avoids the problem by flooring the max-content size to not be
smaller than the min-content size. Note there is no interoperability:
https://github.com/w3c/csswg-drafts/issues/12076

Testing: adding new reftest and crashtest
Fixes: #36481

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-14 18:00:32 +00:00
Tim van der Lippe
4e1ea81992
Implement CSP check for Trusted Types (#36363)
The algorithm [1] is implemented in the content-security-policy
package.

Requires
https://github.com/rust-ammonia/rust-content-security-policy/pull/56
This is part of #36258

[1]:
https://w3c.github.io/trusted-types/dist/spec/#abstract-opdef-should-trusted-type-policy-creation-be-blocked-by-content-security-policy

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-04-14 16:44:50 +00:00
Gae24
2bab5d8d52
async clipboard: implement writeText (#36498)
Implement enough of the Clipboard API to have a working `writeText`.

Testing: Unfortunately many clipboard-apis tests require testdriver, so
only idlharness ones will pass now.

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-04-14 13:49:43 +00:00
Oriol Brufau
f1417c4e75
layout: Let getComputedStyle resolve auto min size as 0px when needed (#36430)
The initial value of `min-width` and `min-height` was 0px in CSS2.
However, CSS3 changed it to `auto`, so for backwards compatibility,
`getComputedStyle` needs to resolve it to 0px in a bunch of cases.

Testing: covered by WPT

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-14 10:31:48 +00:00
Tim van der Lippe
85e4a2b5c7
Update FetchTaskTarget to propagate CSP violations. (#36409)
It also updates the FetchResponseListener to process CSP violations to
ensure that iframe elements (amongst others) properly generate the CSP
events. These iframe elements are used in the Trusted Types tests
themselves and weren't propagating the violations before.

However, the tests themselves are still not passing since they also use
Websockets, which currently aren't using the fetch machinery itself.
That is fixed as part of [1].

[1]: https://github.com/servo/servo/issues/35028

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-04-13 20:54:59 +00:00
Tim van der Lippe
dcc88b53aa
Implement "Create a Trusted Type" algorithm (#36454)
This algorithm is quite straightforward written in the specification,
but leads to some type awkwardness in Rust. Most notably, the callbacks
have different types and cannot be unified easily. They also return
different string types. Similarly, the returning objects are all unique
types and don't have a common denominator.

Therefore, rather than implementing it in 1-to-1 fashion with the
specification text, it instead uses callbacks to instruct the type
system of what to call when.

This is further complicated by the fact that the callback can exist
or not, as well as return a value or not. This requires multiple
unwrangling, combined with the fact that the algorithm should throw
or not.

All in all, the number of lines is relatively low compared to the
specification algorithm and the Rust compiler does a lot of heavy
lifting figuring out which type is what.

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

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-04-13 03:55:23 +00:00
Servo WPT Sync
0c045fc247
Sync WPT with upstream (13-04-2025) (#36488)
Automated downstream sync of changes from upstream as of 13-04-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-04-13 02:52:15 +00:00
Sebastian C
85bd0918f2
Update ProgressEvent to use doubles (#36487)
See: https://github.com/whatwg/xhr/pull/394

Testing: WPT tests exist for this

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-04-13 01:41:39 +00:00
Oriol Brufau
64fe52e918
layout: Enforce min-content min main size of flex-level tables (#36469)
Additionally to the minimum specified in min-width or min-height, tables
also enforce a `min-content` minimum.

This was handled in `Sizes::resolve()`, but flex items don't use that.
So this patch moves the logic into `Size::resolve_for_min()`.

Testing: Covered by WPT

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-12 14:22:37 +00:00
Oriol Brufau
fc2eb7bff2
Enable dom_svg_enabled on all tests (#36475)
This feature is part of --enable-experimental-web-platform-features, so
it should be enabled on all tests.

This causes some new failures, but mostly it's because the tests were
timing out instead of running the failing subtests.

This is part of #36315

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-11 18:46:00 +00:00
Sebastian C
2d2cfade36
fix: File to FormData not correctly handling name and lastModified (#36458)
Set File's lastModified when reconstructing from Blob for FormData
Remove special character replacement in fileName (spec removed this
step)

Testing: WPT tests exist
Fixes: #22744 (if I undertand the issue correctly the filename issue was
already fixed and now this fixes the lastModified part)

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-04-11 17:59:03 +00:00
Sebastian C
87c40b4168
Manually concatenate ACRH headers to not include a space (#36455)
headers library will join values with `, ` (comma space) but
Access-Control-Request-Headers specifies that it does not use the normal
combining algorithm and values should be joined with `,` (comma).

Testing: WPT tests exist
Fixes: temporary fix for #36451 until hyperium/headers#207 is fixed

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-04-11 17:01:55 +00:00
Tim van der Lippe
0aa08042d5
Implement attribute and property lookup for Trusted Types (#36422)
These algorithms are used to check whether an attribute/property can
accept a Trusted Type.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-04-11 08:38:00 +00:00
Sebastian C
2c7aeca404
Handle HTTP Refresh header (#36393)
Move parsing of Refresh values to Document.
Send Refresh header to Document and have meta tags reuse the logic.

I transplanted the existing Regex and made some updates so that it
passed all the existing parser tests.
I added the comments that made sense but it is not very clean to add
many comments within the regex.

Testing: There are existing WPT tests

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-04-11 07:25:37 +00:00
DK Liao
5df4c760d3
fix: Crashing due to input element hack (#36461)
This PR addresses a crash in text input element due to a hack to prevent
text input being trimmed.

The updated behavior will only add `zero width space` unicode character
to the node if there's no text content instead of adding it constantly.
Also by adding the same `zero width space` unicode character to text
area when there's no text content within will allow text area element to
properly display caret.

<img width="197" alt="截圖 2025-04-11 中午12 51 00"
src="https://github.com/user-attachments/assets/10bc7314-9aa3-49df-baac-ef26d39a96d8"
/>

This PR also addresses issues with multiple glyph runs:


https://github.com/user-attachments/assets/658db56f-b166-47ec-bc77-c6c13114d669

Testing: This PR is tested using:
- `./mach run -d 'data:text/html,<input id="input_element"
value="xxxxxxxxxxxxxxxxxxxx">'`
- `./mach run -d 'data:text/html,<textarea id="input_element"
value="xxxxxxxxxxxxxxxxxxxx">'`

without causing crashes, while the results should be covered by WPT
tests

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

---------

Signed-off-by: DK Liao <dklassic@gmail.com>
2025-04-11 06:51:52 +00:00
TIN TUN AUNG
972ca77ce1
dom: should change media element's currentSrc to children source element's src in resource selection algorithm. (#36408)
Set the `htmlmediaelement`'s `currenSrc` in
resource-selection-algorithm.
Change the `htmlsourceelement`'s src and srcset to USVString type.

According to
[Spec](https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm),
Step 9.3 for mode is children, should set the `currentSrc` to `src` of
children `htmlsourceelement`.
Also, In the `htmlsourceelement` [interface
definition](https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element),
the `src` and `srcset` attribute should be type `USVString`.

Testing: More WPT tests related to resource selection algorithm are
passing.
Fix: Some spec fix

[Try](1434753561)
cc @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-04-11 06:32:34 +00:00
Oriol Brufau
2d40fb7fe2
Implement disabled attribute for <link rel="stylesheet"> (#36446)
Adds support for both the content and the IDL attribute.
Note this doesn't cover dynamic updates to `document.styleSheets` and
the owner node of the sheet.

Testing: Covered by WPT
Fixes: #26739

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-10 16:28:01 +00:00
DK Liao
e62aecb103
feat: Implement display for text selection and caret (#35830)
This PR introduces an initial, straightforward implementation for
displaying text selection and the caret.

This is achieved by passing the selection range and insertion point
index down to `TextFragment`, along with the starting offset of each
`TextFragment` to determine the proper range for displaying the caret
and text selection. Additionally, the `selected_style` was passed into
`TextFragment` to specify the background color.

During the final build phase, although whitespace is typically ignored
when constructing glyphs, we still need to retrieve it to render both
the caret and text selection at the correct location. This ensures that
whitespace is not overlooked when the `TextFragment` contains an
insertion point or selection range.

There are several improvements yet to be made, including:

- The caret is static and does not flash.
- The caret is not rendered when the input field is empty. (I suppose
there should be an easy fix somewhere but I haven't found it yet)

**Working Examples**

macOS


https://github.com/user-attachments/assets/f3622cbe-9fa6-40c0-b2d8-b3a8f9842c28

Windows


https://github.com/user-attachments/assets/9b008a0d-0011-4c76-a2e2-0e35869a216c

Linux

[Screencast from 03-07-2025 11_05_41
AM.webm](https://github.com/user-attachments/assets/09a311ad-f975-4450-a66c-b20be525a5ed)



---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix part of #33237 (But the cursor isn't blinking
yet)
- [x] These changes do not require tests because there's no behavior
change

Signed-off-by: DK Liao <dklassic@gmail.com>
2025-04-10 14:40:38 +00:00
Josh Matthews
c16ca22970
Run all CSP tests in CI by default. (#36436)
Extending the original set from #36402 since there are additional tests
relevant to the work happening in #36409 and #36363.

Testing: New tests in CI.
Fixes: Part of https://github.com/servo/servo/issues/4577

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-10 08:09:23 +00:00
Gae24
64b401696a
script: Correctly convert a jsval to a Promise (#36403)
Fixes an oversight of #36097, in which converting to a Promise would
fail if the value passed wasn't actually a Promise, while in binding
code we actually call `Promise::new_resolved` on the value.

Testing: There are wpt tests that should pass now

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-04-09 16:35:35 +00:00
Josh Matthews
ce4ca9ee98
Run subset of CSP tests by default. (#36402)
This will establish a baseline for the changes from #36363.

Testing: New tests in CI.
Fixes: Part of #4577

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-08 14:46:25 +00:00
Sebastian C
9bdc46d66b
fix: meta referrer updating to follow spec (#36390)
Previously the referrer policy used tree order but the spec only cares
about the most-recently-updated or most-recently-added meta referrer.

Testing: change has existing WPT tests

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-04-07 22:29:12 +00:00
Simon Wülker
8f1c23692e
Create a parser for URLPatterns (#36382)
This change implements the pattern parser, completing the "parsing
pipeline" for URL patterns.

Testing: Primarily `urlpattern/urlpattern-hasregexpgroups.any.js`, some
other subtests start to pass too.

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-04-07 18:08:22 +00:00
Martin Robinson
2b63e60e8f
layout: Add initial support for the ::marker pseudo-element (#36317)
This change adds support for the `::marker` pseudo-element and ensure
that
markers are cached into the box tree. This is only initial support,
there are a few
things missing such as animations, transitions, and support the
`content` CSS
property.

Testing: There are WPT tests for this change.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-04-07 17:49:05 +00:00
Manuel Rego
777b74252a
wpt: Unskip acid folder as most tests are passing (#36340)
Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
2025-04-07 15:46:41 +00:00
Euclid Ye
3242592f34
Fix transition toggle & cancellation & delay (#35978)
More details in Stylo PR: https://github.com/servo/stylo/pull/145

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes 
- fixes https://github.com/servo/servo/issues/35833
- fixes https://github.com/servo/servo/issues/35982

<!-- Either: -->
- [x] There are new passing test: `css/css-logical/animation-004.html:
Transitions from physical to logical update when the direction is
changed`

Created new test files as well: 

1. `css-transitions/transition-remove-and-change-immediate.html`
2.  `css-transitions/transition-zero-duration-with-delay.html`
3. `css-transitions/transitioncancel-003.html`

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

cc @Asun0204  @xiaochengh @stevennovaryo

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-04-07 14:51:32 +00:00
ToBinio
4f41354349
layout: Scale images in image_set by their specified resolution (#36374)
This PR makes it so the `resolution` factor in `image-set` also affects
the image size.
For instance, in the example below:

```css
background-image: image-set("./small.png" 1x, "./large.png" 2x);
```

if `large.png` is used, an image which is 32x32 will be rendered as
16x16. This is specified
in <https://drafts.csswg.org/css-images-4/#image-set-notation>.

Testing:
 - `css/css-images/image-set/image-set-resolution-002.html`

---------

Signed-off-by: tobinio <Tobias.frischmann1@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2025-04-07 13:54:29 +00:00
Oriol Brufau
3e249c9bc4
Enable layout_container_queries_enabled on all WPT tests (#36348)
This feature is part of --enable-experimental-web-platform-features, so
it should be enabled on all tests.

It's not really implemented beyond parsing, but it should be safe to
enable. It mostly changes test results from ERROR to FAIL.

This is part of #36315

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-07 11:43:11 +00:00
Simon Wülker
0a4174ad0e
Add a tokenizer for URLPatterns (#36362)
Not a lot of new tests start to pass because the actual parser is still
missing, so we're only passing tests for invalid inputs. The parser will
be added in the next PR.

This is part 3 of upstreaming the changes in
https://github.com/simonwuelker/servo/tree/urlpattern

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-04-07 06:25:32 +00:00
Gae24
d1243a1867
dom: Implement ClipboardItem (#36336)
implement the `ClipboardItem` interface

Testing: covered by existing wpt tests

part of #36084

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2025-04-06 23:47:57 +00:00
elomscansio
1f558a0d49
Fix radio group validity update when removing or selecting an input (#36252)
This PR fixes an issue where radio inputs in the same group failed to
correctly update their `validity.valueMissing` state when:

- A **checked radio button was removed** from the DOM.
- A **different radio button was selected** by user interaction.

This behavior caused mismatches with how browsers like Firefox handle
radio group validation.

---

### Changes in This PR

#### Radio group revalidation on DOM removal
- Updated `unbind_from_tree()` to revalidate other radio buttons in the
same group when a checked input is removed.
- Uses `UnbindContext::parent` as the DOM root to ensure the correct
context is used during traversal.

#### New helper: `find_related_radios()`
- Encapsulates logic for finding other inputs in the same group.
- Used during both removal and attribute changes for consistency.

#### Validation on `checked`/`value` updates
- Introduced `update_related_validity_states()` to revalidate all group
members when a radio's `checked` or `value` is changed.

#### Web Platform Test (WPT) coverage
- Created a new WPT file: `radio-group-valueMissing.html`.
- Tests follow recommended `test()` pattern:
  - **Precondition**: Assert initial `valueMissing`.
  - **Action**: Remove or select a radio.
  - **Postcondition**: Assert expected `valueMissing`.

#### Manifest updated
- The WPT manifest now includes the new test.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #36110

<!-- Either: -->
- [X] There are tests for these changes

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
2025-04-06 23:26:15 +00:00
Servo WPT Sync
bd43b78735
Sync WPT with upstream (06-04-2025) (#36369)
Automated downstream sync of changes from upstream as of 06-04-2025
[no-wpt-sync]

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2025-04-06 04:11:16 +00:00
saku
b4fd9ebb0e
Fix: Add support for stylesheet MIME type quirk in quirks mode (#36338)
This PR implements the HTML spec quirk for stylesheets:
https://html.spec.whatwg.org/multipage/#link-type-stylesheet

The implementation adds a check in `stylesheet_loader.rs` to handle this
quirk condition correctly, and adds a new WPT test to verify that
same-origin non-CSS MIME type resources are properly treated as CSS in
quirks mode.

Testing: Added a new WPT test (`quirk-origin-check-positive.html`) that
verifies the positive case for this quirk.
Fixes: https://github.com/servo/servo/issues/36324

---------

Signed-off-by: saku-1101 <sakupi1101@outlook.jp>
2025-04-06 00:28:35 +00:00
Tim van der Lippe
b87bf0b806
Stub out Trusted Types interfaces (#36355)
Some methods are implemented fully, while others are implemented
partly. With these implementations, there are no observed crashes
when running the trusted-types web-platform-tests.

Most notably, the tests/wpt/tests/trusted-types/idlharness.window.js
is now fully passing.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-04-05 13:08:56 +00:00
Sebastian C
76edcff202
Check all ancestor navigable trustworthiness for mixed content (#36157)
Propagate through documents a flag that represents if any of the
ancestor navigables has a potentially trustworthy origin.

The "potentially trustworthy origin" concept appears to have gotten
confused in a couple of places and we were instead testing if a URL had
"potentially trustworthy" properties.

The main test for the ancestor navigables is
[mixed-content/nested-iframes](https://github.com/web-platform-tests/wpt/blob/master/mixed-content/nested-iframes.window.js)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #36108 

<!-- Either: -->
- [X] There are tests for these changes

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-04-05 05:38:24 +00:00
Josh Matthews
944e795606
constellation: Only return focused browsing contexts that exist. (#36330)
The webdriver server relies on the constellation to report which
browsing context is focused, and assumes that a focused context is ready
for interaction. However, new browsing contexts exist in a weird state
where they are not tracked by the constellation until the initial load
is complete, which leads to the constellation rejecting attempts to
navigate a browsing context right after it's created. These changes
ensure the constellation does not report a browsing context as focused
until it's actually created and ready for interaction.

Testing: Run `./mach test-wpt --product servodriver
tests/wpt/mozilla/tests/mozilla/DOMParser.html`, which now runs to
completion.
Fixes: #34551
Fixes: #36328

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-04-04 21:41:14 +00:00
Tim van der Lippe
ad95a602f8
Run Trusted Types tests (#36354)
To set a baseline of test expectations prior to implementation.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
2025-04-04 21:02:16 +00:00
Sebastian C
d93dad7f49
Implement TestUtils (#36301)
Implement the TestUtils namespace from
https://testutils.spec.whatwg.org/.
This should make the `js/builtins/weakrefs` tests run faster and more
consistently.

This change will enable other WPT tests but no tests exist currently for
TestUtils itself.
Fixes: #36290

---------

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-04-04 19:42:28 +00:00
Manuel Rego
b4c1cdd3e7
wpt: Unskip webaudio tests as most are passing (#36334)
Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
2025-04-04 14:12:40 +00:00
Manuel Rego
1f928252e3
wpt: Unskip old-tests/ folder as most tests are passing (#36333)
Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
2025-04-04 11:05:24 +00:00
Oriol Brufau
202cac900d
layout: Restrict stretch alignment to flex items with computed auto size (#36288)
We were allowing `align-self: stretch` to stretch flex items whose cross
size behaves as `auto`, including cyclic percentages.

However, https://github.com/w3c/csswg-drafts/issues/4525 resolved that
stretching should only happen when the cross size computes to `auto`.

So this patch exposes this information in `ContentBoxSizesAndPBM`, and
refactors the flexbox stretching logic.

Fixes: #36285

Testing:
 - `/css/css-flexbox/quirks-auto-block-size-with-percentage-item.html`
 - `/css/css-flexbox/stretch-requires-computed-auto-size.html`

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-04-04 10:15:40 +00:00