| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/ElementTraversal.h" | 29 #include "core/dom/ElementTraversal.h" |
| 30 #include "core/dom/ExceptionCode.h" | 30 #include "core/dom/ExceptionCode.h" |
| 31 #include "core/dom/FullscreenElementStack.h" | 31 #include "core/dom/FullscreenElementStack.h" |
| 32 #include "core/dom/NodeChildRemovalTracker.h" | 32 #include "core/dom/NodeChildRemovalTracker.h" |
| 33 #include "core/dom/NodeRareData.h" | 33 #include "core/dom/NodeRareData.h" |
| 34 #include "core/dom/NodeRenderStyle.h" | 34 #include "core/dom/NodeRenderStyle.h" |
| 35 #include "core/dom/NodeTraversal.h" | 35 #include "core/dom/NodeTraversal.h" |
| 36 #include "core/events/MutationEvent.h" | 36 #include "core/events/MutationEvent.h" |
| 37 #include "core/events/ThreadLocalEventNames.h" | 37 #include "core/events/ThreadLocalEventNames.h" |
| 38 #include "core/html/HTMLCollection.h" | 38 #include "core/html/HTMLCollection.h" |
| 39 #include "core/html/HTMLFrameOwnerElement.h" |
| 39 #include "core/rendering/InlineTextBox.h" | 40 #include "core/rendering/InlineTextBox.h" |
| 40 #include "core/rendering/RenderText.h" | 41 #include "core/rendering/RenderText.h" |
| 41 #include "core/rendering/RenderTheme.h" | 42 #include "core/rendering/RenderTheme.h" |
| 42 #include "core/rendering/RenderView.h" | 43 #include "core/rendering/RenderView.h" |
| 43 #include "core/rendering/RenderWidget.h" | 44 #include "wtf/Vector.h" |
| 44 | 45 |
| 45 using namespace std; | 46 using namespace std; |
| 46 | 47 |
| 47 namespace WebCore { | 48 namespace WebCore { |
| 48 | 49 |
| 49 static void dispatchChildInsertionEvents(Node&); | 50 static void dispatchChildInsertionEvents(Node&); |
| 50 static void dispatchChildRemovalEvents(Node&); | 51 static void dispatchChildRemovalEvents(Node&); |
| 51 | 52 |
| 52 ChildNodesLazySnapshot* ChildNodesLazySnapshot::latestSnapshot = 0; | 53 ChildNodesLazySnapshot* ChildNodesLazySnapshot::latestSnapshot = 0; |
| 53 | 54 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 429 |
| 429 willRemoveChild(*child); | 430 willRemoveChild(*child); |
| 430 | 431 |
| 431 // Mutation events might have moved this child into a different parent. | 432 // Mutation events might have moved this child into a different parent. |
| 432 if (child->parentNode() != this) { | 433 if (child->parentNode() != this) { |
| 433 exceptionState.throwDOMException(NotFoundError, "The node to be removed
is no longer a child of this node. Perhaps it was moved in response to a mutatio
n?"); | 434 exceptionState.throwDOMException(NotFoundError, "The node to be removed
is no longer a child of this node. Perhaps it was moved in response to a mutatio
n?"); |
| 434 return; | 435 return; |
| 435 } | 436 } |
| 436 | 437 |
| 437 { | 438 { |
| 438 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 439 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 439 | 440 |
| 440 Node* prev = child->previousSibling(); | 441 Node* prev = child->previousSibling(); |
| 441 Node* next = child->nextSibling(); | 442 Node* next = child->nextSibling(); |
| 442 removeBetween(prev, next, *child); | 443 removeBetween(prev, next, *child); |
| 443 childrenChanged(false, prev, next, -1); | 444 childrenChanged(false, prev, next, -1); |
| 444 ChildNodeRemovalNotifier(*this).notify(*child); | 445 ChildNodeRemovalNotifier(*this).notify(*child); |
| 445 } | 446 } |
| 446 dispatchSubtreeModifiedEvent(); | 447 dispatchSubtreeModifiedEvent(); |
| 447 } | 448 } |
| 448 | 449 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 // state of a child. | 519 // state of a child. |
| 519 document().removeFocusedElementOfSubtree(this, true); | 520 document().removeFocusedElementOfSubtree(this, true); |
| 520 | 521 |
| 521 // Removing a node from a selection can cause widget updates. | 522 // Removing a node from a selection can cause widget updates. |
| 522 document().nodeChildrenWillBeRemoved(this); | 523 document().nodeChildrenWillBeRemoved(this); |
| 523 } | 524 } |
| 524 | 525 |
| 525 | 526 |
| 526 NodeVector removedChildren; | 527 NodeVector removedChildren; |
| 527 { | 528 { |
| 528 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 529 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 529 { | 530 { |
| 530 NoEventDispatchAssertion assertNoEventDispatch; | 531 NoEventDispatchAssertion assertNoEventDispatch; |
| 531 removedChildren.reserveInitialCapacity(childNodeCount()); | 532 removedChildren.reserveInitialCapacity(childNodeCount()); |
| 532 while (m_firstChild) { | 533 while (m_firstChild) { |
| 533 removedChildren.append(m_firstChild); | 534 removedChildren.append(m_firstChild); |
| 534 removeBetween(0, m_firstChild->nextSibling(), *m_firstChild); | 535 removeBetween(0, m_firstChild->nextSibling(), *m_firstChild); |
| 535 } | 536 } |
| 536 } | 537 } |
| 537 | 538 |
| 538 childrenChanged(false, 0, 0, -static_cast<int>(removedChildren.size())); | 539 childrenChanged(false, 0, 0, -static_cast<int>(removedChildren.size())); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 return true; | 983 return true; |
| 983 | 984 |
| 984 if (node->isElementNode() && toElement(node)->shadow()) | 985 if (node->isElementNode() && toElement(node)->shadow()) |
| 985 return true; | 986 return true; |
| 986 | 987 |
| 987 return false; | 988 return false; |
| 988 } | 989 } |
| 989 #endif | 990 #endif |
| 990 | 991 |
| 991 } // namespace WebCore | 992 } // namespace WebCore |
| OLD | NEW |