Re:CSS Containment Specification
by frivoal on Sunday February 16, 2020 @02:37AM
(#22340409)
> when you can guarantee that your JS will never apply certain styles to certain elements
It goes further than that: using contain means that even if you tried applying these styles that would break optimizations, the browsers will not obey you. css-contain isn't just a hint to the browser that you're not screwing things up, it's a mode switch that prevents you from doing so.
Re:CSS Containment Specification
by _bxg1 on Sunday February 16, 2020 @02:42AM
(#22340428)
True, but the things it prevents you from doing are virtually never something you would want to prevent via a mechanism like this. You'd want to catch them higher up. I don't think it would really be helpful as a constraints system.
It goes further than that: using contain means that even if you tried applying these styles that would break optimizations, the browsers will not obey you. css-contain isn't just a hint to the browser that you're not screwing things up, it's a mode switch that prevents you from doing so.