Index: Source/core/css/SelectorChecker.h |
diff --git a/Source/core/css/SelectorChecker.h b/Source/core/css/SelectorChecker.h |
index 563f00d6143fe2adc9b292d1499c418f203b72fb..9c12d8aa1a593049cae840ee5f1fcf5f353e5bad 100644 |
--- a/Source/core/css/SelectorChecker.h |
+++ b/Source/core/css/SelectorChecker.h |
@@ -106,11 +106,12 @@ public: |
Mode mode() const { return m_mode; } |
- static bool tagMatches(const Element&, const QualifiedName&); |
+ static bool tagMatches(const Element&, const CSSSelector&); |
static bool isCommonPseudoClassSelector(const CSSSelector&); |
static bool matchesFocusPseudoClass(const Element&); |
static bool matchesSpatialNavigationFocusPseudoClass(const Element&); |
static bool matchesListBoxPseudoClass(const Element&); |
+ static bool localNameMatchesLower(const AtomicString& elementName, const AtomicString& camelCasedType); |
enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited }; |
static unsigned determineLinkMatchType(const CSSSelector&); |
@@ -151,13 +152,18 @@ inline bool SelectorChecker::isCommonPseudoClassSelector(const CSSSelector& sele |
|| pseudoType == CSSSelector::PseudoFocus; |
} |
-inline bool SelectorChecker::tagMatches(const Element& element, const QualifiedName& tagQName) |
+inline bool SelectorChecker::tagMatches(const Element& element, const CSSSelector& selector) |
{ |
+ const QualifiedName& tagQName = selector.tagQName(); |
if (tagQName == anyQName()) |
return true; |
const AtomicString& localName = tagQName.localName(); |
- if (localName != starAtom && localName != element.localName()) |
- return false; |
+ if (localName != starAtom && localName != element.localName()) { |
+ if (!selector.tagIsCamelCase()) |
+ return false; |
+ if (!localNameMatchesLower(element.localName(), localName)) |
+ return false; |
+ } |
const AtomicString& namespaceURI = tagQName.namespaceURI(); |
return namespaceURI == starAtom || namespaceURI == element.namespaceURI(); |
} |