aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_bindings/codegen
Commit message (Collapse)AuthorAgeFilesLines
* add CanGc as argument to methods in DissimilarOriginWindow, ↵Yerkebulan Tulibergenov2025-04-081-3/+15
| | | | | | | | | | | 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-071-1/+1
| | | | | | | | 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>
* dom: Implement `ClipboardItem` (#36336)Gae242025-04-061-0/+4
| | | | | | | | | | | 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-061-1/+9
| | | | | | | | | | | | | 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>
* Add CanGc as arguments in methods in Attr and Node (#36371)Yerkebulan Tulibergenov2025-04-061-1/+5
| | | | | | | | | | | | | 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>
* Stub out Trusted Types interfaces (#36355)Tim van der Lippe2025-04-051-2/+10
| | | | | | | | | | | | 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>
* Move generated bindings to script_bindings (#36323)Josh Matthews2025-04-043-81/+81
| | | | | | | | | | | | | | | | | | | | | This is the final step of #1799, where the majority of the generated code for the JS bindings is now compiled as part of the script_bindings build step. The remaining pieces in script must live there because they refer to concrete DOM types; all code in script_bindings is generic over the [DomTypes](https://doc.servo.org/script/dom/bindings/codegen/DomTypes/trait.DomTypes.html) trait. My testing with incremental builds shows me a 12 second reduction in build times on my 2024 M4 Macbook Pro when modifying code in the script crate after these changes. Before this PR those changes took 20 seconds to rebuild Servo, and now they take 8 seconds. Testing: Existing WPT tests ensure no regressions. Fixes: #1799 --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Support single-value `<select>` elements (#35684)Simon Wülker2025-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/user-attachments/assets/9aba75ff-4190-4a85-89ed-d3f3aa53d3b0 Among other things this adds a new `EmbedderMsg::ShowSelectElementMenu` to tell the embedder to display a select popup at the given location. This is a draft because some small style adjustments need to be made: * the select element should always have the width of the largest option * the border should be part of the shadow tree Apart from that, it's mostly ready for review. <details><summary>HTML for demo video</summary> ```html <html> <body> <select id="c" name="choice"> <option value="first">First Value</option> <option value="second">Second Value</option> <option value="third">Third Value</option> </select> </body> </html> ``` </details> --- <!-- 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] Part of https://github.com/servo/servo/issues/3551 - [ ] 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: Simon Wülker <simon.wuelker@arcor.de>
* Implement CSSNestedDeclarations (#36248)Oriol Brufau2025-04-011-0/+4
| | | | | | | | | | | This is the CSSOM interface that represents a nested declarations rule. https://drafts.csswg.org/css-nesting/#the-cssnestrule Testing: `/_mozilla/mozilla/interfaces.https.html`. And once `CSSStyleRule` becomes a `CSSGroupingRule` subclass, this will be further covered by `/css/css-nestting/`. This is part of #36245 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* More miscellaneous script splitting changes (#36220)Josh Matthews2025-03-302-51/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Move HasParent to script_bindings and update imports for InheritTypes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make principal creation generic over DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move a bunch of proxy-related code to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make some proxy-related code generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move DomSlice to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move some utility bindings code to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make enumerating and resolving globals generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make realm helpers generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move implementations on concrete DOM types to concrete bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make additional codegen helpers generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make iterator creation generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make reporting an exception a generic operation. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move AsCCharPtrPtr to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Address clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Miscellaneous script splitting preparation changes (#36216)Josh Matthews2025-03-292-23/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Move num module to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make JS reflector creation generic over DOM trait. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move bindings-specific lock to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move DOM proto array code to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move finalizer implementations to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move some error routines to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move some DOM interface conversion routines to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make is_array_like generic over DOM trait. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Use generic interfaces for conditional exposure functions. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move a bunch of routines used by codegen to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Stop using `RootedGuard's` DerefMut impl (#36158)Greg Morenz2025-03-281-2/+2
| | | | | | | | | | | | | | | | | * Stop using RootedGuard's DerefMut impl Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Update mozjs version Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * `self.bytes` should not be mutably borrowed over GC pause Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> --------- Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
* Start implementing the `URLPattern` API (#36144)Simon Wülker2025-03-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start working on a basic URLPattern implementation This is API part of Interop 2025, so we should definitely support it! This change implements the basic workflow for parsing and compiling URL patterns. Parts of it are stubbed out and will be implemented later. For now the API is preference-gated behind "dom_urlpattern_enabled". Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Preference-gate the URLPattern API Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix full wildcard value (Should be ".*" not "*") Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Expose new methods for obtaining a global that require a realm. (#36116)Josh Matthews2025-03-261-2/+3
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* feat: add CanGc argument in get_dictionary_property (#36156)Arya Nair2025-03-251-2/+3
| | | | | | | | | | | | | * feat: add CanGc argument in get_dictionary_property Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * feat: add CanGc argument in get_dictionary_property Signed-off-by: Arya Nair <aryaajitnair@gmail.com> --------- Signed-off-by: Arya Nair <aryaajitnair@gmail.com>
* script: Support converting JS values to Rc<Promise> with ↵Josh Matthews2025-03-251-1/+1
| | | | | FromJSValConvertible. (#36097) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Implement `Element::GetHTML` and `ShadowRoot::GetHTML` (#36106)Simon Wülker2025-03-231-2/+2
| | | | | | | | | | | | | | | | | | | | | * Serialize html fragments without going through html5ever Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement ShadowRoot::GetHtml / Element::GetHtml Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Propagate CanGc annotations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Ensure promises are considered DOM interfaces when generating ↵Josh Matthews2025-03-231-3/+3
| | | | | bindings. (#36107) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Use explicit reborrows with mozjs::MutableHandle (#35892)Greg Morenz2025-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | * Explicitly reborrow MutableHandles Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Unify jsapi_wrappers Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Format mozjs changes Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Update mozjs version Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> --------- Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
* feat: add can_gc argument to to_frozen_array (#36043)Arya Nair2025-03-191-4/+41
| | | | | | | | | | | | | | | | | | | | | * feat: add can_gc argument to to_frozen_array Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * fix: linting issues Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * feat: add can_gc in binding.conf Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * fix: linting issues Signed-off-by: Arya Nair <aryaajitnair@gmail.com> --------- Signed-off-by: Arya Nair <aryaajitnair@gmail.com>
* script: Implement `Range::getClientRects` and `Range::getBoundingClientRect` ↵Simon Wülker2025-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | (#35993) * Add doc comments to boundary point Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow querying content box of text fragments Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement Range::getBoundingClientRect Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Streams: Implement stream pipe-to (#35650)Gregory Terzian2025-03-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement PipeTo, stub pipe_to Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * define a data structure to manage the piping Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * implement propagation of errors forward and backward, stub shutdown and shutdown with action Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * adding more fine-grain shutdown variants to state Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * implement progagate closing backward and forward Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * implement shutdown and actions Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * implement reading and writing Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * implement shutdown continuation and finalize Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix typo Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add can_gc arguments Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * implement writer close with error propagation Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * move and document wait on pending write Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * more docs Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * write pending reads as part of shutdown Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * turn on piping test suite Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add comment about using Rust api improve comment on result add comment on backpressure Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix multiple propagations Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix writing of chunks Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix error and close propagation update test expectations Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix warnings Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * improve docs remove redundant logic in pending writes Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix clippy Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * remove unnecessary expansion of visibility of enqueued value to_jsval Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * remove unnecessary conditional accessing of streams when propagating states Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * improve docs Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * remove unused result var Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix typo Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * remove redundant logic dealing with closed sources with pending writes Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add doc links for shutdown actions Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add comments on the need to return early when shutting down before checking close and error states Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fmt Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * Update test expectations Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix can_gc Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
* Implement declarative shadow dom (#34964)batu_hoang2025-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement declarative shadow dom Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Set allowDeclarativeShadowRoots false for innerHTML Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Enable allowDeclarativeShadowRoots for Document Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Expose HTMLTemplateElement to js Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Implemenet setHTMLUnsafe and add more test cases Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Declarative shadow dom: minor updates and expected test result update Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Shadow-dom: add more test cases Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Update comments according to the spec Signed-off-by: batu_hoang <longvatrong111@gmail.com> * Bump html5ever version Signed-off-by: batu_hoang <longvatrong111@gmail.com> --------- Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Move CustomTraceable to script_bindings. (#35988)Josh Matthews2025-03-161-2/+2
| | | | | | | | | | | | | | | | | * script: Move CustomTraceable to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move record binding support to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Address clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Cleanups for future script crate split (#35987)Josh Matthews2025-03-162-0/+29
| | | | | | | | | | | | | | | | | * script: Avoid direct impl blocks on generated dicts and unions. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Remove references to codegen-specific import module. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Use stream in file read operation (#35969)Gregory Terzian2025-03-161-1/+2
| | | | | | | | | | | | | * use read_all_bytes in file read operation Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add docs Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> --------- Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
* Migrate to the 2024 edition (#35755)Simon Wülker2025-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | * Migrate to 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow unsafe_op_in_unsafe_fn lint This lint warns by default in the 2024 edition, but is *way* too noisy for servo. We might enable it in the future, but not now. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Compile using the 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Remove legacy layout (layout 2013) (#35943)Oriol Brufau2025-03-131-1/+0
| | | | | | We were already not compiling it and not running tests on it by default. So it's simpler to just completely remove it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: implement ReadableByteStreamController (#35410)Taym Haddadi2025-03-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: implement ReadableByteStreamController Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * implement can_copy_data_block_bytes and copy_data_block_bytes Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove BufferSource::Default Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * implement StartAlgorithmFulfillmentHandler, StartAlgorithmRejectionHandler, PullAlgorithmFulfillmentHandler, PullAlgorithmRejectionHandler for ReadableByteStreamController Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * implement perform_pull_into Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix build Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix build Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove RefCell from PullIntoDescriptor and QueueEntry Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove commented code Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * add perform_cancel_steps, perform_release_steps and perform_pull_steps Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix crown Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * unskip readable-byte-streams Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix CRASH Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix more CRASHS Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix more crashes Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix bad-buffers-and-views.any.js test Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Update test expectations Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix BorrowMutError crashes Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix view_byte_length test Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix non-transferable-buffers test Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Pass contexts as much as possible by reference Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Make respond_internal Fallible Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix crwon Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * fix process pull into descriptors using queue logic and resulting double-borrow Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * Fix clippy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * FIx more crashes Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix timeout tests Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix all tests Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove all error! logs Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Remove #[allow(unsafe_code)] Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix lint Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix tidy Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * Fix test expectation Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
* Add an about:memory page (#35728)webbeef2025-03-071-0/+5
| | | | | | | | | | | | | | | | | This patch exposes a servo internal DOM API that is only made available to about: pages on the navigator object to request memory reports. The about:memory page itself is loaded like other html resources (eg. bad cert, net error) and makes use of this new API. On the implementation side, notable changes: - components/script/routed_promise.rs abstracts the setup used to fulfill a promise when the work needs to be routed through the constellation. The goal is to migrate other similar promise APIs in followup (eg. dom/webgpu/gpu.rs, bluetooth.rs). - a new message is added to request a report from the memory reporter, and the memory reporter creates a json representation of the set of memory reports. - the post-processing of memory reports is done in Javascript in the about-memory.html page, providing the same results as the current Rust code that outputs to stdout. We can decide later if we want to remove the current output. Signed-off-by: webbeef <me@webbeef.org>
* refactor: add CanGc as argument to methods in CSSKeyframeRule, CSSMediaRule, ↵Yerkebulan Tulibergenov2025-03-051-0/+12
| | | | | CSSRule (#35796) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* script: Mark callback methods with CanGc. (#35753)Josh Matthews2025-03-032-2/+13
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* refactor: add CanGc as argument to methods in CSSGroupingRule, ↵Yerkebulan Tulibergenov2025-03-021-0/+12
| | | | | CSSKeyframesRule, Crypto (#35743) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to methods in CanvasRenderingContext2D and ↵Yerkebulan Tulibergenov2025-03-011-2/+2
| | | | | OffscreenCanvasRenderingContext2D (#35732) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to OffscreenCanvas methods (#35731)Yerkebulan Tulibergenov2025-03-011-0/+4
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to BaseAudioContext::{Destination, Listener} ↵Yerkebulan Tulibergenov2025-03-011-1/+1
| | | | | (#35729) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* script: Implement `Blob::bytes()` (#35151)Kousuke Takaki2025-02-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Implement Blob.bytes() Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * improve read_all_bytes Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * fix read_all_bytes Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * fix bug Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> * something went wrong Signed-off-by: Kousuke Takaki <98276492+yoseio@users.noreply.github.com> * fix read loop Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * add use of can_gc to promise code following rebase Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * fix rooting of fulfillment handler Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * Update test expectations Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * use dom for reader in read loop fulfillment handler Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * use the global of the reader in read loop fulfillment handler Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> * remove FAIl expectations for blob methods in detached iframe Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> --------- Signed-off-by: yoseio <98276492+yoseio@users.noreply.github.com> Signed-off-by: Kousuke Takaki <98276492+yoseio@users.noreply.github.com> Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com> Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
* bindings: Fix support for interface members in setlike/maplike. (#35651)Mukilan Thiyagarajan2025-02-271-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | #30151 added support for setlike and maplike declarations in WebIDL, but the tests only validated if generator code worked with 'DOMString' as the key type. The support for interface type as members was broken as `DomRoot<T>` didn't satify the bounds `Eq` and `Hash` needed by the `Key` and `Value` types in `Setlike` and `Maplike` traits respectively. In addition, the splitting of bindings into a separate 'script_bindings' crate had also broken support for this in CodegenRust.py, as the types used within the definition of `DomTraits` were not referenced using `Self::`. This patch fixes the WebIDL code generator by doing a simple string replacement on the return value of `getRetvalDeclarationForType` so that the proper `Self::` is used. I'm not not sure if there is a better approach to this as it seems most logic in CodegenRust.py uses the `D::` prefix that is expected to be available only when compiling `script` crate and not `script_bindings`. This patch also adds the missing trait implementations for `DomRoot` and ensures that the generated code works for both members of primitive and interface types by splitting the existing `TestBinding{Map,Set}Like` interfaces into `TestBinding{Map,Set}LikeWith{Primitive,Interface}` tests. Fixes #35542. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* refactor: add CanGc as argument to exception_to_promise (#35647)Yerkebulan Tulibergenov2025-02-251-2/+2
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to Promise::reject_error (#35646)Yerkebulan Tulibergenov2025-02-251-1/+1
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to Promise::reject_native (#35640)Yerkebulan Tulibergenov2025-02-251-3/+3
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to Promise::reject (#35622)Yerkebulan Tulibergenov2025-02-231-1/+1
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Unify `(Offscreen)CanvasRenderingContext2d` and make ↵Samson2025-02-231-2/+2
| | | | | `PaintRenderingContext2D` standalone (#35619) Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* refactor: add CanGc as argument to Promise::resolve (#35616)Yerkebulan Tulibergenov2025-02-231-3/+3
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to DataBlock::view (#35610)Yerkebulan Tulibergenov2025-02-231-1/+1
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to CountQueuingStrategy::GetSize (#35595)Yerkebulan Tulibergenov2025-02-221-0/+4
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to ByteLengthQueuingStrategy::GetSize (#35594)Yerkebulan Tulibergenov2025-02-221-0/+4
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to create_buffer_source (#35597)Yerkebulan Tulibergenov2025-02-221-4/+20
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* script: Make callbacks generic over DOM interfaces. (#35459)Josh Matthews2025-02-213-29/+28
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Refer to DOM interfaces with generic types in generated bindings. ↵Josh Matthews2025-02-214-103/+398
| | | | | (#35457) Signed-off-by: Josh Matthews <josh@joshmatthews.net>