Skip to content

Add auto to docs' contain-intrinsic-size decl, to prevent jitter/flicker

Rodrigo Muino Tomonari requested to merge github/fork/dholbert/patch-1 into main

This addresses a scrolling/flickering issue in the node.js docs, as viewed by Firefox versions that have 'content-visibility' support (on by default in Firefox Nightly for several releases, opt-in in about:config in release versions).

See https://bugzilla.mozilla.org/show_bug.cgi?id=1832675 for details. Before this patch, the content-visibility:auto and contain-intrinsic-size:1px 5000px styles are telling the browser to suppress rendering of offscreen sections and behave as if they're 5000px tall, though they in fact are much shorter. This causes scrolling to behave quite bizarrely and can cause troublesome oscillating issues.

By adding auto to the contain-intrinsic-size CSS, we're asking the browser to remember the last-rendered size for the element (once it's been rendered) instead of forcing the browser to treat it as being 1px by 5000px when it goes offscreen.

(In fact the spec was recently updated to require browsers to behave as if auto were specified like this; but this fix hasn't shipped in Firefox yet as of the time I'm writing this patch, so in the meantime it would be nice to avoid the issue directly in the Node.js styles.)

Merge request reports

Loading