aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
Commit message (Collapse)AuthorAgeFilesLines
* layout: Combine `layout_2020` and `layout_thread_2020` into a crate called ↵Martin Robinson10 days1-762/+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: Throw away nested marker elements instead of storing them in a ↵Martin Robinson13 days1-8/+31
| | | | | | | | | | | | | | | | | | | | | | `BoxSlot` (#36568) `::before` and `::after` pseudo-elements can have their own `::marker` pseudo-element. Since this case wasn't taken into account, they were being stored in main element's `::marker` `BoxSlot`. This could cause problems where two layout boxes would try to use the same `BoxSlot`. For now, just don't store the nested version of the marker. Later, we'll need to figure out how to store these layout objects without causing too much memory usage. Testing: This is covered by `/css/css-lists/nested-marker-styling.html`. In addition, we also made a test case that always causes this crash, but since it had to create 100000 `<div>`s it's probably not appropriate for a test suite. Fixes: #36551 Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Eliminate extra stored style on outside markers (#36471)Martin Robinson2025-04-111-1/+0
| | | | | | | | This is a duplicate of the style stored on the marker's `LayoutBoxBase`. Testing: This is covered by existings WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add initial support for the `::marker` pseudo-element (#36317)Martin Robinson2025-04-071-2/+2
| | | | | | | | | | | | | | | This change adds support for the `::marker` pseudo-element and ensure that markers are cached into the box tree. This is only initial support, there are a few things missing such as animations, transitions, and support the `content` CSS property. Testing: There are WPT tests for this change. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Simplify and generalize the usage of pseudo-elements (#36202)Martin Robinson2025-03-291-49/+41
| | | | | | | | | | | | | | | | | | | | | - Remove the last remaining Servo-specific PseudoElement enum from layout. This was made to select `::before` and `::after` (both eager pseudo-elements), but now `traverse_pseudo_element` is called `traverse_eager_pseudo_element` and should work on any eager pseudo element. - Expose a single way of getting psuedo-element variants of ThreadSafeLayoutElement in the Layout DOM, which returns `None` when the pseudo-element doesn't apply (not defined for eager pseudo-elements or when trying to get `<details>` related pseudo-elements on elements that they don't apply to). - Ensure that NodeAndStyleInfo always refers to a node. This is done by making sure that anonymous boxes are all associated with their originating node. These changes are prepatory work for implementation of the `::marker` pseudo-element as well as ensuring that all anonymous boxes can be cached into the box tree eventually. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-7/+9
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* layout: Merge `BoxFragment::used_overflow` into ↵Euclid Ye2025-03-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | `ComputedValuesExt::effective_overflow` (#35670) (#35670) * Update wpt-test * Merge used_overflow to effective_overflow; remove duplicate call * Remove more duplicate calls; update effective_overflow logic * Update reference link&style * Apply final review suggestions Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
* layout: Take percentage columns into account when sizing table grid min and ↵Martin Robinson2025-01-271-44/+33
| | | | | | | | | | | | | | | | | | | | | max (#35167) The specification doesn't say how to deal with percentages when determining the minimum and maximum size of a table grid, so follow the approach that Chromium uses. Essentially, figure out the "missing" percentage from the non-percentage columns and then use that to work backwards to fine the size of the percentage ones. This change is larger than one might expect, because this percentage approach shouldn't happen for tables that are descendants of a flex, grid or table container (except when there is an interceding absolute). We have to pass this information down when building the box tree. This will also make it easier to improve propagated text decorations in the future. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Make sure to cache `inline_content_sizes()` (#34586)Oriol Brufau2024-12-121-1/+1
| | | | | | | | | | | | | | | | The refactoring in 264c0f972fd1a732ee1d1490d78a1d26a65c6f5f stopped caching the `inline_content_sizes()` calls from: - `FlexItemBox::layout_for_block_content_size()` - `IndependentFormattingContext::layout_float_or_atomic_inline()` - `TaffyContainerContext::compute_child_layout()` Also, the call from `OutsideMarker::layout()` was never cached. This patch caches all of them. It's not clear at all which `inline_content_sizes()` are cached and which aren't, so I plan to improve the situation in a follow-up. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
* layout: Clean up inline layout data types a bit (#34563)Martin Robinson2024-12-111-4/+4
| | | | | | | | | | | - Remove the `LayoutBox::InlineBox` variant that was only used for inline level boxes. Now they are stored in `LayoutBox::InlineLevel` along with other kinds of out-of-flow and atomic inline items. - Reduce the size of `InlineItem` by 260 bytes per item by using atomic indirection / pointers. This adds a bit of overhead to access items in exchange for a lot of memory saved. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Have `SameFormattingContextBlock` be a `LayoutBoxBase` (#34530)Martin Robinson2024-12-091-2/+2
| | | | | | This allows `SameFormattingContextBlock` to cache inline content sizes and will eventually allow it to participate in incremental layout. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* layout: Add initial support for bidirectional text (BiDi) (#33148)Martin Robinson2024-08-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* layout: Allow rendering LineItems independent of inline box (#32666)Martin Robinson2024-07-031-1/+2
| | | | | | | | | | Refactor inline layout to allow rendering line items in the second stage to be rendered in any order, independent of their parent inline box. This will allow line items to be reordered, effectively allowing the splitting of inline boxes, for the purposes of BiDi and any other inline reordering feature. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* layout: Simplify `Contents` a little (#32487)Martin Robinson2024-06-211-5/+5
| | | | | | | Instead of duplicating some of `NonReplacedContents` in `Contents`, divide it into either replaced and non-replaced content, since this is how the layout system processes `Contents` always. In addition, stop using `TryInto` to match replaced or non-replaced contents, as it is quite confusing to handle an `Err` as a success case.
* layout: Add very basic support for showing text in input boxes (#32365)Martin Robinson2024-06-201-0/+3
| | | | | | | | | | | | | | | | | | This only paints text in input fields. Selection and cursor are still not painted. In addition to adding this feature, the change also updates the user-agent.css with the latest from the HTML specification. Extra padding and extraneous settings (such as a bogus line-height and min-height) are also removed from servo.css. This leads to some new passes. There are some new passes, this introduces failures as inserting text reveals issues that were hidden before. Notably: - failures in `/html/editing/editing-0/spelling-and-grammar-checking/`: We do not support spell-checking. - Most of the rest of the new failures are missing features of input boxes that are also missing in legacy layout.
* layout: Flatten inline box storage in InlineFormattingContexts (#32539)Martin Robinson2024-06-191-9/+14
| | | | | | | | | | | This accomplishes two things: 1. Makes it easier to iterate through all inline formatting context items. 2. Will make it possible to easily move back and forth through the tree of inline boxes, in order to enable reordering and splitting inline boxes on lines -- necessary for BiDi. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* layout: Add a `InlineFormattingContextBuilder` (#32415)Martin Robinson2024-06-031-246/+147
| | | | | | | | | | | | | | | | 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>
* layout: Ensure empty list items are at least as tall as outside markers (#32152)Martin Robinson2024-04-291-3/+3
| | | | | | | | | | | | | | | | While <https://drafts.csswg.org/css-lists/#list-style-position-property> says: > The size or contents of the marker box may affect the height of the > principal block box and/or the height of its first line box, and in some > cases may cause the creation of a new line box; this interaction is also > not defined. All other browsers ensure that the first line of list item content is the same block size as the marker. Doing this is complicated, but we can ensure that the entire list item is at least as tall as the marker. This should handle the majority of cases and we can make refinements later for stranger situations, such as when the marker is very tall. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* layout: Add a basic support for `list-style-position: outside` (#32114)Martin Robinson2024-04-221-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds very basic support for `list-style-position`. Currently, the marker does not do any kind of baseline alignment with the rest of the list item contents and it also doesn't force the list item to be at least as tall as the marker. This adds a few new failures: - Four failures because markers do not ensure that list-items have at least the same block size as they do: - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-012.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-014.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-type-applies-to-012.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-type-applies-to-014.xht - One failure because we don't yet support the `::marker` pseudo-selector: - FAIL [expected PASS] /css/css-position/position-absolute-dynamic-list-marker.html - One failure because we don't support the list item exception for the line height quirk: - FAIL [expected PASS] /quirks/line-height-in-list-item.tentative.html Co-authored-by: Oriol Brufau <obrufau@igalia.com> <!-- Please describe your changes on the following line: --> Fixes #27383. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27383. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Allow finishing anonymous inline-table at the end of inline elements (#31650)Oriol Brufau2024-03-141-0/+2
| | | This avoids inserting it outside of its parent.
* End ongoing IFC when inserting anonymous block-level table (#31606)Oriol Brufau2024-03-131-0/+1
| | | | So that the table appears after preceding inline-level contents. Fixes #31603.
* clippy: Fix warnings in `components/layout_2020` (#31611)eri2024-03-111-10/+6
| | | | | * clippy: fix warnings in components/layout_2020 * fix: review comments
* layout: Do not inherit node and fragment flags in anonymous boxes (#31586)Martin Robinson2024-03-091-2/+2
| | | | | | | This doesn't really have observable behavior right now, as much as I tried to trigger some kind of bug. On the other hand, it's just wrong and is very obvious when you dump the Fragment tree. If you create a `display: table-cell` that is a child of the `<body>` all parts of the anonymous table are flagged as if they are the `<body>` element.
* layout: Do whitespace collapse during breaking and shaping (#31322)Martin Robinson2024-02-131-194/+11
| | | | | | | | This moves white space collapse to right before breaking and shaping happens, which is more similar to what happens in legacy layout. This is the first step toward making this procedure more efficient (avoiding string copies) and also implementing support for `text-transform`. Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
* layout: Implement support for font fallback (#31254)Martin Robinson2024-02-111-6/+8
| | | | | | | This adds an initial implementation of font fallback, on part with the one used in legacy layout. There are still issues. For instance, font matching is done per unicode character rather than based on graphemes or the shape first approach of Chrome. The idea is that these changes can be made later.
* layout: Shape text only once (#31146)Martin Robinson2024-01-251-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Shape text during InlineFormattingContext construction rather than doing it twice during fragment tree construction. This is a step on the way toward proper font fallback. This also moves all `TextRun` related code into `text_run.rs` to try to trim down the size of `inline.rs`. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because this should only have performance impacts. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* Lint layout_2020 with clippy (#31169)Oriol Brufau2024-01-251-5/+5
| | | cargo clippy --fix -p layout_2020 --allow-dirty --broken-code
* Add support for table fixups (#30868)Martin Robinson2023-12-221-46/+160
| | | | | | | | | | | | | | | | This adds support for fixing up tables so that internal table elements that are not properly parented in the DOM have the correct box tree structure according to the CSS Table specification [1]. Note that this only comes into play when building the DOM via script, as HTML 5 has its own table fixups that mean that the box tree construction fixups here are not necessary. There are no tests for this change. In general, it's hard to write tests against the shape of the box tree, because it depends on the DOM. We plan to test this via WPT tests once layout is complete. 1. https://drafts.csswg.org/css-tables/#table-internal-element Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Add initial support for table box tree construction (#30799)Martin Robinson2023-12-051-0/+3
| | | | | | | | | | | | This is the first part of constructing the box tree for table layout. No layout is actually done and the construction of tables is now hidden behind a flag (in order to not regress WPT). Notably, this does not handle anonymous table part construction, when the DOM does not reflect a fully-formed table. That's part two. Progress toward #27459. Co-authored-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Manish Goregaokar <manishsmail@gmail.com>
* Make LineItems a token stream on the root (#30608)Martin Robinson2023-10-251-6/+6
| | | | | | | | | Flattening the LineItem tree into a token stream will allow for handling the case where an unbreakable line segment spans multiple inline boxes which might have different hierarchies. This change also fixes the handling of the second anonymous fragment of a block-in-inline-split. Co-authored-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Anonymous boxes that wrap inlines should not inherit overflow (#30579)Martin Robinson2023-10-191-2/+2
| | | | | | | | | | | | | | In legacy layout, anonymous text wrappers were inheriting the `overflow` and `text-overflow` properties. This results in the creation of extra clipping for these anonymous wrappers which could clip away floats. We will likely implement `text-overflow` differently in non-legacy layout. This change marks all legacy layout pseudo elements as "legacy" and also adds a new pseudo element for non-legacy layout that does not inherit `overflow`. Fixes #30562. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-9/+11
| | | | | * strict imports formatting * Reformat all imports
* Add initial support for css-text-3 whitespace handling (#29828)Atbrakhi2023-07-201-153/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-80/+39
| | | | | | | | | | | 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`).
* layout_2020: Check blocks for whether they will establish a formatting contextPu Xingyu2023-05-311-2/+4
|
* Combine DOM-related concepts in Layout 2020 into dom.rsMartin Robinson2023-05-131-4/+2
|
* Detect body elements during layoutMartin Robinson2023-05-041-5/+4
| | | | | | | | | | | | | | | | | 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.
* Fix text-decoration for block containers in layout-2020Oriol Brufau2023-04-261-3/+6
| | | | | | It was only applied to the 1st inline formatting context of a block container. Other IFCs were created with the Default trait, implying TextDecorationLine::NONE.
* Support text-indent in layout-2020Oriol Brufau2023-04-251-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existing WPT now passing: - _mozilla/css/text_indent_a.html - css/CSS2/css1/c71-fwd-parsing-002.xht - css/CSS2/css1/c71-fwd-parsing-004.xht - css/CSS2/floats-clear/floats-138.xht - css/CSS2/text/text-indent-007.xht - css/CSS2/text/text-indent-008.xht - css/CSS2/text/text-indent-010.xht - css/CSS2/text/text-indent-019.xht - css/CSS2/text/text-indent-020.xht - css/CSS2/text/text-indent-031.xht - css/CSS2/text/text-indent-032.xht - css/CSS2/text/text-indent-043.xht - css/CSS2/text/text-indent-044.xht - css/CSS2/text/text-indent-055.xht - css/CSS2/text/text-indent-056.xht - css/CSS2/text/text-indent-067.xht - css/CSS2/text/text-indent-068.xht - css/CSS2/text/text-indent-079.xht - css/CSS2/text/text-indent-080.xht - css/CSS2/text/text-indent-091.xht - css/CSS2/text/text-indent-092.xht - css/CSS2/text/text-indent-103.xht - css/CSS2/text/text-indent-104.xht - css/CSS2/text/text-indent-112.xht - css/CSS2/text/text-indent-113.xht - css/CSS2/text/text-indent-115.xht - css/CSS2/text/text-indent-applies-to-002.xht - css/CSS2/text/text-indent-applies-to-003.xht - css/CSS2/text/text-indent-applies-to-005.xht - css/CSS2/text/text-indent-applies-to-006.xht - css/CSS2/text/text-indent-applies-to-007.xht - css/CSS2/text/text-indent-applies-to-008.xht - css/CSS2/text/text-indent-applies-to-009.xht - css/CSS2/text/text-indent-applies-to-010.xht - css/CSS2/text/text-indent-applies-to-011.xht - css/CSS2/text/text-indent-applies-to-014.xht - css/CSS2/text/text-indent-applies-to-015.xht - css/CSS2/text/text-indent-inherited-001.xht - css/CSS2/text/text-indent-overflow-001.xht - css/CSS2/text/text-indent-overflow-002.xht - css/CSS2/text/text-indent-overflow-003.xht - css/CSS2/text/text-indent-overflow-004.xht - css/CSS2/text/text-indent-wrap-001.xht - css/css-text-decor/text-shadow/textindent.html - css/css-text/text-indent/text-indent-percentage-001.xht - css/css-text/text-indent/text-indent-percentage-002.html - css/css-text/text-indent/text-indent-percentage-003.html - css/css-text/text-indent/text-indent-percentage-004.html - css/css-values/minmax-length-percent-serialize.html - css/css-values/minmax-length-serialize.html Also improvements in: - _mozilla/mozilla/calc.html - css/css-text/animations/text-indent-interpolation.html - css/css-text/inheritance.html - css/css-text/parsing/text-indent-computed.html - css/css-text/parsing/text-indent-valid.html - css/css-transitions/properties-value-implicit-001.html - css/css-values/animations/calc-interpolation.html - css/css-values/minmax-percentage-serialize.html - css/css-values/viewport-units-css2-001.html - css/css-variables/variable-substitution-basic.html - css/cssom/serialize-values.html Existing WPT now failing, due to lack of direction, outside list markers, flex and grid: - css/CSS2/text/text-indent-rtl-001.xht - css/CSS2/text/text-indent-rtl-002.xht - css/css-pseudo/marker-content-023.html - css/css-text/text-indent/anonymous-flex-item-001.html - css/css-text/text-indent/anonymous-grid-item-001.html New WPT tests: - css/css-text/text-indent/text-indent-length-001.html - css/css-text/text-indent/text-indent-length-002.html This one fails in layout-2013.
* Simplify control flow of whitespace handling.Josh Matthews2020-07-271-60/+78
|
* Implement basic white-space: pre support for layout 2020.Josh Matthews2020-07-271-14/+37
|
* Add layout support for list markersSimon Sapin2020-07-241-2/+45
|
* Make a bool for `display: list-item` available to flow box constructionSimon Sapin2020-07-231-10/+45
|
* Remove the now single-field `Accumulator` structSimon Sapin2020-06-191-15/+7
|
* Compute content sizes lazily in layout 2020Anthony Ramine2020-06-181-107/+16
|
* Make IndependentFormattingContext an enumAnthony Ramine2020-06-151-4/+4
|
* Make outer_inline and outer_inline_and_percentages free functionsAnthony Ramine2020-06-151-11/+11
| | | | They now take a closure that will compute the content sizes on demand.
* Use the writing mode of the containing block when accessing CSS propertiesSimon Sapin2020-06-101-5/+30
| | | | | | | | … and converting them to flow-relative geometric values. These values are almost always used to size and position a fragment within its containing block, so using the mode of the containing block seems more correct. Note that the `writing-mode` and `direction` properties are disabled in Servo at the moment, so this PR by itself should have no effect: the writing mode of an element is always the same of that of its containing block since they’re both horizontal rtl.
* Store abspos boxes in a RefCell tooAnthony Ramine2020-06-091-6/+12
| | | | | | We want to mutate them when lazily computing their content sizes, but they are behind an Arc for the hoisting infra, so it also needs its own layer of inner mutability.
* layout_2020: Tag fragments with their pseudo content typeMartin Robinson2020-06-061-99/+70
| | | | | This will allow us to answer queries and properly handle animations in the future for fragments generated for pseudo content.