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

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

Issue 1099963003: Support type selector for camel-cased SVG elements in HTML. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase issue. querySelector didn't use tagMatches anymore. Created 5 years, 7 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
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 694c652130adfeac5356ee443095b01574122e4a..cb86f50b0565297dbf1d83264029f302cfdc04fe 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -99,8 +99,12 @@ 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;
+ if (localName != starAtom && localName != element.localName()) {
+ if (element.isHTMLElement() || !element.document().isHTMLDocument())
+ return false;
+ if (!equalIgnoringCase(localName, element.localName()))
+ return false;
+ }
const AtomicString& namespaceURI = tagQName.namespaceURI();
return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
}

Powered by Google App Engine
This is Rietveld 408576698