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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 enum NodeListRootType { | 37 enum NodeListRootType { |
38 NodeListIsRootedAtNode, | 38 NodeListIsRootedAtNode, |
39 NodeListIsRootedAtDocument | 39 NodeListIsRootedAtDocument |
40 }; | 40 }; |
41 | 41 |
42 class LiveNodeListBase { | 42 class LiveNodeListBase { |
43 public: | 43 public: |
44 LiveNodeListBase(ContainerNode* ownerNode, NodeListRootType rootType, NodeLi
stInvalidationType invalidationType, | 44 LiveNodeListBase(ContainerNode& ownerNode, NodeListRootType rootType, NodeLi
stInvalidationType invalidationType, |
45 CollectionType collectionType) | 45 CollectionType collectionType) |
46 : m_ownerNode(ownerNode) | 46 : m_ownerNode(ownerNode) |
47 , m_rootType(rootType) | 47 , m_rootType(rootType) |
48 , m_invalidationType(invalidationType) | 48 , m_invalidationType(invalidationType) |
49 , m_collectionType(collectionType) | 49 , m_collectionType(collectionType) |
50 { | 50 { |
51 ASSERT(m_ownerNode); | |
52 ASSERT(m_rootType == static_cast<unsigned>(rootType)); | 51 ASSERT(m_rootType == static_cast<unsigned>(rootType)); |
53 ASSERT(m_invalidationType == static_cast<unsigned>(invalidationType)); | 52 ASSERT(m_invalidationType == static_cast<unsigned>(invalidationType)); |
54 ASSERT(m_collectionType == static_cast<unsigned>(collectionType)); | 53 ASSERT(m_collectionType == static_cast<unsigned>(collectionType)); |
55 | 54 |
56 document().registerNodeList(this); | 55 document().registerNodeList(this); |
57 } | 56 } |
58 | 57 |
59 virtual ~LiveNodeListBase() | 58 virtual ~LiveNodeListBase() |
60 { | 59 { |
61 document().unregisterNodeList(this); | 60 document().unregisterNodeList(this); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 while ((next = nextMatchingElement(nodeList, *next, root))) { | 200 while ((next = nextMatchingElement(nodeList, *next, root))) { |
202 if (++currentOffset == offset) | 201 if (++currentOffset == offset) |
203 return next; | 202 return next; |
204 } | 203 } |
205 return 0; | 204 return 0; |
206 } | 205 } |
207 | 206 |
208 } // namespace WebCore | 207 } // namespace WebCore |
209 | 208 |
210 #endif // LiveNodeListBase_h | 209 #endif // LiveNodeListBase_h |
OLD | NEW |