Files
rust_browser/tests/goldens/expected/114-float-with-margin.layout.txt
Zachary D. Rowitsch cac67f3628 Fix out-of-flow elements incorrectly participating in anonymous block wrapping
Per CSS 2.1 §9.2.1, anonymous block generation should only consider in-flow
elements. Floats, absolutely positioned, and fixed positioned elements are
out-of-flow and should not trigger anonymous block wrapping. Previously,
normalize_children() classified floats as "inline-level" (because
is_block_level_child returned false for them), causing them to be wrapped
inside anonymous blocks. This gave floats the wrong containing block and
broke clear interaction with siblings (e.g., ACID2 .nose/.smile).

Add is_out_of_flow predicate, exclude OOF elements from the has_inline
check, and add a dedicated branch in the wrapping loop that flushes
pending inline runs and places OOF elements as direct children.

Net WPT improvement: +6 passing tests (9 promoted, 3 regressed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 04:25:08 -05:00

1.4 KiB