Skip to content

Resolve percentage heights when measuring a block container's intrinsic width - #1408

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1794393054-block-intrinsic-width-percent-height
Open

nicoburns wants to merge 1 commit into
mainfrom
devin/1794393054-block-intrinsic-width-percent-height

Conversation

@nicoburns

@nicoburns nicoburns commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Implemented in “Check Nico's min-content PRs for orthogonal-flow losses”Devin Review

Objective

determine_content_based_container_width measured the children of a block container with parent_size: Size::NONE, so a child's percentage height/max-height never resolved during the intrinsic-width pass, even when the container has a definite or specified height. The final layout pass already resolves those percentages against container_percentage_resolution_height, so the two passes disagreed.

This now passes that same height (minus the container's vertical padding and border) as the children's parent height in the intrinsic-width pass. container_percentage_resolution_height is moved up so both passes use it.

Context

Found while checking Blitz with #1407/DioxusLabs/blitz#1491, which treat a min-content available block size as max-content. css-flexbox/intrinsic-size/col-wrap-dynamic.html (a width: max-content; height: 100px block holding a column wrap flex container with max-height: 100%) only passed on Blitz main by accident. The max-height: 100% didn't resolve, and the MinContent available height made collect_flex_lines put every item on its own line. With the percentage resolved, the container wraps because of its real height.

Blitz WPT (css html) vs Blitz main with this patch: +4 (CSS2/normal-flow/intrinsic-size-with-anonymous-block, css-flexbox/percentage-heights-022, css-grid/grid-definition/grid-auto-repeat-aspect-ratio-002, css-writing-modes/two-levels-of-orthogonal-flows-fixed), -1 (col-wrap-dynamic). That one loss happens because Blitz keeps a stale child cache after the parent's height changes, since the cache key has no parent_size. The companion Blitz fix clears child caches on relayout damage. With both, Blitz gets +10 and loses nothing, and blitz#1491 on top also loses nothing.

cargo test --workspace passes.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/2f57afb3bd9f442c81942accf1d4617b
Link to Bot: https://dioxus.staging.devinenterprise.com/org/dioxus-engineering/bots/aa009e38e66f4e3086e3d54bc74984ae
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/2f57afb3bd9f442c81942accf1d4617b?variant=devin-insiders

@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

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