OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> | 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 { | 162 { |
163 return adoptPtr(new NodeListsNodeData); | 163 return adoptPtr(new NodeListsNodeData); |
164 } | 164 } |
165 | 165 |
166 void invalidateCaches(const QualifiedName* attrName = 0); | 166 void invalidateCaches(const QualifiedName* attrName = 0); |
167 bool isEmpty() const | 167 bool isEmpty() const |
168 { | 168 { |
169 return m_atomicNameCaches.isEmpty() && m_nameCaches.isEmpty() && m_tagNo
deListCacheNS.isEmpty(); | 169 return m_atomicNameCaches.isEmpty() && m_nameCaches.isEmpty() && m_tagNo
deListCacheNS.isEmpty(); |
170 } | 170 } |
171 | 171 |
172 void adoptTreeScope(Document* oldDocument, Document* newDocument) | 172 void adoptTreeScope() |
| 173 { |
| 174 invalidateCaches(); |
| 175 } |
| 176 |
| 177 void adoptDocument(Document* oldDocument, Document* newDocument) |
173 { | 178 { |
174 invalidateCaches(); | 179 invalidateCaches(); |
175 | 180 |
176 if (oldDocument != newDocument) { | 181 if (oldDocument != newDocument) { |
177 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_at
omicNameCaches.end(); | 182 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_at
omicNameCaches.end(); |
178 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCac
hes.begin(); it != atomicNameCacheEnd; ++it) { | 183 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCac
hes.begin(); it != atomicNameCacheEnd; ++it) { |
179 LiveNodeListBase* list = it->value; | 184 LiveNodeListBase* list = it->value; |
180 oldDocument->unregisterNodeList(list); | 185 oldDocument->unregisterNodeList(list); |
181 newDocument->registerNodeList(list); | 186 newDocument->registerNodeList(list); |
182 } | 187 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 #endif | 404 #endif |
400 | 405 |
401 #if ENABLE(MICRODATA) | 406 #if ENABLE(MICRODATA) |
402 mutable OwnPtr<NodeMicroDataTokenLists> m_microDataTokenLists; | 407 mutable OwnPtr<NodeMicroDataTokenLists> m_microDataTokenLists; |
403 #endif | 408 #endif |
404 }; | 409 }; |
405 | 410 |
406 } // namespace WebCore | 411 } // namespace WebCore |
407 | 412 |
408 #endif // NodeRareData_h | 413 #endif // NodeRareData_h |
OLD | NEW |