[csswg-drafts] [css-containment] Layout containment should block percentage resolution sizing (#4255)

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

== [css-containment] Layout containment should block percentage resolution sizing ==
Percentage sizes resolve against the containing block for auto sized children. In quirks mode this can follow a whole chain of containing blocks, and in non-quirks mode it stops at the first containing block.

https://drafts.csswg.org/css-sizing-3/#percentage-sizing

This is a problem for layout containment, because it weakens the isolation between layout below contain:layout and outside. The behavior is also problematic in general because, especially in quirks mode, there is "action at a distance" happening in layout.


The containment spec should be amended to specify that percentage size resolution stops at a contain:layout element.

```
<div style="height: 100px;">
  <div>
    <div style="height: 50%;"> </div>
  </div>
</div>
```

In this example, the height of the inner div resolves to 50% of the outer div, i.e. 50px.

If the intermediate div had `contain:layout`, then the resolved height of the inner div should be 0px.

@tabatkins @bfgeek 

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

Received on Friday, 30 August 2019 17:45:26 UTC