W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2016

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

From: David Baron via GitHub <sysbot+gh@w3.org>
Date: Fri, 12 Aug 2016 20:49:47 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-170956476-1471034986-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:22 UTC