Index: Source/core/dom/DocumentOrderedMap.cpp |
diff --git a/Source/core/dom/DocumentOrderedMap.cpp b/Source/core/dom/DocumentOrderedMap.cpp |
index ec815e16f206174c33644d56fb7a6253cbe9673e..604549b089a44301fd4ded709357be32c5879e29 100644 |
--- a/Source/core/dom/DocumentOrderedMap.cpp |
+++ b/Source/core/dom/DocumentOrderedMap.cpp |
@@ -41,24 +41,24 @@ namespace blink { |
using namespace HTMLNames; |
-inline bool keyMatchesId(StringImpl* key, Element& element) |
+inline bool keyMatchesId(const AtomicString& key, const Element& element) |
{ |
- return element.getIdAttribute().impl() == key; |
+ return element.getIdAttribute() == key; |
} |
-inline bool keyMatchesMapName(StringImpl* key, Element& element) |
+inline bool keyMatchesMapName(const AtomicString& key, const Element& element) |
{ |
- return isHTMLMapElement(element) && toHTMLMapElement(element).getName().impl() == key; |
+ return isHTMLMapElement(element) && toHTMLMapElement(element).getName() == key; |
} |
-inline bool keyMatchesLowercasedMapName(StringImpl* key, Element& element) |
+inline bool keyMatchesLowercasedMapName(const AtomicString& key, const Element& element) |
{ |
- return isHTMLMapElement(element) && toHTMLMapElement(element).getName().lower().impl() == key; |
+ return isHTMLMapElement(element) && toHTMLMapElement(element).getName().lower() == key; |
} |
-inline bool keyMatchesLabelForAttribute(StringImpl* key, Element& element) |
+inline bool keyMatchesLabelForAttribute(const AtomicString& key, const Element& element) |
{ |
- return isHTMLLabelElement(element) && element.getAttribute(forAttr).impl() == key; |
+ return isHTMLLabelElement(element) && element.getAttribute(forAttr) == key; |
} |
PassOwnPtrWillBeRawPtr<DocumentOrderedMap> DocumentOrderedMap::create() |
@@ -66,12 +66,12 @@ PassOwnPtrWillBeRawPtr<DocumentOrderedMap> DocumentOrderedMap::create() |
return adoptPtrWillBeNoop(new DocumentOrderedMap()); |
} |
-void DocumentOrderedMap::add(StringImpl* key, Element* element) |
+void DocumentOrderedMap::add(const AtomicString& key, Element* element) |
{ |
ASSERT(key); |
ASSERT(element); |
- Map::AddResult addResult = m_map.add(key, adoptPtrWillBeNoop(new MapEntry(element))); |
+ Map::AddResult addResult = m_map.add(key.impl(), adoptPtrWillBeNoop(new MapEntry(element))); |
if (addResult.isNewEntry) |
return; |
@@ -82,12 +82,12 @@ void DocumentOrderedMap::add(StringImpl* key, Element* element) |
entry->orderedList.clear(); |
} |
-void DocumentOrderedMap::remove(StringImpl* key, Element* element) |
+void DocumentOrderedMap::remove(const AtomicString& key, Element* element) |
{ |
ASSERT(key); |
ASSERT(element); |
- Map::iterator it = m_map.find(key); |
+ Map::iterator it = m_map.find(key.impl()); |
if (it == m_map.end()) |
return; |
@@ -106,13 +106,13 @@ void DocumentOrderedMap::remove(StringImpl* key, Element* element) |
} |
} |
-template<bool keyMatches(StringImpl*, Element&)> |
-inline Element* DocumentOrderedMap::get(StringImpl* key, const TreeScope* scope) const |
+template<bool keyMatches(const AtomicString&, const Element&)> |
+inline Element* DocumentOrderedMap::get(const AtomicString& key, const TreeScope* scope) const |
{ |
ASSERT(key); |
ASSERT(scope); |
- MapEntry* entry = m_map.get(key); |
+ MapEntry* entry = m_map.get(key.impl()); |
if (!entry) |
return 0; |
@@ -131,18 +131,18 @@ inline Element* DocumentOrderedMap::get(StringImpl* key, const TreeScope* scope) |
return 0; |
} |
-Element* DocumentOrderedMap::getElementById(StringImpl* key, const TreeScope* scope) const |
+Element* DocumentOrderedMap::getElementById(const AtomicString& key, const TreeScope* scope) const |
{ |
return get<keyMatchesId>(key, scope); |
} |
-const WillBeHeapVector<RawPtrWillBeMember<Element> >& DocumentOrderedMap::getAllElementsById(StringImpl* key, const TreeScope* scope) const |
+const WillBeHeapVector<RawPtrWillBeMember<Element> >& DocumentOrderedMap::getAllElementsById(const AtomicString& key, const TreeScope* scope) const |
{ |
ASSERT(key); |
ASSERT(scope); |
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapVector<RawPtrWillBeMember<Element> > >, emptyVector, (adoptPtrWillBeNoop(new WillBeHeapVector<RawPtrWillBeMember<Element> >()))); |
- Map::iterator it = m_map.find(key); |
+ Map::iterator it = m_map.find(key.impl()); |
if (it == m_map.end()) |
return *emptyVector; |
@@ -164,17 +164,17 @@ const WillBeHeapVector<RawPtrWillBeMember<Element> >& DocumentOrderedMap::getAll |
return entry->orderedList; |
} |
-Element* DocumentOrderedMap::getElementByMapName(StringImpl* key, const TreeScope* scope) const |
+Element* DocumentOrderedMap::getElementByMapName(const AtomicString& key, const TreeScope* scope) const |
{ |
return get<keyMatchesMapName>(key, scope); |
} |
-Element* DocumentOrderedMap::getElementByLowercasedMapName(StringImpl* key, const TreeScope* scope) const |
+Element* DocumentOrderedMap::getElementByLowercasedMapName(const AtomicString& key, const TreeScope* scope) const |
{ |
return get<keyMatchesLowercasedMapName>(key, scope); |
} |
-Element* DocumentOrderedMap::getElementByLabelForAttribute(StringImpl* key, const TreeScope* scope) const |
+Element* DocumentOrderedMap::getElementByLabelForAttribute(const AtomicString& key, const TreeScope* scope) const |
{ |
return get<keyMatchesLabelForAttribute>(key, scope); |
} |