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

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

Issue 844203002: Avoid looping through all attributes for attribute selector. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « LayoutTests/fast/css/namespaces/attribute-selectors-001-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 099a94cd6a4073d6787053d246c48cf3df6305a2..48cf3ced8655de35ad88db4d7610f72dab6a8195 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -474,8 +474,11 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons
if (attributeValueMatches(attributeItem, match, selectorValue, !caseInsensitive))
return true;
- if (caseInsensitive)
+ if (caseInsensitive) {
+ if (selectorAttr.namespaceURI() != starAtom)
+ return false;
continue;
+ }
// Legacy dictates that values of some attributes should be compared in
// a case-insensitive manner regardless of whether the case insensitive
@@ -488,6 +491,8 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons
UseCounter::count(element.document(), UseCounter::CaseInsensitiveAttrSelectorMatch);
return true;
}
+ if (selectorAttr.namespaceURI() != starAtom)
+ return false;
}
return false;
« no previous file with comments | « LayoutTests/fast/css/namespaces/attribute-selectors-001-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698