Skip to content

Make float slot search height-aware (boxes must avoid floats over their full height) - #1066

Draft
nicoburns wants to merge 3 commits into
mainfrom
devin/1786127796-float-height-aware
Draft

Make float slot search height-aware (boxes must avoid floats over their full height)#1066
nicoburns wants to merge 3 commits into
mainfrom
devin/1786127796-float-height-aware

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 7, 2026

Copy link
Copy Markdown
Member

Objective

Part 3/5 of the float placement fixes split from #1063 (stacked on #1065).

A box establishing a BFC must not overlap floats over its entire vertical extent, and a line box is shortened by any float its extent intersects — the slot search previously only considered the float insets of the starting segment.

  • FloatContext::find_content_slot and find_bfc_slot (and the BlockContext wrappers) take a new height parameter and union float insets across all segments that [y, y + height) crosses. ContentSlot::height now reports the extent over which the slot's width remains valid.
  • compute_block_layout estimates BFC-establishing children's height up-front from their style, then re-runs the slot search with the actual height after layout (re-laying the child out, up to 4 iterations, if the slot changes).
  • The "below all floats" content slot now starts at the last segment's end rather than min_y, so content can't be placed higher than existing floats.

Fixes WPT css/CSS2/floats/floats-wrap-top-below-bfc-* (6 tests) and, with the companion Blitz inline changes (DioxusLabs/blitz#628), floats-wrap-top-below-inline-* (6 tests). Regression test added in tests/hand_written/floats.rs.

Context

Stack (bottom-up): rules 3&7 overflow (#1064) → margin collapse (#1065) → this PR → zero-height floats → float snapshot API. Together they supersede #1063 (closed). Latest WPT verification after rebasing onto v0.13-era main: blitz css/CSS2/floats+floats-clear = 247 PASS / 90 FAIL / 0 CRASH of 337 with the stack + DioxusLabs/blitz#628, vs 227 PASS / 110 FAIL on current blitz main (20 newly passing, 0 regressions).

Link to Devin session: https://app.devin.ai/sessions/2aa49a15ca484966b5b71922bfd2bb58
Requested by: @nicoburns

@nicoburns nicoburns self-assigned this Aug 7, 2026
@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

@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1786127796-float-height-aware branch from 69e04d8 to 5a288a1 Compare August 18, 2026 21:15
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