3 ms·
> CSS is an imprecise language that targets indiscriminately and is difficult to statically analyze CSS as specified is imprecise, yes, but individual browser
by pcwalton 11y ago
> CSS is an imprecise language that targets indiscriminately and is difficult to statically analyze
CSS as specified is imprecise, yes, but individual browser implementations implement their own precise behaviors. (This is no worse than native UIs.)
CSS has a lot of weird quirks, but techniques such as Gecko's display lists have gone a long way toward taming this complexity by lowering to a simpler form. This opens up aggressive optimizations at the engine level (which is not to say that browser engines are currently doing all optimizations that are possible!) What's nice about CSS in terms of analysis is, again, its declarative nature: the fact that common layouts are implemented declaratively means that browser engines have a lot of freedom to optimize them in different ways.