summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp b/src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp
index 44e1104..0c65121 100644
--- a/src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp
+++ b/src/3rdparty/webkit/WebCore/html/HTMLCollection.cpp
@@ -266,7 +266,7 @@ bool HTMLCollection::checkForNameMatch(Element* element, bool checkName, const A
HTMLElement* e = static_cast<HTMLElement*>(element);
if (!checkName)
- return e->getAttribute(idAttr) == name;
+ return e->getAttribute(e->idAttributeName()) == name;
// document.all returns only images, forms, applets, objects and embeds
// by name (though everything by id)
@@ -277,7 +277,7 @@ bool HTMLCollection::checkForNameMatch(Element* element, bool checkName, const A
e->hasLocalName(selectTag)))
return false;
- return e->getAttribute(nameAttr) == name && e->getAttribute(idAttr) != name;
+ return e->getAttribute(nameAttr) == name && e->getAttribute(e->idAttributeName()) != name;
}
Node* HTMLCollection::namedItem(const AtomicString& name) const
@@ -319,7 +319,7 @@ void HTMLCollection::updateNameCache() const
if (!element->isHTMLElement())
continue;
HTMLElement* e = static_cast<HTMLElement*>(element);
- const AtomicString& idAttrVal = e->getAttribute(idAttr);
+ const AtomicString& idAttrVal = e->getAttribute(e->idAttributeName());
const AtomicString& nameAttrVal = e->getAttribute(nameAttr);
if (!idAttrVal.isEmpty()) {
// add to id cache
@@ -358,7 +358,8 @@ void HTMLCollection::namedItems(const AtomicString& name, Vector<RefPtr<Node> >&
resetCollectionInfo();
updateNameCache();
-
+ m_info->checkConsistency();
+
Vector<Element*>* idResults = m_info->idCache.get(name.impl());
Vector<Element*>* nameResults = m_info->nameCache.get(name.impl());
@@ -373,6 +374,7 @@ void HTMLCollection::namedItems(const AtomicString& name, Vector<RefPtr<Node> >&
Node* HTMLCollection::nextNamedItem(const AtomicString& name) const
{
resetCollectionInfo();
+ m_info->checkConsistency();
for (Element* e = itemAfter(m_info->current); e; e = itemAfter(e)) {
if (checkForNameMatch(e, m_idsDone, name)) {