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. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 return true; | 167 return true; |
168 } | 168 } |
169 | 169 |
170 // This should never happen, but also protect release builds from tree corru
ption. | 170 // This should never happen, but also protect release builds from tree corru
ption. |
171 ASSERT(!newChild->isPseudoElement()); | 171 ASSERT(!newChild->isPseudoElement()); |
172 if (newChild->isPseudoElement()) { | 172 if (newChild->isPseudoElement()) { |
173 es.throwDOMException(HierarchyRequestError); | 173 es.throwDOMException(HierarchyRequestError); |
174 return false; | 174 return false; |
175 } | 175 } |
176 | 176 |
177 if (newChild->inDocument() && newChild->isDocumentTypeNode()) { | |
178 es.throwDOMException(HierarchyRequestError); | |
179 return false; | |
180 } | |
181 if (containsConsideringHostElements(newChild, newParent)) { | 177 if (containsConsideringHostElements(newChild, newParent)) { |
182 es.throwDOMException(HierarchyRequestError); | 178 es.throwDOMException(HierarchyRequestError); |
183 return false; | 179 return false; |
184 } | 180 } |
185 | 181 |
186 if (oldChild && newParent->isDocumentNode()) { | 182 if (oldChild && newParent->isDocumentNode()) { |
187 if (!toDocument(newParent)->canReplaceChild(newChild, oldChild)) { | 183 if (!toDocument(newParent)->canReplaceChild(newChild, oldChild)) { |
188 es.throwDOMException(HierarchyRequestError); | 184 es.throwDOMException(HierarchyRequestError); |
189 return false; | 185 return false; |
190 } | 186 } |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 return true; | 1048 return true; |
1053 | 1049 |
1054 if (node->isElementNode() && toElement(node)->shadow()) | 1050 if (node->isElementNode() && toElement(node)->shadow()) |
1055 return true; | 1051 return true; |
1056 | 1052 |
1057 return false; | 1053 return false; |
1058 } | 1054 } |
1059 #endif | 1055 #endif |
1060 | 1056 |
1061 } // namespace WebCore | 1057 } // namespace WebCore |
OLD | NEW |