Re: [csswg-drafts] [css2] 2 elements may get clearance, 1 suffices to avoid floats, how to pick? (#9013)

We don't do exactly as you describe, but its likely closest to Option 3. EdgeHTML had the same behaviour I believe. Blink's block layout works on an "inside-out" positioning scheme (e.g. margins/clearance/floats of an arbitrary element(s) within your subtree can affect your position).

We:
 - Determine we can't place `#a` yet within the BFC (margins, etc from a child within it may affect its position, no border/etc to resolve BFC offset).
 - Begin the layout of `#b`.
 -`#b` is self collapsing so doesn't resolve its BFC offset.
 - `#a` sees that `#b` has clearance which inhibits margin collapsing, resolve `#a`'s position at 50px.
 - `#b` is now positioned - and will take into account the clearance - positioned at 25px (-25px relative).

Ian

-- 
GitHub Notification of comment by bfgeek
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9013#issuecomment-1610650103 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 28 June 2023 03:55:02 UTC