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

Unified Diff: third_party/WebKit/Source/core/dom/Attribute.h

Issue 2490393002: Match camelCased SVG attributes selectors in html documents. (Closed)
Patch Set: Created 4 years, 1 month 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: third_party/WebKit/Source/core/dom/Attribute.h
diff --git a/third_party/WebKit/Source/core/dom/Attribute.h b/third_party/WebKit/Source/core/dom/Attribute.h
index f207741ae562d9bcfaaa79571e73627833076dd6..1ba868c37c8a3b7d88cf7435f95328e85327f60d 100644
--- a/third_party/WebKit/Source/core/dom/Attribute.h
+++ b/third_party/WebKit/Source/core/dom/Attribute.h
@@ -53,6 +53,7 @@ class Attribute {
bool isEmpty() const { return m_value.isEmpty(); }
bool matches(const QualifiedName&) const;
+ bool matchesCaseInsensitive(const QualifiedName&) const;
void setValue(const AtomicString& value) { m_value = value; }
@@ -79,6 +80,14 @@ inline bool Attribute::matches(const QualifiedName& qualifiedName) const {
qualifiedName.namespaceURI() == namespaceURI();
}
+inline bool Attribute::matchesCaseInsensitive(
+ const QualifiedName& qualifiedName) const {
+ if (qualifiedName.localNameUpper() != m_name.localNameUpper())
sashab 2016/11/11 00:16:52 You could move this into the return statement :)
rune 2016/11/11 09:49:23 Done.
+ return false;
+ return qualifiedName.prefix() == starAtom ||
+ qualifiedName.namespaceURI() == namespaceURI();
+}
+
} // namespace blink
#endif // Attribute_h

Powered by Google App Engine
This is Rietveld 408576698