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

Side by Side Diff: Source/WebCore/dom/ContainerNodeAlgorithms.cpp

Issue 11273086: Merge 131709 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt ('k') | no next file » | 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, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2012 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 30 matching lines...) Expand all
41 // inserted into the document because they haven't. 41 // inserted into the document because they haven't.
42 if (node->inDocument() && child->parentNode() == node) 42 if (node->inDocument() && child->parentNode() == node)
43 notifyNodeInsertedIntoDocument(child); 43 notifyNodeInsertedIntoDocument(child);
44 } 44 }
45 45
46 if (!node->isElementNode()) 46 if (!node->isElementNode())
47 return; 47 return;
48 48
49 if (ElementShadow* shadow = toElement(node)->shadow()) { 49 if (ElementShadow* shadow = toElement(node)->shadow()) {
50 ShadowRootVector roots(shadow); 50 ShadowRootVector roots(shadow);
51 for (size_t i = 0; i < roots.size(); ++i) 51 for (size_t i = 0; i < roots.size(); ++i) {
52 notifyNodeInsertedIntoDocument(roots[i].get()); 52 if (node->inDocument() && roots[i]->host() == node)
53 notifyNodeInsertedIntoDocument(roots[i].get());
54 }
53 } 55 }
54 } 56 }
55 57
56 void ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree(ContainerNode* node) 58 void ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree(ContainerNode* node)
57 { 59 {
58 for (Node* child = node->firstChild(); child; child = child->nextSibling()) { 60 for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
59 if (child->isContainerNode()) 61 if (child->isContainerNode())
60 notifyNodeInsertedIntoTree(toContainerNode(child)); 62 notifyNodeInsertedIntoTree(toContainerNode(child));
61 } 63 }
62 64
(...skipping 13 matching lines...) Expand all
76 } 78 }
77 79
78 if (!node->isElementNode()) 80 if (!node->isElementNode())
79 return; 81 return;
80 82
81 if (node->document()->cssTarget() == node) 83 if (node->document()->cssTarget() == node)
82 node->document()->setCSSTarget(0); 84 node->document()->setCSSTarget(0);
83 85
84 if (ElementShadow* shadow = toElement(node)->shadow()) { 86 if (ElementShadow* shadow = toElement(node)->shadow()) {
85 ShadowRootVector roots(shadow); 87 ShadowRootVector roots(shadow);
86 for (size_t i = 0; i < roots.size(); ++i) 88 for (size_t i = 0; i < roots.size(); ++i) {
87 notifyNodeRemovedFromDocument(roots[i].get()); 89 if (!node->inDocument() && roots[i]->host() == node)
90 notifyNodeRemovedFromDocument(roots[i].get());
91 }
88 } 92 }
89 } 93 }
90 94
91 void ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree(ContainerNode* no de) 95 void ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree(ContainerNode* no de)
92 { 96 {
93 for (Node* child = node->firstChild(); child; child = child->nextSibling()) { 97 for (Node* child = node->firstChild(); child; child = child->nextSibling()) {
94 if (child->isContainerNode()) 98 if (child->isContainerNode())
95 notifyNodeRemovedFromTree(toContainerNode(child)); 99 notifyNodeRemovedFromTree(toContainerNode(child));
96 } 100 }
97 101
(...skipping 13 matching lines...) Expand all
111 collectDescendant(root, IncludeRoot); 115 collectDescendant(root, IncludeRoot);
112 } 116 }
113 117
114 void ChildFrameDisconnector::Target::disconnect() 118 void ChildFrameDisconnector::Target::disconnect()
115 { 119 {
116 ASSERT(isValid()); 120 ASSERT(isValid());
117 toFrameOwnerElement(m_owner.get())->disconnectContentFrame(); 121 toFrameOwnerElement(m_owner.get())->disconnectContentFrame();
118 } 122 }
119 123
120 } 124 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698