| Index: Source/core/html/HTMLCollection.cpp
|
| diff --git a/Source/core/html/HTMLCollection.cpp b/Source/core/html/HTMLCollection.cpp
|
| index b6e97846a2b1925cb0561d7564a40462ce690d61..db4da2fa5ef69b100bc39f86bc7703a96d6b0a56 100644
|
| --- a/Source/core/html/HTMLCollection.cpp
|
| +++ b/Source/core/html/HTMLCollection.cpp
|
| @@ -302,11 +302,11 @@ ALWAYS_INLINE Node* LiveNodeListBase::itemBefore(Node* previous) const
|
| }
|
|
|
| template <class NodeListType>
|
| -inline Element* firstMatchingElement(const NodeListType* nodeList, ContainerNode* root)
|
| +inline Element* firstMatchingElement(const NodeListType* nodeList, ContainerNode& root)
|
| {
|
| Element* element = ElementTraversal::firstWithin(root);
|
| while (element && !isMatchingElement(nodeList, element))
|
| - element = ElementTraversal::next(*element, root);
|
| + element = ElementTraversal::next(*element, &root);
|
| return element;
|
| }
|
|
|
| @@ -345,7 +345,7 @@ inline Node* LiveNodeListBase::traverseChildNodeListForwardToOffset(unsigned off
|
| }
|
|
|
| // FIXME: This should be in LiveNodeList
|
| -inline Element* LiveNodeListBase::traverseLiveNodeListFirstElement(ContainerNode* root) const
|
| +inline Element* LiveNodeListBase::traverseLiveNodeListFirstElement(ContainerNode& root) const
|
| {
|
| ASSERT(isNodeList(type()));
|
| ASSERT(type() != ChildNodeListType);
|
| @@ -435,9 +435,9 @@ Node* LiveNodeListBase::item(unsigned offset) const
|
| if (type() == ChildNodeListType)
|
| firstItem = root->firstChild();
|
| else if (isNodeList(type()))
|
| - firstItem = traverseLiveNodeListFirstElement(root);
|
| + firstItem = traverseLiveNodeListFirstElement(*root);
|
| else
|
| - firstItem = static_cast<const HTMLCollection*>(this)->traverseFirstElement(offsetInArray, root);
|
| + firstItem = static_cast<const HTMLCollection*>(this)->traverseFirstElement(offsetInArray, *root);
|
|
|
| if (!firstItem) {
|
| setLengthCache(0);
|
| @@ -525,11 +525,11 @@ bool HTMLCollection::checkForNameMatch(Element* element, bool checkName, const A
|
| return e->getNameAttribute() == name && e->getIdAttribute() != name;
|
| }
|
|
|
| -inline Element* firstMatchingChildElement(const HTMLCollection* nodeList, ContainerNode* root)
|
| +inline Element* firstMatchingChildElement(const HTMLCollection* nodeList, ContainerNode& root)
|
| {
|
| Element* element = ElementTraversal::firstWithin(root);
|
| while (element && !isMatchingElement(nodeList, element))
|
| - element = ElementTraversal::nextSkippingChildren(element, root);
|
| + element = ElementTraversal::nextSkippingChildren(element, &root);
|
| return element;
|
| }
|
|
|
| @@ -541,7 +541,7 @@ inline Element* nextMatchingChildElement(const HTMLCollection* nodeList, Element
|
| return current;
|
| }
|
|
|
| -inline Element* HTMLCollection::traverseFirstElement(unsigned& offsetInArray, ContainerNode* root) const
|
| +inline Element* HTMLCollection::traverseFirstElement(unsigned& offsetInArray, ContainerNode& root) const
|
| {
|
| if (overridesItemAfter())
|
| return virtualItemAfter(offsetInArray, 0);
|
| @@ -598,7 +598,7 @@ Node* HTMLCollection::namedItem(const AtomicString& name) const
|
|
|
| unsigned arrayOffset = 0;
|
| unsigned i = 0;
|
| - for (Element* element = traverseFirstElement(arrayOffset, root); element; element = traverseNextElement(arrayOffset, *element, root)) {
|
| + for (Element* element = traverseFirstElement(arrayOffset, *root); element; element = traverseNextElement(arrayOffset, *element, root)) {
|
| if (checkForNameMatch(element, /* checkName */ false, name)) {
|
| setItemCache(element, i, arrayOffset);
|
| return element;
|
| @@ -607,7 +607,7 @@ Node* HTMLCollection::namedItem(const AtomicString& name) const
|
| }
|
|
|
| i = 0;
|
| - for (Element* element = traverseFirstElement(arrayOffset, root); element; element = traverseNextElement(arrayOffset, *element, root)) {
|
| + for (Element* element = traverseFirstElement(arrayOffset, *root); element; element = traverseNextElement(arrayOffset, *element, root)) {
|
| if (checkForNameMatch(element, /* checkName */ true, name)) {
|
| setItemCache(element, i, arrayOffset);
|
| return element;
|
| @@ -628,7 +628,7 @@ void HTMLCollection::updateNameCache() const
|
| return;
|
|
|
| unsigned arrayOffset = 0;
|
| - for (Element* element = traverseFirstElement(arrayOffset, root); element; element = traverseNextElement(arrayOffset, *element, root)) {
|
| + for (Element* element = traverseFirstElement(arrayOffset, *root); element; element = traverseNextElement(arrayOffset, *element, root)) {
|
| const AtomicString& idAttrVal = element->getIdAttribute();
|
| if (!idAttrVal.isEmpty())
|
| appendIdCache(idAttrVal, element);
|
|
|