Skip to content

Implement flex-wrap: balance and flex-line-count (CSS Flexbox Level 2, Servo-only) - #1

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1786716636-flex-wrap-balance
Open

Implement flex-wrap: balance and flex-line-count (CSS Flexbox Level 2, Servo-only)#1
nicoburns wants to merge 1 commit into
mainfrom
devin/1786716636-flex-wrap-balance

Conversation

@nicoburns

Copy link
Copy Markdown
Member

Summary

Port of DioxusLabs/stylo#12 to the Firefox tree (servo/components/style). Servo-engine-only, gated behind layout.flexbox.balance (always false on Gecko builds):

  • flex-wrap switches from a generated keyword property to a custom specified::FlexWrap type (also the computed value) parsing the Level 2 grammar nowrap | [ wrap | wrap-reverse ] || balance:
    pub enum FlexWrap { Nowrap, Wrap, WrapReverse, Balance, WrapReverseBalance }
    wrap balance / balance wrap / bare balanceBalance; wrap-reverse balanceWrapReverseBalance; nowrap balance rejected. Serializes to canonical balance / wrap-reverse balance. The Balance* variants are #[cfg(feature = "servo")], and the balance keyword only parses when static_prefs::pref!("layout.flexbox.balance") is true (that pref lookup is also servo-cfg'd, so Gecko never references a nonexistent pref).
  • New flex-line-count longhand (positive <integer>, initial 1), engine = "servo" with servo_pref = "layout.flexbox.balance" — not generated at all for Gecko.
  • Gecko compatibility: gecko.mako.rs gains manual set/copy/reset/clone_flex_wrap mapping to structs::StyleFlexWrap (balance variants are unreachable on Gecko builds).

Differences from the DioxusLabs/stylo PR: the stylo_static_prefs/preferences.toml hunk (adding "layout.flexbox.balance" = false) has no equivalent here — that crate only exists in the standalone Stylo repo; in this tree static_prefs is Gecko's modules/libpref crate and the pref reference is servo-cfg'd out for Gecko. Everything else applied cleanly with only the style/servo/components/style/ path change.

Verification: ran properties/build.py for both gecko and servo products — both generate successfully; the gecko output contains no flex_line_count and uses the manual flex_wrap glue, the servo output contains the new longhand. Did not run ./mach build per instructions; the Servo cfg paths are not compiled in this tree.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/53c65c43aed94d578c1203fdc9994176
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@staging-devin-ai-integration
staging-devin-ai-integration Bot force-pushed the devin/1786716636-flex-wrap-balance branch from c303a93 to afd4730 Compare August 14, 2026 14:13
@nicoburns
nicoburns force-pushed the devin/1786716636-flex-wrap-balance branch 2 times, most recently from 1a89e79 to 5d66fdc Compare August 14, 2026 15:18
@nicoburns
nicoburns force-pushed the devin/1786716636-flex-wrap-balance branch from e465760 to f15dc59 Compare August 14, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant