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 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 document().unregisterNodeList(this); | 60 document().unregisterNodeList(this); |
61 } | 61 } |
62 | 62 |
63 ContainerNode& rootNode() const; | 63 ContainerNode& rootNode() const; |
64 | 64 |
65 void didMoveToDocument(Document& oldDocument, Document& newDocument); | 65 void didMoveToDocument(Document& oldDocument, Document& newDocument); |
66 ALWAYS_INLINE bool hasIdNameCache() const { return !isLiveNodeListType(type(
)); } | 66 ALWAYS_INLINE bool hasIdNameCache() const { return !isLiveNodeListType(type(
)); } |
67 ALWAYS_INLINE bool isRootedAtDocument() const { return m_rootType == NodeLis
tIsRootedAtDocument; } | 67 ALWAYS_INLINE bool isRootedAtDocument() const { return m_rootType == NodeLis
tIsRootedAtDocument; } |
68 ALWAYS_INLINE NodeListInvalidationType invalidationType() const { return sta
tic_cast<NodeListInvalidationType>(m_invalidationType); } | 68 ALWAYS_INLINE NodeListInvalidationType invalidationType() const { return sta
tic_cast<NodeListInvalidationType>(m_invalidationType); } |
69 ALWAYS_INLINE CollectionType type() const { return static_cast<CollectionTyp
e>(m_collectionType); } | 69 ALWAYS_INLINE CollectionType type() const { return static_cast<CollectionTyp
e>(m_collectionType); } |
70 ContainerNode* ownerNode() const { return m_ownerNode.get(); } | 70 ContainerNode& ownerNode() const { return *m_ownerNode; } |
71 ALWAYS_INLINE void invalidateCache(const QualifiedName* attrName) const | 71 ALWAYS_INLINE void invalidateCache(const QualifiedName* attrName) const |
72 { | 72 { |
73 if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(
), *attrName)) | 73 if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(
), *attrName)) |
74 invalidateCache(); | 74 invalidateCache(); |
75 else if (hasIdNameCache() && (*attrName == HTMLNames::idAttr || *attrNam
e == HTMLNames::nameAttr)) | 75 else if (hasIdNameCache() && (*attrName == HTMLNames::idAttr || *attrNam
e == HTMLNames::nameAttr)) |
76 invalidateIdNameCacheMaps(); | 76 invalidateIdNameCacheMaps(); |
77 } | 77 } |
78 virtual void invalidateCache(Document* oldDocument = 0) const = 0; | 78 virtual void invalidateCache(Document* oldDocument = 0) const = 0; |
79 | 79 |
80 static bool shouldInvalidateTypeOnAttributeChange(NodeListInvalidationType,
const QualifiedName&); | 80 static bool shouldInvalidateTypeOnAttributeChange(NodeListInvalidationType,
const QualifiedName&); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 current = previousNode(collection.rootNode(), *previous, collection.shou
ldOnlyIncludeDirectChildren()); | 163 current = previousNode(collection.rootNode(), *previous, collection.shou
ldOnlyIncludeDirectChildren()); |
164 else | 164 else |
165 current = lastNode(collection.rootNode(), collection.shouldOnlyIncludeDi
rectChildren()); | 165 current = lastNode(collection.rootNode(), collection.shouldOnlyIncludeDi
rectChildren()); |
166 | 166 |
167 return iterateForPreviousNode(collection, current); | 167 return iterateForPreviousNode(collection, current); |
168 } | 168 } |
169 | 169 |
170 } // namespace WebCore | 170 } // namespace WebCore |
171 | 171 |
172 #endif // LiveNodeListBase_h | 172 #endif // LiveNodeListBase_h |
OLD | NEW |