Implement flex-wrap: balance and flex-line-count (CSS Flexbox Level 2) - #12
Open
nicoburns wants to merge 3 commits into
Open
Implement flex-wrap: balance and flex-line-count (CSS Flexbox Level 2)#12nicoburns wants to merge 3 commits into
flex-wrap: balance and flex-line-count (CSS Flexbox Level 2)#12nicoburns wants to merge 3 commits into
Conversation
…el 2 Adds the full Level 2 flex-wrap grammar (nowrap | [ wrap | wrap-reverse ] || balance) with Balance and WrapReverseBalance computed values, and a new flex-line-count longhand (positive integer, initial 1). Both are Servo-only, gated behind the new layout.flexbox.balance pref, and disabled for Gecko.
🤖 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
Implements CSS Flexbox Level 2
flex-wrap: balanceand theflex-line-countlonghand, Servo-only and gated behind a newlayout.flexbox.balancepref (defaultfalse; always off for Gecko).flex-wrapswitches from a generated keyword enum to a custom bitflags type (matching the approach in DioxusLabs/firefox#1), used as both specified and computed value, parsing the Level 2 grammarnowrap | [ wrap | wrap-reverse ] || balancevia the derived bitflags parser:validate_and_simplifyrejectswrap wrap-reverse, rejectsbalanceunlessstatic_prefs::pref!("layout.flexbox.balance")is true (the pref lookup is servo-cfg'd, so it always fails on Gecko), and simplifieswrap balance→balance(canonical serialization:balance,wrap-reverse balance).nowrap balanceis rejected by the bitflags grammar (nowrapissingle).Gecko's manual
flex_wrapglue ingecko.mako.rsis removed; in the Firefox treeStyleFlexWrapbecomes a cbindgen-exported type sharing this representation (see DioxusLabs/firefox#1).flex-line-countis a new Servo-only longhand (positive<integer>, initial1),servo_pref = "layout.flexbox.balance", not generated for Gecko.Verified with
cargo build --features servoandcargo check(no features), both clean.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/b7bd5b365d054b87a6053872323832b2
Requested by: @nicoburns