| 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, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 if (getFlag(NeedsShadowTreeWalkerFlag)) | 265 if (getFlag(NeedsShadowTreeWalkerFlag)) |
| 266 return true; | 266 return true; |
| 267 Handle<ContainerNode> parent = parentOrShadowHostNode(); | 267 Handle<ContainerNode> parent = parentOrShadowHostNode(); |
| 268 return parent && parent->getFlag(NeedsShadowTreeWalkerFlag); | 268 return parent && parent->getFlag(NeedsShadowTreeWalkerFlag); |
| 269 } | 269 } |
| 270 | 270 |
| 271 // This constant controls how much buffer is initially allocated | 271 // This constant controls how much buffer is initially allocated |
| 272 // for a Node Vector that is used to store child Nodes of a given Node. | 272 // for a Node Vector that is used to store child Nodes of a given Node. |
| 273 // FIXME: Optimize the value. | 273 // FIXME: Optimize the value. |
| 274 const int initialNodeVectorSize = 11; | 274 const int initialNodeVectorSize = 11; |
| 275 typedef Vector<Member<Node>, initialNodeVectorSize> NodeVector; | 275 typedef CollectionRoot<Vector<Member<Node>, initialNodeVectorSize> > NodeVector; |
| 276 | 276 |
| 277 inline void getChildNodes(Node* node, NodeVector& nodes) | 277 inline void getChildNodes(Node* node, NodeVector& nodes) |
| 278 { | 278 { |
| 279 ASSERT(!nodes.size()); | 279 ASSERT(!nodes->size()); |
| 280 for (Handle<Node> child = node->firstChild(); child; child = child->nextSibl
ing()) { | 280 for (Handle<Node> child = node->firstChild(); child; child = child->nextSibl
ing()) { |
| 281 NoHandleScope scope; | 281 NoHandleScope scope; |
| 282 nodes.append(child); | 282 nodes->append(child); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 | 286 |
| 287 class ChildNodesLazySnapshot { | 287 class ChildNodesLazySnapshot { |
| 288 WTF_MAKE_NONCOPYABLE(ChildNodesLazySnapshot); | 288 WTF_MAKE_NONCOPYABLE(ChildNodesLazySnapshot); |
| 289 WTF_MAKE_FAST_ALLOCATED; | 289 WTF_MAKE_FAST_ALLOCATED; |
| 290 DISALLOW_ALLOCATION() | 290 DISALLOW_ALLOCATION() |
| 291 public: | 291 public: |
| 292 explicit ChildNodesLazySnapshot(const Handle<Node>& parentNode) | 292 explicit ChildNodesLazySnapshot(const Handle<Node>& parentNode) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 m_node->resumePostAttachCallbacks(); | 366 m_node->resumePostAttachCallbacks(); |
| 367 } | 367 } |
| 368 | 368 |
| 369 private: | 369 private: |
| 370 Handle<ContainerNode> m_node; | 370 Handle<ContainerNode> m_node; |
| 371 }; | 371 }; |
| 372 | 372 |
| 373 } // namespace WebCore | 373 } // namespace WebCore |
| 374 | 374 |
| 375 #endif // ContainerNode_h | 375 #endif // ContainerNode_h |
| OLD | NEW |