aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Rename `gfx` to `fonts` (#32556)Martin Robinson2024-06-191-1/+1
| | | | | | | | | This crate only takes care of fonts now as graphics related things are split into other crates. In addition, this exposes data structures at the top of the crate, hiding the implementation details and making it simpler to import them. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Mark some ResizeObserver tests as flaky (#32546)Martin Robinson2024-06-182-0/+11
| | | ResizeObserver isn't completed.
* layout: Allocate inline box start space on segment (#32486)Martin Robinson2024-06-184-0/+104
| | | | | | Instead of allocating the inline padding and border space on the line, allocate it on the segment -- which where the inline box start goes. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Use workspace definitions for all crates and update to the 2021 edition (#32544)Martin Robinson2024-06-185-20/+25
|
* fonts: Respect emoji variation selector when selecting fonts (#32493)Martin Robinson2024-06-183-4/+2
| | | | | | | | | | | | | | This uses a pretty simple heuristic to select a font likely to contain color emoji. In the future Servo should actually check if the font also contains a color representation of the character in question. For now the code assumes that when a font supports color glyphs of some kind and supports the character in question at all, it supports the color version. This fixes support for rendering keycap emoji clusters such as 1️⃣ . Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* implement basic infra for ResizeObserver (#31108)Gregory Terzian2024-06-1715-0/+88
|
* webgpu: Implement device lost (#32354)Samson2024-06-171-5566/+90
| | | | | | | | | | | | | * device lost promise should be init at creation of device object * device lost impl * lock for device poll workaround for wgpu deadlocks * expect * Less lost reason reasoning in script
* Update web-platform-tests to revision ↵Servo WPT Sync2024-06-161393-47379/+71511
| | | | | b'ed9e9309618bdf76de06ff85757edbc8e1d7da82' (#32512) Signed-off-by: WPT Sync Bot <josh+wptsync@joshmatthews.net>
* layout: Linebreak the entire InlineFormattingContext at once (#32483)Martin Robinson2024-06-1343-54/+32
| | | | | | | | | | | | | Instead of linebreaking inside each single-font text segment, linebreak the entire inline formatting context at once. This has several benefits: 1. It allows us to use `icu_segmenter` (already in use from style), which is written against a newer version of the Unicode spec -- preventing breaking emoji clusters. 2. Opens up the possibility of changing the way that linebreaking and shaping work -- eventually allowing shaping across inline box boundaries and line breaking *after* shaping. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* build(deps): bump url from 2.5.0 to 2.5.1 (#32478)dependabot[bot]2024-06-134-567/+0
| | | | | | | | | | | | | | | Bumps [url](https://github.com/servo/rust-url) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/servo/rust-url/releases) - [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.1) --- updated-dependencies: - dependency-name: url dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Implement HTMLImageElement decode (#31269)Taym Haddadi2024-06-1314-172/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement HTMLImageElement decode Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Fix Decode doc link Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Temp * Decode HTML Image Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Fix doc link Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Move image decode to process_image_response_for_environment_change Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Update some wpt test result Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Handle multiple image decode promises Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove unnecessary promise calls Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Update more wpt test result Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Undo body-size-cross-origin.https.html.ini changes Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Reject decode when src and srcset are missing Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Revert "Reject decode when src and srcset are missing" This reverts commit 1b57ab978f9fc24facafc8af97ee8851d5142533. * Drain promises vec and run update_the_image_data when element is created Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * resolve decode promise in abort_request when request is CompletelyAvailable Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Update wpt test Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Move storing promise in decode task Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove the resolve logic from decode task Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Revert "Remove the resolve logic from decode task" This reverts commit eee6096d50dbe46a22a5bbfd7f15c03988ed2f4b. * reject or reject current promise before storing it Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Add comment to explain why resolve promise when state is CompletelyAvailable Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Fix table track offsets when there is `visibility: collapse` (#32469)Oriol Brufau2024-06-114-1/+48
| | | | | | | | | | | | | Each non-collapsed track used to increase the offset by the subsequent border spacing. Now they will take care of their preceding spacing instead. This way, if a cell spans two rows, and the second is collapsed, the cell won't be forced to be at least as tall as the border spacing. This matches Gecko and Blink (WebKit lacks `visibility: collapse`). This makes visibility-collapse-border-spacing-001.html fail because we generate outlines in a different way than Blink. Gecko also fails it in a similar (but different) way.
* layout: Take into account `display: table` etc in offset* queries (#32448)Martin Robinson2024-06-105-96/+0
| | | | | | | | | | | | | | | * layout: Take into account `display: table` etc in offset* queries The specification says that for deciding whether an element should be used for offset* queries, a browser should take into account whether the element is a table cell or table. This change makes that happen. Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Only tag HTML elements if they are in the HTML namespace --------- Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* script: Remove explicit reflow for web font loads (#32455)Martin Robinson2024-06-101-3/+0
| | | | | | Instead of using an explicit reflow when a web font laods, queue a pending reflow. This should be able to eliminate multiple reflows some situations. A followup should ensure that only nodes that have pending fonts loading are reflows, but this change is the first step.
* Fix and unify 'span' attribute for table columns (#32467)Oriol Brufau2024-06-1021-44/+0
| | | | | | | | The attribute was only taken into account on columns that are immediate children of tables, and on column groups. It was ignored on columns within column groups. This patch moves the logic into a helper function that is then called from the three consumers.
* Update web-platform-tests to revision ↵Servo WPT Sync2024-06-09714-20203/+24491
| | | | b'68f7e630c2646830a3ee274e21a3efcb001fbd65' (#32464)
* Don't shrink table columns when handling cells with greater spanning (#32458)Oriol Brufau2024-06-0719-43/+0
| | | | | | | | | | | | | For example: ```html <table border="1"> <tr> <td></td> <td></td> </tr> <tr> <td colspan="2"></td> </tr> </table> ``` We should initially size the columns according to the cells in the first row since they have a span of 1. Then we handle the cell in the second row with a span of 2, this should be able to increase the size of the columns, but never decrease them.
* layout: Properly size absolutely positioned tables (#32447)Martin Robinson2024-06-076-59/+2
| | | Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* build(deps): bump xml5ever from 0.18.0 to 0.18.1 (#32446)dependabot[bot]2024-06-0658-118/+0
| | | | | | | | | | | | | | Bumps [xml5ever](https://github.com/servo/html5ever) from 0.18.0 to 0.18.1. - [Commits](https://github.com/servo/html5ever/compare/xml5ever-v0.18.0...xml5ever-x0.18.1) --- updated-dependencies: - dependency-name: xml5ever dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* layout: Don't default to fallback fonts for spaces (#32442)Martin Robinson2024-06-052-4/+0
| | | | | | | | | | | | Previously, when deciding the font for a space, preference was given to the previous used font. This could means that the font chosen was a fallback font instead of the first font that supporting the space character in the font preference list. This caused an issue rendering emojis surrounded by spaces with "Noto Color Emoji" which has a space character the same size as the emoji, leading to too much spacing between them. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Fix getComputedStyle for width and height (#32437)Oriol Brufau2024-06-045-23/+3
| | | | | It was providing a length whenever the element generates a box. However, these properties don't apply to non-replaced inlines, so the computed value should be provided instead.
* layout: Add a `InlineFormattingContextBuilder` (#32415)Martin Robinson2024-06-032-4/+0
| | | | | | | | | | | | | | | | The main change here is that collapsed and `text-transform`'d text is computed as it's processed by DOM traversal. This single transformed text is stored in the root of the `InlineFormattingContext`. This will eventually allow performing linebreaking and shaping of the entire inline formatting context at once. Allowing for intelligent processing of linebreaking and also shaping across elements. This matches more closely what LayoutNG does. This shouldn't have any (or negligable) behavioral changes, but will allow us to prevent linebreaking inside of clusters in a followup change. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Update web-platform-tests to revision ↵Servo WPT Sync2024-06-02391-1453/+6901
| | | | b'17375f41ccf41e081764d2786ec535dede108c47' (#32426)
* layout: Add support for `white-space-collapse: break-spaces` (#32388)Martin Robinson2024-05-3081-261/+2
| | | | | | | | | | | | | | This change adds support for `white-space-collapse: break-spaces` and adds initial parsing support for `overflow-wrap` and `word-break`. The later two properties are not fully supported, only in their interaction with `break-spaces`. This is a preliminary change preparing to implement them. In addition, `break_and_shape` is now forked and added to Layout 2020. This function is going to change a lot soon and forking is preparation for this. More code that is only used by Layout 2013 is moved from `gfx` to that crate. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Upgrade stylo to 2024-05-15 (#32334)Oriol Brufau2024-05-271-0/+1
| | | | | | | | | | | | | * Upgrade stylo to 2024-05-15 * Fixup for https://phabricator.services.mozilla.com/D208599 * Fixup for https://phabricator.services.mozilla.com/D208569 * Fixup for https://phabricator.services.mozilla.com/D207796 * Fixup for https://phabricator.services.mozilla.com/D209690 * hashbrown and indexmap are no longer duplicated
* Update web-platform-tests to revision ↵Servo WPT Sync2024-05-26423-2321/+9319
| | | | b'f2cdcb7e9550e74d07ed6cf17bbcb9643aeedb99' (#32381)
* fonts: Add support for the CSS font matching algorithm (#32366)Martin Robinson2024-05-244-631/+0
| | | | | | | | | | | | | | | | | | | | | | * fonts: Add support for the CSS font matching algorithm This is a port from Gecko of the CSS font matching algorithm distance functions as well as the "simple family" concept for optimizing matching when dealing with simple fonts. Fixes #189. Fixes #190. Fixes #20686. Fixes #20684. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> * Ensure that simple faces are removed for removed stylesheets --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* fonts: Remove web fonts when their stylsheet is removed (#32346)Martin Robinson2024-05-233-2/+64
| | | | | | | | | | | | | This is the first part of ensuring that unused fonts do not leak. This change makes it so that when a stylesheet is removed, the corresponding web fonts are removed from the `FontContext`. Note: WebRender assets are still leaked, which was the situation before for all fonts. A followup change will fix this issue. Fixes #15139. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Uprade stylo to include servo/style#33 (#32147)Munish Mummadi2024-05-2319-104/+18
| | | This adds support for text decoration color and style.
* webgpu: Move errorscopes to WGPU thread (#32304)Samson2024-05-221-7/+2609
| | | | | | | | | | | | | | | | | | | | | * Prepare errorscopes logic in wgpu_thread * remove scope_id from ipc * new GPUErrors per spec * remove cotent timeline error_scope * fixup poperrorscope types * device_scope -> gpu_error and nice errors * Handle errors detection more elegantly * good expectations * new expectations * Make error_scope.errors Vec as per spec
* Implement 'visibility: collapse' on table parts (#32333)Oriol Brufau2024-05-2122-81/+0
| | | | | https://drafts.csswg.org/css2/#dynamic-effects Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Implement 'empty-cells' for layout 2020 (#32331)Oriol Brufau2024-05-217-118/+0
| | | | | https://drafts.csswg.org/css-tables/#empty-cell-rendering Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fonts: Store web fonts in the per-Layout `FontContext` (#32303)Martin Robinson2024-05-206-0/+86
| | | | | | | | | This moves mangement of web fonts to the per-Layout `FontContext`, preventing web fonts from being available in different Documents. Fixes #12920. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Update web-platform-tests to revision ↵Servo WPT Sync2024-05-19364-1598/+7958
| | | | b'cb53e377321267af4f5a1f05b3b851aab6fa8ede' (#32313)
* tables: Add a naive implementation of `border-collapse` (#32309)Martin Robinson2024-05-1833-242/+0
| | | | | | | | | This change adds a very simple implementation of `border-collapse` for tables. No harmonization or merging is done at all for borders. Instead, the largest border for every continuous border sets the size. Instead of merging different border styles, they are squashed to half size -- which isn't great, but ensures appropriate positioning. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-172-3/+3
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* fonts: Add color emoji support for FreeType (#32278)Martin Robinson2024-05-173-2/+5
| | | | | | | | | | | Color emoji support with "Noto Color Emoji" requires two things: 1. Support for bitmap fonts in the FreeType backend. This requires specially handling bitmap fonts which have different characteristics in the FreeType API (such as requiring metrics scaling). This support is generally ported from Gecko's implementation. 2. When a character is an emoji it "Noto Color Emoji" needs to be in the fallback list. Ensure that this is high on the list -- this will be improved in a later PR.
* script: Start rework to better match the specification HTML event loop (#31505)Gregory Terzian2024-05-132-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix the HTML event-loop: add a update the rendering task add rendering task source sketch structure to update the rendering resize steps composition events fix warnings in rendering task source refactor handling of composition events: put window and doc for pipeline on top set script as user interacting in update the rendering task fmt add todos for other steps, put all compositor handling logic in one place update the rendering: evaluate media queries and report changes update the rendering: update animations and send events update the rendering: run animation frames update the rendering: order docs put rendering related info on documents map tidy update the rendering: add issue numbers to todos update the rendering: reflow as last step update the rendering: add todo for top layer removals note rendering opportunity when ticking animations for testing fix double borrow crash in css/basic-transition fix faster reversing of transitions test undo ordering of docs bypass not fully-active pipeline task throttling for rendering tasks ensure tasks are dequed from task queue prioritize update the rendering task remove servo media stuff from set activity tidy debug update the rendering: perform microtask checkpoint after task tidy-up only run evaluate media queries if resized re-add evaluation of media queries for each rendering task, re-prioritize rendering tasks, re-add microtask checkpoint for all sequential messages re-structure resize steps, and their interaction with evaluating media queries and reacting to environment changes update the rendering: remove reflow call at the end update webmessaging expectations update to FAIL /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html update to FAIL load-pageshow-events-window-open.html add issue number for ordering of docs nits move batching of mouse move event to document info nits add doc for mouse move event index reset mouse move event index when taking pending compositor events fix replacing mouse move event nits * move update the rendering related data to document * move re-taking of tasks to try_recv * address nits * change task queue try_recv into take_tasks_and_recv, with nits * refactor process_pending_compositor_events * when updating the rendering, return early if script cannot continue running * use an instant for the last render opportunity time * nits * remove handle_tick_all_animations * use a vec for pending resize and compositor events * fix spec links * Fix a few other nits before landing --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* layout: When line-height is not `Normal` use metrics of first font not ↵Martin Robinson2024-05-132-4/+0
| | | | | fallback (#32165) This fixes an issue revealed by more consistent font fallback.
* fix: Implement additional logic in ↵shanehandley2024-05-132-60/+0
| | | | DOMString::set_best_representation_of_the_floating_point_number in order to correct some failing tests related to -0 values. (#32272)
* Update web-platform-tests to revision ↵Servo WPT Sync2024-05-12407-1088/+12183
| | | | b'8f48f40aab7f7f8a8118dc1a46972d070622be52' (#32271)
* Implement attributes for the `<meter>` element (#32230)shanehandley2024-05-118-730/+0
| | | | | * Implement attributes for the meter element * Remove checks for min < max before clamping
* webgpu: Update to wgpu 0.20 (#32173)Samson2024-05-0810-791/+1440
| | | | | | | | | | | * Update wgpu to 0.20 * good expectations * Throw TypeError in configure on unsupported format instead of panic * Expect * `into_command_buffer_id`,`into_command_encoder_id`
* Revert "script: implement AbortController (#31361)" (#32243)Samson2024-05-0775-263/+1185
| | | This reverts commit 7fce850cffb72a6fbcf763a40164a9b35b7fa833.
* Update web-platform-tests to revision ↵Servo WPT Sync2024-05-06189-620/+4263
| | | | b'536297144c737f84096d1f448e790de0fb654956' (#32232)
* script: implement AbortController (#31361)Smitty2024-05-0477-1186/+268
| | | | | | | | | | | | | | | | | | | | | * Implement AbortController Signed-off-by: syvb <me@iter.ca> * Update WPT tests Signed-off-by: syvb <me@iter.ca> * Address review comments * Fix duplicate import generation * Update WPT test expectations * Change expectation to FAIL for flaky test --------- Signed-off-by: syvb <me@iter.ca>
* servoshell: Upgrade `egui` and many other dependencies (#31278)Magnus Larsen2024-05-022-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * servoshell: Upgrade `egui` and many other dependencies This upgrades: - `core-graphics` - `core-text` - `egui` and friends - `font-kit` - `glow` and friends - `harfbuzz-sys` - `jni` - `nix` - `raqote` - `raw-window-handle` - `winit` * Downgrade jni until we can properly upgrade * Update some test results It's unclear why these are now passing, but they are. --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* feat: Support font-relative `ch` and `ic` units (#32171)Andreu Botella2024-05-0263-424/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: Support font-relative `ch` and `ic` units After #31966, which made it possible for the first time to resolve font-relative CSS units, this change adds support for the `ch` and `ic` units. One difference with the `ex` unit that was added in that PR is that these units must reflect the advance width of a character (the zero digit in the case of `ch`, and the CJK water radical for `ic`) as it would be rendered by the current font group. This means that the size of these units don't only depend on the first available font, in the case where that font does not contain a glyph for that character. This is implemented by adding the advance width for these two characters as optional fields of `FontMetrics`, so the advance width computation happens in advance. Then, when the font metrics are queried as part of unit resolution, the font group is searched for the first font containing that character. This change only implements support for these units in upright typesetting modes, since Servo does not yet have support for vertical writing modes. This means that many of the WPT tests that test for the behavior of these units with vertical writing modes do not pass. This change also makes a number of WPT tests pass, which relied on the `ch` and `ic` units. It, however, also makes the test `/css/css-text/white-space/text-wrap-balance-overflow-002.html` fail, since it tests `text-wrap: balance`, which Servo does not yet implement, and it was only previously passing by chance due to the previous behavior of these units. * Revert Python 3.10-related changes to wss * Fix formatting * Remove test expectation
* fonts: Use `FontInstanceFlags::EMBEDDED_BITMAPS` for color fonts on MacOS ↵Martin Robinson2024-05-021-0/+343
| | | | | | (#32203) This flag ensures that these fonts are rendered full color in WebRender, allowing for full color emoji.
* Update web-platform-tests to revision ↵Servo WPT Sync2024-05-02149-3112/+5249
| | | | b'9b5719f9756aba6e4aa3c855db9cc54648df815f' (#32214)