aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Update web-platform-tests to revision ↵wpt_update_23-03-2025Servo WPT Sync2025-03-23404-2222/+10968
| | | | | | b'aa0081aeb91d3890fbc8e21ccda3ab61ccd099fa' Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* Make input element display-inside always flow-root (#35908)Kenzie Raditya Tirtarahardja2025-03-234-0/+74
| | | | Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com> Co-authored-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
* Max assign outer block size to cell measures (#36064)Kenzie Raditya Tirtarahardja2025-03-231-6/+0
| | | | Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com> Co-authored-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja.18@gmail.com>
* Fix form validation for readonly inputs and update WPT expectations (#36090)elomscansio2025-03-221-9/+0
| | | | | | | | | | | | | | | | | | | 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>
* metrics: Simplify `ProgressiveWebMetrics` (#35985)Martin Robinson2025-03-214-282/+0
| | | | | | | | | | | | | | | | 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>
* Make Element::attach_shadow() and ShadowRoot closer to spec (#36024)batu_hoang2025-03-198-139/+0
| | | Signed-off-by: batu_hoang <longvatrong111@gmail.com>
* layout: Stop ignoring containing block padding for the static position (#36051)Oriol Brufau2025-03-1941-1341/+31
| | | | | | | | The static position rect is calculated assuming that the containing block would be established by the content box of some ancestor, but the actual containing block is established by the padding box. So we need to add the padding of that ancestor. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Obey sizing keywords in `layout_for_block_content_size()` (#36015)Oriol Brufau2025-03-192-0/+30
| | | | | | We were ignoring sizing keywords on the min and max sizing properties. With this, flexbox layout has full support for sizing keywords. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Support min/max main keyword sizes in flexbox (#35961)Oriol Brufau2025-03-1910-154/+0
| | | | | | | | | | Adds support for min-content, max-content, fit-content and stretch on the min and max main size properties of a flex item. I'm removing `automatic_min_size()` and `flex_base_size()` because they would need to share so much code among themselves and their one caller that it's simpler to just inline the code. Signed-off-by: Oriol Brufau <obrufau@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>
* layout: Don't consider a definite `stretch` size as intrinsic (#36045)Oriol Brufau2025-03-191-2/+0
| | | | | | | | `block_size_is_zero_or_intrinsic()` was always returning true for `stretch`. This function is used for the margin collapse heuristics in block layout, so we were considering that an empty element with `height: stretch` would self-collapse. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* script: Implement `Range::getClientRects` and `Range::getBoundingClientRect` ↵Simon Wülker2025-03-193-24/+0
| | | | | | | | | | | | | | | | | | | | | | | (#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-192-120/+0
| | | Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
* layout: Fix intrinsic contributions of indefinite `stretch` keyword (#36030)Oriol Brufau2025-03-183-28/+10
| | | | | | | | | | | In #35630 I treated an indefinite `stretch` as 0px on min sizing properties, and as `none` on max sizing properties. However, this was only for final layout sizes, I forgot about intrinsic contributions. Blink already modified the relevant test, I'm just reordering it a bit since we are no longer treating `stretch` as `fit-content`, so it seems better to test it at the end. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Create `config_dir` if none exist for caching (#35761)Euclid Ye2025-03-181-0/+2
| | | | | | | | | | | | | | | | | | | | | * Create config_dir if none exist for caching Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> * remove specialized behaviour for ohos; copy prefs.json if necessary Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> * downgrade the log to trace verbosity Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> * update wpt-test Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Streams: Implement stream pipe-to (#35650)Gregory Terzian2025-03-1819-23/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1837-126/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Update web-platform-tests to revision ↵Servo WPT Sync2025-03-18496-2534/+17512
| | | | | b'18fda923cafeb4e3e0546ffcfb2302c3b1b11f98' (#36019) Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* Implement declarative shadow dom (#34964)batu_hoang2025-03-1730-1960/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Various fixes for webdriver conformance tests (#35737)Josh Matthews2025-03-153-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-143-126/+0
| | | | | | | | | | | | | * 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>
* layout: Add support for basic transform css properties (#35926)chocolate-pie2025-03-1410-31/+2
| | | | Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Check whether an element is custom in the spec-compliant way (#35960)Xiaocheng Hu2025-03-133-5/+55
| | | | | | | | | | | | | * 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>
* Don't run disconnected callback on already disconnected custom elements (#35883)Xiaocheng Hu2025-03-133-33/+0
| | | | | | | | | | | | | * 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>
* Remove legacy layout (layout 2013) (#35943)Oriol Brufau2025-03-1317165-1551721/+0
| | | | | | We were already not compiling it and not running tests on it by default. So it's simpler to just completely remove it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Improve logic for establishing a stacking context (#35947)Oriol Brufau2025-03-1329-48/+127
| | | | | | | | | | In particular: - `z-index` will now work on unpositioned grid items. - `will-change: z-index` will only establish a stacking context if `z-index` applies, i.e. if the box is positioned or a flex/grid item. - The conditions in `establishes_stacking_context()` are reordered, so that the most likely ones are checked first. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Remove special height logic of replaced element with auto width (#35275)Oriol Brufau2025-03-137-79/+76
| | | | | | | | | | | | | When computing the intrinsic block size of a replaced element with a computed preferred inline size of `auto`, instead of transferring the final inline size through the aspect ratio, we were only transferring the min and max constraints. We did this to match other browsers, but Ian Kilpatrick agreed that this is a bug and plans to change Blink. CSSWG issue: https://github.com/w3c/csswg-drafts/issues/11236 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Set `is` value when constructing custom elements with the `new` operator ↵Simon Wülker2025-03-122-339/+0
| | | | | | | | | | | | | | | | | | | | | | | (#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>
* Remove message from WebGL subtest name and remove stale expectations (#35791)Samson2025-03-12616-18472/+19771
| | | | | | | | | | | | | | | * Remove message from WebGL subtest name This causes stale expectations: https://github.com/servo/servo/issues/35750 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Implement `ElementInternals::shadowRoot` (#35923)Simon Wülker2025-03-123-12/+0
| | | | | | | | | | | | | * 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-123-3/+3
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* Bump Stylo to from a93e7ef to 4add86f (#34714)Asun02042025-03-111-2/+0
| | | | | | | | | | | | | | | https://github.com/servo/stylo/compare/a93e7efd1b4ce73d5a1b3df2337f5d16d3de121e...4add86f53a05ee27c13db998465e83e1ed733871 - servo/stylo#134 Remove unnecessary imports - servo/stylo#133 Reinstate missing gecko-specific import - servo/stylo#135 fix: add atoms "show" - servo/stylo#102 Use truncation instead of rounding to resolve percentages into app units Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Fix interaction of margin and stretch size on block-level boxes (#35904)Oriol Brufau2025-03-118-69/+240
| | | | | | | | | | | | | The CSSWG resolved that `block-size: stretch` on a block-level box stretches the margin box to fill the parent. However, if the parent doesn't have padding nor border, and doesn't establish an independent formatting context, then we assume that the margins will collapse. Therefore, we treat the margins as zero when resolving the stretch size, regardless of whether they will actually end up collapsing. https://github.com/w3c/csswg-drafts/issues/11044#issuecomment-2599101601 https://drafts.csswg.org/css-sizing-4/#stretch-fit-sizing Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Enable ShadowDom support by default (#35899)Simon Wülker2025-03-112-2/+2
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: implement ReadableByteStreamController (#35410)Taym Haddadi2025-03-1011-0/+481
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-3/+3
| | | | | | | | | | | | | | | | * 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>
* layout: Support min/max cross keywords sizes in flexbox (#35860)Oriol Brufau2025-03-106-174/+0
| | | | | | | | Adds support for min-content, max-content, fit-content and stretch on the min and max cross size properties of a flex item. With one exception: when resolving the main sizes, transferred cross minimums and maximums will still ignore keywords. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Only prevent fixed table layout when `inline-size` is `auto` (#35882)Oriol Brufau2025-03-103-24/+22
| | | | | | | | | | | | We were ignoring `table-layout: fixed` both for `inline-size: auto` and `inline-size: max-content`. However, the CSSWG resolved that fixed table layout should be triggered except when `inline-size` is `auto`. https://github.com/w3c/csswg-drafts/issues/10937#issuecomment-2669150397 Blink has already adopted this change, and they modified the WPT `/css/css-tables/fixed-layout-2.html` accordingly. Here I'm doing some further cosmetic cleanups to the test. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Add test for percentage sizes resolving against subpixel lengths (#35809)Oriol Brufau2025-03-104-0/+168
| | | | | | | | | | | Two floats with `width: 50%` each should fit on the same line, and four floats with `width: 25%` each should fit on the same line. That's even if the containing block width, expressed in layout units, cannot be divided by 2 or 4. This test checks cases that are tricky for browsers where 1 pixel are either 60, 64 or 100 layout units. It passes on other browsers but fails on Servo because of #34665. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Handle keyword sizes when computing the hypothetical cross size (#35826)Oriol Brufau2025-03-102-21/+0
| | | Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Fix animation frame callback cancellation (#35849)Xiaocheng Hu2025-03-101-3/+0
| | | Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* script: use passive event listener option on AddEventListenerOptions (#35877)shanehandley2025-03-102-197/+0
| | | Signed-off-by: Shane Handley <shanehandley@fastmail.com>
* Implement `nonce` attribute to pass more CSP checks (#35876)Simon Wülker2025-03-109-282/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* layout: support CSS will-change (#35787)Euclid Ye2025-03-0918-50/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * support CSS `will-change` * update wpt-test result * Enable css-will-change test * Update css-will-change test results * Check transformable before will-change; update wpt-results * Solve merge conflict * Update Cargo.toml and Cargo.lock * Mark new failing test-cases --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* Update web-platform-tests to revision ↵Servo WPT Sync2025-03-09762-9697/+25202
| | | | | b'c23b0ad587af296087067b48a2f2101233589a8f' (#35869) Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* Implement can-have-its-url-rewritten for history api (#35864)Kingsley Yung2025-03-085-38/+3
| | | | | | | 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>
* layout: Make `transform-style: preserve-3d` establish a containing block for ↵Daniel Hast2025-03-073-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all descendants (#35808) * layout: Fix behavior of `transform-style: preserve-3d` This makes `transform-style: preserve-3d` establish a containing block for all descendants, as specified here: <https://drafts.csswg.org/css-transforms-2/#transform-style-property> Signed-off-by: Daniel Hast <hast.daniel@protonmail.com> * layout: Check for transformable elements Adds a new `is_transformable` helper method and use this in several other methods, including the methods for whether the fragment establishes a new stacking context or a containing block for all descendants. Signed-off-by: Daniel Hast <hast.daniel@protonmail.com> * Use generic green square reference for reftest. Signed-off-by: Daniel Hast <hast.daniel@protonmail.com> * layout: Fix stacking context & containing block checks. Only the computed value of `transform-style` should be used to determine whether the element establishes a stacking context and/or a containing block, not the used value. Signed-off-by: Daniel Hast <hast.daniel@protonmail.com> * Update clip-no-stacking-context test expectation to pass. Signed-off-by: Daniel Hast <hast.daniel@protonmail.com> --------- Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
* layout: Partial support for keyword sizes on preferred cross size (#35682)Oriol Brufau2025-03-045-60/+15
| | | | | | | | | | | | | This changes `FlexItem::content_cross_size` into `Size<Au>` to preserve keyword sizes. The calculation of the hypothetical cross size still ignores them though, that will be addressed in a follow-up. Also, browsers don't follow the spec and treat a stretch size different than a stretch alignment: the former stretches to the containing block, while the latter stretches to the line. This aligns Servo with that behavior (following the spec would require bigger refactorings), so `stretches()` is renamed to `stretches_to_line()` for clarity. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* compositor: Make `PipelineDetails` and pending paint metrics per-WebView ↵Martin Robinson2025-03-041-1/+3
| | | | | | | | | | | | | | | | (#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>
* Upgrade Stylo to 2025-03-01 (#35782)Oriol Brufau2025-03-044-432/+0
| | | | | | | | | | | | | | | | | * Upgrade Stylo to 2025-03-01 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D236733 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>