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

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

Issue 751023002: Use SubSelector as relation on left-most selector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: SubSelector is not a combinator Created 6 years, 1 month 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 | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/parser/BisonCSSParser-in.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleSet.cpp
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index 6cf0f6e24d0c974cb8584b64b34221f0dd735749..e8e68520a5fca6e2ba7661f29fe512b8dabf19bc 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -57,10 +57,8 @@ static inline bool isSelectorMatchingHTMLBasedOnRuleHash(const CSSSelector& sele
const AtomicString& selectorNamespace = selector.tagQName().namespaceURI();
if (selectorNamespace != starAtom && selectorNamespace != xhtmlNamespaceURI)
return false;
- if (selector.relation() == CSSSelector::SubSelector) {
- ASSERT(selector.tagHistory());
+ if (selector.relation() == CSSSelector::SubSelector && selector.tagHistory())
return isSelectorMatchingHTMLBasedOnRuleHash(*selector.tagHistory());
- }
return true;
}
if (SelectorChecker::isCommonPseudoClassSelector(selector))
@@ -181,10 +179,8 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
#endif
const CSSSelector* it = &component;
- for (; it && it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
+ for (; it && it->relation() == CSSSelector::SubSelector; it = it->tagHistory())
extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
- }
- // FIXME: this null check should not be necessary. See crbug.com/358475
if (it)
extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/parser/BisonCSSParser-in.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698