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, 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 Loading... |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |