Re: [csswg-drafts] [css-selectors] `:has()` and performance (#3345)

> > would be essentially identical in terms of performance, and therefore viable for the live profile.
> 
> That is not true. `b.matches('a b:has(c)')` requires looking at every descendant of `b`, while `c.matches('a b c')` does not. Evaluating the selector is much more expensive.

That’s from JavaScript. I mean the initial parsing, which ends up being fast‑ish since once you encounter `c`, you can send an event back to `b`, which would be marked as potentially matching a `:has(…)` selector and be updated as such.

-- 
GitHub Notification of comment by ExE-Boss
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3345#issuecomment-441571728 using your GitHub account

Received on Monday, 26 November 2018 09:25:56 UTC