Skip to content

Preserve known dimensions in empty inline layout short-circuit - #633

Merged
nicoburns merged 2 commits into
devin/1786122908-taffy-git-depfrom
devin/1786150337-flex-item-empty-inline-known-dims
Aug 8, 2026
Merged

Preserve known dimensions in empty inline layout short-circuit#633
nicoburns merged 2 commits into
devin/1786122908-taffy-git-depfrom
devin/1786150337-flex-item-empty-inline-known-dims

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the css/css-flexbox/flexible-box-float.html regression on #625.

When an inline formatting context contains only out-of-flow content (all children absolutely positioned or floated — e.g. a <p>&nbsp;</p> flex item whose only text is whitespace and whose box is floated), compute_inline_layout short-circuits and returned Size::ZERO, discarding the definite known_dimensions taffy passed for the item (its flexed target size, e.g. 300x30). The flex items therefore collapsed to 0x0 and the test's red fail-flag became visible.

 return LayoutOutput::from_outer_size(
-    Size::ZERO.maybe_max(container_pb.sum_axes().map(Some)),
+    Size {
+        width: known_dimensions.width.unwrap_or(0.0),
+        height: known_dimensions.height.unwrap_or(0.0),
+    }
+    .maybe_max(container_pb.sum_axes().map(Some)),
 );

Together with DioxusLabs/taffy#1081 (which fixes flexbox-min-height-auto-002b.html), both flexbox regressions on #625 pass. Verified with the WPT runner and cargo fmt/clippy.

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

WPT results

8 newly passing, 2 newly failing (net +6).

Full diff (10 changed tests)
+ Fail => Pass css/CSS2/linebox/line-height-applies-to-016.xht
- Pass => Fail css/CSS2/normal-flow/inline-block-zorder-002.xht
- Pass => Fail css/CSS2/normal-flow/inline-table-zorder-001.xht
+ Fail => Pass css/CSS2/normal-flow/max-height-applies-to-016.xht
+ Fail => Pass css/CSS2/normal-flow/max-width-applies-to-016.xht
+ Fail => Pass css/CSS2/normal-flow/min-width-applies-to-016.xht
+ Fail => Pass css/CSS2/text/white-space-007.xht
+ Fail => Pass css/css-animations/animation-name-in-shadow-part-inner-match.html
+ Fail => Pass css/css-flexbox/flexible-box-float.html
+ Fail => Pass css/css-values/lh-unit-002.html

Generated by the WPT workflow.

@nicoburns nicoburns self-assigned this Aug 8, 2026
@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 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

@nicoburns
nicoburns merged commit e599162 into devin/1786122908-taffy-git-dep Aug 8, 2026
15 checks passed
@nicoburns
nicoburns deleted the devin/1786150337-flex-item-empty-inline-known-dims branch August 8, 2026 01:08
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