Comment

Comment by gluxon

> 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.)

parent gluxon 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton