| 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" |
| 28 #include "core/dom/ChildListMutationScope.h" | 29 #include "core/dom/ChildListMutationScope.h" |
| 29 #include "core/dom/ContainerNodeAlgorithms.h" | 30 #include "core/dom/ContainerNodeAlgorithms.h" |
| 30 #include "core/dom/ElementTraversal.h" | 31 #include "core/dom/ElementTraversal.h" |
| 31 #include "core/dom/EventNames.h" | 32 #include "core/dom/EventNames.h" |
| 32 #include "core/dom/ExceptionCode.h" | 33 #include "core/dom/ExceptionCode.h" |
| 33 #include "core/dom/FullscreenElementStack.h" | 34 #include "core/dom/FullscreenElementStack.h" |
| 34 #include "core/dom/MutationEvent.h" | 35 #include "core/dom/MutationEvent.h" |
| 35 #include "core/dom/NodeRareData.h" | 36 #include "core/dom/NodeRareData.h" |
| 36 #include "core/dom/NodeRenderStyle.h" | 37 #include "core/dom/NodeRenderStyle.h" |
| 37 #include "core/dom/NodeTraversal.h" | 38 #include "core/dom/NodeTraversal.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 65 | 66 |
| 66 static inline void attachAfterInsertion(Node* node, AttachBehavior attachBehavio
r = AttachLazily) | 67 static inline void attachAfterInsertion(Node* node, AttachBehavior attachBehavio
r = AttachLazily) |
| 67 { | 68 { |
| 68 if (node->attached() || !node->parentNode() || !node->parentNode()->attached
()) | 69 if (node->attached() || !node->parentNode() || !node->parentNode()->attached
()) |
| 69 return; | 70 return; |
| 70 | 71 |
| 71 if (attachBehavior == AttachLazily) | 72 if (attachBehavior == AttachLazily) |
| 72 node->lazyAttach(); | 73 node->lazyAttach(); |
| 73 else | 74 else |
| 74 node->attach(); | 75 node->attach(); |
| 76 |
| 77 if (StyleResolver* resolver = node->document().styleResolverIfExists()) |
| 78 resolver->clearStyleSharingList(); |
| 75 } | 79 } |
| 76 | 80 |
| 77 static void collectChildrenAndRemoveFromOldParent(Node* node, NodeVector& nodes,
ExceptionState& es) | 81 static void collectChildrenAndRemoveFromOldParent(Node* node, NodeVector& nodes,
ExceptionState& es) |
| 78 { | 82 { |
| 79 if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) { | 83 if (node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) { |
| 80 nodes.append(node); | 84 nodes.append(node); |
| 81 if (ContainerNode* oldParent = node->parentNode()) | 85 if (ContainerNode* oldParent = node->parentNode()) |
| 82 oldParent->removeChild(node, es); | 86 oldParent->removeChild(node, es); |
| 83 return; | 87 return; |
| 84 } | 88 } |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 return true; | 1060 return true; |
| 1057 | 1061 |
| 1058 if (node->isElementNode() && toElement(node)->shadow()) | 1062 if (node->isElementNode() && toElement(node)->shadow()) |
| 1059 return true; | 1063 return true; |
| 1060 | 1064 |
| 1061 return false; | 1065 return false; |
| 1062 } | 1066 } |
| 1063 #endif | 1067 #endif |
| 1064 | 1068 |
| 1065 } // namespace WebCore | 1069 } // namespace WebCore |
| OLD | NEW |