|
|
|
|
|
by gluxon
2313 days ago
|
|
> If it doesn't have any absolutely positioned or floating child elements, wouldn't that imply contain: content? I think the goal is to avoid analyzing child elements at all. So you can layout a given set of children at one layer of the DOM tree at once rather than having to dig deeper into one node to know where to put its sibling. > And if you add overflow: auto or hidden, wouldn't that infer to contain: strict? I think browsers would only be able to reasonable infer "contain: strict" on elements with both overflow auto/hidden and fixed width/height. I'm guessing that "contain: strict" would allow you to avoid defining fixed height and width then? (That was just my first guess. There may be other reasons.) |
|
If you add contain: strict to the container in the above example you'll see that it then successfully clips the child div.