Support flex-wrap: balance and flex-line-count (CSS Flexbox Level 2) - #717
Open
nicoburns wants to merge 6 commits into
Open
Support flex-wrap: balance and flex-line-count (CSS Flexbox Level 2)#717nicoburns wants to merge 6 commits into
flex-wrap: balance and flex-line-count (CSS Flexbox Level 2)#717nicoburns wants to merge 6 commits into
Conversation
Points taffy at the flex-wrap-balance branch and stylo at the branch implementing the new property values, maps the new FlexWrap variants to taffy's Balance/BalanceReverse, plumbs flex-line-count through, and enables the layout.flexbox.balance pref.
Contributor
🤖 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:
|
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.
Summary
Adds end-to-end support for CSS Flexbox Level 2 line balancing:
flex-wrap: balance(andwrap-reverse balance) and theflex-line-countproperty, per https://drafts.csswg.org/css-flexbox-2/.stylo_taffy::convert::flex_wrapmaps Stylo's newFlexWrap::Balance/WrapReverseBalancetotaffy::FlexWrap::Balance/BalanceReverse, andTaffyStyloStyleimplementsFlexboxContainerStyle::flex_line_count()(clamped to>= 1). Gated behind a new on-by-defaultflexbox_balancecargo feature onstylo_taffy.blitz-domenables thelayout.flexbox.balanceStylo pref at document init, so the new syntax parses in Blitz.mainrev (20f04b9f) that includes the merged balancing implementation (Implementflex-wrap: balance(CSS Flexbox Level 2) taffy#1105); Stylo is pinned to the head of the Stylo PR branch (Implementflex-wrap: balanceandflex-line-count(CSS Flexbox Level 2) stylo#12, rev404505d5). The Stylo git rev should be switched to a release once that PR merges and is released.tests/blitz-tests/tests/flex_wrap_balance.rs): four 25px items in a 120px container with 10px gaps split 3/1 withwrapbut 2/2 withbalance; pluswrap balance,wrap-reverse balance, invalidnowrap balance, andflex-line-countforcing extra lines.WPT
css/css-flexbox/balance: 32/41 run tests pass. The 9 failures are preexisting limitations (7 need script execution which the WPT runner doesn't support, 1 needswidth: min-contenton atomic inline boxes, 1 needsdisplay: -webkit-box).Rendered verification (wrap 3/1 vs balance 2/2, wrap-reverse balance, flex-line-count: 2):
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/b7bd5b365d054b87a6053872323832b2
Requested by: @nicoburns
WPT results
28 newly passing, 0 newly failing (net +28).
Full diff (28 changed tests)
Generated by the WPT workflow.