2 ms·
An important detail is that browsers can infer some of this, but that doesn't mean it's guaranteed to work. You're relying on heuristics and browser internals a
by kevingadd 7y ago
An important detail is that browsers can infer some of this, but that doesn't mean it's guaranteed to work. You're relying on heuristics and browser internals and the gap between 'it was inferred' and 'it wasn't inferred' can be multiple milliseconds of layout time. It's quite easy for someone to accidentally break the inferred optimization by changing a CSS style or adding some new HTML if the side effect is invisible.
Contain gives you something approximating a guarantee and you also know the exact effect of the attribute.