3 ms·
Note the related CSS property "content-visibility": https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility https://developer.mozilla.org/en-US/doc
by fleddr 5y ago
Note the related CSS property "content-visibility":
https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility https://developer.mozilla.org/en-US/docs/Web/CSS/content-vis...
Whereas "contain" prevents recalculations, "content-visibility" doesn't render applicable elements at all until needed.
- azangru 5y agoI seem to recall reading somewhere that 'content-visibility' has a performance penalty, because the browser effectively sticks intersection observers on the elements marked with content-visibility:auto; so that setting content-visibility:auto on, say, thousands of table rows delays page render. But now I can't find where I saw that.
- fleddr 5y agoThat makes sense. Ideally in that scenario you don't set it at table row level, rather at a higher container level. In this case a container wrapping things far down the page. Your markup structure of course has to support this.