Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: sky/engine/core/dom/Range.cpp

Issue 732203004: Clean up child checks in ContainerNode. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add back secondary hierarchy checks. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/tests/dom/appendChild.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Range.cpp
diff --git a/sky/engine/core/dom/Range.cpp b/sky/engine/core/dom/Range.cpp
index a246715ef6e806a2eebb8e0801d00b7335019c5c..2fca889cde3c90b5383092fa106e05cfd56dc045 100644
--- a/sky/engine/core/dom/Range.cpp
+++ b/sky/engine/core/dom/Range.cpp
@@ -816,18 +816,10 @@ void Range::insertNode(PassRefPtr<Node> prpNewNode, ExceptionState& exceptionSta
// check each child node, not the DocumentFragment itself
numNewChildren = 0;
for (Node* c = toDocumentFragment(newNode)->firstChild(); c; c = c->nextSibling()) {
- if (!checkAgainst->childTypeAllowed(c->nodeType())) {
- exceptionState.throwDOMException(HierarchyRequestError, "The node to be inserted contains a '" + c->nodeName() + "' node, which may not be inserted here.");
- return;
- }
++numNewChildren;
}
} else {
numNewChildren = 1;
- if (!checkAgainst->childTypeAllowed(newNodeType)) {
- exceptionState.throwDOMException(HierarchyRequestError, "The node to be inserted is a '" + newNode->nodeName() + "' node, which may not be inserted here.");
- return;
- }
}
for (Node* n = m_start.container(); n; n = n->parentNode()) {
@@ -1118,11 +1110,6 @@ void Range::surroundContents(PassRefPtr<Node> passNewParent, ExceptionState& exc
return;
}
- if (!parentOfNewParent->childTypeAllowed(newParent->nodeType())) {
- exceptionState.throwDOMException(HierarchyRequestError, "The node provided is of type '" + newParent->nodeName() + "', which may not be inserted here.");
- return;
- }
-
if (newParent->contains(m_start.container())) {
exceptionState.throwDOMException(HierarchyRequestError, "The node provided contains the insertion point; it may not be inserted into itself.");
return;
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/tests/dom/appendChild.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698