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

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

Issue 218403012: Check for null selectors when looping in findBestRuleSetAndAdd (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments from ojan@. Created 6 years, 9 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 | « Source/core/css/CSSSelector.cpp ('k') | no next file » | 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 fefc1e4310b1aa9006b8ffcfa65737dd361a0a0b..a745456129f99c6f77be7d50a853fdfa68f7c5b4 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -177,10 +177,12 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
#endif
const CSSSelector* it = &component;
- for (; it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
+ for (; it && it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
}
- 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);
// Prefer rule sets in order of most likely to apply infrequently.
if (!id.isEmpty()) {
« no previous file with comments | « Source/core/css/CSSSelector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698