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 20 matching lines...) Expand all Loading... |
31 #include "core/dom/ExceptionCode.h" | 31 #include "core/dom/ExceptionCode.h" |
32 #include "core/dom/FullscreenElementStack.h" | 32 #include "core/dom/FullscreenElementStack.h" |
33 #include "core/dom/NameNodeList.h" | 33 #include "core/dom/NameNodeList.h" |
34 #include "core/dom/NodeChildRemovalTracker.h" | 34 #include "core/dom/NodeChildRemovalTracker.h" |
35 #include "core/dom/NodeRareData.h" | 35 #include "core/dom/NodeRareData.h" |
36 #include "core/dom/NodeRenderStyle.h" | 36 #include "core/dom/NodeRenderStyle.h" |
37 #include "core/dom/NodeTraversal.h" | 37 #include "core/dom/NodeTraversal.h" |
38 #include "core/dom/SelectorQuery.h" | 38 #include "core/dom/SelectorQuery.h" |
39 #include "core/events/MutationEvent.h" | 39 #include "core/events/MutationEvent.h" |
40 #include "core/html/HTMLCollection.h" | 40 #include "core/html/HTMLCollection.h" |
| 41 #include "core/html/HTMLFrameOwnerElement.h" |
41 #include "core/html/RadioNodeList.h" | 42 #include "core/html/RadioNodeList.h" |
42 #include "core/rendering/InlineTextBox.h" | 43 #include "core/rendering/InlineTextBox.h" |
43 #include "core/rendering/RenderText.h" | 44 #include "core/rendering/RenderText.h" |
44 #include "core/rendering/RenderTheme.h" | 45 #include "core/rendering/RenderTheme.h" |
45 #include "core/rendering/RenderView.h" | 46 #include "core/rendering/RenderView.h" |
46 #include "core/rendering/RenderWidget.h" | |
47 | 47 |
48 using namespace std; | 48 using namespace std; |
49 | 49 |
50 namespace WebCore { | 50 namespace WebCore { |
51 | 51 |
52 using namespace HTMLNames; | 52 using namespace HTMLNames; |
53 | 53 |
54 static void dispatchChildInsertionEvents(Node&); | 54 static void dispatchChildInsertionEvents(Node&); |
55 static void dispatchChildRemovalEvents(Node&); | 55 static void dispatchChildRemovalEvents(Node&); |
56 | 56 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 442 |
443 willRemoveChild(*child); | 443 willRemoveChild(*child); |
444 | 444 |
445 // Mutation events might have moved this child into a different parent. | 445 // Mutation events might have moved this child into a different parent. |
446 if (child->parentNode() != this) { | 446 if (child->parentNode() != this) { |
447 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?"); | 447 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?"); |
448 return; | 448 return; |
449 } | 449 } |
450 | 450 |
451 { | 451 { |
452 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 452 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
453 | 453 |
454 Node* prev = child->previousSibling(); | 454 Node* prev = child->previousSibling(); |
455 Node* next = child->nextSibling(); | 455 Node* next = child->nextSibling(); |
456 removeBetween(prev, next, *child); | 456 removeBetween(prev, next, *child); |
457 childrenChanged(false, prev, next, -1); | 457 childrenChanged(false, prev, next, -1); |
458 ChildNodeRemovalNotifier(*this).notify(*child); | 458 ChildNodeRemovalNotifier(*this).notify(*child); |
459 } | 459 } |
460 dispatchSubtreeModifiedEvent(); | 460 dispatchSubtreeModifiedEvent(); |
461 } | 461 } |
462 | 462 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // state of a child. | 532 // state of a child. |
533 document().removeFocusedElementOfSubtree(this, true); | 533 document().removeFocusedElementOfSubtree(this, true); |
534 | 534 |
535 // Removing a node from a selection can cause widget updates. | 535 // Removing a node from a selection can cause widget updates. |
536 document().nodeChildrenWillBeRemoved(*this); | 536 document().nodeChildrenWillBeRemoved(*this); |
537 } | 537 } |
538 | 538 |
539 | 539 |
540 NodeVector removedChildren; | 540 NodeVector removedChildren; |
541 { | 541 { |
542 RenderWidget::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 542 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
543 { | 543 { |
544 NoEventDispatchAssertion assertNoEventDispatch; | 544 NoEventDispatchAssertion assertNoEventDispatch; |
545 removedChildren.reserveInitialCapacity(countChildren()); | 545 removedChildren.reserveInitialCapacity(countChildren()); |
546 while (m_firstChild) { | 546 while (m_firstChild) { |
547 removedChildren.append(m_firstChild); | 547 removedChildren.append(m_firstChild); |
548 removeBetween(0, m_firstChild->nextSibling(), *m_firstChild); | 548 removeBetween(0, m_firstChild->nextSibling(), *m_firstChild); |
549 } | 549 } |
550 } | 550 } |
551 | 551 |
552 childrenChanged(false, 0, 0, -static_cast<int>(removedChildren.size())); | 552 childrenChanged(false, 0, 0, -static_cast<int>(removedChildren.size())); |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 return true; | 1101 return true; |
1102 | 1102 |
1103 if (node->isElementNode() && toElement(node)->shadow()) | 1103 if (node->isElementNode() && toElement(node)->shadow()) |
1104 return true; | 1104 return true; |
1105 | 1105 |
1106 return false; | 1106 return false; |
1107 } | 1107 } |
1108 #endif | 1108 #endif |
1109 | 1109 |
1110 } // namespace WebCore | 1110 } // namespace WebCore |
OLD | NEW |