Index: Source/core/css/SelectorChecker.cpp |
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp |
index 8b93541c6efe4271a0b2cf596eb93420072e5499..e8fe8ab23b706651069df9e72648caa5a1b152ba 100644 |
--- a/Source/core/css/SelectorChecker.cpp |
+++ b/Source/core/css/SelectorChecker.cpp |
@@ -482,7 +482,8 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons |
if (!element.hasAttributesWithoutUpdate()) |
return false; |
- const AtomicString& selectorValue = selector.value(); |
+ const AtomicString& selectorValue = selector.value(); |
+ bool caseInsensitive = selector.attributeFlags() & CSSSelector::CaseInsensitive; |
unsigned attributeCount = element.attributeCount(); |
for (size_t i = 0; i < attributeCount; ++i) { |
@@ -491,9 +492,12 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons |
if (!attributeItem.matches(selectorAttr)) |
continue; |
- if (attributeValueMatches(attributeItem, match, selectorValue, true)) |
+ if (attributeValueMatches(attributeItem, match, selectorValue, !caseInsensitive)) |
return true; |
+ if (caseInsensitive) |
+ continue; |
+ |
// Case sensitivity for attribute matching is looser than hasAttribute or |
// Element::shouldIgnoreAttributeCase() for now. Unclear if that's correct. |
bool caseSensitive = !element.document().isHTMLDocument() || HTMLDocument::isCaseSensitiveAttribute(selectorAttr); |