content-visibility landed in Chrome in August 2020, and the property has always carried an awkward companion: to get real performance value, you pair it with contain-intrinsic-size on large page chunks, which means supplying an arbitrary guessed height for content the browser hasn't measured. Jake Archibald and Das Surma recently made a video walking through the mechanics, and it clarifies what that number is actually doing.

What the intrinsic size actually describes

In the video's demo, Jake wraps big chunks of a large HTML spec page in <section> elements and applies:

section {
  content-visibility: auto; /* this is the thing that delays painting */
  contain-intrinsic-size: 1px 5000px; /* this is the guess at the height of the content, and also saying width doesn't matter */
}

The 5000px value is not the height of the element—it is the size of the element's content. That distinction matters because the guess will push the parent element taller by that amount unless the parent overrides it with an explicit height of its own. The browser then lays out and paints only the first section, where it is very likely the viewport doesn't extend past 5000px, and defers the rest—similar to lazy loading, but for everything rather than only media. Once the top of a deferred section becomes visible, it gets painted for real and its actual height is known. If your page is simply a stack of large blocks, an extremely large number works fine. More elaborate layouts are where the guess becomes fragile.

The recurring cost of telling the browser what it can't infer

The underlying tradeoff shows up elsewhere in the platform: the browser can discover this information on its own, but only after paying a performance cost to do so, so you declare it up front instead. Responsive images work the same way—a srcset with a sizes attribute giving the browser advance knowledge of how your CSS behaves lets it compute which candidate to fetch without downloading the wrong ones. will-change works the same way, pre-optimizing for movement the browser can't anticipate. It's understandable, if a little tiresome—as though browsers need a stuff-you-need-to-know.manifest before doing anything, only that would cost an extra request.

Accessibility: neither fully hidden nor fully exposed

Steve Faulkner tested content-visibility: auto applied to images and paragraphs, and the results don't match either simple model. Visually the content is hidden, yet both JAWS and NVDA announce the hidden <img> while omitting the content of the <p>. The reason lies in the browser accessibility tree: the img is exposed with its alt text as the accessible name, but the p element's content is absent. Per the spec, content hidden this way should not be available to screen readers at all.

Two consistent behaviors would be defensible: strip everything as though it were display: none, or keep it all in the accessibility tree. Today's behavior is the in-between—stray images announced with nothing but their alt text for context. It's a useful example of new technology shipping with sharper edges than one might hope.

Which makes writing decent alt text more important, not less. Dave Rupert's framing is that alt text is like a paragraph—word pictures—which helps with writing good descriptions and with thinking through source order in code.

Worth the rough edges

None of the caveats cancel the upside. On a long-scrolling page, the performance gains from content-visibility are huge, and getting the browser to skip unneeded rendering work—per the spec's language, omitting large swathes of layout and rendering work until needed—takes only a couple of lines of CSS.