[csswg-drafts] [css2] Margins shouldn't collapse through replaced element (#9006)

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css2] Margins shouldn't collapse through replaced element ==
```html
<!DOCTYPE html>
aaa
<canvas style="display: block; margin: 50px 0; height: 0px; min-height: 0"></canvas>
bbb
```

No browser lets the top and bottom margins of the replaced element to collapse through it.
The conditions are:

- both belong to in-flow [block-level boxes](https://drafts.csswg.org/css2/#block-boxes) that participate in the same [block formatting context](https://drafts.csswg.org/css2/#block-formatting)
- no line boxes, no clearance, no padding and no border separate them
- top and bottom margins of a box that does not establish a new block formatting context and that has zero computed [min-height](https://drafts.csswg.org/css2/#propdef-min-height), zero or [auto](https://drafts.csswg.org/css2/#valdef-height-auto) computed [height](https://drafts.csswg.org/css2/#propdef-height), and no in-flow children

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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9006 using your GitHub account


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

Received on Monday, 26 June 2023 12:56:08 UTC