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

Unified Diff: Source/core/dom/Element.h

Issue 22803008: setAttributeNode() does not properly normalize case. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: submitting patch with small name changes. Created 7 years, 4 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/dom/Element.h
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index 7b075ce8638b2e631f36a5c5516def6a933f2a61..88df55f6cedbe0b2ad9a4f0aad8401840613335c 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -87,7 +87,7 @@ public:
const Attribute* attributeItem(unsigned index) const;
const Attribute* getAttributeItem(const QualifiedName&) const;
- size_t getAttributeItemIndex(const QualifiedName&) const;
+ size_t getAttributeItemIndex(const QualifiedName&, bool shouldIgnoreCase = false) const;
size_t getAttributeItemIndex(const AtomicString& name, bool shouldIgnoreAttributeCase) const;
size_t getAttrIndex(Attr*) const;
@@ -1037,12 +1037,12 @@ inline const Attribute* ElementData::attributeBase() const
return static_cast<const ShareableElementData*>(this)->m_attributeArray;
}
-inline size_t ElementData::getAttributeItemIndex(const QualifiedName& name) const
+inline size_t ElementData::getAttributeItemIndex(const QualifiedName& name, bool shouldIgnoreCase) const
{
const Attribute* begin = attributeBase();
for (unsigned i = 0; i < length(); ++i) {
const Attribute& attribute = begin[i];
- if (attribute.name().matches(name))
+ if (attribute.name().matchesPossiblyIgnoringCase(name, shouldIgnoreCase))
return i;
}
return notFound;
« no previous file with comments | « LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-xhtml-expected.txt ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698