Open Loirooriol opened 1 year ago
Agreed. I'd perhaps add an "and is not a replaced element" after "does not establish a new block formatting context".
Or "top and bottom margins of a non-replaced box that does not establish a new block formatting"
Arguably replaced elements establish their own formatting contexts - also the text should likely be just "independent formatting context" instead of "block formatting context"
the text should likely be just "independent formatting context"
Sure but CSS2 doesn't have that term. Just like when it says "vertical margins" and we understand "block margins", when it says "new block formatting context" we should treat it as "independent formatting context".
Arguably replaced elements establish their own formatting contexts
Not opposed to that, but other parts of CSS2 don't make that assumption and handle replaced elements explicilty, e.g. https://drafts.csswg.org/css2/#floats
The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context
OK it's already on Display 3: https://drafts.csswg.org/css-display-3/#replaced-element
Replaced elements always establish an independent formatting context.
CSS2 can still be clarified, but not sure if it's worth it.
No browser lets the top and bottom margins of the replaced element to collapse through it. The conditions are: https://drafts.csswg.org/css2/#collapsing-margins
The interior of replaced elements is outside the scope of CSS, so I guess UAs might establish an independent formatting context if they want. But probably this shouldn't be left up to the UAs, the spec should explicitly handle replaced elements.