| Index: Source/core/css/SelectorChecker.cpp
|
| diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
|
| index 659010b9de47867b734d324d7829537655e3a116..174a87e7204eef98fe325845825e74312064d834 100644
|
| --- a/Source/core/css/SelectorChecker.cpp
|
| +++ b/Source/core/css/SelectorChecker.cpp
|
| @@ -94,6 +94,17 @@ static bool matchesListBoxPseudoClass(const Element& element)
|
| return isHTMLSelectElement(element) && !toHTMLSelectElement(element).usesMenuList();
|
| }
|
|
|
| +static bool matchesTagName(const Element& element, const QualifiedName& tagQName)
|
| +{
|
| + if (tagQName == anyQName())
|
| + return true;
|
| + const AtomicString& localName = tagQName.localName();
|
| + if (localName != starAtom && localName != element.localName())
|
| + return false;
|
| + const AtomicString& namespaceURI = tagQName.namespaceURI();
|
| + return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
|
| +}
|
| +
|
| static Element* parentElement(const SelectorChecker::SelectorCheckingContext& context)
|
| {
|
| // - If context.scope is a shadow root, we should walk up to its shadow host.
|
| @@ -563,7 +574,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
|
|
|
| switch (selector.match()) {
|
| case CSSSelector::Tag:
|
| - return SelectorChecker::tagMatches(element, selector.tagQName());
|
| + return matchesTagName(element, selector.tagQName());
|
| case CSSSelector::Class:
|
| return element.hasClass() && element.classNames().contains(selector.value());
|
| case CSSSelector::Id:
|
|
|