summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLCollection.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-23 15:08:59 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-23 15:09:20 +0100
commit061d58bc0fa016cfeed744fd3e4663460635d69b (patch)
treead9b8b032c803e1c9054c23fa1b7a0f1976bf98f /Source/WebCore/html/HTMLCollection.cpp
parent470286ecfe79d59df14944e5b5d34630fc739391 (diff)
downloadqtwebkit-061d58bc0fa016cfeed744fd3e4663460635d69b.tar.gz
Imported WebKit commit 8eb048315f36fa33731f28694630fe4a3c2cbc99 (http://svn.webkit.org/repository/webkit/trunk@135602)
New snapshot that fixes various bugs Change-Id: Icb6ce541a26a9f500d087821ce4b83a8d8a5474a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/html/HTMLCollection.cpp')
-rw-r--r--Source/WebCore/html/HTMLCollection.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp
index ac9e605e5..da2a4bfca 100644
--- a/Source/WebCore/html/HTMLCollection.cpp
+++ b/Source/WebCore/html/HTMLCollection.cpp
@@ -176,7 +176,7 @@ static NodeListInvalidationType invalidationTypeExcludingIdAndNameAttributes(Col
HTMLCollection::HTMLCollection(Node* ownerNode, CollectionType type, ItemAfterOverrideType itemAfterOverrideType)
- : HTMLCollectionCacheBase(ownerNode, rootTypeFromCollectionType(type), invalidationTypeExcludingIdAndNameAttributes(type),
+ : DynamicNodeListCacheBase(ownerNode, rootTypeFromCollectionType(type), invalidationTypeExcludingIdAndNameAttributes(type),
WebCore::shouldOnlyIncludeDirectChildren(type), type, itemAfterOverrideType)
{
document()->registerNodeListCache(this);
@@ -364,16 +364,11 @@ ALWAYS_INLINE void DynamicNodeListCacheBase::setItemCache(Node* item, unsigned o
setItemCache(item, offset);
if (overridesItemAfter()) {
ASSERT(item->isElementNode());
- static_cast<const HTMLCollectionCacheBase*>(this)->m_cachedElementsArrayOffset = elementsArrayOffset;
+ static_cast<const HTMLCollection*>(this)->m_cachedElementsArrayOffset = elementsArrayOffset;
} else
ASSERT(!elementsArrayOffset);
}
-ALWAYS_INLINE unsigned DynamicNodeListCacheBase::cachedElementsArrayOffset() const
-{
- return overridesItemAfter() ? static_cast<const HTMLCollectionCacheBase*>(this)->m_cachedElementsArrayOffset : 0;
-}
-
unsigned DynamicNodeListCacheBase::lengthCommon() const
{
if (isLengthCacheValid())
@@ -441,7 +436,7 @@ Node* DynamicNodeListCacheBase::itemBeforeOrAfterCachedItem(unsigned offset) con
return 0;
}
- unsigned offsetInArray = cachedElementsArrayOffset();
+ unsigned offsetInArray = overridesItemAfter() ? static_cast<const HTMLCollection*>(this)->m_cachedElementsArrayOffset : 0;
while ((currentItem = itemAfter(offsetInArray, currentItem))) {
currentOffset++;
if (currentOffset == offset) {
@@ -584,7 +579,7 @@ PassRefPtr<NodeList> HTMLCollection::tags(const String& name)
return ownerNode()->getElementsByTagName(name);
}
-void HTMLCollectionCacheBase::append(NodeCacheMap& map, const AtomicString& key, Element* element)
+void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, Element* element)
{
OwnPtr<Vector<Element*> >& vector = map.add(key.impl(), nullptr).iterator->value;
if (!vector)