RESOLVED FIXED 234959
Make separate invalidation rulesets for negated selectors (inside :not())
https://bugs.webkit.org/show_bug.cgi?id=234959
Summary Make separate invalidation rulesets for negated selectors (inside :not())
Antti Koivisto
Reported 2022-01-07 08:11:58 PST
With this information we can reduce invalidation traversal by half.
Attachments
Patch (22.42 KB, patch)
2022-01-07 08:29 PST, Antti Koivisto
ews-feeder: commit-queue-
Patch (22.48 KB, patch)
2022-01-07 08:33 PST, Antti Koivisto
no flags
Patch (22.46 KB, patch)
2022-01-07 08:43 PST, Antti Koivisto
no flags
Patch for landing (22.46 KB, patch)
2022-01-07 10:33 PST, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2022-01-07 08:29:12 PST
Antti Koivisto
Comment 2 2022-01-07 08:33:13 PST
Antti Koivisto
Comment 3 2022-01-07 08:43:53 PST
Darin Adler
Comment 4 2022-01-07 09:52:03 PST
Comment on attachment 448601 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=448601&action=review > Source/WebCore/style/ClassChangeInvalidation.cpp:37 > +enum class ClassChangeType { Add, Remove }; Consider ": bool"? > Source/WebCore/style/ClassChangeInvalidation.cpp:41 > + AtomStringImpl* className; > + ClassChangeType type; Consider providing default values rather than leaving these scalars uninitialized? > Source/WebCore/style/ClassChangeInvalidation.cpp:118 > + auto invalidateBeforeChange = [](ClassChangeType classChangeType, IsNegation isNegation) { I think calling the local just "type" makes it slightly easier to read. > Source/WebCore/style/ClassChangeInvalidation.cpp:121 > + if (classChangeType == ClassChangeType::Remove) > + return isNegation == IsNegation::No; > + return isNegation == IsNegation::Yes; I’d wish for a simpler way to write this; I kind of feel like it’s a boolean maze right now. But I can’t think of anything obviously better. > Source/WebCore/style/StyleScopeRuleSets.h:49 > + Vector<const CSSSelector*> invalidationSelectors { }; Do we really need the "{ }" here? A workaround for a compiler bug?
Simon Fraser (smfr)
Comment 5 2022-01-07 09:54:46 PST
Comment on attachment 448601 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=448601&action=review > Source/WebCore/style/StyleScopeRuleSets.h:48 > + IsNegation isNegation; > + RefPtr<RuleSet> ruleSet; There will be some padding here.
Antti Koivisto
Comment 6 2022-01-07 09:58:22 PST
> Do we really need the "{ }" here? A workaround for a compiler bug? Yeah, in the EWS compiler version. We talked about this earlier.
Antti Koivisto
Comment 7 2022-01-07 10:33:01 PST
Created attachment 448608 [details] Patch for landing
EWS
Comment 8 2022-01-07 11:39:54 PST
Committed r287772 (245832@main): <https://commits.webkit.org/245832@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 448608 [details].
Radar WebKit Bug Importer
Comment 9 2022-01-07 11:40:25 PST
Note You need to log in before you can comment on or make changes to this bug.