content-visibility: auto
Rows the browser refuses to lay out
- row 01
- row 02
- row 03
- row 04
- row 05
- row 06
- row 07
- row 08
- row 09
- row 10
- row 11
- row 12
- row 13
- row 14
- row 15
- row 16
- row 01
- row 02
- row 03
- row 04
- row 05
- row 06
- row 07
- row 08
- row 09
- row 10
- row 11
- row 12
- row 13
- row 14
- row 15
- row 16
CaveatA skipped element reports a height of zero unless you tell it otherwise, so the left scrollbar above lurches while you drag it and the right one does not. contain-intrinsic-size: auto 27px is the fix: guess once, and auto makes the browser remember the real height after the row has been laid out a first time. Skipping also applies size containment, so a child that used to size its parent stops doing so.
FallbackAn engine that does not know the property lays everything out as it always did, so the page is correct and merely slower to paint. That makes this one of the very few performance properties worth adding with no feature query at all. Find-in-page and anchor links still reach inside skipped content, which is what separates it from hidden.
<li>one of two thousand rows</li>
li {
content-visibility: auto;
/* or the scrollbar guesses zero */
contain-intrinsic-size: auto 27px;
}
Published