What content-visibility does

Una Kravets and Vladimir Levin describe content-visibility as a CSS property that applies the containment an off-screen section needs automatically. Their claim is that it delivers the largest performance gains the browser can offer while asking as little as possible of the developer. The property takes several values, but auto is the one that produces immediate improvements.

The reported gains are substantial:

In our example, we see a boost from a 232ms rendering time to a 30ms rendering time. That’s a 7x performance boost.

The manual setup it requires

Realizing that improvement is not automatic. You split large vertical chunks of the page into sections yourself and apply content-visibility: auto; to each one. You then supply an estimate of how tall each section is, for example contain-intrinsic-size: 1000px;.

That height guess is the awkward part. It raises open questions: what happens if the estimate is wrong, whether a bad value can hurt performance, and whether the value should be changed per viewport when the height difference between small and large screens is drastic.

Who this work falls to

Getting it right appears to demand a fairly skilled performance specialist — someone comfortable inspecting and comparing rendering profiles in DevTools. That reinforces the idea that web performance is a vocation of its own.