Re: [csswg-drafts] Remove the "content" requirement for ::before and ::after? [css-pseudo] (#3419)

> I'm not sure I follow - instead of checking for content and display, you'd check for ::before and display (or ::after and display). Is that more work? Yes, by one string, which increases complexity by 100%, but also by a single string check. I don't see a performance hit here? (except maybe once you hit thousands of DOM elements, but at that point, ::before or ::after is not going to be your bottleneck)

So to put a concrete example, this would mean that a page with 2000 elements (which is not a lot, for example in this website `document.all.length` returns `3059`) and the rule `*, *::before, *::after { box-sizing: border-box }` (which is quite common) causes the engine to create 4000 pseudo-elements instead of zero (since `display` is `inline` by default).

That's not cool.

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

Received on Tuesday, 11 December 2018 02:56:13 UTC