aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
* Implement CSP check for Trusted Types (#36363)Tim van der Lippe10 days1-3/+12
| | | | | | | | | | | | | | 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)Gae2410 days5-0/+151
| | | | | | | | | | 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>
* Remove HTMLStyleElement::line_number (#36507)Simon Wülker10 days1-2/+0
| | | | | This field is unused. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update FetchTaskTarget to propagate CSP violations. (#36409)Tim van der Lippe11 days19-18/+180
| | | | | | | | | | | | | | | | | | 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>
* add CanGc as argument to methods in HTMLInputElement, HTMLLinkElement (#36504)Yerkebulan Tulibergenov11 days3-24/+21
| | | | | | | | add CanGc as argument to methods in HTMLInputElement, HTMLLinkElement Testing: These changes do not require tests because they are a refactor. Addresses part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Support optional message for dataclone error (#36308)Jerens Lensun11 days6-9/+60
| | | | | | | | | | | | | | | | | | | | | | | - [x] our [DataClone error](https://github.com/servo/servo/blob/d733abfca02cdb9fd2af4f0d82ff050e25f71829/components/script/dom/bindings/error.rs#L80) needs to support an optional message - [x] we need to add support to our DOMException implementation to allow an optional message to replace the default message - [x] we need to create a new struct used by both StructuredDataReader and StructuredDataWriter for storing the error message in the report_error_callback - [x] report_error_callback needs to cast the closure pointer to the new struct - [x] the code that [throws a DataClone error](https://github.com/servo/servo/blob/5d1c64dba9cf3e65f770370eb17f00ad4114edce/components/script/dom/bindings/structuredclone.rs#L542) needs to use the stored error message if it's available Testing: *Describe how this pull request is tested or why it doesn't require tests* Fixes: #36191 --------- Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
* add CanGc as argument to methods in HTMLCollection, HTMLDataListElement, ↵Yerkebulan Tulibergenov11 days13-56/+53
| | | | | | | | | | | | HTMLDialogElement, HTMLElement, HTMLFieldSetElement, HTMLFormControlsCollection, HTMLFormElement, HTMLIFrameElement (#36495) add CanGc as argument to methods in HTMLCollection, HTMLDataListElement, HTMLDialogElement, HTMLElement, HTMLFieldSetElement, HTMLFormControlsCollection, HTMLFormElement, HTMLIFrameElement Testing: These changes do not require tests because they are a refactor. Addresses part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* script: Clean up CSP management code (#36493)chocolate-pie11 days3-85/+130
| | | | | | | | | | | Current implementation takes arguments for specifying values of violation report, but is difficult to understand which value should be passed. These changes create new builder for violation report to address the issue. Testing: These changes do not require tests because they just refactor current code Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
* add CanGc as argument to methods in ElementInternals, GlobalScope, ↵Yerkebulan Tulibergenov11 days9-23/+25
| | | | | | | | | | | HTMLAnchorElement, HTMLAreaElement, HTMLCanvasElement (#36492) add CanGc as argument to methods in ElementInternals, GlobalScope, HTMLAnchorElement, HTMLAreaElement, HTMLCanvasElement Testing: These changes do not require tests because they are a refactor. Addresses part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Implement "Create a Trusted Type" algorithm (#36454)Tim van der Lippe11 days2-25/+179
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update ProgressEvent to use doubles (#36487)Sebastian C11 days3-13/+20
| | | | | | | See: https://github.com/whatwg/xhr/pull/394 Testing: WPT tests exist for this Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* compositor: Unify the cross process and in-process API (#36443)Martin Robinson12 days2-7/+4
| | | | | | | | | | | | | | | | | | | | | | Because there used to be two traits exposing messages to the compositor, there were two kinds of messages that could be sent: 1. In-process messages from the `Constellation` 2. Cross-process messages from other parts of Servo Now these two types of messages can be unified into one type. With that done the compositor can simply keep a single `IpcReceiver` for all messages, instead of having to set up a route for the cross-process messsages. This decreases overhead of cross proceses messages a bit, but more importantly solves an issue where Servo would rely on the compositor's cross-process message route after the `Constellation` had called `ROUTER.shutdown()`. This is part of #36442. Testing: This is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* textinput: position the caret at the end when selecting input (#36478)webbeef13 days1-6/+12
| | | | | | | | | | | When clicking on a text input element, we currently position the caret at the very beginning, even if there is already text present. That makes is annoying when you want to add text, and doesn't match what other browsers do. Instead, this change positions the caret at the end of the current text. Testing: Not covered by any wpt tests (rightly so I think). Signed-off-by: webbeef <me@webbeef.org>
* fix: File to FormData not correctly handling name and lastModified (#36458)Sebastian C13 days2-5/+7
| | | | | | | | | | | 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>
* Implement attribute and property lookup for Trusted Types (#36422)Tim van der Lippe13 days1-11/+131
| | | | | | | | 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 C13 days4-117/+127
| | | | | | | | | | | | | | | 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>
* dom: should change media element's currentSrc to children source element's ↵TIN TUN AUNG13 days2-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* add CanGc as argument to methods in Element (#36464)Yerkebulan Tulibergenov13 days8-50/+59
| | | | | | | | add CanGc as argument to methods in Element Testing: These changes do not require tests because they are a refactor. Addresses part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Implement `disabled` attribute for `<link rel="stylesheet">` (#36446)Oriol Brufau14 days2-3/+37
| | | | | | | | | | 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>
* script: Correctly convert a jsval to a `Promise` (#36403)Gae242025-04-091-4/+6
| | | | | | | | | | | 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>
* Add serde and wgsl features to wgpu-core (#36411)Oriol Brufau2025-04-091-2/+4
| | | | | | | | | | | This fixes errors when running `./mach clippy -r -p layout_2020` and `./mach clippy -r -p script`. Also addressing an unused import warning when running the latter. Testing: These changes do not require tests because it's just a compile error fix. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: copy include! files from script_bindings to script's OUT_DIR (#36384)sagudev2025-04-083-14/+52
| | | | | | | | | | | | | | | | | | | | copy generated `include!`d files from script_bindings's OUT_DIR, to script's OUT_DIR to allow Rust Analyzer to load them. This is done to bypass limitation of Rust Analyzer: https://github.com/rust-lang/rust-analyzer/issues/17040 Also build script will now be rerun only when there are actual changes to concrete bindings due to emitted `cargo::rerun-if-changed` (not for each change in script crate). Testing: It compiles so it works, I tested manually and RA now works as expected (although we need to from type alias to concrete union-types definitions) Fixes: https://servo.zulipchat.com/#narrow/channel/263398-general/topic/rust-analyzer.20failed.20to.20include.20codes.20in.20script_bindings --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Unify the way html5ever and xml5ever block on script elements (#36284)Simon Wülker2025-04-086-25/+23
| | | | | | | | | | | | Companion PR for https://github.com/servo/html5ever/pull/591 Testing: Covered by WPT Part of https://github.com/servo/servo/issues/6414, https://github.com/servo/servo/issues/24898, preparation for https://github.com/servo/html5ever/pull/590 --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Devtools: initial Debugger > Sources panel (#36164)delan azabani2025-04-081-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for listing scripts in the Sources panel. Classic scripts, both external and inline, are implemented, but worker scripts and imported module scripts are not yet implemented. For example: ```html <!-- sources.html --> <!doctype html><meta charset=utf-8> <script src="classic.js"></script> <script> console.log("inline classic"); new Worker("worker.js"); </script> <script type="module"> import module from "./module.js"; console.log("inline module"); </script> <script src="https://servo.org/js/load-table.js"></script> ``` ```js // classic.js console.log("external classic"); ``` ```js // worker.js console.log("external classic worker"); ``` ```js // module.js export default 1; console.log("external module"); ``` ![image](https://github.com/user-attachments/assets/2f1d8d7c-501f-4fe5-bd07-085c95e504f2) --- <!-- 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 partially implement #36027 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes require tests, but they are blocked on #36325 Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: atbrakhi <atbrakhi@igalia.com>
* add CanGc as argument to methods in DissimilarOriginWindow, ↵Yerkebulan Tulibergenov2025-04-086-12/+16
| | | | | | | | | | | DocumentFragment, DocumentType, DOMRect, DOMRectReadOnly, DOMStringMap (#36395) add CanGc as argument to methods in DissimilarOriginWindow, DocumentFragment, DocumentType, DOMRect, DOMRectReadOnly, DOMStringMap Testing: These changes do not require tests because they are a refactor. Addressed part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to methods in Document (#36392)Yerkebulan Tulibergenov2025-04-075-54/+60
| | | | | | | | Add CanGc as arguments in methods in Document Testing: These changes do not require tests because they are a refactor. Addressed part of https://github.com/servo/servo/issues/34573. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* fix: meta referrer updating to follow spec (#36390)Sebastian C2025-04-072-37/+28
| | | | | | | | | | 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>
* Split up the URLPattern implementation (#36391)Simon Wülker2025-04-075-2427/+2466
| | | | | | | | | The current implementation is already rather large at ~2.5k lines (~2k LoC). There is still quite a lot of functionality left to implement, so let's split it up while it's still manageable. Testing: Covered by existing web platform tests Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Create a parser for URLPatterns (#36382)Simon Wülker2025-04-071-9/+449
| | | | | | | | | | | 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-071-0/+1
| | | | | | | | | | | | | | | 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>
* Streams: add an underlying sink type (#36385)Gregory Terzian2025-04-072-50/+105
| | | | | | | | | | | | Introduces the concept of different types of underlying sinks for the writable controller, and a minor fix to the abort algorithm. The dead code is already used in the wip at https://github.com/servo/servo/pull/36181/, and will also be used in a another wip in parallel to implement transform stream, so the concept is introduced here with dead code to facilitate the work in parallel and prevent too much merge conflicts down the road. Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
* Remove trailing space in CSSStyleSheet::AddRule() (#36383)Usman Yahaya Baba2025-04-071-1/+1
| | | | | | | | -Remove trailing space in CSSStyleSheet::AddRule() Testing: The change made does not require testing Fixes: https://github.com/servo/servo/issues/36380 Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
* Add a tokenizer for URLPatterns (#36362)Simon Wülker2025-04-071-4/+543
| | | | | | | | | | | | 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-062-0/+182
| | | | | | | | | | | implement the `ClipboardItem` interface Testing: covered by existing wpt tests part of #36084 --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Add CanGc as arguments in methods in devtools.rs, CharacterData, ↵Yerkebulan Tulibergenov2025-04-065-29/+33
| | | | | | | | | | | | | CSSStyleRule, CSSStyleSheet (#36375) Add CanGc as arguments in methods in devtools.rs, CharacterData, CSSStyleRule, CSSStyleSheet Testing: These changes do not require tests because they are a refactor. Addressed part of https://github.com/servo/servo/issues/34573. --------- Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Fix radio group validity update when removing or selecting an input (#36252)elomscansio2025-04-064-38/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* `compositing`: Combine `webrender_traits` and `compositing_traits` (#36372)Martin Robinson2025-04-065-6/+6
| | | | | | | | | | | | | | | These two traits both exposed different parts of the compositing API, but now that the compositor doesn't depend directly on `script` any longer and the `script_traits` crate has been split into the `constellation_traits` crate, this can be finally be cleaned up without causing circular dependencies. In addition, some unit tests for the `IOPCompositor`'s scroll node tree are also moved into `compositing_traits` as well. Testing: This just combines two crates, so no new tests are necessary. Fixes: #35984. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add CanGc as arguments in methods in Attr and Node (#36371)Yerkebulan Tulibergenov2025-04-0619-110/+132
| | | | | | | | | | | | | Add CanGc as argument to methods in `Attr` and `Node`. Addressed part of https://github.com/servo/servo/issues/34573. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they are a refactor. Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Fix: Add support for stylesheet MIME type quirk in quirks mode (#36338)saku2025-04-061-1/+11
| | | | | | | | | | | | | | | | | 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>
* Move `ScriptToConstellationMsg` to `constellation_traits` (#36364)Martin Robinson2025-04-0551-96/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the last big change necessary to create the `constellation_traits` crate. This moves the data structure for messages that originate from the `ScriptThread` and are sent to the `Contellation` to `constellation_traits`, effectively splitting `script_traits` in half. Before, `script_traits` was responsible for exposing the API of both the `ScriptThread` and the `Constellation` to the rest of Servo. - Data structures that are used by `ScriptToConstellationMsg` are moved to `constellation_traits`. The dependency graph looks a bit like this: `script_layout_interface` depends on `script_traits` depends on `constellation_traits` depends on `embedder_traits`. - Data structures that are used in the embedding layer (`UntrustedNodeAddress`, `CompositorHitTestResult`, `TouchEventResult` and `AnimationState`) are moved to embedder_traits, to avoid a dependency cycle between `webrender_traits` and `constellation_traits`. - Types dealing with MessagePorts and serialization are moved to `constellation_traits::message_port`. Testing: This is covered by existing tests as it just moves types around. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Stub out Trusted Types interfaces (#36355)Tim van der Lippe2025-04-059-0/+407
| | | | | | | | | | | | 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>
* structuredclone::read throws a DataClone error on failure (#36361)Kingsley Yung2025-04-051-10/+8
| | | | | | | | | In the structured clone writing API, the read function should throw a DataClone error on failure, just like the write function. Testing: It doesn't require tests. Fixes: #36217 Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
* Make the memory reporting multi-process aware (#35863)webbeef2025-04-052-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | So far the memory reporter aggregates reports from all processes, and runs the system reporter only in the main process. Instead it is desirable to have per-process reports. We do so by: - creating a ProcessReports struct that holds includes the pid in addition to the reports themselves. - running the system memory reporter also in content processes. - updating the about:memory page to create one report per process, and add useful information like the pid and the urls loaded in a given process. <!-- Please describe your changes on the following line: --> --- <!-- 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 ![image](https://github.com/user-attachments/assets/0bafe140-539d-4d6a-8316-639309a22d4a) Signed-off-by: webbeef <me@webbeef.org>
* Check all ancestor navigable trustworthiness for mixed content (#36157)Sebastian C2025-04-0529-5/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* script: Implement input preprocessing for URLPatterns (#36225)Simon Wülker2025-04-041-51/+685
| | | | | | | | | | | | Implements https://urlpattern.spec.whatwg.org/#process-a-urlpatterninit and the component canonicalization functions. These handle percent-encoding and such for the components of a `URLPattern`. No new tests pass, because the tokenizer and parser are still missing. This is part 2 of upstreaming the changes in https://github.com/simonwuelker/servo/tree/urlpattern Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement TestUtils (#36301)Sebastian C2025-04-042-0/+50
| | | | | | | | | | | | | | | | 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>
* constellation: Rename messages sent to the `Constellation` (#36341)Martin Robinson2025-04-0420-133/+155
| | | | | | | | | | | | | | | | | | | | Messages that are sent to the `Constellation` have pretty ambiguous names. This change does two renames: - `ConstellationMsg` → `EmbedderToConstellationMessage` - `ScriptMsg` → `ScriptToConstellationMessage` This naming reflects that the `Constellation` stands in between the embedding layer and the script layer and can receive messages from both. Soon both of these message types will live in `constellation_traits`, reflecting the idea that the `_traits` variant for a crate is responsible for exposing the API for that crate. Testing: No new tests are necessary here as this just renames two enums. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Remove code dealing with `CompositorUntrustedNode` (#36343)Martin Robinson2025-04-042-36/+5
| | | | | | | | | | | | There used to be two kinds of untrusted nodes, but these have been unified, so the duplicate methods dealing with them in `script` can be removed. Testing: This is covered by existing tests as it shouldn't change any behavior. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* constellation: Stop assuming that the viewport is shared by all WebViews ↵Martin Robinson2025-04-0410-85/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#36312) The `Constellation` previously held a `window_size` member, but this assumes that all `WebView`s have the same size. This change removes that assumption as well as making sure that all `WebView`s pass their size and HiDIP scaling to the `Constellation` when they are created. In addition - `WindowSizeData` is renamed to `ViewportDetails`, as it was holding more than just the size and it didn't necessarily correspond to a "window." It's used for tracking viewport data, whether for an `<iframe>` or the main `WebView` viewport. - `ViewportDetails` is stored more consistently so that conceptually an `<iframe>` can also have its own HiDPI scaling. This isn't something we necessarily want, but it makes everything conceptually simpler. The goal with this change is to work toward allowing per-`WebView` HiDPI scaling and sizing. There are still some corresponding changes in the compositor to make that happen, but they will in a subsequent change. Testing: This is covered by existing tests. There should be no behavior changes. Fixes: This is part of #36232. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Remove dependency on `webgpu` (#36332)Martin Robinson2025-04-0423-346/+351
| | | | | | | | | | | | | After #36320, `script` only depends on `webgpu` for its type aliases to `wgpu_core` and `wgpu_types`. This change removes the dependency on `webgpu` in favor of depending directly on the upstream crates. This makes it so that you can change `webgpu` without recompiling `script`. Testing: This change is covered by existing WebGPU tests and is mainly just changing the way dependencies are accessed. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>