[csswg-drafts] [css-contain-1] layout containment should make an element containing block for absolute/fixed positioned elements

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

== [css-contain-1] layout containment should make an element 
containing block for absolute/fixed positioned elements ==
[Layout 
containment](https://drafts.csswg.org/css-containment/#containment-layout)
 does not currently specify that an element must be a containing block
 for absolute and fixed positioned descendants.  ([Paint 
containment](https://drafts.csswg.org/css-containment/#containment-paint)
 does specify this.)

I believe failing to specify this makes some of the optimizations 
intended to be possible with layout containment not be possible.  In 
particular, if you have:
```
<div id="A" style="position:relative"> <!-- containing block for abs 
pos elements -->
    <div id="B" style="contain: layout">
        <div id="C" style="position: absolute; top: auto; left: auto">
        </div>
    </div>
</div>
```
then changes inside of B require relayout of A, since they can move 
the position of C, which is (box-wise) a child of A.  Note that C 
could also be positioned partly relative to the contents of B, and 
partly relative to the size of A (e.g., bottom: 20px; left: auto).

I think layout containment should also specify the line that paint 
containment currently does:
>  The element must act as a containing block for absolutely 
positioned and fixed positioned descendants.


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

Received on Friday, 12 August 2016 20:49:55 UTC