W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2018

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

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Tue, 11 Dec 2018 02:56:12 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-446054347-1544496971-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:40 UTC