aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_bindings
Commit message (Collapse)AuthorAgeFilesLines
* script: Implement CSSStyleSheet constructor (#36521)Oriol Brufau9 days1-0/+8
| | | | | | | | 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>
* Transfer ReadableStream (#36181)Gregory Terzian9 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- 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>
* Gate `window.trustedTypes` behind flag (#36511)Tim van der Lippe10 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)Gae2410 days3-1/+20
| | | | | | | | | | 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>
* add CanGc as argument to methods in HTMLInputElement, HTMLLinkElement (#36504)Yerkebulan Tulibergenov11 days1-2/+2
| | | | | | | | 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 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - [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 days1-4/+16
| | | | | | | | | | | | 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>
* add CanGc as argument to methods in ElementInternals, GlobalScope, ↵Yerkebulan Tulibergenov12 days1-4/+4
| | | | | | | | | | | 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 Lippe12 days2-5/+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>
* Update ProgressEvent to use doubles (#36487)Sebastian C12 days1-4/+4
| | | | | | | See: https://github.com/whatwg/xhr/pull/394 Testing: WPT tests exist for this Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* dom: should change media element's currentSrc to children source element's ↵TIN TUN AUNG13 days1-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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 days1-2/+2
| | | | | | | | 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 Brufau2025-04-101-2/+9
| | | | | | | | | | 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: copy include! files from script_bindings to script's OUT_DIR (#36384)sagudev2025-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* Remove unsafe annotation add to unsafe blocks (#36399)Barigbue Nbira2025-04-081-17/+23
| | | | | | | | | | | | Remove the `unsafe` annotation from the `cross_origin_get` function and add `unsafe` blocks around unsafe code within the function Testing: Testing is not required as this change does not alter behaviour. Fixes: #36358 --------- Signed-off-by: Barigbue <barigbuenbira@gmail.com>
* 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-062-0/+30
| | | | | | | | | | | 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>
* Remove unsafe from cross_origin_property_fallback (#36373)Usman Yahaya Baba2025-04-061-2/+2
| | | | | | | | | | | | Remove unsafe from cross_origin_property_fallback - Refactors `cross_origin_property_fallback` to remove the `unsafe` annotation from the function signature, as it now uses safe wrappers instead of raw pointers - Adds an `unsafe` block around `MutableHandle::from_raw` Testing: Changes does not require test Fixes: https://github.com/servo/servo/issues/36359 Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
* Remove unsafe from maybe_cross_origin_get_prototype (#36366)Usman Yahaya Baba2025-04-061-8/+6
| | | | | | | | | | | | | Remove unsafe from maybe_cross_origin_get_prototype -Refactors `maybe_cross_origin_get_prototype` to remove the `unsafe` annotation from the function signature and `get_proto_object` argument -Adds `unsafe` blocks around calls `D::GlobalScope::from_context` and `MutableHandleObject::from_raw` Testing: Changes does not require test Fixes: https://github.com/servo/servo/issues/36357 Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@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>
* Refactor:Refactors report_cross_origin_denial method to use unsafe block ↵kaushikashok452025-04-051-5/+7
| | | | | | | | | | | | | | | | (#36365) The method report_cross_origin_denial was marked as unsafe, have instead moved the unsafe code within the method into an unsafe block within the method and removed the unsafe marking for the method. Testing: No testing needed Fixes: This PR resolves #36356. Signed-off-by : Ashok Kaushik kaushikashok45@gmail.com --------- Signed-off-by: ashok.kaushik <ashok.kaushik@zohocorp.com> Co-authored-by: ashok.kaushik <ashok.kaushik@zohocorp.com>
* Stub out Trusted Types interfaces (#36355)Tim van der Lippe2025-04-057-2/+107
| | | | | | | | | | | | 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>
* script: Implement input preprocessing for URLPatterns (#36225)Simon Wülker2025-04-041-1/+1
| | | | | | | | | | | | 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-041-0/+10
| | | | | | | | | | | | | | | | 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>
* Move generated bindings to script_bindings (#36323)Josh Matthews2025-04-0424-143/+2715
| | | | | | | | | | | | | | | | | | | | | 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>
* script: Implement deprecated CSSStyleSheet members (#36313)Oriol Brufau2025-04-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | Implements `rules`, `addRule()` and `removeRule()` for `CSSStyleSheet`. https://drafts.csswg.org/cssom/#legacy-css-style-sheet-members This is part of #36162 Testing: - `/css/css-cascade/at-scope-parsing.html` - `/css/css-conditional/at-supports-whitespace.html` - `/css/css-nesting/invalidation-004.html` - `/css/css-nesting/parsing.html` - `/css/css-nesting/serialize-group-rules-with-decls.html` - `/css/css-syntax/custom-property-rule-ambiguity.html` - `/css/css-syntax/invalid-nested-rules.html` - `/css/css-syntax/trailing-braces.html` - `/css/css-syntax/var-with-blocks.html` - `/css/css-transitions/parsing/starting-style-parsing.html` - `/css/cssom/CSSStyleSheet.html` - `/css/cssom/idlharness.html` - `/css/cssom/insertRule-across-context.html` Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* 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>
* Turn `CSSStyleRule` into a `CSSGroupingRule` subclass (#36254)Oriol Brufau2025-04-011-1/+1
| | | | | | | | | | | | | | | Note that `StyleRule` may not have the `CssRules` readily available, they may need to be created. So the previous approach of providing `CSSGroupingRule` with the `CssRules` is no good: it would require writing them in advance, just in case they end up being used. Therefore, this removes the `CSSGroupingRule::rules` field. Instead, they are lazily obtained in `CSSGroupingRule::rulelist()` by downcasting and calling the appropriate method for the subclass. Testing: covered by WPT Fixes: #36245 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* canvas: Implement line dash setters and getters (#36257)Steven Novaryo2025-04-011-3/+3
| | | | | | | | | | | Implement `setLineDash`, `getLineDash`, and `lineDashOffset` from `CanvasPathDrawingStyles` mixin, according to the spec https://html.spec.whatwg.org/multipage/canvas.html#canvaspathdrawingstyles. Testing: Existing WPT. --------- Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
* Implement CSSNestedDeclarations (#36248)Oriol Brufau2025-04-012-0/+17
| | | | | | | | | | | 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>
* Organize component Cargo.toml dependencies (#36224)Alex Touchet2025-03-301-7/+7
| | | Signed-off-by: Alex Touchet <26315797+atouchet@users.noreply.github.com>
* More miscellaneous script splitting changes (#36220)Josh Matthews2025-03-308-55/+631
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-2911-26/+815
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-272-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add `Path2D` (#35783)Lukas Lihotzki2025-03-261-5/+14
| | | Signed-off-by: Lukas Lihotzki <lukas@lihotzki.de>
* 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-252-1/+2
| | | | | FromJSValConvertible. (#36097) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Implement `Element::GetHTML` and `ShadowRoot::GetHTML` (#36106)Simon Wülker2025-03-233-4/+10
| | | | | | | | | | | | | | | | | | | | | * 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-232-3/+5
| | | | | 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>
* Make Element::attach_shadow() and ShadowRoot closer to spec (#36024)batu_hoang2025-03-192-4/+4
| | | Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* Cleanup Stylo dependencies (#36046)Oriol Brufau2025-03-191-1/+1
| | | | | | | | | Now that Stylo considers `servo` as the default feature, Servo doesn't need to specify `features = ["servo"]`. Also use the same crate names as Stylo, rather than renaming them with `package`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: Implement `Range::getClientRects` and `Range::getBoundingClientRect` ↵Simon Wülker2025-03-192-4/+3
| | | | | | | | | | | | | | | | | | | | | | | (#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>
* Support align attribute on HTMLParagraphElement interface (#36054)Stephen Muss2025-03-191-2/+1
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* Streams: Implement stream pipe-to (#35650)Gregory Terzian2025-03-182-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>