-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Stop eagerly resolving flex container block sizes #11089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kalenikaliaksandr
merged 4 commits into
LadybirdBrowser:master
from
kalenikaliaksandr:flex-automatic-height
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8b0fe56
LibWeb: Resolve column-axis flex container block size from their own run
kalenikaliaksandr caedb4c
LibWeb: Resolve row-axis flex container block sizes from their own run
kalenikaliaksandr a31f6da
LibWeb: Stop consulting indefinite flex container cross sizes early
kalenikaliaksandr f6119b8
LibWeb: Stop eagerly resolving flex container block sizes before body
kalenikaliaksandr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Tests/LibWeb/Layout/expected/flex/auto-height-row-flex-with-natural-ratio-only-svg-item.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline | ||
| BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 96 0+0+0] [BFC] children: not-inline | ||
| BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 80 0+0+8] children: not-inline | ||
| Box <div#auto-height-flex> at [8,8] flex-container(row) [0+0+0 784 0+0+0] [0+0+0 80 0+0+0] [FFC] children: not-inline | ||
| BlockContainer <(anonymous)> (not painted) [BFC] children: inline | ||
| TextNode <#text> (not painted) | ||
| SVGSVGBox <svg> at [8,8] flex-item [0+0+0 60 0+0+0] [0+0+0 30 0+0+0] [SVG] children: not-inline | ||
| BlockContainer <(anonymous)> (not painted) [BFC] children: inline | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <div> at [68,8] flex-item [0+0+0 50 0+0+0] [0+0+0 80 0+0+0] [BFC] children: not-inline | ||
| BlockContainer <(anonymous)> (not painted) [BFC] children: inline | ||
| TextNode <#text> (not painted) | ||
| BlockContainer <(anonymous)> at [8,88] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline | ||
| TextNode <#text> (not painted) | ||
|
|
||
| ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
| PaintableWithLines (BlockContainer<HTML>) [0,0 800x96] | ||
| PaintableWithLines (BlockContainer<BODY>) [8,8 784x80] | ||
| Paintable (Box<DIV>#auto-height-flex) [8,8 784x80] | ||
| SVGSVGPaintable (SVGSVGBox<svg>) [8,8 60x30] | ||
| PaintableWithLines (BlockContainer<DIV>) [68,8 50x80] | ||
| PaintableWithLines (BlockContainer(anonymous)) [8,88 784x0] | ||
|
|
||
| SC for Viewport<#document> [0,0 800x600] (z-index: auto) | ||
| SC for BlockContainer<HTML> [0,0 800x96] (z-index: auto) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep cyclic percentage cross gaps resolved against zero.
The helper resolves a cyclic percentage cross gap against zero. After line 3101 resolves the automatic block size,
align_all_flex_lines()recalculatescross_gap()against that resolved size.A wrapping auto-height row flex container with
row-gap: 50%will size without the gap, then place lines with a nonzero gap. The lines can overflow the resolved block size.Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs#L2750-L2760: retain the zero-based cross-gap result for the self-resolution flow.Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs#L3098-L3101: ensure later line alignment does not resolve the cyclic gap against the newly resolved block size.📍 Affects 1 file
Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs#L2750-L2760(this comment)Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs#L3098-L3101🤖 Prompt for AI Agents