| 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, 2013 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. |
| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (newChild->isPseudoElement()) { | 145 if (newChild->isPseudoElement()) { |
| 146 exceptionState.throwDOMException(HierarchyRequestError, "The new child e
lement is a pseudo-element."); | 146 exceptionState.throwDOMException(HierarchyRequestError, "The new child e
lement is a pseudo-element."); |
| 147 return false; | 147 return false; |
| 148 } | 148 } |
| 149 | 149 |
| 150 if (containsConsideringHostElements(*newChild)) { | 150 if (containsConsideringHostElements(*newChild)) { |
| 151 exceptionState.throwDOMException(HierarchyRequestError, "The new child e
lement contains the parent."); | 151 exceptionState.throwDOMException(HierarchyRequestError, "The new child e
lement contains the parent."); |
| 152 return false; | 152 return false; |
| 153 } | 153 } |
| 154 | 154 |
| 155 if (oldChild && isDocumentNode()) { | 155 if (isDocumentNode()) |
| 156 if (!toDocument(this)->canReplaceChild(*newChild, *oldChild)) { | 156 return toDocument(this)->canAcceptChild(*newChild, oldChild, exceptionSt
ate); |
| 157 // FIXME: Adjust 'Document::canReplaceChild' to return some addition
al detail (or an error message). | 157 |
| 158 exceptionState.throwDOMException(HierarchyRequestError, "Failed to r
eplace child."); | 158 if (!isChildTypeAllowed(*newChild)) { |
| 159 return false; | |
| 160 } | |
| 161 } else if (!isChildTypeAllowed(*newChild)) { | |
| 162 exceptionState.throwDOMException(HierarchyRequestError, "Nodes of type '
" + newChild->nodeName() + "' may not be inserted inside nodes of type '" + node
Name() + "'."); | 159 exceptionState.throwDOMException(HierarchyRequestError, "Nodes of type '
" + newChild->nodeName() + "' may not be inserted inside nodes of type '" + node
Name() + "'."); |
| 163 return false; | 160 return false; |
| 164 } | 161 } |
| 165 | 162 |
| 166 return true; | 163 return true; |
| 167 } | 164 } |
| 168 | 165 |
| 169 bool ContainerNode::checkAcceptChildGuaranteedNodeTypes(const Node& newChild, Ex
ceptionState& exceptionState) const | 166 bool ContainerNode::checkAcceptChildGuaranteedNodeTypes(const Node& newChild, Ex
ceptionState& exceptionState) const |
| 170 { | 167 { |
| 171 ASSERT(isChildTypeAllowed(newChild)); | 168 ASSERT(isChildTypeAllowed(newChild)); |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 return true; | 1431 return true; |
| 1435 | 1432 |
| 1436 if (node->isElementNode() && toElement(node)->shadow()) | 1433 if (node->isElementNode() && toElement(node)->shadow()) |
| 1437 return true; | 1434 return true; |
| 1438 | 1435 |
| 1439 return false; | 1436 return false; |
| 1440 } | 1437 } |
| 1441 #endif | 1438 #endif |
| 1442 | 1439 |
| 1443 } // namespace blink | 1440 } // namespace blink |
| OLD | NEW |