OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 128 } |
129 }; | 129 }; |
130 | 130 |
131 template<class GenericNode, class GenericNodeContainer> | 131 template<class GenericNode, class GenericNodeContainer> |
132 struct NodeRemovalDispatcher<GenericNode, GenericNodeContainer, true> { | 132 struct NodeRemovalDispatcher<GenericNode, GenericNodeContainer, true> { |
133 static void dispatch(GenericNode* node, GenericNodeContainer* container) | 133 static void dispatch(GenericNode* node, GenericNodeContainer* container) |
134 { | 134 { |
135 // Clean up any TreeScope to a removed tree. | 135 // Clean up any TreeScope to a removed tree. |
136 if (Document* containerDocument = container->ownerDocument()) | 136 if (Document* containerDocument = container->ownerDocument()) |
137 containerDocument->adoptIfNeeded(node); | 137 containerDocument->adoptIfNeeded(node); |
138 ChildNodeRemovalNotifier(container).notify(node); | 138 if (node->inDocument()) |
| 139 ChildNodeRemovalNotifier(container).notify(node); |
139 } | 140 } |
140 }; | 141 }; |
141 | 142 |
142 template<class GenericNode> | 143 template<class GenericNode> |
143 struct ShouldDispatchRemovalNotification { | 144 struct ShouldDispatchRemovalNotification { |
144 static const bool value = false; | 145 static const bool value = false; |
145 }; | 146 }; |
146 | 147 |
147 template<> | 148 template<> |
148 struct ShouldDispatchRemovalNotification<Node> { | 149 struct ShouldDispatchRemovalNotification<Node> { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 { | 261 { |
261 if (node->inDocument()) | 262 if (node->inDocument()) |
262 notifyNodeRemovedFromDocument(node); | 263 notifyNodeRemovedFromDocument(node); |
263 else if (node->isContainerNode()) | 264 else if (node->isContainerNode()) |
264 notifyNodeRemovedFromTree(toContainerNode(node)); | 265 notifyNodeRemovedFromTree(toContainerNode(node)); |
265 } | 266 } |
266 | 267 |
267 } // namespace WebCore | 268 } // namespace WebCore |
268 | 269 |
269 #endif // ContainerNodeAlgorithms_h | 270 #endif // ContainerNodeAlgorithms_h |
OLD | NEW |