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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Does this one more time because removeChild() fires a MutationEvent. | 274 // Does this one more time because removeChild() fires a MutationEvent. |
275 checkReplaceChild(newChild.get(), oldChild, ec); | 275 checkReplaceChild(newChild.get(), oldChild, ec); |
276 if (ec) | 276 if (ec) |
277 return false; | 277 return false; |
278 | 278 |
279 NodeVector targets; | 279 NodeVector targets; |
280 collectChildrenAndRemoveFromOldParent(newChild.get(), targets, ec); | 280 collectChildrenAndRemoveFromOldParent(newChild.get(), targets, ec); |
281 if (ec) | 281 if (ec) |
282 return false; | 282 return false; |
283 | 283 |
| 284 // Does this yet another check because collectChildrenAndRemoveFromOldParent
() fires a MutationEvent. |
| 285 checkReplaceChild(newChild.get(), oldChild, ec); |
| 286 if (ec) |
| 287 return false; |
| 288 |
284 InspectorInstrumentation::willInsertDOMNode(document(), this); | 289 InspectorInstrumentation::willInsertDOMNode(document(), this); |
285 | 290 |
286 // Add the new child(ren) | 291 // Add the new child(ren) |
287 for (NodeVector::const_iterator it = targets.begin(); it != targets.end(); +
+it) { | 292 for (NodeVector::const_iterator it = targets.begin(); it != targets.end(); +
+it) { |
288 Node* child = it->get(); | 293 Node* child = it->get(); |
289 | 294 |
290 // Due to arbitrary code running in response to a DOM mutation event it'
s | 295 // Due to arbitrary code running in response to a DOM mutation event it'
s |
291 // possible that "next" is no longer a child of "this". | 296 // possible that "next" is no longer a child of "this". |
292 // It's also possible that "child" has been inserted elsewhere. | 297 // It's also possible that "child" has been inserted elsewhere. |
293 // In either of those cases, we'll just stop. | 298 // In either of those cases, we'll just stop. |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 if (shouldLazyAttach) | 987 if (shouldLazyAttach) |
983 child->lazyAttach(); | 988 child->lazyAttach(); |
984 else | 989 else |
985 child->attach(); | 990 child->attach(); |
986 } | 991 } |
987 | 992 |
988 dispatchChildInsertionEvents(child); | 993 dispatchChildInsertionEvents(child); |
989 } | 994 } |
990 | 995 |
991 } // namespace WebCore | 996 } // namespace WebCore |
OLD | NEW |