| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2  * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 
| 3  *           (C) 1999 Antti Koivisto (koivisto@kde.org) | 3  *           (C) 1999 Antti Koivisto (koivisto@kde.org) | 
| 4  *           (C) 2001 Dirk Mueller (mueller@kde.org) | 4  *           (C) 2001 Dirk Mueller (mueller@kde.org) | 
| 5  * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 5  * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 
| 6  * | 6  * | 
| 7  * This library is free software; you can redistribute it and/or | 7  * This library is free software; you can redistribute it and/or | 
| 8  * modify it under the terms of the GNU Library General Public | 8  * modify it under the terms of the GNU Library General Public | 
| 9  * License as published by the Free Software Foundation; either | 9  * License as published by the Free Software Foundation; either | 
| 10  * version 2 of the License, or (at your option) any later version. | 10  * version 2 of the License, or (at your option) any later version. | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 34 namespace blink { | 34 namespace blink { | 
| 35 | 35 | 
| 36 class Element; | 36 class Element; | 
| 37 | 37 | 
| 38 class LiveNodeList : public NodeList, public LiveNodeListBase { | 38 class LiveNodeList : public NodeList, public LiveNodeListBase { | 
| 39     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LiveNodeList); | 39     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LiveNodeList); | 
| 40 public: | 40 public: | 
| 41     LiveNodeList(ContainerNode& ownerNode, CollectionType collectionType, NodeLi
    stInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRoote
    dAtNode) | 41     LiveNodeList(ContainerNode& ownerNode, CollectionType collectionType, NodeLi
    stInvalidationType invalidationType, NodeListRootType rootType = NodeListIsRoote
    dAtNode) | 
| 42         : LiveNodeListBase(ownerNode, rootType, invalidationType, collectionType
    ) { } | 42         : LiveNodeListBase(ownerNode, rootType, invalidationType, collectionType
    ) { } | 
| 43 | 43 | 
| 44     virtual unsigned length() const override final; | 44     unsigned length() const final; | 
| 45     virtual Element* item(unsigned offset) const override final; | 45     Element* item(unsigned offset) const final; | 
| 46     virtual bool elementMatches(const Element&) const = 0; | 46     virtual bool elementMatches(const Element&) const = 0; | 
| 47 | 47 | 
| 48     virtual void invalidateCache(Document* oldDocument = 0) const override final
    ; | 48     void invalidateCache(Document* oldDocument = 0) const final; | 
| 49     void invalidateCacheForAttribute(const QualifiedName*) const; | 49     void invalidateCacheForAttribute(const QualifiedName*) const; | 
| 50 | 50 | 
| 51     // Collection IndexCache API. | 51     // Collection IndexCache API. | 
| 52     bool canTraverseBackward() const { return true; } | 52     bool canTraverseBackward() const { return true; } | 
| 53     Element* traverseToFirst() const; | 53     Element* traverseToFirst() const; | 
| 54     Element* traverseToLast() const; | 54     Element* traverseToLast() const; | 
| 55     Element* traverseForwardToOffset(unsigned offset, Element& currentNode, unsi
    gned& currentOffset) const; | 55     Element* traverseForwardToOffset(unsigned offset, Element& currentNode, unsi
    gned& currentOffset) const; | 
| 56     Element* traverseBackwardToOffset(unsigned offset, Element& currentNode, uns
    igned& currentOffset) const; | 56     Element* traverseBackwardToOffset(unsigned offset, Element& currentNode, uns
    igned& currentOffset) const; | 
| 57 | 57 | 
| 58     DECLARE_VIRTUAL_TRACE(); | 58     DECLARE_VIRTUAL_TRACE(); | 
| 59 | 59 | 
| 60 private: | 60 private: | 
| 61     virtual Node* virtualOwnerNode() const override final; | 61     Node* virtualOwnerNode() const final; | 
| 62 | 62 | 
| 63     mutable CollectionItemsCache<LiveNodeList, Element> m_collectionItemsCache; | 63     mutable CollectionItemsCache<LiveNodeList, Element> m_collectionItemsCache; | 
| 64 }; | 64 }; | 
| 65 | 65 | 
| 66 DEFINE_TYPE_CASTS(LiveNodeList, LiveNodeListBase, list, isLiveNodeListType(list-
    >type()), isLiveNodeListType(list.type())); | 66 DEFINE_TYPE_CASTS(LiveNodeList, LiveNodeListBase, list, isLiveNodeListType(list-
    >type()), isLiveNodeListType(list.type())); | 
| 67 | 67 | 
| 68 inline void LiveNodeList::invalidateCacheForAttribute(const QualifiedName* attrN
    ame) const | 68 inline void LiveNodeList::invalidateCacheForAttribute(const QualifiedName* attrN
    ame) const | 
| 69 { | 69 { | 
| 70     if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), *
    attrName)) | 70     if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), *
    attrName)) | 
| 71         invalidateCache(); | 71         invalidateCache(); | 
| 72 } | 72 } | 
| 73 | 73 | 
| 74 } // namespace blink | 74 } // namespace blink | 
| 75 | 75 | 
| 76 #endif // LiveNodeList_h | 76 #endif // LiveNodeList_h | 
| OLD | NEW | 
|---|