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

Unified Diff: Source/core/dom/TreeScope.cpp

Issue 459203004: Have DocumentOrderedMap API deal with AtomicString type instead of StringImpl* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index 821cd6ede346ab06555e03502c92233ff02f023a..781e7b0d26cb9927c9411f4c77b79d766113d0c4 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -165,7 +165,7 @@ Element* TreeScope::getElementById(const AtomicString& elementId) const
return 0;
if (!m_elementsById)
return 0;
- return m_elementsById->getElementById(elementId.impl(), this);
+ return m_elementsById->getElementById(elementId, this);
}
const WillBeHeapVector<RawPtrWillBeMember<Element> >& TreeScope::getAllElementsById(const AtomicString& elementId) const
@@ -175,14 +175,14 @@ const WillBeHeapVector<RawPtrWillBeMember<Element> >& TreeScope::getAllElementsB
return *emptyVector;
if (!m_elementsById)
return *emptyVector;
- return m_elementsById->getAllElementsById(elementId.impl(), this);
+ return m_elementsById->getAllElementsById(elementId, this);
}
void TreeScope::addElementById(const AtomicString& elementId, Element* element)
{
if (!m_elementsById)
m_elementsById = DocumentOrderedMap::create();
- m_elementsById->add(elementId.impl(), element);
+ m_elementsById->add(elementId, element);
m_idTargetObserverRegistry->notifyObservers(elementId);
}
@@ -190,7 +190,7 @@ void TreeScope::removeElementById(const AtomicString& elementId, Element* elemen
{
if (!m_elementsById)
return;
- m_elementsById->remove(elementId.impl(), element);
+ m_elementsById->remove(elementId, element);
m_idTargetObserverRegistry->notifyObservers(elementId);
}
@@ -210,7 +210,7 @@ Node* TreeScope::ancestorInThisScope(Node* node) const
void TreeScope::addImageMap(HTMLMapElement* imageMap)
{
- StringImpl* name = imageMap->getName().impl();
+ const AtomicString& name = imageMap->getName();
if (!name)
return;
if (!m_imageMapsByName)
@@ -222,7 +222,7 @@ void TreeScope::removeImageMap(HTMLMapElement* imageMap)
{
if (!m_imageMapsByName)
return;
- StringImpl* name = imageMap->getName().impl();
+ const AtomicString& name = imageMap->getName();
if (!name)
return;
m_imageMapsByName->remove(name, imageMap);
@@ -235,10 +235,10 @@ HTMLMapElement* TreeScope::getImageMap(const String& url) const
if (!m_imageMapsByName)
return 0;
size_t hashPos = url.find('#');
- String name = (hashPos == kNotFound ? url : url.substring(hashPos + 1)).impl();
+ String name = hashPos == kNotFound ? url : url.substring(hashPos + 1);
if (rootNode().document().isHTMLDocument())
- return toHTMLMapElement(m_imageMapsByName->getElementByLowercasedMapName(AtomicString(name.lower()).impl(), this));
- return toHTMLMapElement(m_imageMapsByName->getElementByMapName(AtomicString(name).impl(), this));
+ return toHTMLMapElement(m_imageMapsByName->getElementByLowercasedMapName(AtomicString(name.lower()), this));
+ return toHTMLMapElement(m_imageMapsByName->getElementByMapName(AtomicString(name), this));
}
HitTestResult hitTestInDocument(const Document* document, int x, int y)
@@ -281,13 +281,13 @@ Element* TreeScope::elementFromPoint(int x, int y) const
void TreeScope::addLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
{
ASSERT(m_labelsByForAttribute);
- m_labelsByForAttribute->add(forAttributeValue.impl(), element);
+ m_labelsByForAttribute->add(forAttributeValue, element);
}
void TreeScope::removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element)
{
ASSERT(m_labelsByForAttribute);
- m_labelsByForAttribute->remove(forAttributeValue.impl(), element);
+ m_labelsByForAttribute->remove(forAttributeValue, element);
}
HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeValue)
@@ -305,7 +305,7 @@ HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeV
}
}
- return toHTMLLabelElement(m_labelsByForAttribute->getElementByLabelForAttribute(forAttributeValue.impl(), this));
+ return toHTMLLabelElement(m_labelsByForAttribute->getElementByLabelForAttribute(forAttributeValue, this));
}
DOMSelection* TreeScope::getSelection() const
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698