diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/html/HTMLAllCollection.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/html/HTMLAllCollection.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLAllCollection.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/WebCore/html/HTMLAllCollection.cpp b/Source/WebCore/html/HTMLAllCollection.cpp index dab0500fa..1812ab176 100644 --- a/Source/WebCore/html/HTMLAllCollection.cpp +++ b/Source/WebCore/html/HTMLAllCollection.cpp @@ -30,33 +30,36 @@ namespace WebCore { -Ref<HTMLAllCollection> HTMLAllCollection::create(Document& document, CollectionType type) +PassRef<HTMLAllCollection> HTMLAllCollection::create(Document& document, CollectionType type) { return adoptRef(*new HTMLAllCollection(document, type)); } -inline HTMLAllCollection::HTMLAllCollection(Document& document, CollectionType type) - : CachedHTMLCollection<HTMLAllCollection, CollectionTypeTraits<DocAll>::traversalType>(document, type) +HTMLAllCollection::HTMLAllCollection(Document& document, CollectionType type) + : HTMLCollection(document, type) { } -Element* HTMLAllCollection::namedItemWithIndex(const AtomicString& name, unsigned index) const +HTMLAllCollection::~HTMLAllCollection() { - updateNamedElementCache(); - const CollectionNamedElementCache& cache = namedItemCaches(); +} + +Node* HTMLAllCollection::namedItemWithIndex(const AtomicString& name, unsigned index) const +{ + updateNameCache(); - if (const Vector<Element*>* elements = cache.findElementsWithId(name)) { - if (index < elements->size()) - return elements->at(index); - index -= elements->size(); + if (Vector<Element*>* cache = idCache(name)) { + if (index < cache->size()) + return cache->at(index); + index -= cache->size(); } - if (const Vector<Element*>* elements = cache.findElementsWithName(name)) { - if (index < elements->size()) - return elements->at(index); + if (Vector<Element*>* cache = nameCache(name)) { + if (index < cache->size()) + return cache->at(index); } - return nullptr; + return 0; } } // namespace WebCore |