aboutsummaryrefslogtreecommitdiffstats
path: root/components
Commit message (Collapse)AuthorAgeFilesLines
...
* Make DOMException serializable (#36535)Kingsley Yung6 days4-3/+138
| | | | | | | | | | | 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>
* Unify media query and media query list parsing (#36520)Oriol Brufau7 days4-123/+64
| | | | | | | | | | Several places were using identical logic in order to parse a media queries or media query lists. This patch centralizes the logic into 2 new helper methods in MediaList. Testing: not needed (no behavior change) Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* touch: Fix panic with -Zconvert-mouse-to-touch (#36531)Jonathan Schwender7 days2-17/+47
| | | | | | | | | | | | | | | - We previously converted all mouse move events to touch events, but we should only be doing that while a mouse button is pressed (a finger always does touch-down -> move -> up / cancel) - Only consider Left mouse button for mouse-to-touch. We currently already hardcode TouchId 0, which we would need to change in order to properly support Multi-touch. Since we don't have any Multi-touch gestures at the moment, we leave this unimplemented and simply only evaluate the left mouse button. Testing: Manual testing. We don't have servodriver support yet. Fixes: #36526 Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Revert "compositor: Unify the cross process and in-process API (#36443)" ↵Martin Robinson7 days8-95/+215
| | | | | | | | | | | | | (#36533) This reverts commit 4c55104b36c7b858a117a6dd90a5dc21b74324d1. This commit introduced an issue where messages from script to the compositor no longer woke up the embedder. There is a larger issue here, but this change exacerbated it. Fixes #36528. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Transfer ReadableStream (#36181)Gregory Terzian7 days9-57/+868
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- 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>
* Remove unused pref: dom_forcetouch_enabled (#36524)webbeef7 days1-2/+0
| | | | | | | This is a leftover from e7c754fb64bf200cf64f7c7c4104f8489d117965 Testing: removing unused pref, no testing needed. Signed-off-by: webbeef <me@webbeef.org>
* layout: Floor the max-content size by the min-content size (#36518)Oriol Brufau7 days1-2/+8
| | | | | | | | | | | | | | | 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 Lippe7 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>
* layout: Add a `LayoutBoxBase` to inline boxes (#36513)Martin Robinson7 days6-24/+29
| | | | | | | | | | | | `LayoutBoxBase` will soon contain laid out `Fragment`s of a box tree node in order to facilitate incremental layout and also layout queries. This is currently missing for inline boxes, so this change adds a `LayoutBoxBase` to them. Testing: This should not change any observable behavior, so existing WPT suites should suffice for testing. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Gate `window.trustedTypes` behind flag (#36511)Tim van der Lippe7 days1-0/+1
| | | | | | | This was missed in #36355 and should have also been gated by the flag. With these, the wpt.fyi tests should now no longer pass, as the flag hasn't been removed yet. Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
* async clipboard: implement `writeText` (#36498)Gae247 days8-1/+171
| | | | | | | | | | 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>
* libservo: Make zooming and HiDPI scaling work per-`WebView` (#36419)Martin Robinson8 days9-313/+365
| | | | | | | | | | | | | | | | | | | | | | | | libservo: Make zooming and HiDPI scaling work per-`WebView` This change moves all zooming and HiDPI scaling to work per-`WebView` in both libservo and Compositor. This means that you can pinch zoom one `WebView` and it should now work independently of other `WebView`s. This is accomplished by making each `WebView` in the WebRender scene have its own scaling reference frame. All WebViews are now expected to manage their HiDPI scaling factor and this can be set independently of other WebViews. Perhaps in the future this will become a Servo-wide setting. This allows full removal of the `WindowMethods` trait from Servo. Testing: There are not yet any tests for the WebView API, but I hope to add those soon. Co-authored-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Shubham Gupta <shubham13297@gmail.com>
* layout: Let getComputedStyle resolve auto min size as 0px when needed (#36430)Oriol Brufau8 days1-91/+132
| | | | | | | | | 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>
* compositing: Remove `IOCompositor::zoom_time` and ↵Martin Robinson8 days1-17/+0
| | | | | | | | | `IOCompositor::zoom_action` (#36509) It seems that these two members are completely unused. Testing: These changes are untested as they simply removed dead code. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Remove the unused `multiview` feature (#36485)Martin Robinson8 days3-3/+0
| | | Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Remove HTMLStyleElement::line_number (#36507)Simon Wülker8 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 Lippe8 days27-35/+251
| | | | | | | | | | | | | | | | | | 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 Tulibergenov8 days4-26/+23
| | | | | | | | 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 Lensun8 days7-10/+61
| | | | | | | | | | | | | | | | | | | | | | | - [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>
* Fix typo in tracing code. (#36501)Josh Matthews8 days1-1/+1
| | | | | | | Presumably this was an autocomplete mistake. Testing: ran Servo with RUST_LOG enabled. No panic any more. Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* add CanGc as argument to methods in HTMLCollection, HTMLDataListElement, ↵Yerkebulan Tulibergenov9 days14-60/+69
| | | | | | | | | | | | 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-pie9 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 Tulibergenov9 days10-27/+29
| | | | | | | | | | | 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 Lippe9 days4-30/+188
| | | | | | | | | | | | | | | | | | | | | | | | | 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 C9 days4-17/+24
| | | | | | | 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 Robinson9 days8-215/+95
| | | | | | | | | | | | | | | | | | | | | | 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>
* compositing: Send `CompositorDisplayListInfo` as bytes to compositor (#36484)Martin Robinson9 days4-8/+25
| | | | | | | | | | | | | `CompositorDisplayListInfo` is a large data structure that scales with the size of the display list. Serializing it onto the Compositor's IPC channel can cause deadlocks. This change serializes it with bincode and sends it alongside the rest of the serialized display list information on the IPC `bytes_channel`. This should prevent deadlocks when the compositor API is unified. Testing: This is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Create a `WebViewBuilder` class to construct `WebView`s (#36483)Martin Robinson9 days3-38/+79
| | | | | | | | | | | This exposes a new method of creating `WebView`s using the Rust builder pattern. This will be more important as we add more kinds of configuration options for `WebView` such as size and HiDPI scaling. Testing: The API currently doesn't have tests, but functionality is ensured by the fact that servoshell is the test harness. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* libservo: Add a very simple `libservo` API test (#36440)Martin Robinson9 days2-0/+99
| | | | | | | | | | | | libservo: Add a very simple `libservo` API test This is the first step toward adding full testing for the `WebView` API. The test added here simply starts up a Servo instance and verifies that it does not crash when shutting down. Testing: This change is a test, so there are tests for these changes. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Enforce min-content min main size of flex-level tables (#36469)Oriol Brufau9 days2-16/+31
| | | | | | | | | | | 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>
* layout: Store table parts in DOM layout data (#36447)Martin Robinson9 days8-143/+229
| | | | | | | | | | | | | | | | | | | When laying out tables, store the boxes of non-anonymous table parts in their respective DOM objects. This is going to be important for incremental layout, but also for mapping from the DOM to the box tree (and eventually the fragment tree). For now, anonymous table parts are still lost to time and space, but in a followup change we hope to store them somewhere. Testing: This has no visible change to web rendering, so is covered by existing WPT. Co-authored-by: Oriol Brufau <obrufau@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Box `block_margins_collapsed_with_children` member of `BoxFragment` ↵Martin Robinson10 days7-42/+29
| | | | | | | | | | | (#36474) This reduces the size of `BoxFragment` by around 20 bytes. Testing: This just changes the layout of a data structure, so is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* textinput: position the caret at the end when selecting input (#36478)webbeef10 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 C10 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>
* Manually concatenate ACRH headers to not include a space (#36455)Sebastian C10 days2-9/+14
| | | | | | | | | | | | 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>
* layout: Eliminate extra stored style on outside markers (#36471)Martin Robinson10 days2-5/+3
| | | | | | | | This is a duplicate of the style stored on the marker's `LayoutBoxBase`. Testing: This is covered by existings WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Cleanup after #36461 (#36472)Oriol Brufau10 days2-13/+7
| | | | | | | This avoids some minor code duplication. Testing: not needed (no behavior change) Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Implement attribute and property lookup for Trusted Types (#36422)Tim van der Lippe11 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 C11 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>
* fix: Crashing due to input element hack (#36461)DK Liao11 days3-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 AUNG11 days3-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | 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 Tulibergenov11 days9-52/+61
| | | | | | | | 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>
* layout: Add documentation for `CacheableLayoutResultAndInputs` (#36448)Martin Robinson11 days1-0/+6
| | | | Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Replace bluetooth Readme with corrected version from devices repository (#36429)Alex Touchet11 days1-36/+146
| | | | | | | | | This Readme is for a different crate located in https://github.com/servo/servo/tree/main/third_party/blurmac. Was adding it to the bluetooth directory in #30974 a mistake? --------- Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
* Implement `disabled` attribute for `<link rel="stylesheet">` (#36446)Oriol Brufau11 days3-5/+46
| | | | | | | | | | 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 Liao11 days8-11/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* refactor: use is_zero() instead of comparing with Au::Zero() (#36347)Barigbue Nbira12 days6-14/+15
| | | | | | | | | | | Use `is_zero()` instead of comparing with `Au::Zero()` for zero checks. Testing: This change does not cause behaviour change, a test is not necessary. Fixes: #36300 --------- Signed-off-by: Barigbue <barigbuenbira@gmail.com>
* libservo: Move animation tracking from `WindowMethods` to delegates (#36400)Martin Robinson12 days9-78/+115
| | | | | | | | | | | | | | | | | | This changes removes animation tracking from the `WindowMethods` trait and moves it to `ServoDelegate` and `WebViewDelegate`. - Animation changes per-`WebView` are now triggered in the compositor only when the value is updated there, rather than right after ticking animations. - Both `WebView` and `Servo` now expose an `animation()` method, so tracking animation state actually becomes unecessary in many cases, such as that of desktop servoshell, which can just read the value when the event loop spins. Testing: No tests necessary as the API layer is still untested. Later, tests will be added for the `WebView` API and this can be tested then. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Correctly convert a jsval to a `Promise` (#36403)Gae2412 days1-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>
* libservo: Move `EventLooperWaker` from `webxr_traits` to `embedder_traits` ↵Martin Robinson12 days6-27/+8
| | | | | | | | | | | | (#36420) Now that `webxr` is integrated into the Servo directory, `webxr` can depend on `embedder_traits` instead of having it re-export this type conditionally (and sometimes duplicating it). Testing: This just moves a data type, so no tests are necessary. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>