aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-1811-49/+839
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1711-24/+45
| | | | | | | | | | | | | | | | | * 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-1711-4/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1641-146/+182
| | | | | | | | | | | | | | | | | * 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>
* Various fixes for webdriver conformance tests (#35737)Josh Matthews2025-03-151-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * servodriver: Ensure capabilities is always a non-empty value. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Serialize arguments object like an array. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Ensure script body is always valid JS. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Use current browsing context when getting element center point. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Propagate errors received from getting element center point. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Ensure opening a new window records a unique window handle. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Don't panic if script execution fails. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Do not update the current browsing context after closing a window. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * webdriver: Use more precise check for arguments exotic object. 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>
* Bring back DOM GC checkpoint to script_thread (#35949)Sebastian C2025-03-141-0/+7
| | | Signed-off-by: Sebastian C <sebsebmc@gmail.com>
* 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>
* script: Remove ThreadSafeLayoutNode::is_ignorable_whitespace (#35959)Martin Robinson2025-03-131-29/+0
| | | | | | This is now unused with the removal of legacy layout. I didn't see any others methods in this trait that were unused. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Hide servo internal shadow roots from the inspector by default (#35958)Simon Wülker2025-03-134-4/+24
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Use `strum` to iterate through enum variants and get their names (#35933)Martin Robinson2025-03-134-29/+8
| | | | | | | | `strum` allows us to avoid manually listing enum variant names and also to get their names as static strings. We cannot use this for all cases due to https://github.com/Peternator7/strum/issues/152, but we can still use it to remove a lot of code. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* 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>
* script: refactor create_buffer_source_with_constructor (#35952)Taym Haddadi2025-03-131-65/+73
| | | Signed-off-by: Taym <haddadi.taym@gmail.com>
* Migrate to the 2024 edition (#35755)Simon Wülker2025-03-1323-173/+191
| | | | | | | | | | | | | | | | | | | | | | * 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>
* Set `is` value when constructing custom elements with the `new` operator ↵Simon Wülker2025-03-125-34/+71
| | | | | | | | | | | | | | | | | | | | | | | (#35930) * Add doc comments throughout the code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set is-value for elements constructed with the "new" operator Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow custom elements to extend <slot> 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>
* canvas: Do not update ImageKey during canvas layout (#35719)Samson2025-03-126-63/+35
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Implement `ElementInternals::shadowRoot` (#35923)Simon Wülker2025-03-123-0/+41
| | | | | | | | | | | | | * Implement ElementInternals::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>
* Use new stylo crate renames (#35898)Nico Burns2025-03-1283-89/+89
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* base: Finish rename of `TopLevelBrowsingContextId` to `WebViewId` (#35896)Martin Robinson2025-03-116-89/+71
| | | | | | The `WebViewId` name is a lot more descriptive these days to the casual reader, so I think we can go ahead and finish the rename. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Keep a list of slot descendants on each shadow root (#35802)Simon Wülker2025-03-103-13/+89
| | | | | | | | | This makes it much faster to traverse over the slot descendants of a shadow root, which is a fairly costly part of "assign slottables to a tree". This reduces the time it takes for the results to load on wpt.fyi from over 3 minutes to about 5 seconds. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: implement ReadableByteStreamController (#35410)Taym Haddadi2025-03-1018-323/+2920
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Don't run scripts in documents that don't have a browsing context (#35871)Simon Wülker2025-03-102-0/+5
| | | | | | | | | | | | | | | | * Don't run scripts in document that don't have a browsing context For confirmation that this is correct, refer to the note under Step 3 of https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring. 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>
* Show correctly computed element display type in devtools (#35870)Stephen Muss2025-03-101-0/+8
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* Fix animation frame callback cancellation (#35849)Xiaocheng Hu2025-03-101-20/+8
| | | Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* script: use passive event listener option on AddEventListenerOptions (#35877)shanehandley2025-03-103-19/+86
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Implement `nonce` attribute to pass more CSP checks (#35876)Simon Wülker2025-03-106-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add doc comments to RequestBuilder fields/methods Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement Request::cryptographic_nonce_metadata Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement HTMLOrSVGElement::nonce Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set request cryptographic nonce metadata for link elements Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set request's cryptographic nonce when fetching scripts Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Forward request nonce to rust-content-security-policy 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>
* feat: display file chosen for input file (#35789)DK Liao2025-03-102-3/+47
| | | Signed-off-by: DK Liao <dklassic@gmail.com>
* Register iframes with the devtools (#35874)Simon Wülker2025-03-092-7/+11
| | | | | | | | | | | Previously, the devtools didn't know about <iframe>s. They either ignored messages coming from iframes or crashed. This reverts https://github.com/servo/servo/pull/34032 and then filters out non-tab globals in the "listTabs" message to the root actor. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Implement can-have-its-url-rewritten for history api (#35864)Kingsley Yung2025-03-081-24/+48
| | | | | | | Implement the helper function to verify whether the document can have its URL rewritten to a new URL. https://html.spec.whatwg.org/multipage/nav-history-apis.html#can-have-its-url-rewritten Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
* Add an about:memory page (#35728)webbeef2025-03-076-0/+155
| | | | | | | | | | | | | | | | | 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>
* Let layout invalidations happen in the flat tree (#35769)Simon Wülker2025-03-062-8/+43
| | | | | | | | | When invalidating layout, computing dirty roots and such, we want to work in the flat tree. That means that the children of slots are their assigned slottables, parents of assigned slottables are their slots and the children of an element include children of a potential shadow dom. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* refactor: add CanGc as argument to methods in CSSKeyframeRule, CSSMediaRule, ↵Yerkebulan Tulibergenov2025-03-056-17/+18
| | | | | CSSRule (#35796) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Optimize IPC for non-cancelable touch events (#35785)Bi Fuguo2025-03-041-1/+3
| | | | | | | | | | | | | | * The cancelable feature is optimized. If the cancelable feature is a non-cancelable feature, no message is sent back to the Compositor. Add a warning log when prevent TouchsequenceInfo cannot be found. Signed-off-by: kongbai1996 <1782765876@qq.com> * fix Clippy Error Reported in the Pipeline. Signed-off-by: kongbai1996 <1782765876@qq.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com>
* compositor: Make `PipelineDetails` and pending paint metrics per-WebView ↵Martin Robinson2025-03-041-0/+1
| | | | | | | | | | | | | | | | (#35701) This is one of the first big steps toward making the compositor work per-WebView. It moves the collection of pipelines into the per-WebView data structure in the compositor as well as the pending paint metrics. This means that more messages need to carry information about the WebView they apply to. Note that there are still a few places that we need to map from `PipelineId` to `WebViewId`, so this also includes a shared mapping which tracks this. The mapping can be removed once event handling is fully per-WebView. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
* script: Mark callback methods with CanGc. (#35753)Josh Matthews2025-03-0324-65/+120
| | | Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-03389-874/+864
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Avoid double borrow crash on iframe focus (#35742)Sean Burke2025-03-031-4/+12
| | | Signed-off-by: Seán de Búrca <leftmostcat@gmail.com>
* script: Implement preparation-time document (#35718)Xiaocheng Hu2025-03-021-58/+108
| | | | | | | | | | | | | | | | | * Use preparation-time document for scripts Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Rebaseline test Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Fix step numbers and spec quotes Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> --------- Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* add `cancelable` property to the `TouchEvent` (#35713)Bi Fuguo2025-03-021-1/+1
| | | | | | | | | | | | | | * add `cancelable` property to the `TouchEvent` set cancellable = false when sending move events to script, if the first touch_move event did not cancel it Signed-off-by: kongbai1996 <1782765876@qq.com> * modified review commentss Signed-off-by: kongbai1996 <1782765876@qq.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com>
* refactor: add CanGc as argument to methods in CSSGroupingRule, ↵Yerkebulan Tulibergenov2025-03-023-21/+21
| | | | | CSSKeyframesRule, Crypto (#35743) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* Don't recurse in Node::GetRootNode (#35725)Simon Wülker2025-03-011-9/+6
| | | | | | | | | | | | | | | | * Don't recurse in Node::GetRootNode This causes servo to crash when computing the root of deeply nested shadow roots. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add test case Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* refactor: add CanGc as argument to methods in CanvasRenderingContext2D and ↵Yerkebulan Tulibergenov2025-03-012-15/+14
| | | | | OffscreenCanvasRenderingContext2D (#35732) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to OffscreenCanvas methods (#35731)Yerkebulan Tulibergenov2025-03-011-6/+8
| | | Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
* refactor: add CanGc as argument to BaseAudioContext::{Destination, Listener} ↵Yerkebulan Tulibergenov2025-03-011-4/+4
| | | | | (#35729) Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>