Flexbox: fix container baseline for column-reverse containers - #1127
Merged
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Blitz WPT comparison (full
|
nicoburns
enabled auto-merge (squash)
August 18, 2026 23:54
…m for reverse containers
nicoburns
force-pushed
the
devin/1787096013-flex-baseline-wrap-reverse
branch
from
August 18, 2026 23:54
f4212c1 to
26cc1ae
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
Fix the flex container baseline computation so that it matches browsers (and the current css-flexbox-1 ED wording, https://drafts.csswg.org/css-flexbox-1/#flex-baselines) for reverse-direction containers. This is what causes Blitz to fail WPT tests
css/css-flexbox/flexbox-baseline-multi-line-horiz-004.htmlandcss/css-flexbox/flexbox-baseline-multi-line-vert-002.html.Context
The original hypothesis was that the wrap-reverse line selection was wrong (that the first baseline should come from the first flex line in flex-line order regardless of wrap direction, per the css-flexbox-1 TR wording). However, empirical testing against Chrome (both via gentest fixtures with the container nested in a baseline-aligning flex parent, and via headless Chrome measurements of the inline baseline export) shows Chrome consistently generates the first baseline from the visually startmost line — for wrap-reverse that is the last line in flex-line order, which is what taffy already does. The current ED spec text agrees: "startmost flex line", where startmost links to the writing-mode (visual) definition of start.
The actual bug making the two WPT tests fail is on the column side: for
column-reversecontainers taffy took the baseline of the first item in flex order, which is positioned at the visual bottom. Browsers use the startmost (visually topmost) item, which for reverse-direction containers is the last item in flex order. In the WPT reftests it is the reference page (which usescolumn-reverse/ single-line column containers) that taffy renders wrong, producing the observed ~15px baseline offset.Pseudo-diff of the fix in
compute_flexbox_layout:New generated test fixtures cover:
All fixtures regenerated from Chrome via
just gentest;cargo test --workspace,cargo fmtandcargo clippypass.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/1674564446a64939b4972322b4f46da4
Requested by: @nicoburns