aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/Cargo.toml
Commit message (Collapse)AuthorAgeFilesLines
* layout: Combine `layout_2020` and `layout_thread_2020` into a crate called ↵Martin Robinson2 days1-64/+0
| | | | | | | | | | | | | | | | | | `layout` (#36613) Now that legacy layout has been removed, the name `layout_2020` doesn't make much sense any longer, also it's 2025 now for better or worse. The split between the "layout thread" and "layout" also doesn't make as much sense since layout doesn't run on it's own thread. There's a possibility that it will in the future, but that should be something that the user of the crate controls rather than layout iself. This is part of the larger layout interface cleanup and optimization that @Looriool and I are doing. Testing: Covered by existing tests as this is just code movement. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Report memory usage for fragment and box trees. (#36553)Josh Matthews3 days1-0/+2
| | | | | | | | | | | | Add memory reporter integration for the fragment and box trees that are persisted in the layout thread. Testing: Looked at the numbers for https://servo.org and https://html.spec.whatwg.org/. The former was very small, but the latter was 700mb. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* refactor: use is_zero() instead of comparing with Au::Zero() (#36347)Barigbue Nbira12 days1-0/+1
| | | | | | | | | | | Use `is_zero()` instead of comparing with `Au::Zero()` for zero checks. Testing: This change does not cause behaviour change, a test is not necessary. Fixes: #36300 --------- Signed-off-by: Barigbue <barigbuenbira@gmail.com>
* `compositing`: Combine `webrender_traits` and `compositing_traits` (#36372)Martin Robinson2025-04-061-1/+1
| | | | | | | | | | | | | | | These two traits both exposed different parts of the compositing API, but now that the compositor doesn't depend directly on `script` any longer and the `script_traits` crate has been split into the `constellation_traits` crate, this can be finally be cleaned up without causing circular dependencies. In addition, some unit tests for the `IOPCompositor`'s scroll node tree are also moved into `compositing_traits` as well. Testing: This just combines two crates, so no new tests are necessary. Fixes: #35984. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@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: Implement a non-recursive version of CSS `quotes` (#34770)Xiaocheng Hu2025-02-271-0/+1
| | | | | | | | | | | | | | | | | * Squash and don't explicitly use noto-cjk in tests Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Mark quotes-034.html.ini failure Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> * Address review comments Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> --------- Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
* layout: Remove the obsolete layout tracing functionality (#35001)Martin Robinson2025-01-151-3/+1
| | | | | | | | | | | | | | | | | | | | There were two kinds of layout tracing controlled by the same debugging option: - modern layout: Functionality that dumped a JSON serialization of the layout tree before and after layout. - legacy layout: A scope based tracing that reported the process of layout in a structured way. I don't think anyone working on layout is using either of these two features. For modern layout requiring data structure to implement `serde` serialization is incredibly inconvenient and also generates a lot of extra code. We also have a more modern tracing functionality based on perfetto that we have started to use for layout and IMO it's actually being used and more robust. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Fix CSS `attr()` function case sensitivity matching (#34574)Steven Novaryo2024-12-131-0/+1
| | | Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
* Remove some unused dependencies (#34355)Jonathan Schwender2024-11-251-2/+1
| | | | | | | | | | | | | | | * Remove unused deps This doesn't seem to remove any deps from the workspace. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * ohos: Remove gaol dependency Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Layout: Implement CSS Grid using `taffy` (#32619)Nico Burns2024-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add layout.grid.enabled pref Signed-off-by: Nico Burns <nico@nicoburns.com> * Add taffy dependency Signed-off-by: Nico Burns <nico@nicoburns.com> * Import taffy <-> stylo conversion code from taffy_stylo crate Signed-off-by: Nico Burns <nico@nicoburns.com> * Add `Grid` variant to DisplayInside Signed-off-by: Nico Burns <nico@nicoburns.com> * Implement CSS Grid using Taffy Signed-off-by: Nico Burns <nico@nicoburns.com> Import full stylo_taffy crate Signed-off-by: Nico Burns <nico@nicoburns.com> Squashed PR feedback changes Deduplicate is_document_only_whitespace Signed-off-by: Nico Burns <nico@nicoburns.com> Import taffy::AvailableSpace Signed-off-by: Nico Burns <nico@nicoburns.com> Rename FlexContext to TaffyContainerContext Signed-off-by: Nico Burns <nico@nicoburns.com> Eliminate references to flexbox in taffy/layout module Signed-off-by: Nico Burns <nico@nicoburns.com> Use constructors for geom types Signed-off-by: Nico Burns <nico@nicoburns.com> Remove comment about abspos elements splitting contiguous text runs Signed-off-by: Nico Burns <nico@nicoburns.com> Remove reference to flexbox in taffy/construct Signed-off-by: Nico Burns <nico@nicoburns.com> Deduplicate construction of flexbox/grid containers Signed-off-by: Nico Burns <nico@nicoburns.com> Make anonymous text runs InFlow Signed-off-by: Nico Burns <nico@nicoburns.com> Remove commented code Signed-off-by: Nico Burns <nico@nicoburns.com> Update comments Signed-off-by: Nico Burns <nico@nicoburns.com> Inline/vendor the stylo/taffy interop code Signed-off-by: Nico Burns <nico@nicoburns.com> * Update test expectations Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix nits from PR review Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Gate all use of `tracing` behind Cargo feature (#33845)Delan Azabani2024-10-161-1/+4
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* tools: Improve instrumentation and add it for some layout (#33647)Martin Robinson2024-10-051-0/+1
| | | | | | | Improves the instrumentation to skip all function arguments and also add spans for some layout modes. This is preparation for improving the performance of flexbox. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add `rust-version` to all `Cargo.toml` files (#33483)Martin Robinson2024-09-171-0/+1
| | | | | | | This is another step preparing for building Servo without `mach`. Fixes #33430. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Stop using `unicode-segmentation` in layout (#33250)Martin Robinson2024-08-291-1/+0
| | | | | | | `layout` already uses `icu_segmentation` so there's no need to pull in another segmenter. This reduces the number of segmenters used in the crate to 2 from 3. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add initial support for bidirectional text (BiDi) (#33148)Martin Robinson2024-08-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds supports for right-to-left text assigning bidi levels to all line items when necessary. This includes support for the `dir` attribute as well as corresponding CSS properties like `unicode-bidi`. It only implements right-to-left rendering for inline layout at the moment and doesn't include support for `dir=auto`. Because of missing features, this causes quite a few tests to start failing, as references become incorrect due to right-to-left rendering being active in some cases, but not others (before it didn't exist at all). Analysis of most of the new failures: ``` - /css/css-flexbox/gap-001-rtl.html /css/css-flexbox/gap-004-rtl.html - Require implementing BiDi in Flexbox, because the start and end inline margins are opposite the order of items. - /css/CSS2/bidi-text/direction-applies-to-*.xht /css/CSS2/bidi-text/direction-applies-to-002.xht /css/CSS2/bidi-text/direction-applies-to-003.xht /css/CSS2/bidi-text/direction-applies-to-004.xht - Broken due to a bug in tables, not allocating the right amount of width for a column. - /css/css-lists/inline-list.html - This fails because we wrongly insert a soft wrap opportunity between the start of an inline box and its first content. - /css/css-text/bidi/bidi-lines-001.html /css/css-text/bidi/bidi-lines-002.html /css/CSS2/text/bidi-flag-emoji.html - We do not fully support unicode-bidi: plaintext - /css/css-text/text-align/text-align-end-010.html /css/css-text/text-align/text-align-justify-006.html /css/css-text/text-align/text-align-start-010.html /html/dom/elements/global-attributes/* - We do not support dir=auto yet. - /css/css-text/white-space/tab-bidi-001.html - Servo doesn't support tab stops - /css/CSS2/positioning/abspos-block-level-001.html /css/css-text/word-break/word-break-normal-ar-000.html - Do not yet support RTL layout in block - /css/css-text/white-space/pre-wrap-018.html - Even in RTL contexts, spaces at the end of the line must hang and not be reordered - /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html - We are letting spaces hang with white-space: pre, but they shouldn't hang. ``` Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* Remove lazy static (#33078)Hayashi Mikihiro2024-08-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove from rand Mutex<OsRng> can be initialized in compile time. Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * remove from layout_2020 Mutex<()> can be initialize in compile time Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * remove from media `IS_MULTIPROCESS` doesn't be used. Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * remove lazy_static from dependencies Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> * rewrite suppressed_leaks_for_asan.txt For all of lazy_static was replaced with LazyLock. Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> --------- Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* layout: Reduce the complexity of `FlexLine::layout` (#32810)Martin Robinson2024-07-191-0/+1
| | | | | | | | Instead of a complex combination of iterators, use a flatter iteration design when laying out a flex line. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
* Clean up some unused dependencies (#32600)Oriol Brufau2024-06-251-1/+0
|
* Rename `gfx` to `fonts` (#32556)Martin Robinson2024-06-191-2/+2
| | | | | | | | | 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>
* Use workspace definitions for all crates and update to the 2021 edition (#32544)Martin Robinson2024-06-181-5/+5
|
* layout: Linebreak the entire InlineFormattingContext at once (#32483)Martin Robinson2024-06-131-1/+2
| | | | | | | | | | | | | 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>
* compositor: Move WebRender-ish messages and types to `webrender_traits` (#32315)Mukilan Thiyagarajan2024-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | * Move WebRender related types to `webrender_traits` This refactor moves several WebRender related types from `compositing_traits`, `script_traits` and `net_traits` crates to the `webrender_traits` crate. This change also moves the `Image` type and associated function out of `net_traits` and into the `pixels` crate. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi` --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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`.
* layout: Add support for `<object>` with image data URLs (#32069)Martin Robinson2024-04-151-0/+2
| | | | | This is enough support for `<object>` to get Acid2 working. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add support for box-shadow to Layout 2020 (#31453)Martin Robinson2024-03-071-0/+1
|
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove packages that were moved to external repo * Add workspace dependencies pointing to 2023-06-14 branch * Fix servo-tidy.toml errors * Update commit to include #31346 * Update commit to include servo/stylo#2 * Move css-properties.json lookup to target/doc/stylo * Remove dependency on vendored mako in favour of pypi dependency This also removes etc/ci/generate_workflow.py, which has been unused since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f. * Add temporary code to debug Windows test failures * Fix failures on Windows due to custom target dir * Update commit to include servo/stylo#3 * Fix license in tests/unit/style/build.rs * Document how to build with local Stylo in Cargo.toml
* layout: Add initial support for `text-transform` (#31396)Martin Robinson2024-02-221-0/+1
| | | | | | | | | | | | | This adds basic support for `text-transform` in a way that is more complete than legacy layout. There are still many missing elements of proper `text-transform` support such as: 1. Support for `full-width` and `full-size-kana` 2. Support for grapheme based uppercasing, lowercasing, and capitalization. These are all done per-code point right now. 3. Support for the language-specific `SpecialCasing.txt` cases for case mapping such as the ones for Irish and Turkish. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* deps: Remove unused crate dependencies (#31185)Martin Robinson2024-01-261-1/+0
| | | These were identified with `cargo-marchete`.
* Move `*_traits` and other shared types to `shared`Martin Robinson2023-11-031-8/+8
| | | | | | | | | | | | This is the start of the organization of types that are in their own crates in order to break dependency cycles between other crates. The idea here is that putting these packages into their own directory is the first step toward cleaning them up. They have grown organically and it is difficult to explain to new folks where to put new shared types. Many of these crates contain more than traits or don't contain traits at all. Notably, `script_traits` isn't touched because it is vendored from Gecko. Eventually this will move to `third_party`.
* Fix painting order of atomic inline stacking containers (#30458)Delan Azabani2023-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * Sort stacking contexts and stacking containers by painting order * fix stealing of stacking containers; fix interleaving with fragments * actually positioned stacking containers should be stolen too * update expectations and clean up panic changes * rework naming and docs * rename s_c_a_p_s_c to real_s_c_a_p_s_c; fix docs * rename InlineStackingContainer to AtomicInlineStackingContainer * rework debug logging to use PrintTree * clean up docs and PrintTree output * don't panic unless cfg!(debug_assertions) is true * update expectations
* Use std::cell::OnceCell and remove mitochondria dependency (#30207)Martin Robinson2023-08-251-1/+0
| | | | | `OnceCell` is now part of the standard library and we'll be able to use it once we upgrade rust. For now we can use the version that's shipped behind a feature flag in rust. This removes a dependency on one crate.
* Add initial support for css-text-3 whitespace handling (#29828)Atbrakhi2023-07-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add initial support for css-text-3 whitespace handling This adds initial support for whitespace handling from the CSS specification for Layout 2020. In general, the basics are covered. Since test output is very sensitive to whitespace handling, this change incorporates several fixes: 1. Whitespace is collapsed according to the Phase 1 rules of the specification, though language-specific unbreaking rules are not handled properly yet. 2. Whitespace is mostly trimmed and positioned according to the Phase 2 rules, but full support for removing whitespace at the end of lines is pending on a temporary data structure to hold lines under construction. 3. Completely empty box fragments left over immediately after line breaks are now trimmed from the fragment tree. 4. This change tries to detect when an inline formatting context collapses through. Fixes #29994. Co-authored-by: Mukilan Thiyagarajan <me@mukilan.in> Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> * Update test results --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <me@mukilan.in> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Remove rayon_croissant and clean up `contains_floats` (#29960)Martin Robinson2023-07-191-1/+0
| | | | | | | | | | | Remove rayon_croissant and refactor the way that information about floats in flows bubbles up. This simplifies the code a good deal and lets us take advantage of some more optimized functions provided by rayon. This removes 2 crates from the dependency tree. In addition, this allows avoiding passing `contains_floats` up from every box tree construction function. This makes things simpler, but also opens up the possibility of passing more of these flags up in the future (such as `contains_counters`).
* Make the choice of layout runtime settingMartin Robinson2023-07-061-2/+2
| | | | Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* Vendor the current version of WebRenderMartin Robinson2023-07-031-1/+1
| | | | | | | | This is a step toward upgrading WebRender, which will be upgraded and patched in the `third_party` directory. This change vendors the current private branch of WebRender that we use and adds a `patches` directory which tracks the changes on top of the upstream WebRender commit described by third_party/webrender/patches/head.
* Start the transition to workspace dependenciesMartin Robinson2023-05-171-18/+18
| | | | | | | This will ultimately make it simpler to update crate dependencies and reduce duplicate when specifying requirements. Generally, this change does not touch dependencies that are only used by a single crate. We could consider moving them to workspace dependencies in the future.
* Detect body elements during layoutMartin Robinson2023-05-041-0/+1
| | | | | | | | | | | | | | | | | During layout it is often useful, for various specification reasons, to know if an element is the `<body>` element of an `<html>` element root. There are a couple places where a brittle heuristic is used to detect `<body>` elements. This information is going to be even more important to properly handle `<html>` elements that inherit their overflow property from their `<body>` children. Implementing this properly requires updating the DOM wrapper interface. This check does reach up to the parent of thread-safe nodes, but this is essentially the same kind of operation that `parent_style()` does, so is ostensibly safe. This change should not change any behavior and is just a preparation step for properly handle `<body>` overflow.
* Bump euclid to 0.22Martin Robinson2023-01-261-1/+1
| | | | | | | | | | | | | - Also updates raqote to latest with an upgrade of font-kit to 0.11 applied on as a patch - Update lyon_geom to the latest version Major change: - All matrices are now stored in row major order. This means that parameters to rotation functions no longer should be negated. - `post_...()` functions are now named `then()`. `pre_transform()` is removed, so `then()` is used and the order of operations changed.
* Remove env_logger duplicate.Josh Matthews2022-04-011-1/+1
|
* Update html5ever/xml5ever.Josh Matthews2022-04-011-1/+1
|
* Update parking_lot.Josh Matthews2022-04-011-1/+1
|
* Updated cssparser dependency to 0.29.Lewin Probst2021-11-181-1/+1
| | | | Signed-off-by: Lewin Probst <info@emirror.de>
* Miscellaneous build / tidy fixes.Emilio Cobos Álvarez2021-02-261-1/+1
|
* Revert "Revert "Update harfbuzz, freetype, unicode-script.""Josh Matthews2020-08-101-1/+1
| | | | This reverts commit 6b520850f34d55e88678999ff85aa70ba949d10c.
* Revert "Update harfbuzz, freetype, unicode-script."Josh Matthews2020-08-041-1/+1
| | | | This reverts commit 327fed6084a99cfeede4752dc7b71416b5d83032.
* Update harfbuzz, freetype, unicode-script.Josh Matthews2020-07-311-1/+1
|
* Add an implementation of the core float and clear placement logic in layoutPatrick Walton2020-07-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2020, not yet wired to the rest of layout. This commit implements an object that handles the 10 rules in CSS 2.1: https://www.w3.org/TR/CSS2/visuren.html#float-position The implementation strategy is that of a persistent balanced binary search tree of float bands. Binary search trees are commonly used for implementing float positioning; e.g. by WebKit. Persistence enables each object that interacts with floats to efficiently contain a snapshot of the float list at the time that object was laid out. That way, incremental layout can invalidate and start reflow at any point in a containing block. This commit features extensive use of [QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules of the CSS specification are followed. Because this is not yet connected to layout, floats will not actually be laid out in Web pages yet. Note that unit tests as set up in Servo currently require types that they access to be public. Therefore, some internal layout 2020 types that were previously private have been made public. This is somewhat unfortunate. Part of #25167.
* Remove some unused dependency declarationsSimon Sapin2020-05-291-1/+0
| | | | | | This is based on compiling with `RUSTFLAGS="-W unused_crate_dependencies"` (CC https://github.com/rust-lang/rust/pull/72342) in a recent Nightly (more so than used in the tree as of this writing, CC https://github.com/servo/servo/issues/26661 for work-arounds). Only one crate is actually removed from the dependency graph, others are still dependended from other places.
* Remove use of nightly features in parking_lot. Update many uses from 0.9 to ↵Josh Matthews2020-05-261-1/+1
| | | | 0.10.
* layout_2020: Add support for transitions and animationsMartin Robinson2020-05-191-0/+1
|