Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Unified Diff: third_party/WebKit/Source/core/css/RuleSet.cpp

Issue 1703893002: Don't add rule feature data for rules which may never match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uncommon-attr-20160216
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/RuleSet.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleSet.cpp b/third_party/WebKit/Source/core/css/RuleSet.cpp
index 663371ae1e0e3f8130f6b1480ed4385491360480..ba97888f66c243b5f65b8d06c2b6ae4575890812 100644
--- a/third_party/WebKit/Source/core/css/RuleSet.cpp
+++ b/third_party/WebKit/Source/core/css/RuleSet.cpp
@@ -78,12 +78,8 @@ static bool containsUncommonAttributeSelector(const CSSSelector& selector)
return true;
if (selectorListContainsUncommonAttributeSelector(current))
return true;
- if (current->relationIsAffectedByPseudoContent()
- || current->pseudoType() == CSSSelector::PseudoHost
- || current->pseudoType() == CSSSelector::PseudoHostContext
- || current->pseudoType() == CSSSelector::PseudoSlotted) {
+ if (current->relationIsAffectedByPseudoContent() || current->pseudoType() == CSSSelector::PseudoSlotted)
return false;
- }
if (current->relation() != CSSSelector::SubSelector) {
current = current->tagHistory();
break;
@@ -222,7 +218,8 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
void RuleSet::addRule(StyleRule* rule, unsigned selectorIndex, AddRuleFlags addRuleFlags)
{
RuleData ruleData(rule, selectorIndex, m_ruleCount++, addRuleFlags);
- m_features.collectFeaturesFromRuleData(ruleData);
+ if (m_features.collectFeaturesFromRuleData(ruleData) == RuleFeatureSet::SelectorNeverMatches)
+ return;
if (!findBestRuleSetAndAdd(ruleData.selector(), ruleData)) {
// If we didn't find a specialized map to stick it in, file under universal rules.
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698