Dealing with CSS performance
At this point I'm happily re-concluding the conclusion arrived at in Appendix 1, CSS Selector Performance - that CSS selectors are rarely a problem with static pages. Plus, attempting to second guess which selector will perform well is probably futile.
However, for large DOMs and dynamic DOMs (e.g. not the odd class toggle, we are talking lots of JavaScript manipulation) it may not be beyond the realms of possibility that CSS selectors could be causing an issue. I can't speak for all of Mozilla, but I think when you're dealing with performance, you want to focus on what's slow. Sometimes that will be selectors; usually it will be other things, says L. David Baron (http://dbaron.org/), of Mozilla (https://www.mozilla.org/en-US/ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access