aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* layout: Implement proper absolute child position for flexbox (#33346)Martin Robinson2024-09-0910-465/+243
| | | | | | | | | | | This implements the requirements outlined in the [flexbox specification] about how to position absolute children of flex containers. We must establish a static position rectangle (to use if all insets are auto) and also align the child into that rectangle. [flebox specification]: https://drafts.csswg.org/css-flexbox/#abspos-items Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* script: Implement `TextEncoder::encodeInto()` (#33360)webbeef2024-09-092-276/+0
| | | | | | | | | | | | | | | | | | | * Implement TextEncoder::encodeInto() Signed-off-by: webbeef <me@webbeef.org> * Update components/script/dom/textencoder.rs Signed-off-by: Martin Robinson <mrobinson@igalia.com> * Update components/script/dom/textencoder.rs Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: webbeef <me@webbeef.org> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* script: Use `time@0.3` for input elements and do conversion in a &str trait ↵Martin Robinson2024-09-092-18/+0
| | | | | | | | | | | | | | | | | (#33355) This changes converts all input element parsing and normalization to use `time` instead of `chrono`. `time` is used by our dependencies, so it makes sense to work toward removing the Servo dependency on chrono. In addition, parsing and normalization also moves to a trait on &str to prepare for the possibility of all script parsers moving to a separate crate that can have unit tests written against it. Code duplication is eliminated when possible and more conversion is done using integer types. These two things together mean we pass more tests now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* webxr: Update XRInputSource gamepad index to be -1 (#33369)Daniel Adams2024-09-092-4/+6
| | | | | | | | | | | | | * Update XRInputSource gamepad index to be -1 Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update test expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* net: use saturating_sub when substracting durations to prevent underflows ↵webbeef2024-09-083-0/+37
| | | | | | | | | | | | | | | | | | | (#33341) * net: use saturating_sub when substracting durations to prevent underflows Signed-off-by: webbeef <me@webbeef.org> * Add regression test. (#1) * Add regression test. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: webbeef <me@webbeef.org> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* Update web-platform-tests to revision ↵Servo WPT Sync2024-09-082373-4306/+20985
| | | | | b'ec9b870fec350e59e9db48ae2858e914a07f38d6' (#33359) Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* Set empty object as `console` prototype (#33358)Simon Wülker2024-09-072-16/+0
| | | | | | | | | | | | | | | | * Remove console prototype hack The console object has an empty object as its prototype, not the realm object prototype. 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: Do not use orthogonal baselines in flex layout (#33347)Martin Robinson2024-09-072-0/+49
| | | | | | | | | When a baseline is orthogonal to the main flexbox axis, it should not take part in baseline alignment. This change does that for column flex. While there is no support for vertical writing modes, this change is made to be as writing mode-agnostic as possible. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* chore: Update wgpu (#33357)Samson2024-09-071-1929/+244
| | | | | | | | | | | | | * Update wgpu 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>
* layout: Lay out absolutes in atomic containing blocks (#33336)Martin Robinson2024-09-0650-377/+2
| | | | | | | | | | When inline atomics establish containing blocks for absolute descendants, layout should happen with those atomics as the containing block. This ensures that the absolute descendents have the correct containing block and Fragment parent. This wasn't happening before and this change fixes that. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* script: Create a `CrossProcessInstant` to enable serializable monotonic time ↵Martin Robinson2024-09-0510-59/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#33282) Up until now, Servo was using a very old version of time to get a cross-process monotonic timestamp (using `time::precise_time_ns()`). This change replaces the usage of old time with a new serializable monotonic time called `CrossProcessInstant` and uses it where `u64` timestamps were stored before. The standard library doesn't provide this functionality because it isn't something you can do reliably on all platforms. The idea is that we do our best and then fall back gracefully. This is a big change, because Servo was using `u64` timestamps all over the place some as raw values taken from `time::precise_time_ns()` and some as relative offsets from the "navigation start," which is a concept similar to DOM's `timeOrigin` (but not exactly the same). It's very difficult to fix this situation without fixing it everywhere as the `Instant` concept is supposed to be opaque. The good thing is that this change clears up all ambiguity when passing times as a `time::Duration` is unit agnostic and a `CrossProcessInstant` represents an absolute moment in time. The `time` version of `Duration` is used because it can both be negative and is also serializable. Good things: - No need too pass around `time` and `time_precise` any longer. `CrossProcessInstant` is also precise and monotonic. - The distinction between a time that is unset or at `0` (at some kind of timer epoch) is now gone. There still a lot of work to do to clean up timing, but this is the first step. In general, I've tried to preserve existing behavior, even when not spec compliant, as much as possible. I plan to submit followup PRs fixing some of the issues I've noticed. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Treat `align-self: normal` as `stretch` on flex items (#33314)Oriol Brufau2024-09-052-0/+37
| | | | | | According to https://drafts.csswg.org/css-align/#align-flex It was being treated as `auto` instead. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* webxr: Add some missing internal checks/validation (#33318)Daniel Adams2024-09-056-36/+0
| | | | | | | | | | | | | | | | | * Ensure depthFar is non-negative Signed-off-by: Daniel Adams <msub2official@gmail.com> * Properly append default features in requestSession Signed-off-by: Daniel Adams <msub2official@gmail.com> * Ensure XRRigidTransform init members have finite values Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* webgpu: Support pipeline-overridable constants (#33291)Samson2024-09-041-350/+0
| | | | | | | | | | | | | | | | | | | | | * Impl pipeline constants Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * More relaxed lifetimes Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Replace convert function with `From` implementation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Implement HTMLQuoteElement "cite" attribute (#33307)Simon Wülker2024-09-046-297/+0
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fix intrinsic sizing of column flex containers (#33299)Oriol Brufau2024-09-0414-58/+0
| | | | | | | | | | | From https://drafts.csswg.org/css-flexbox-1/#intrinsic-cross-sizes, > The min-content/max-content cross size of a single-line flex container > is the largest min-content contribution/max-content contribution > (respectively) of its flex items. We were using the min/max-content size instead of the min/max-content contribution. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* Implement compact/type attributes for HTMLUListElement (#33303)Simon Wülker2024-09-042-234/+0
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Update FakeXRDevice to support updating bounds (#33271)Daniel Adams2024-09-012-14/+0
| | | | | | | | | | | | | | | | | * Update FakeXRDevice to support updating bounds Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec link Signed-off-by: Daniel Adams <msub2official@gmail.com> * Mark secondaryViews as optional in FakeXRDevice.setViews Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update web-platform-tests to revision ↵Servo WPT Sync2024-09-01584-3056/+14688
| | | | | b'5d8ec746ed021738e7ee0cee92ad1a1814ba00fe' (#33274) Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* Fix various issues with replaced elements in flex layout (#33263)Oriol Brufau2024-08-3035-294/+3
| | | | | | | | In particular, this takes into account that flex items may be stretched, and if they have an aspect ratio, we ma6y need to convert the stretched size through the ratio. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* chore: Update wgpu to 34bb9e4ceb45a5b1cfc5df6aa2b2e201cc55372c (#33266)Samson2024-08-301-250/+66
| | | | | | | | | | | | | * Update wgpu to include local const Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * set expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* webgpu: Clean up `GPUCommandEncoders` and add some validation (#33223)Samson2024-08-301-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TextureUsages::from_bits_retain Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fixup CreateBindGroupLayout Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * GPUExtent3D checking and converting Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Cleanup GPUCommandEncoders and some TODOs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * validate gpuorigin3d Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * validate GPUColor Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * set good expect Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Use the proper aspect ratio in flexbox (#33256)Oriol Brufau2024-08-302-0/+37
| | | | | | | | | | When computing the automatic minimum size, flex layout was using the natural aspect ratio, ignoring the `aspect-ratio` property. `ReplacedContent::inline_size_over_block_size_intrinsic_ratio()` is now made private to avoid more accidental uses. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix automatic minimum size for column flexbox (#33248)Oriol Brufau2024-08-293-113/+0
| | | | | | | `main_content_size_info()` was always assigning the main-axis automatic minimum size into the inline axis. But in a column flexbox, the main axis corresponds to the block axis. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* mach: Add `test-speedometer` command and `--bmf-output` to speedometer and ↵Samson2024-08-291-2/+11
| | | | | | | | | | | | | | | dromaeo (#33247) * Allow exporting Dromaeo results as BMF JSON Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Add speedometer runner Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Handle aspect ratios in `ReplacedContent::inline_content_sizes` (#33240)Oriol Brufau2024-08-2910-35/+0
| | | | | | | We were only handling the aspect ratio of a replaced element when computing its min/max-content contribution, but not when computing the min/max-content size. Now both cases will take it into account. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add an indefinite containing block for intrinsic sizing (#33204)Oriol Brufau2024-08-2917-31/+24
| | | | | | | | | | | | | | | | | | When computing the min-content or max-content size of an element we need to ignore `inline-size`, `min-inline-size` and `max-inline-size`. However, we should take the block-axis sizing properties into account. That's because the contents could have percentages depending on them, which can then affect their inline size via an aspect ratio. Therefore, this patch adds `IndefiniteContainingBlock`, which is similar to `ContainingBlock`, but it allows an indefinite inline-size. This struct is then passed arround during intrinsic sizing. More refinement will be needed in follow-up patches in order to fully address the problem. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Obey min and max cross sizes of flex items (#33242)Oriol Brufau2024-08-292-0/+43
| | | | | | | | When laying out the contents of a flex item, we used to resolve their cross-axis percentages against the preferred cross size of the item. Now we will take the min and max cross sizes into account. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Obey `min-block-size` and `max-block-size` in floats (#33241)Oriol Brufau2024-08-293-0/+64
| | | | | We were using the unclamped `box_size.block` instead of `block_size`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* wpt: fix path to wpt-prefs.json (#33243)Mukilan Thiyagarajan2024-08-292-3/+3
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Fix run_dromaeo.py (#33239)Samson2024-08-281-13/+15
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* layout: Add initial support for `clip-path: [<basic-shape> || <shape-box>]` ↵Chocolate Pie2024-08-2851-51/+63
| | | | | | | | | | | | | | | | | | | | | (#33107) * Turn on clip-path tests and add results Signed-off-by: Martin Robinson <mrobinson@igalia.com> * enhance: Add support for `clip-path: [<basic-shape> || <shape-box>]` Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com> * Changes from review Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Fix panic in parser-reentrancy-customelement.window.js (#33162)Taym Haddadi2024-08-281-6/+0
| | | | | | | | | | | | | | | | | * Try to fix panic in parser-reentrancy-customelement.window.js Signed-off-by: Taym <haddadi.taym@gmail.com> * ./mach fmt Signed-off-by: Taym <haddadi.taym@gmail.com> * Only return with ToTokenizerMsg::End and continue for others Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
* Remove `width` and `height` presentational hints for `<canvas>` (#33211)Oriol Brufau2024-08-287-11/+42
| | | | | | | | According to HTML, the `width` and `height` attributes should only set the natural sizes and the aspect ratio. The `width` and `height` properties should stay as `initial` by default. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* wpt: fix the path to wpt-prefs.json on WPT runner (#33220)Mukilan Thiyagarajan2024-08-282-4/+5
| | | Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Respect min/max constraints in the block axis of block containers (#33203)Oriol Brufau2024-08-273-2/+39
| | | | | | | | | | | | | | | Consider a block container that establishes an inline formatting context and has a definite `block-size` which is clamped by `min-block-size` or `max-block-size`. We were already sizing such container correctly, however, its contents were resolving their percentages against the unclamped `block-size` value. This patch fixes the `ContainingBlock` that we pass to the contents so that they resolve percentages correctly. Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* wpt: check for wpt-prefs.json in "./servo" sub-directory (#33202)Mukilan Thiyagarajan2024-08-272-2/+17
| | | | | | | | | | | | | | | The current working directory when running on WPT runners is not the folder with the servo binary, but a parent folder into which the servo nightly tar is extracted. This means the binary is `$PWD/servo/servo` and resources directory in in `$PWD/servo/resources`, so the current hardcoded relative path `resources/wpt-prefs.json` will not work on WPT runners. This is causing crashes in WPT runner: https://github.com/web-platform-tests/wpt/runs/29284407168 https://community-tc.services.mozilla.com/tasks/J7MqNwJGQRSkIWlvB5ktPQ/runs/0/logs/live/public/logs/live.log Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* webgpu: Sync `GPUBuffer` (#33154)Samson2024-08-271-838/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * More helpers on `Promise` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Sync `GPUBuffer` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set some good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Some bad expect also on firefox Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Extract DataBlock, DataView impl from GPUBuffer Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix size check to work on 32bit platforms Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* layout: Enable flexbox by default on non-legacy layout (#33186)Martin Robinson2024-08-2661-349/+464
| | | | | | | Flexbox is still very much in progress, but things are working well enough that we can enable it by default. It improves most pages that use flexbox now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* webxr: Implement XRBoundedReferenceSpace (#33176)Daniel Adams2024-08-258-63/+6
| | | | | | | | | | | | | | | | | | | | | * Implement XRBoundedReferenceSpace Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update interfaces Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing pref condition on IDL interface Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Fix panic in abort-block-bfcache.window.js (#33173)Taym Haddadi2024-08-251-1/+2
| | | | | | | | | | | | | * Fix panic in abort-block-bfcache.window.js Signed-off-by: Taym <haddadi.taym@gmail.com> * Update test expectation Signed-off-by: Taym <haddadi.taym@gmail.com> --------- Signed-off-by: Taym <haddadi.taym@gmail.com>
* script: fix `querySelector` returning the root (#33174)Nolan Lawson2024-08-252-7/+0
| | | Signed-off-by: Nolan Lawson <nolan@nolanlawson.com>
* Update web-platform-tests to revision ↵Servo WPT Sync2024-08-25702-6446/+27346
| | | | | b'd988aeeb33edc4d452899921799b8bed69fff65d' (#33178) Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
* script: Update list of non-TS pseudo classes supported by Servo (#33165)Martin Robinson2024-08-247-36/+0
| | | | | | Also remove some code duplication by moving some of the code into the `Element` impl. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Fix panic in `htmlimageelement.rs` using `str::find()` to find ↵Kopanov Anton2024-08-246-31/+27
| | | | | | | | | | | | | | | | | | | | | character boundaries. (#32980) * fix loop with chars().enumerate() by using find() Signed-off-by: Kopanov Anton <anton.kopanov@ya.ru> * Add documentation to parser and fix some small issues - Rename the properties of `Descriptor` so that they are full words - Use the Rust-parser to parse doubles - Add documentation and restructure parser to be more readable Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Kopanov Anton <anton.kopanov@ya.ru> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Allow prefs to be overridden from a file and set WPT-specific prefs from ↵Daniel Adams2024-08-247-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file (#33163) * Allow prefs to be passed in from a separate file Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add wpt-prefs.json for setting WPT-specific prefs Signed-off-by: Daniel Adams <msub2official@gmail.com> * fix argument to read_prefs_file Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update test_parse_pref test Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add line in executorservo.py to read from wpt-prefs.json Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update MANIFEST.json Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Disable dom.webxr.test for interfaces test Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* layout: Add support for flex items with `position: relative` (#33151)Martin Robinson2024-08-233-0/+75
| | | Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* shaping: Don't assume there's a space glyph when rendering tabs (#32979)Martin Robinson2024-08-232-2/+2
| | | | | | | | | | | | | | | | | | Previously if a font didn't have a space advance and it was needed to make advances for tabs, Servo would try to read the advance from the font. If the font didn't have a space glyph, Servo would panic. This fixes that issue by making the space advance part of the `FontMetrics` of a font (like Gecko) and falling back properly if that glyph doesn't exist. The rendered glyph is still the "space" glyph, but we make sure to select a font that supports that glyph explicitly. This prevents a crash, but tabs still aren't handled properly. In reality, tab stops should be calculated in layout and the size of the space character of the current font shouldn't come into play. The addition of the space advance metric will make this easier. Fixes #32970. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Implement crypto.randomUUID() (#33158)webbeef2024-08-224-64/+0
| | | Signed-off-by: webbeef <me@webbeef.org>
* webxr: Update XRWebGLLayer interface to latest spec (#33157)Daniel Adams2024-08-222-12/+0
| | | | | | | | | | | | | * Update XRWebGLLayer interface to latest spec Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec links Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>