diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/html/HTMLCollection.cpp | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/html/HTMLCollection.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLCollection.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp index d11fee121..1b9cc31f7 100644 --- a/Source/WebCore/html/HTMLCollection.cpp +++ b/Source/WebCore/html/HTMLCollection.cpp @@ -100,6 +100,9 @@ void HTMLCollection::invalidateCacheIfNeeded() const inline bool HTMLCollection::isAcceptableElement(Element* element) const { + if (!element->isHTMLElement() && !(m_type == DocAll || m_type == NodeChildren)) + return false; + switch (m_type) { case DocImages: return element->hasLocalName(imgTag); @@ -146,7 +149,7 @@ inline bool HTMLCollection::isAcceptableElement(Element* element) const return true; #if ENABLE(MICRODATA) case ItemProperties: - return element->isHTMLElement() && element->fastHasAttribute(itempropAttr); + return element->fastHasAttribute(itempropAttr); #endif case DocumentNamedItems: case OtherCollection: @@ -359,7 +362,7 @@ PassRefPtr<NodeList> HTMLCollection::tags(const String& name) void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element* element) { - OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).first->second; + OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->second; if (!vector) vector = adoptPtr(new Vector<Element*>); vector->append(element); |