Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: Source/core/dom/ContainerNode.cpp

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Handle shared-renderer case. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/plugins/plugin-persists-expected.txt ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
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
OLDNEW
« no previous file with comments | « LayoutTests/plugins/plugin-persists-expected.txt ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698