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, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 870 |
871 Node *ContainerNode::childNode(unsigned index) const | 871 Node *ContainerNode::childNode(unsigned index) const |
872 { | 872 { |
873 unsigned i; | 873 unsigned i; |
874 Node *n = firstChild(); | 874 Node *n = firstChild(); |
875 for (i = 0; n != 0 && i < index; i++) | 875 for (i = 0; n != 0 && i < index; i++) |
876 n = n->nextSibling(); | 876 n = n->nextSibling(); |
877 return n; | 877 return n; |
878 } | 878 } |
879 | 879 |
880 void ContainerNode::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
881 { | |
882 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | |
883 Node::reportMemoryUsage(memoryObjectInfo); | |
884 info.ignoreMember(m_firstChild); | |
885 info.ignoreMember(m_lastChild); | |
886 | |
887 // Report child nodes as direct members to make them look like a tree in the
snapshot. | |
888 NodeVector children; | |
889 getChildNodes(const_cast<ContainerNode*>(this), children); | |
890 for (size_t i = 0; i < children.size(); ++i) | |
891 info.addMember(children[i], "child"); | |
892 } | |
893 | |
894 static void dispatchChildInsertionEvents(Node* child) | 880 static void dispatchChildInsertionEvents(Node* child) |
895 { | 881 { |
896 if (child->isInShadowTree()) | 882 if (child->isInShadowTree()) |
897 return; | 883 return; |
898 | 884 |
899 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); | 885 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
900 | 886 |
901 RefPtr<Node> c = child; | 887 RefPtr<Node> c = child; |
902 RefPtr<Document> document = child->document(); | 888 RefPtr<Document> document = child->document(); |
903 | 889 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 return true; | 955 return true; |
970 | 956 |
971 if (node->isElementNode() && toElement(node)->shadow()) | 957 if (node->isElementNode() && toElement(node)->shadow()) |
972 return true; | 958 return true; |
973 | 959 |
974 return false; | 960 return false; |
975 } | 961 } |
976 #endif | 962 #endif |
977 | 963 |
978 } // namespace WebCore | 964 } // namespace WebCore |
OLD | NEW |