Zero-width float edges in BFC slots; float state snapshot/restore - #1070
Draft
nicoburns wants to merge 3 commits into
Draft
Zero-width float edges in BFC slots; float state snapshot/restore#1070nicoburns wants to merge 3 commits into
nicoburns wants to merge 3 commits into
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…hot/restore - find_bfc_slot: skip segments with no real float edge when searching for the constraining segment (zero-width floats don't constrain box width), while treating zero-width float edges as obstacles that negative margins may not move a float-avoiding box past - Track zero-width float edges per segment side - Add BlockContext::snapshot_float_state/restore_float_state so callers doing speculative layout (e.g. inline layout re-running line breaking) can undo float placements
devin-ai-integration
Bot
force-pushed
the
devin/1786136827-zero-width-floats-bfc-slots
branch
from
August 10, 2026 22:10
910d49f to
6d4a7c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fix remaining Blitz WPT failures in the "floats × inline content / line boxes" group involving zero-width floats and BFC roots with negative margins, and add an API needed by Blitz's inline layout (see DioxusLabs/blitz#630).
This PR has been rebuilt on top of latest
main(which already landed overlapping fixes in #1055, #1056, #1061, #1062, #1064, #1065), so it is now much smaller than its original form.Changes
1.
find_bfc_slot: zero-width float edges vs. real float edgesSegmentnow trackszero_width_edge: [bool; 2]alongsidehas_float(which is now only set for positive-width floats). When searching for the slot for a float-avoiding box (BFC root):yposition.zero-width-floats-positioning.tentative.html).zero-width-floats.html).This distinguishes three previously-conflated cases which WPT expects to behave differently:
floats-wrap-bfc-with-margin-006)2.
BlockContext::snapshot_float_state/restore_float_stateNew public API (exporting a new opaque
FloatStateSnapshottype) allowing callers performing speculative layout — such as inline layout that may need to re-run line breaking — to roll back float placements made during a discarded layout attempt. Used by Blitz's inline layout in DioxusLabs/blitz#630 to fix floats-in-inline placement when Parley rewinds content.Context
Diagnosed from Blitz WPT failures on DioxusLabs/blitz#625; the Blitz-side changes are in DioxusLabs/blitz#630 (which pins taffy to this branch for CI; it should be re-pinned to
mainonce this merges).Newly passing WPT tests attributable to the taffy changes in this PR (measured with blitz#630,
css/CSS2/floats css/CSS2/floats-clearsuites):css/CSS2/floats/zero-width-floats.htmlcss/CSS2/floats/zero-width-floats-positioning.tentative.html(kept passing; regressed by upstream main alone)Overall suite result with blitz#630 (retargeted to blitz
main, which now includes #625) + this branch: 231 PASS / 106 FAIL / 0 CRASH of 337 vs a blitz-mainbaseline of 227 PASS / 110 FAIL. No previously-passing test regresses.Testing
cargo test(all pass, including 3 new hand-written regression tests covering the three scenarios above)cargo fmtandcargo clippy --workspacecleanLink to Devin session: https://app.devin.ai/sessions/ca393611e919410aaa93e816fdf90a54
Requested by: @nicoburns