Hacker News new | ask | show | jobs
by londons_explore 1692 days ago
Browsers give no control over when areas are repainted. If you change a bit of CSS or DOM, it will be repainted in the next frame. There is no way to say 'dont paint this yet'.

The thing the contain property does is ensure that a particular Dom change won't affect pixels outside the element involved, which means the browser won't need to do any extra repainting.

1 comments

You can say “don’t paint this yet” if it’s not within the viewport. In addition to ‘contain’ there’s also ‘content-visibility’.

https://developer.mozilla.org/en-US/docs/Web/CSS/content-vis...