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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
24 #include "core/dom/ContainerNode.h" | 24 #include "core/dom/ContainerNode.h" |
25 | 25 |
26 #include "bindings/v8/ExceptionState.h" | 26 #include "bindings/v8/ExceptionState.h" |
27 #include "bindings/v8/ExceptionStatePlaceholder.h" | 27 #include "bindings/v8/ExceptionStatePlaceholder.h" |
28 #include "core/css/resolver/StyleResolver.h" | |
29 #include "core/dom/ChildListMutationScope.h" | 28 #include "core/dom/ChildListMutationScope.h" |
30 #include "core/dom/ContainerNodeAlgorithms.h" | 29 #include "core/dom/ContainerNodeAlgorithms.h" |
31 #include "core/dom/ElementTraversal.h" | 30 #include "core/dom/ElementTraversal.h" |
32 #include "core/dom/EventNames.h" | 31 #include "core/dom/EventNames.h" |
33 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
34 #include "core/dom/FullscreenElementStack.h" | 33 #include "core/dom/FullscreenElementStack.h" |
35 #include "core/dom/MutationEvent.h" | 34 #include "core/dom/MutationEvent.h" |
36 #include "core/dom/NodeRareData.h" | 35 #include "core/dom/NodeRareData.h" |
37 #include "core/dom/NodeRenderStyle.h" | 36 #include "core/dom/NodeRenderStyle.h" |
38 #include "core/dom/NodeTraversal.h" | 37 #include "core/dom/NodeTraversal.h" |
(...skipping 24 matching lines...) Expand all Loading... |
63 #ifndef NDEBUG | 62 #ifndef NDEBUG |
64 unsigned NoEventDispatchAssertion::s_count = 0; | 63 unsigned NoEventDispatchAssertion::s_count = 0; |
65 #endif | 64 #endif |
66 | 65 |
67 static inline void attachAfterInsertion(Node* node) | 66 static inline void attachAfterInsertion(Node* node) |
68 { | 67 { |
69 if (node->attached() || !node->parentNode() || !node->parentNode()->attached
()) | 68 if (node->attached() || !node->parentNode() || !node->parentNode()->attached
()) |
70 return; | 69 return; |
71 | 70 |
72 node->lazyAttach(); | 71 node->lazyAttach(); |
73 | |
74 if (StyleResolver* resolver = node->document().styleResolverIfExists()) | |
75 resolver->clearStyleSharingList(); | |
76 } | 72 } |
77 | 73 |
78 static void collectChildrenAndRemoveFromOldParent(Node* node, NodeVector& nodes,
ExceptionState& es) | 74 static void collectChildrenAndRemoveFromOldParent(Node* node, NodeVector& nodes,
ExceptionState& es) |
79 { | 75 { |
80 if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) { | 76 if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) { |
81 nodes.append(node); | 77 nodes.append(node); |
82 if (ContainerNode* oldParent = node->parentNode()) | 78 if (ContainerNode* oldParent = node->parentNode()) |
83 oldParent->removeChild(node, es); | 79 oldParent->removeChild(node, es); |
84 return; | 80 return; |
85 } | 81 } |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 return true; | 1053 return true; |
1058 | 1054 |
1059 if (node->isElementNode() && toElement(node)->shadow()) | 1055 if (node->isElementNode() && toElement(node)->shadow()) |
1060 return true; | 1056 return true; |
1061 | 1057 |
1062 return false; | 1058 return false; |
1063 } | 1059 } |
1064 #endif | 1060 #endif |
1065 | 1061 |
1066 } // namespace WebCore | 1062 } // namespace WebCore |
OLD | NEW |