Index: Source/core/css/SelectorChecker.cpp |
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp |
index 3e205e96ac78575f4084fffac61a2f1747ebd2be..2f71c6982fc16f8668fb346c96a273313722559c 100644 |
--- a/Source/core/css/SelectorChecker.cpp |
+++ b/Source/core/css/SelectorChecker.cpp |
@@ -498,7 +498,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; |
AttributeIteratorAccessor attributes = element.attributesIterator(); |
AttributeConstIterator end = attributes.end(); |
@@ -508,9 +509,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); |
Timothy Loh
2014/07/22 08:51:02
This is super confusing (we have a caseSensitive a
fs
2014/07/22 11:06:17
I suppose we could make the new (currently |caseIn
Timothy Loh
2014/07/22 11:50:26
If I'm reading crbug.com/327060 right, the existin
fs
2014/07/22 14:09:04
Thank you for elaborating. I've updated to somethi
Timothy Loh
2014/07/23 01:46:50
I think |legacyCaseInsensitive| (instead of |legac
|