| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 dispatchChildRemovalEvents(child); | 395 dispatchChildRemovalEvents(child); |
| 396 child->document().nodeWillBeRemoved(child); // e.g. mutation event listener
can create a new range. | 396 child->document().nodeWillBeRemoved(child); // e.g. mutation event listener
can create a new range. |
| 397 ChildFrameDisconnector(child).disconnect(); | 397 ChildFrameDisconnector(child).disconnect(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 static void willRemoveChildren(ContainerNode* container) | 400 static void willRemoveChildren(ContainerNode* container) |
| 401 { | 401 { |
| 402 NodeVector children; | 402 NodeVector children; |
| 403 getChildNodes(container, children); | 403 getChildNodes(container, children); |
| 404 | 404 |
| 405 container->document().nodeChildrenWillBeRemoved(container); | |
| 406 | |
| 407 ChildListMutationScope mutation(container); | 405 ChildListMutationScope mutation(container); |
| 408 for (NodeVector::const_iterator it = children.begin(); it != children.end();
it++) { | 406 for (NodeVector::const_iterator it = children.begin(); it != children.end();
it++) { |
| 409 Node* child = it->get(); | 407 Node* child = it->get(); |
| 410 mutation.willRemoveChild(child); | 408 mutation.willRemoveChild(child); |
| 411 child->notifyMutationObserversNodeWillDetach(); | 409 child->notifyMutationObserversNodeWillDetach(); |
| 412 | 410 |
| 413 // fire removed from document mutation events. | 411 // fire removed from document mutation events. |
| 414 dispatchChildRemovalEvents(child); | 412 dispatchChildRemovalEvents(child); |
| 415 } | 413 } |
| 416 | 414 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 // or widget updates (e.g., for <embed>). | 537 // or widget updates (e.g., for <embed>). |
| 540 SubframeLoadingDisabler disabler(this); | 538 SubframeLoadingDisabler disabler(this); |
| 541 | 539 |
| 542 // Exclude this node when looking for removed focusedElement since only | 540 // Exclude this node when looking for removed focusedElement since only |
| 543 // children will be removed. | 541 // children will be removed. |
| 544 // This must be later than willRemoveChildren, which might change focus | 542 // This must be later than willRemoveChildren, which might change focus |
| 545 // state of a child. | 543 // state of a child. |
| 546 document().removeFocusedElementOfSubtree(this, true); | 544 document().removeFocusedElementOfSubtree(this, true); |
| 547 } | 545 } |
| 548 | 546 |
| 547 document().nodeChildrenWillBeRemoved(this); |
| 548 |
| 549 NodeVector removedChildren; | 549 NodeVector removedChildren; |
| 550 { | 550 { |
| 551 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 551 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 552 { | 552 { |
| 553 NoEventDispatchAssertion assertNoEventDispatch; | 553 NoEventDispatchAssertion assertNoEventDispatch; |
| 554 removedChildren.reserveInitialCapacity(childNodeCount()); | 554 removedChildren.reserveInitialCapacity(childNodeCount()); |
| 555 while (m_firstChild) { | 555 while (m_firstChild) { |
| 556 removedChildren.append(m_firstChild); | 556 removedChildren.append(m_firstChild); |
| 557 removeBetween(0, m_firstChild->nextSibling(), m_firstChild); | 557 removeBetween(0, m_firstChild->nextSibling(), m_firstChild); |
| 558 } | 558 } |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 return true; | 983 return true; |
| 984 | 984 |
| 985 if (node->isElementNode() && toElement(node)->shadow()) | 985 if (node->isElementNode() && toElement(node)->shadow()) |
| 986 return true; | 986 return true; |
| 987 | 987 |
| 988 return false; | 988 return false; |
| 989 } | 989 } |
| 990 #endif | 990 #endif |
| 991 | 991 |
| 992 } // namespace WebCore | 992 } // namespace WebCore |
| OLD | NEW |