-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[CSS] Early return from matching when doing invalidation #39737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CSS] Early return from matching when doing invalidation #39737
Conversation
|
EWS run on previous version of this PR (hash bd604f8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this is the good approach or not, but here's a style nit
|
EWS run on previous version of this PR (hash afab8f2)
|
afab8f2 to
00508c0
Compare
|
EWS run on previous version of this PR (hash 00508c0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still do some unnecessary work like hash lookups in ElementRuleCollector::collectMatchingRules after the first match. I think this ok for now though, it can be improved later.
00508c0 to
5cc3611
Compare
|
EWS run on previous version of this PR (hash 5cc3611) |
|
Failed mac-AS-debug-wk2 checks. Please resolve failures and re-apply Rejecting #39737 from merge queue. |
|
Safe-Merge-Queue: Build #47392. |
|
Failed mac-AS-debug-wk2 checks. Please resolve failures and re-apply Rejecting #39737 from merge queue. |
|
Safe-Merge-Queue: Build #47431. |
5cc3611 to
fc45b11
Compare
|
EWS run on current version of this PR (hash fc45b11) |
|
|
https://bugs.webkit.org/show_bug.cgi?id=286721 rdar://138419832 Reviewed by Antti Koivisto. For invalidation, we generally don't want to collect rules but just to know if any rule matches. We can optimize for this use case by early returning on first match. * Source/WebCore/style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::isFirstMatchModeAndHasMatchedAnyRules const): (WebCore::Style::ElementRuleCollector::collectMatchingRules): (WebCore::Style::ElementRuleCollector::transferMatchedRules): (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList): (WebCore::Style::ElementRuleCollector::matchAllRules): (WebCore::Style::ElementRuleCollector::hasAnyMatchingRules): Deleted. Renamed to matchesAnyRules(). * Source/WebCore/style/ElementRuleCollector.h: * Source/WebCore/style/StyleSharingResolver.cpp: (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet const): Canonical link: https://commits.webkit.org/289611@main
fc45b11 to
ce251e4
Compare
|
Committed 289611@main (ce251e4): https://commits.webkit.org/289611@main Reviewed commits have been landed. Closing PR #39737 and removing active labels. |
ce251e4
fc45b11
🧪 wpe-wk2🧪 api-mac🧪 api-ios🧪 mac-AS-debug-wk2🧪 gtk-wk2