aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
Commit message (Collapse)AuthorAgeFilesLines
...
* dom: Track "removed" event listener status (#36163)Andrei Volykhin2025-03-282-97/+107
| | | | | | | | | | | | | | | | | The DOM event listener "removed" status should be supported to track the following situations (with immediate effect of listener removal): - Removing a later event listener while an earlier listener for the same event is running - Nested usage (recursively dispatch another event) of "once" listeners https://dom.spec.whatwg.org/#event-listener-removed During event dispatching requires to clone event listeners list on "invoke" step https://dom.spec.whatwg.org/#concept-event-listener-invoke and the lowercase "event listener" concept in Servo is EventListenerEntry https://dom.spec.whatwg.org/#concept-event-listener Bug: #25479, #25090 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
* Animation: Aggregate Animated Image Info to Document (#36141)TIN TUN AUNG2025-03-282-1/+17
| | | Signed-off-by: rayguo17 <rayguo17@gmail.com>
* Stop using `RootedGuard's` DerefMut impl (#36158)Greg Morenz2025-03-282-6/+7
| | | | | | | | | | | | | | | | | * 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>
* fix: prevent missing value error for radio button inputs without a name (#36197)Barigbue Nbira2025-03-281-0/+3
| | | Signed-off-by: Barigbue <barigbuenbira@gmail.com>
* Replace some uses of window.global() with upcast. (#36179)Aniebiet Afia2025-03-271-1/+1
| | | Signed-off-by: aniebietafia <aniebietafia87@gmail.com>
* fix(parser): Set shadow’s available to element internals in ↵elomscansio2025-03-271-0/+3
| | | | | | | | | | | | | | | attach_declarative_shadow (#36173) Aligns the implementation with step 8.5 of the HTML spec for parsing a <template> element in the InHead state by setting shadow_root.set_available_to_element_internals(true) after assigning the shadow root to the template’s contents. Also removes tests/wpt/meta/shadow-dom/declarative/declarative-shadow-dom-available-to-element-internals.html.ini since the test expectations are now updated accordingly. Spec reference: https://html.spec.whatwg.org/multipage/#parsing-main-inhead Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
* Start implementing the `URLPattern` API (#36144)Simon Wülker2025-03-273-5/+828
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Allow setting userscripts directly without the need of files (#35388)Tony2025-03-272-31/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow settings userscripts through preferences Signed-off-by: Tony <legendmastertony@gmail.com> * mach fmt instead of cargo fmt Signed-off-by: Tony <legendmastertony@gmail.com> * Fix pref loading not working for array values Signed-off-by: Tony <legendmastertony@gmail.com> * Use pref! in userscripts instead Signed-off-by: Tony <legendmastertony@gmail.com> * Implement the model jdm suggested - Remove userscripts from all places and move it to servoshell - Add in `UserContentManager` struct and passing it through `Servo::new` all the way down to script thread Signed-off-by: Tony <legendmastertony@gmail.com> * Apply suggestions from code review and format Signed-off-by: Tony <legendmastertony@gmail.com> * Revert unrelated change Signed-off-by: Tony <legendmastertony@gmail.com> --------- Signed-off-by: Tony <legendmastertony@gmail.com> Signed-off-by: Tony <68118705+Legend-Master@users.noreply.github.com>
* Make DOMPoint and DOMPointReadOnly serializable (#35989)Josh Matthews2025-03-278-12/+157
| | | | | | | | | | | | | | | | | | | | | | | * script: Make DOMPointReadOnly serializable. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make DOMPoint serializable. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Shrink worker script event. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update components/script/dom/dompoint.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* script: Expose new methods for obtaining a global that require a realm. (#36116)Josh Matthews2025-03-265-17/+27
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add `Path2D` (#35783)Lukas Lihotzki2025-03-265-0/+381
| | | Signed-off-by: Lukas Lihotzki <lukas@lihotzki.de>
* Stop using MutableHandle's DerefMut impl (#36160)Greg Morenz2025-03-261-2/+2
| | | Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
* Stop using JS::MutableHandle's DerefMut impl (#36161)Greg Morenz2025-03-261-1/+1
| | | Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
* Fix check in get_array_index_from_id to return early on ASCII char (#36136)Michael Rees2025-03-251-1/+1
| | | | | | | | | | | | | * fix: wrong ascii check in get_array_index_from_id Signed-off-by: Michael Rees <mrees@noeontheend.com> * Update WPT expectations Signed-off-by: Michael Rees <mrees@noeontheend.com> --------- Signed-off-by: Michael Rees <mrees@noeontheend.com>
* feat: add CanGc argument in get_dictionary_property (#36156)Arya Nair2025-03-254-9/+22
| | | | | | | | | | | | | * 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/+23
| | | | | FromJSValConvertible. (#36097) Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* canvas: Update the image as part of update the rendering (#35996)sagudev2025-03-255-16/+48
| | | | | | | | | | | | | | | | | | | | | | | * Create `update_rendering` in `CanvasState` instead of manually updating in layout Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Mark as dirty and do flushes Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup rebase Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update components/script/dom/htmlcanvaselement.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* feat(notification): add `EmbedderMsg::ShowNotification` (#36055)Jason Tsai2025-03-241-18/+80
| | | Signed-off-by: Jason Tsai <git@pews.dev>
* fix: radio input element don't trigger validity state (#36103)Jerens Lensun2025-03-231-2/+4
| | | Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
* script: Implement `Element::GetHTML` and `ShadowRoot::GetHTML` (#36106)Simon Wülker2025-03-235-96/+265
| | | | | | | | | | | | | | | | | | | | | * 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>
* webgpu: leverage routed_promise in calls returning promises (#35859)webbeef2025-03-239-196/+159
| | | | | | | Using the RoutedPromiseListener let us define a different response type for each promise. This removes unreachable branches that used to exist when they all shared the same WebGPUResponse. Signed-off-by: webbeef <me@webbeef.org>
* Don't clear children of declarative shadow hosts when imperatively attaching ↵Simon Wülker2025-03-231-2/+1
| | | | | | | | | | | | | | | | | another shadow root (#36104) * Don't remove a declarative shadow hosts children when attaching an imperative shadow root Instead we should remove all children of the shadowroot. 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>
* script: Allow opening links in a new `WebView` (#35017)webbeef2025-03-231-1/+25
| | | | | | | | | | | | | This changes starts tracking the keyboard modifier state in the `Constellation` and forwards it with every input event. The state is used to modify the target of link click so when the platform-dependent alternate action key is enabled, the target is overriden to "_blank". In addition, specification step numbers and text is updated. Signed-off-by: webbeef <me@webbeef.org> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Use explicit reborrows with mozjs::MutableHandle (#35892)Greg Morenz2025-03-2311-24/+49
| | | | | | | | | | | | | | | | | | | | | * 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>
* crown: Do not check trait item projections. (#36095)Josh Matthews2025-03-2210-20/+0
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix form validation for readonly inputs and update WPT expectations (#36090)elomscansio2025-03-221-19/+1
| | | | | | | | | | | | | | | | | | | The HTML specification states that an input element with the `readonly` attribute must be barred from constraint validation. Our implementation previously included an extra check (`does_readonly_apply()`) to verify if `readonly` applies to the input type, which is unnecessary. This caused three test failures in: tests/wpt/meta/html/semantics/forms/constraints/form-validation-willValidate.html.ini - Removed `does_readonly_apply()` as it is not required for validation. - Removed `tests/wpt/meta/html/semantics/forms/constraints/form-validation-willValidate.html.ini` since the test now passes. To update the Web Platform Test expectations, see: https://book.servo.org/hacking/testing.html#updating-web-platform-test-expectations Fixes servo/servo#36076 Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
* Create a `constellation_traits` crate (#36088)Martin Robinson2025-03-227-11/+14
| | | | | | | | | | | | | | This change creates a `constellation_traits` crate. Previously messages to the `Constellation` were in the `compositing_traits` crate, which came about organically. This change moves these to a new crate which also contains data types that are used in both compositing/libservo and script (ie types that cross the process boundary). The idea is similar to `embedding_traits`, but this is meant for types not exposed to the API. This change allows deduplicating `UntrustedNodeAddress`, which previously had two versions to avoid circular dependencies. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* metrics: Simplify `ProgressiveWebMetrics` (#35985)Martin Robinson2025-03-211-25/+52
| | | | | | | | | | | | | | | | Simply how `ProgressiveWebMetrics` works: 1. Keep only a single struct instead of one in layout and one script that both implement the `ProgressiveWebMetrics` trait. Since layout and script are the same thread these can now just be a single `ProgressiveWebMetrics` struct stored in script. 2. Have the compositor be responsible for informing the Constellation (which informs the ScripThread) about paint metrics. This makes communication flow one way and removes one dependency between the compositor and script (of two). 3. All units tests are moved into the `metrics` crate itself since there is only one struct there now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* constellation: Proxy `ScrollState` through the `Constellation` (#36062)Martin Robinson2025-03-211-3/+2
| | | | | | | | | This will allow removing the dependency of the compositor on `script_traits`, which should make our internal dependency chain a lot easier to deal with. Part of #35984. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* pixels: Extend Image to allow for multiple frames (#36058)TIN TUN AUNG2025-03-211-1/+1
| | | Signed-off-by: rayguo17 <rayguo17@gmail.com>
* feat: add can_gc argument to to_frozen_array (#36043)Arya Nair2025-03-1920-39/+56
| | | | | | | | | | | | | | | | | | | | | * 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-198-15/+113
| | | Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* devtools: Use `webview_id` as `browser_id` (#35956)atbrakhi2025-03-191-1/+3
| | | | | | | | | | | | | | | | | | | | | * use `webview_id` as `browser_id` Signed-off-by: atbrakhi <atbrakhi@igalia.com> * use correct webview id Signed-off-by: atbrakhi <atbrakhi@igalia.com> * fmt Signed-off-by: atbrakhi <atbrakhi@igalia.com> * review fix Signed-off-by: atbrakhi <atbrakhi@igalia.com> --------- Signed-off-by: atbrakhi <atbrakhi@igalia.com>
* Cleanup Stylo dependencies (#36046)Oriol Brufau2025-03-191-2/+2
| | | | | | | | | 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-1/+69
| | | | | | | | | | | | | | | | | | | | | | | (#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-0/+10
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* feat: fetch notification image resources (#35878)Jason Tsai2025-03-191-4/+406
| | | | | | | | | | | | | | | | | | | | | * feat: fetch notification image resources Signed-off-by: Jason Tsai <git@pews.dev> * docs: more specific for `ResourceFetchListener` Signed-off-by: Jason Tsai <git@pews.dev> * feat(notification): queue show event Signed-off-by: Jason Tsai <git@pews.dev> * chore: set shown step to TODO until we are using the variable Signed-off-by: Jason Tsai <git@pews.dev> --------- Signed-off-by: Jason Tsai <git@pews.dev>
* Streams: Implement stream pipe-to (#35650)Gregory Terzian2025-03-182-3/+805
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* dom: Implement minimal IntersectionObserver workflow (#35551)Steven Novaryo2025-03-188-47/+822
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add very rough implemnentation of observation steps Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix entry reflection and propagate can_gc Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix BorrowError and add fragment find descendant Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Implement is descendant in containing block path correctly Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix unrooted error and tidy issues Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix comments Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Remove is descendant of other node query I suppose these changes is better separated to other PRs. Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix intersection and refactor registration Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Use AppUnit more and propagate GlobalScope better Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Update WPT expectations Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Revert delay changes Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Align compute intersection algo to other browser actual behavior Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Align processing documents and note several issues Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Update WPT Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Minor lint Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix top level browsing context Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Make Registration rootable Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Avoid reflow inside observation step algo Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Using borrow for iterating registration Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix document disconnect Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Update WPT Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Address comments and minor quality suggestions Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Root the observer before nofifying any of it Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Tidy docs Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Account not found element and refactor observation step Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix documentations Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Ignore position of document viewport Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Refactor root intersection rectangle Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Add can GC note to the callback Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix top-level browsing context term Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> * Fix minor comments Signed-off-by: stevennovaryo <steven.novaryo@gmail.com> --------- Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
* Set composed flag for mouse events dispatched by the UA (#36010)Simon Wülker2025-03-182-54/+98
| | | | | | | | | | | | | * Add doc comments to mouse event methods Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Make MouseEvents composed by default Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* feat: add CanGc argument to Error::to_jsval (#36014)Arya Nair2025-03-1710-18/+36
| | | | | | | | | | | | | | | | | * feat: add CanGc argument to Error::to_jsval Signed-off-by: Arya Nair <aryaajitnair@gmail.com> * feat: pass CanGc to gen_type_error 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>
* Implement declarative shadow dom (#34964)batu_hoang2025-03-1710-4/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-169-470/+29
| | | | | | | | | | | | | | | | | * 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-1639-137/+166
| | | | | | | | | | | | | | | | | * 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-37/+98
| | | | | | | | | | | | | * 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>
* Refactor common boilerplate out of serialize/transfer implementations (#35831)Josh Matthews2025-03-155-200/+426
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Create infrastructure for reducing hand-written serializable/transferrable implementations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Clone all serializable DOM interfaces. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Deserialize all serializable DOM interfaces. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Serialize all serializable DOM interfaces. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Transfer-receive all transferable DOM interfaces. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Transfer all transferable DOM interfaces. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract boilerplate from serialize/deserialize implementations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract boilerplate from transfer-receive. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract boilerplate from transfer operation. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Tidy fixes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Check transferability of all DOM interfaces. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clippy fixes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clippy fixes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove unnecessary duplicate crate. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Implement HTMLOptgroupElement::Label (#35970)Simon Wülker2025-03-141-13/+18
| | | | | | | | | | | | | * Implement HTMLOptgroupElement::Label 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>
* Check whether an element is custom in the spec-compliant way (#35960)Xiaocheng Hu2025-03-133-8/+16
| | | | | | | | | | | | | * Check whether element is custom in spec-compliant way Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Update tests Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> --------- Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* Hide servo internal shadow roots from the inspector by default (#35958)Simon Wülker2025-03-133-3/+18
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Don't run disconnected callback on already disconnected custom elements (#35883)Xiaocheng Hu2025-03-131-19/+38
| | | | | | | | | | | | | * Add missing step 11 of remove a node algorithm Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Rebaseline tests Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> --------- Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>