OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 if (!parentOfNewParent) { | 1211 if (!parentOfNewParent) { |
1212 exceptionState.throwDOMException(HierarchyRequestError, "The container n
ode is a detached character data node; no parent node is available for insertion
."); | 1212 exceptionState.throwDOMException(HierarchyRequestError, "The container n
ode is a detached character data node; no parent node is available for insertion
."); |
1213 return; | 1213 return; |
1214 } | 1214 } |
1215 | 1215 |
1216 if (!parentOfNewParent->childTypeAllowed(newParent->getNodeType())) { | 1216 if (!parentOfNewParent->childTypeAllowed(newParent->getNodeType())) { |
1217 exceptionState.throwDOMException(HierarchyRequestError, "The node provid
ed is of type '" + newParent->nodeName() + "', which may not be inserted here.")
; | 1217 exceptionState.throwDOMException(HierarchyRequestError, "The node provid
ed is of type '" + newParent->nodeName() + "', which may not be inserted here.")
; |
1218 return; | 1218 return; |
1219 } | 1219 } |
1220 | 1220 |
1221 if (newParent->containsIncludingShadowDOM(m_start.container())) { | 1221 if (newParent->isShadowIncludingInclusiveAncestorOf(m_start.container())) { |
1222 exceptionState.throwDOMException(HierarchyRequestError, "The node provid
ed contains the insertion point; it may not be inserted into itself."); | 1222 exceptionState.throwDOMException(HierarchyRequestError, "The node provid
ed contains the insertion point; it may not be inserted into itself."); |
1223 return; | 1223 return; |
1224 } | 1224 } |
1225 | 1225 |
1226 // FIXME: Do we need a check if the node would end up with a child node of a
type not | 1226 // FIXME: Do we need a check if the node would end up with a child node of a
type not |
1227 // allowed by the type of node? | 1227 // allowed by the type of node? |
1228 | 1228 |
1229 while (Node* n = newParent->firstChild()) { | 1229 while (Node* n = newParent->firstChild()) { |
1230 toContainerNode(newParent)->removeChild(n, exceptionState); | 1230 toContainerNode(newParent)->removeChild(n, exceptionState); |
1231 if (exceptionState.hadException()) | 1231 if (exceptionState.hadException()) |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 { | 1646 { |
1647 if (range && range->boundaryPointsValid()) { | 1647 if (range && range->boundaryPointsValid()) { |
1648 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1648 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
1649 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1649 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
1650 } else { | 1650 } else { |
1651 fprintf(stderr, "Cannot show tree if range is null, or if boundary point
s are invalid.\n"); | 1651 fprintf(stderr, "Cannot show tree if range is null, or if boundary point
s are invalid.\n"); |
1652 } | 1652 } |
1653 } | 1653 } |
1654 | 1654 |
1655 #endif | 1655 #endif |
OLD | NEW |