Skip to content

Flexbox: resolve cross-axis stretch against a definite container when sizing flex lines - #1290

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1791558808-flex-stretch-cross-definite-container
Open

nicoburns wants to merge 1 commit into
mainfrom
devin/1791558808-flex-stretch-cross-definite-container

Conversation

@nicoburns

@nicoburns nicoburns commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Objective

Split out of #1242 (fix 3 of 3 there; independent of the other two).

When sizing the flex lines (determine_hypothetical_cross_size in src/compute/flexbox.rs), a cross size of stretch now resolves against the container's cross size if that size is definite, instead of contributing the item's content size. The resolved size is clamped by the item's min/max cross sizes and floored at its padding + border. The item is still stretched to its flex line afterwards in determine_used_cross_size. (csswg-drafts #11784)

If the container's cross size is indefinite, behaviour is unchanged.

Context

Tests

Five new gentest fixtures with expectations generated from Chrome: flex_wrap_row_item_height_stretch_{definite,indefinite}_container, flex_wrap_column_item_width_stretch_definite_container{,_wide_sibling} and flex_row_item_height_stretch_definite_container_align_start.

WPT

Results via Blitz CI for this change alone (DioxusLabs/blitz#1157, subtests passing, Blitz main -> pinned to this PR). Four subtests gained and two lost across css:

Test Before After
css-sizing/stretch/flex-line-003 1/4 4/4
css-sizing/stretch/flex-line-004 3/4 2/4

Known regressions

Both come from existing Taffy behaviour that stretch now resolves against, rather than from the rule itself:

  • flex-line-004 subtests 1-2 (subtest 4 is fixed). The container is flex-flow: column wrap; width: min-content with two lines. Chrome sizes it to the widest item (26px); Taffy sizes it to the sum of its lines (52px). The items now stretch to 52px rather than staying at their 26px content size.
  • Container with min-height == max-height and height: auto. A wrapping row container with min-height: 100px; max-height: 100px and height: stretch items gives 100px items; Chrome gives the content height. Taffy treats equal min and max sizes as a definite size, so has_definite_cross_size is true; Chrome does not. No fixture covers this.

Test coverage gaps

  • No fixture fails if the .maybe_clamp(transferred_min_cross, transferred_max_cross).max(padding_border_sum) on the new arm is removed.
  • No fixture fails if the has_definite_cross_size guard is removed.

Feedback wanted

Whether to land this given the two regressions above, or to fix the underlying differences first.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/3a06d93089f2434ba3519a7813dea1e8
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/3a06d93089f2434ba3519a7813dea1e8?variant=devin-insiders
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@staging-devin-ai-integration
staging-devin-ai-integration Bot force-pushed the devin/1791558808-flex-stretch-cross-definite-container branch from 5646a46 to ac4c49c Compare October 9, 2026 16:42

This branch has not been deployed

No deployments
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