Index: Source/core/dom/Element.cpp |
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
index 94402222e8a03166c57ce2ed1588dde7eee46284..d54973019399ee0c488cfb208986771472a62e31 100644 |
--- a/Source/core/dom/Element.cpp |
+++ b/Source/core/dom/Element.cpp |
@@ -157,16 +157,16 @@ static AttrNodeList* attrNodeListForElement(Element* element) |
return attrNodeListMap().get(element); |
} |
-static AttrNodeList* ensureAttrNodeListForElement(Element* element) |
+static AttrNodeList& ensureAttrNodeListForElement(Element* element) |
{ |
if (element->hasSyntheticAttrChildNodes()) { |
ASSERT(attrNodeListMap().contains(element)); |
- return attrNodeListMap().get(element); |
+ return *attrNodeListMap().get(element); |
} |
ASSERT(!attrNodeListMap().contains(element)); |
element->setHasSyntheticAttrChildNodes(true); |
AttrNodeListMap::AddResult result = attrNodeListMap().add(element, adoptPtr(new AttrNodeList)); |
- return result.iterator->value.get(); |
+ return *result.iterator->value; |
} |
static void removeAttrNodeListForElement(Element* element) |
@@ -177,11 +177,11 @@ static void removeAttrNodeListForElement(Element* element) |
element->setHasSyntheticAttrChildNodes(false); |
} |
-static Attr* findAttrNodeInList(AttrNodeList* attrNodeList, const QualifiedName& name) |
+static Attr* findAttrNodeInList(AttrNodeList& attrNodeList, const QualifiedName& name) |
{ |
- for (unsigned i = 0; i < attrNodeList->size(); ++i) { |
- if (attrNodeList->at(i)->qualifiedName() == name) |
- return attrNodeList->at(i).get(); |
+ for (unsigned i = 0; i < attrNodeList.size(); ++i) { |
+ if (attrNodeList[i]->qualifiedName() == name) |
+ return attrNodeList[i].get(); |
} |
return 0; |
} |
@@ -1936,7 +1936,7 @@ PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionState& es) |
attrNode->attachToElement(this); |
treeScope().adoptIfNeeded(attrNode); |
- ensureAttrNodeListForElement(this)->append(attrNode); |
+ ensureAttrNodeListForElement(this).append(attrNode); |
return oldAttrNode.release(); |
} |
@@ -3056,18 +3056,18 @@ void Element::setSavedLayerScrollOffset(const IntSize& size) |
PassRefPtr<Attr> Element::attrIfExists(const QualifiedName& name) |
{ |
if (AttrNodeList* attrNodeList = attrNodeListForElement(this)) |
- return findAttrNodeInList(attrNodeList, name); |
+ return findAttrNodeInList(*attrNodeList, name); |
return 0; |
} |
PassRefPtr<Attr> Element::ensureAttr(const QualifiedName& name) |
{ |
- AttrNodeList* attrNodeList = ensureAttrNodeListForElement(this); |
+ AttrNodeList& attrNodeList = ensureAttrNodeListForElement(this); |
RefPtr<Attr> attrNode = findAttrNodeInList(attrNodeList, name); |
if (!attrNode) { |
attrNode = Attr::create(*this, name); |
treeScope().adoptIfNeeded(attrNode.get()); |
- attrNodeList->append(attrNode); |
+ attrNodeList.append(attrNode); |
} |
return attrNode.release(); |
} |
@@ -3096,7 +3096,7 @@ void Element::detachAllAttrNodesFromElement() |
for (unsigned i = 0; i < attributeCount(); ++i) { |
const Attribute* attribute = attributeItem(i); |
- if (RefPtr<Attr> attrNode = findAttrNodeInList(attrNodeList, attribute->name())) |
+ if (RefPtr<Attr> attrNode = findAttrNodeInList(*attrNodeList, attribute->name())) |
attrNode->detachFromElementWithValue(attribute->value()); |
} |