aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* layout: Always floor the max-content size by the min-content size (#36571)Oriol Brufau2025-04-171-2/+0
| | | | | | | | | | This is a follow-up to #36518, which only addressed inline formatting contexts. However, flex formatting contexts had the same problem, so it seems safer to address it in general. Testing: this makes a WPT test pass Fixes: #36570 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix crash when enumerating properties of global object (#36491)Josh Matthews2025-04-173-1/+25
| | | | | | | | | | | | | | | | | | | These changes make our implementation of the enumeration hook for globals [match Gecko's](https://searchfox.org/mozilla-central/rev/1f65969e57c757146e3e548614b49d3a4168eeb8/dom/base/nsGlobalWindowInner.cpp#3297), fixing an assertion failure that occurred in the previous implementation. Our enumeration hook is supposed to fill a vector with names of properties on the global object without modifying the global in any way; instead we were defining all of the missing webidl interfaces. We now do much less work and crash less. Testing: New crashtest based on manual testcase. Fixes: #34686 --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* fix writablestream assertion crash when getting chunk size following spec ↵Taym Haddadi2025-04-161-6/+0
| | | | | | | | change (#36566) One-line change to align with the new spec and avoid a crash. fix #36565 Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* Fix crash when setting custom property on Location (#36494)Josh Matthews2025-04-165-9/+12
| | | | | | | | | | | | | | | | | 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>
* media element: support seekable attribute (#36541)TIN TUN AUNG2025-04-162-19/+0
| | | | | | | | | | | | | | | 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>
* Switch to data_url::mime for document content type (#36522)webbeef2025-04-153-129/+0
| | | | | | | | 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>
* canvas: Add "EnforceRange" attribute to CanvasImageData interface (#36546)Andrei Volykhin2025-04-1512-45/+0
| | | | | | | | | | | | | 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>
* script: Implement CSSStyleSheet constructor (#36521)Oriol Brufau2025-04-155-28/+0
| | | | | | | | 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>
* Make DOMException serializable (#36535)Kingsley Yung2025-04-152-9/+0
| | | | | | | | | | | 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>
* Transfer ReadableStream (#36181)Gregory Terzian2025-04-1513-18/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- 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>
* Run all tests with --enable-experimental-web-platform-features (#36335)Oriol Brufau2025-04-146-85/+2
| | | | | Fixes: #36315 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Enable all experimental web platform features on all testsuites (#36519)Oriol Brufau2025-04-1422-4078/+170
| | | | | | | | | | | | 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>
* layout: Floor the max-content size by the min-content size (#36518)Oriol Brufau2025-04-143-0/+63
| | | | | | | | | | | | | | | 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>
* Implement CSP check for Trusted Types (#36363)Tim van der Lippe2025-04-149-57/+2
| | | | | | | | | | | | | | 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>
* async clipboard: implement `writeText` (#36498)Gae242025-04-143-40/+2
| | | | | | | | | | 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>
* layout: Let getComputedStyle resolve auto min size as 0px when needed (#36430)Oriol Brufau2025-04-146-46/+0
| | | | | | | | | 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>
* Update FetchTaskTarget to propagate CSP violations. (#36409)Tim van der Lippe2025-04-13117-574/+258
| | | | | | | | | | | | | | | | | | 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>
* Implement "Create a Trusted Type" algorithm (#36454)Tim van der Lippe2025-04-1324-229/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Sync WPT with upstream (13-04-2025) (#36488)Servo WPT Sync2025-04-13296-3576/+8322
| | | | | | 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>
* Update ProgressEvent to use doubles (#36487)Sebastian C2025-04-131-9/+0
| | | | | | | See: https://github.com/whatwg/xhr/pull/394 Testing: WPT tests exist for this Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* layout: Enforce min-content min main size of flex-level tables (#36469)Oriol Brufau2025-04-123-6/+0
| | | | | | | | | | | 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>
* Enable dom_svg_enabled on all tests (#36475)Oriol Brufau2025-04-1119-99/+1959
| | | | | | | | | | | 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>
* fix: File to FormData not correctly handling name and lastModified (#36458)Sebastian C2025-04-112-16/+0
| | | | | | | | | | | 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>
* Manually concatenate ACRH headers to not include a space (#36455)Sebastian C2025-04-112-17/+0
| | | | | | | | | | | | 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>
* Implement attribute and property lookup for Trusted Types (#36422)Tim van der Lippe2025-04-116-181/+12
| | | | | | | | 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>
* Handle HTTP Refresh header (#36393)Sebastian C2025-04-119-256/+20
| | | | | | | | | | | | | | | 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>
* fix: Crashing due to input element hack (#36461)DK Liao2025-04-112-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dom: should change media element's currentSrc to children source element's ↵TIN TUN AUNG2025-04-114-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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](https://github.com/rayguo17/servo/actions/runs/14347535616) cc @xiaochengh Signed-off-by: rayguo17 <rayguo17@gmail.com>
* Implement `disabled` attribute for `<link rel="stylesheet">` (#36446)Oriol Brufau2025-04-106-23/+0
| | | | | | | | | | 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>
* feat: Implement display for text selection and caret (#35830)DK Liao2025-04-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Run all CSP tests in CI by default. (#36436)Josh Matthews2025-04-10509-12/+5492
| | | | | | | | | 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>
* script: Correctly convert a jsval to a `Promise` (#36403)Gae242025-04-091-3/+0
| | | | | | | | | | | 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>
* Run subset of CSP tests by default. (#36402)Josh Matthews2025-04-0848-0/+333
| | | | | | | | 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>
* fix: meta referrer updating to follow spec (#36390)Sebastian C2025-04-073-9/+0
| | | | | | | | | | 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>
* Create a parser for URLPatterns (#36382)Simon Wülker2025-04-073-234/+0
| | | | | | | | | | | 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>
* layout: Add initial support for the `::marker` pseudo-element (#36317)Martin Robinson2025-04-0717-228/+244
| | | | | | | | | | | | | | | 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>
* wpt: Unskip acid folder as most tests are passing (#36340)Manuel Rego2025-04-073-0/+46
| | | Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
* Fix transition toggle & cancellation & delay (#35978)Euclid Ye2025-04-076-4/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* layout: Scale images in `image_set` by their specified resolution (#36374)ToBinio2025-04-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Enable layout_container_queries_enabled on all WPT tests (#36348)Oriol Brufau2025-04-07109-151/+1495
| | | | | | | | | | | 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>
* Add a tokenizer for URLPatterns (#36362)Simon Wülker2025-04-072-108/+0
| | | | | | | | | | | | 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>
* dom: Implement `ClipboardItem` (#36336)Gae242025-04-066-38/+4
| | | | | | | | | | | implement the `ClipboardItem` interface Testing: covered by existing wpt tests part of #36084 --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Fix radio group validity update when removing or selecting an input (#36252)elomscansio2025-04-062-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Sync WPT with upstream (06-04-2025) (#36369)Servo WPT Sync2025-04-06708-3351/+15414
| | | | | | 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>
* Fix: Add support for stylesheet MIME type quirk in quirks mode (#36338)saku2025-04-063-0/+34
| | | | | | | | | | | | | | | | | 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>
* Stub out Trusted Types interfaces (#36355)Tim van der Lippe2025-04-05126-556/+2858
| | | | | | | | | | | | 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>
* Check all ancestor navigable trustworthiness for mixed content (#36157)Sebastian C2025-04-0548-477/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* constellation: Only return focused browsing contexts that exist. (#36330)Josh Matthews2025-04-042-2/+2
| | | | | | | | | | | | | | | | | | 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>
* Run Trusted Types tests (#36354)Tim van der Lippe2025-04-04183-0/+1739
| | | | | | | To set a baseline of test expectations prior to implementation. Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
* Implement TestUtils (#36301)Sebastian C2025-04-043-2/+3
| | | | | | | | | | | | | | | | 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>