aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow
Commit message (Collapse)AuthorAgeFilesLines
* Rename `gfx` to `fonts` (#32556)Martin Robinson2024-06-193-10/+8
| | | | | | | | | 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>
* layout: Flatten inline box storage in InlineFormattingContexts (#32539)Martin Robinson2024-06-194-250/+220
| | | | | | | | | | | 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: Allocate inline box start space on segment (#32486)Martin Robinson2024-06-181-12/+12
| | | | | | 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>
* layout: Linebreak the entire InlineFormattingContext at once (#32483)Martin Robinson2024-06-134-164/+319
| | | | | | | | | | | | | 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>
* layout: Don't default to fallback fonts for spaces (#32442)Martin Robinson2024-06-051-1/+1
| | | | | | | | | | | | 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>
* layout: Add a `InlineFormattingContextBuilder` (#32415)Martin Robinson2024-06-036-774/+903
| | | | | | | | | | | | | | | | 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>
* clippy: Fix warnings in `components/layout_2020/flow/text_run.rs` (#32393)Farid2024-05-311-1/+1
| | | | | | | | | | | | | * clippy: Fix warnings in `components/layout_2020/flow/text_run.rs` Signed-off-by: Jujumba <far77578@gmail.com> * clippy: Fix warnings in `components/layout_2020/flow/text_run.rs` Signed-off-by: Jujumba <far77578@gmail.com> --------- Signed-off-by: Jujumba <far77578@gmail.com>
* layout: Add support for `white-space-collapse: break-spaces` (#32388)Martin Robinson2024-05-303-24/+174
| | | | | | | | | | | | | | 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>
* fonts: Improve font fallback (#32286)Martin Robinson2024-05-271-5/+44
| | | | | | | | | | | | | | | | | | - Better detect situations where emoji is necessary by looking ahead one character while laying out. This allow processing Unicode presentation selectors. When detecting emoji, put emoji fonts at the front of fallback lists for all platforms. This enables monochrome emoji on Windows. Full-color emoji on Windows probably needs full support for processing the COLR table and drawing separate glyph color layers. - Improve the font fallback list on FreeType platforms. Ideally, Servo would be able to look through the entire font list to find the best font for a certain character, but until that time we can make sure the font list contains the "Noto Sans" fonts which cover most situations. Fixes #31664. Fixes #12944.
* compositor: Move WebRender-ish messages and types to `webrender_traits` (#32315)Mukilan Thiyagarajan2024-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | * 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>
* tables: Add a naive implementation of `border-collapse` (#32309)Martin Robinson2024-05-181-17/+8
| | | | | | | | | 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>
* use au in HoistedSharedFragment (#32288)atbrakhi2024-05-161-3/+2
|
* layout: When line-height is not `Normal` use metrics of first font not ↵Martin Robinson2024-05-131-4/+16
| | | | | fallback (#32165) This fixes an issue revealed by more consistent font fallback.
* fonts: Make `FontContext` thread-safe and share it per-Layout (#32205)Martin Robinson2024-05-022-43/+35
| | | | | | | | | | | | This allows sharing font templates, fonts, and platform fonts across layout threads. It's the first step toward storing web fonts in the layout versus the shared `FontCacheThread`. Now fonts and font groups have some locking (especially on FreeType), which will probably affect performance. On the other hand, we measured memory usage and this saves roughly 40 megabytes of memory when loading servo.org based on data from the memory profiler. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* layout: Ensure empty list items are at least as tall as outside markers (#32152)Martin Robinson2024-04-292-14/+69
| | | | | | | | | | | | | | | | 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>
* Turn white-space into a shorthand (#32146)Oriol Brufau2024-04-293-45/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | Bumps Stylo to servo/stylo#37 `white-space` is split into `white-space-collapse` and `text-wrap-mode`: | white-space | white-space-collapse | text-wrap-mode | | ----------- | -------------------- | -------------- | | normal | collapse | wrap | | nowrap | collapse | nowrap | | pre-wrap | preserve | wrap | | pre | preserve | nowrap | | pre-line | preserve-breaks | wrap | | - | preserve-breaks | nowrap | Note this introduces a combination that wasn't previously possible, but I think the existing logic can handle it well enough. The old `allow_wrap()` is replaced by checking whether `text-wrap-mode` is set to `wrap`. The old `preserve_newlines()` is replaced by checking whether `white-space-collapse` is *not* set to `collapse`. The old `preserve_spaces()` is replaced by checking whether `white-space-collapse` is set to `preserve`.
* Implement special table sizing for floats (#32150)Oriol Brufau2024-04-261-4/+18
| | | | | | | Tables should always be at least as big as their min-content size, even if we would expect a smaller size according to CSS sizing properties. #31455 implemented it for in-flow tables participting in flow layout, but a few cases remained. This patch addresses floated tables.
* Address issues uncovered by rust-1.78 beta (#32130)Martin Robinson2024-04-221-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes changes to allow Servo to compile with the 1.78 version of Rust: - Dead code is removd (Rust seems to have gotten better at detecting it). - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice [^1]. - The `imports.rs` now explicitly silences warnings about unused imports. [^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179 <!-- 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 they should not change behavior. <!-- 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. -->
* layout: Add a basic support for `list-style-position: outside` (#32114)Martin Robinson2024-04-222-12/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* layout: Have `TextRun::glyph_run_is_preserved_newline` take into account ↵Martin Robinson2024-04-212-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `TextRunSegment` offset (#32119) A `TextRun` is composed of `TextRunSegment`s that are composed of `GlyphRun`s. `TextRun::glyph_run_is_preserved_newline` is indexing into the `TextRun` text, but the `GlyphRun` indexes that it uses are relative to the `TextRunSegment` offset. Before the code was using the offset without incorporating the `TextRunSegment` offset. This led to miscalculation of preserved newline location while processing text content. <!-- 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] There are tests for these changes <!-- 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. -->
* layout: Have `current_block_direction_position` in `PlacementState` use `Au` ↵Ekta Siwach2024-04-191-13/+12
| | | | (#31948)
* clippy: Fix collapsible_if warning (#32109)Oluwatobi Sofela2024-04-191-4/+3
|
* layout: Add support for `clear` on `<br>` elements (#32094)Martin Robinson2024-04-171-2/+34
| | | | | | | | `<br>` elements are a bit "special" in the sense that they defer a linebreak, but can also have `clear` applied to them. The `clear` that they supply should be applie *after* the linebreak is processed. This change adds special processing for this situation. Fixes #15402.
* layout: Add support for `<object>` with image data URLs (#32069)Martin Robinson2024-04-151-3/+3
| | | | | This is enough support for `<object>` to get Acid2 working. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Keep 1st collapsible space after a preserved one (#32037)Oriol Brufau2024-04-152-15/+19
| | | | | | | | The logic was to remove any collapsible white space preceded by other white space. However, this should only happen if the preceding space is also collapsible. Also fixing the logic in ContentSizesComputation, which was wrong but previously it didn't matter.
* Element collapsing thru should collapse with its children (#32060)Oriol Brufau2024-04-121-9/+11
| | | | | | | If the top and bottom margins of an element collapse through, then this patch treats the bottom margin as collapsing with its children, even if `height` doesn't compute to zero. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Treat indefinite percentages as auto for margin collapse (#32059)Oriol Brufau2024-04-121-19/+27
| | | | | | | The top and bottom margins of an element can collapse through if its height is auto or zero. Indefinite percentages behave as auto, so they shouldn't prevent the margins from collapsing. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Obey min-height and max-height on floated elements (#32057)Oriol Brufau2024-04-121-4/+8
| | | Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Upgrade Stylo to 2023-12-01 (#32032)Oriol Brufau2024-04-101-0/+1
| | | | | | | | | | | | | | | | | | | * Upgrade Stylo to 2023-12-01 * Fixup for https://phabricator.services.mozilla.com/D191362 * Fixup for https://phabricator.services.mozilla.com/D191522 * Fixup for https://phabricator.services.mozilla.com/D191613 * Fixup for https://phabricator.services.mozilla.com/D191161 * Fixup for https://phabricator.services.mozilla.com/D191615 * Fixup for https://phabricator.services.mozilla.com/D193048 * Fixup for https://phabricator.services.mozilla.com/D193547 * Update test expectations
* layout: Add a `FontMetricsProvider` for resolving font-relative units (#31966)Martin Robinson2024-04-041-6/+5
| | | | | | | | | | | | | | | | | | | The only font relative unit that Servo knows how to resolve currently is `rem` (relative to the root font size). This is because Stylo cannot do any font queries. This adds a mechanism to allow this, exposing the ability to properly render `ex` units in Servo. This change only allows resolving some font size relative units thoug, as Servo doesn't collect all the FontMetrics it needs to resolve them all. This capability will be added in followup changes. Some new tests fail: - ex-unit-001.html: This test fails because Servo does not yet have support for setting the weight using @font-face rules on web fonts. - ex-unit-004.html: This test fails because Servo does not yet have support for setting the Unicode range of a web font using @font-face rules. - first-available-font-001.html: This test fails because the above two feature are missing.
* script: Split style and layout data in DOM nodes (#31985)Martin Robinson2024-04-041-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change splits the style and layout data in DOM nodes that is populated by style and layout passes. This makes Servo's data design more like Gecko's. This allows: 1. Removing the various `StyleAndLayout` data structures used by layout. 2. Removing the `GetStyleAndLayoutData` and `GetStyleAndOpaqueLayoutData` traits. Accessing style and layout data are now just functions on the `LayoutNode` and `ThreadSafeLayoutNode` traits. 3. Styling now doesn't populate layout data. This is is postponed until layout itself. 4. Allows the DOM wrappers to no longer have to be generic over the layout data. This data was already stored using `std::any::Any` and the new code just makes layout responsible for downcasting. Cleaning up the generic type parameter in the DOM wrappers can happen in a followup change. The main benefit to all of this is that we should be able to remove unsafe creation of `ServoLayoutNode` in layout and `TrustedLayoutNodeAddress` entirely, because `ServoLayoutNode` will be able to be passed directly from script to layout. In addition, this removes one more abstraction layer from the layout DOM wrappers, making the code a lot more understandable. Note: This increases the measured size of DOM types, but the same data is stored. It's simply that before that data was stored behind a heap pointer.
* Implementation of baseline-source (#31904)Munish Mummadi2024-04-021-6/+12
| | | Updating Stylo and test expectations.
* Update Stylo to 2023-10-16 (#31932)Oriol Brufau2024-03-302-8/+10
| | | | | | | | | | | | | | | | | | | | | | | * Update Stylo to 2023-10-16 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D188216 * Fixup for https://phabricator.services.mozilla.com/D185677 * Fixup for https://phabricator.services.mozilla.com/D188566 * Fixup for https://phabricator.services.mozilla.com/D188727 * Fixup for https://phabricator.services.mozilla.com/D189475 * Fixup for https://phabricator.services.mozilla.com/D189521 * Fixup for https://phabricator.services.mozilla.com/D188812 * Fixup for https://phabricator.services.mozilla.com/D189484 * Update test expectations
* Obey `white-space: pre-wrap` when intrinsically sizing an IFC (#31930)Oriol Brufau2024-03-291-10/+20
| | | It was being treated like `pre`, but it allows wrapping lines.
* layout: Use `Au` in `ResolvedMargins` and `CollapsedMargin` (#31848)Ekta Siwach2024-03-282-59/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * change ResolvedMargins to use Au instead of length * made suggested changes removed whitespace changes made suggested changes * Update components/layout_2020/flexbox/layout.rs Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Update components/layout_2020/flow/mod.rs Co-authored-by: Oriol Brufau <obrufau@igalia.com> * fixed errors fixed errors fixed formatting fixed errors * modified changes made suggested changes * Update components/layout_2020/fragment_tree/fragment.rs Co-authored-by: Oriol Brufau <obrufau@igalia.com> updated components/layout_2020/fragment_tree/fragment.rs * Update components/layout_2020/flow/mod.rs Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Update components/layout_2020/flow/mod.rs Co-authored-by: Oriol Brufau <obrufau@igalia.com> * updated changes updated changes * unified all the suggested changes here * fixed formatting * reverted unnecessary changes * fixed unnecessary warnings --------- Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Ignore spaces before atomic inline for the min-content size (#31896)Oriol Brufau2024-03-271-1/+4
| | | | | | | | | | | | | | | * Ignore spaces before atomic inline for the min-content size For the min-content size we should wrap lines wherever is possible, so wrappable spaces shouldn't increase the length of the line, they will just be removed or hang at the end of the line. * Add a clarifying comment Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Pick the first or last baseline as appropriate (#31705)Oriol Brufau2024-03-251-4/+17
| | | | | | | The old logic was always picking the last baseline, but this should only happen for inline-blocks. Since replaced elements and flex containers aren't currently setting their baselines, this is only an improvement for inline-tables.
* layout: use `Au` in `BoxFragment` (#31794)atbrakhi2024-03-224-46/+41
| | | | | * use au in BoxFragement * review fix
* layout: Take into account `text-indent` for justification (#31777)Martin Robinson2024-03-211-1/+6
| | | | | | This change makes it so that when calculating the space added between words for justification, text-indent is taken into account. Fixes #31775.
* clippy: Fix several warnings (#31710)RustAndMetal2024-03-183-9/+6
| | | Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
* rustdoc: Fix two warnings in `components/layout_2020` (#31712)Rhea-Eve2024-03-181-1/+2
| | | | | | | | | | | | | | | | | | * Fix BoxFragment reference. Signed-off-by: Rhea Karty <rheakarty@gmail.com> * Fix reference to InlineFormattingContext. Signed-off-by: Rhea Karty <rheakarty@gmail.com> * Rewrap lines to avoid long length * Remove trailing whitesapce --------- Signed-off-by: Rhea Karty <rheakarty@gmail.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Allow pre-wrap whitespace to hang at the end of the line (#31681)Oriol Brufau2024-03-151-18/+54
| | | | | * Allow pre-wrap whitespace to hang at the end of the line * Use bitflags
* Obey white-space when intrinsically sizing an IFC (#31660)Oriol Brufau2024-03-152-27/+28
| | | | | | | | | | | | | | | | | The old logic was assuming that all whitespace was a break opportunity, and that no newlines would be preserved. Note that text shaping considers the advance of a newline to be the same as a space. This was problematic because if we have a segment with a preserved space and newline, only the advance of the space should contrinute to the size of the block container. Therefore, I'm changing the breaker logic in other to have newline characters in their own segment. Then glyph_run_is_whitespace_ending_with_preserved_newline can just be renamed to glyph_run_is_preserved_newline. This patch is still not perfect because it doesn't check allow_wrap(), so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`.
* dependencies: Upgrade to WebRender 0.64 (#31486)Martin Robinson2024-03-141-1/+1
| | | | | | | | | This brings the version of WebRender used in Servo up-to-date with Gecko upstream. The big change here is that HiDPI is no longer handled via WebRender. Instead this happens via a scale applied to the root layer in the compositor. In addition to this change, various changes are made to Servo to adapt to the new WebRender API. Co-authored-by: Mukilan Thiyagarajan <mukilan@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.
* layout: IFCs should not always be marked as containing floats (#31641)Martin Robinson2024-03-142-2/+4
| | | | | | | Marking all IFCs as containing floats shouldn't change layout results, but does prevent parallel layout in some cases. This change fixes an issue where we were marking all IFCs as containing floats. Fixes #31540.
* 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.
* rustdoc: Fix warnings in `components/layout_2020` (#31647)Aarya Khandelwal2024-03-131-2/+2
| | | | | * Added a : to make it a clickable link * changed block_offset_of_parent to parent_offset , to make it a clickable link.
* rustdoc: Fix warnings in `components/layout_2020` (#31640)Aarya Khandelwal2024-03-131-3/+3
| | | | | * Changed LineItems to LineItem to make it a clickable link * No variant named Anonymous is present in Fragment.
* Fix vertical alignment at the root of an IFC (#31636)Oriol Brufau2024-03-132-41/+56
| | | | | | | | | | | | | | At the root of an inline formatting context, we used its vertical-align in order to compute the strut. That was wrong, since vertical-align on a block container shouldn't affect the contents, it should only affect the alignment of the block container (if it's inline-level) within the parent IFC. This was only working well if the block container was block-level, since effective_vertical_align_for_inline_layout returned `baseline` for block-level boxes. Instead of the outer display type, this patch changes the logic to check whether we are at the root of the IFC.