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

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

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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/css/resolver/StyleResolver.cpp ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/ContainerNode.cpp
diff --git a/sky/engine/core/dom/ContainerNode.cpp b/sky/engine/core/dom/ContainerNode.cpp
index 97f3708d03789a6e8d0fc22c1da1a2f450866ee8..ccdf11e954111987f47e2cfbb133e5f84652afbc 100644
--- a/sky/engine/core/dom/ContainerNode.cpp
+++ b/sky/engine/core/dom/ContainerNode.cpp
@@ -99,21 +99,6 @@ void ContainerNode::checkAcceptChildHierarchy(const Node& newChild, const Node*
exceptionState.ThrowDOMException(HierarchyRequestError, "The new child element contains the parent.");
return;
}
-
- // TODO(esprehn): Remove this, sky should allow multiple top level elements.
- if (isDocumentNode()) {
- unsigned elementCount = 0;
- if (newChild.isElementNode()) {
- elementCount = 1;
- } else if (newChild.isDocumentFragment()) {
- for (Element* element = ElementTraversal::firstChild(newChild); element; element = ElementTraversal::nextSibling(*element))
- ++elementCount;
- }
- if (elementCount > 1 || ((!oldChild || !oldChild->isElementNode()) && elementCount && document().documentElement())) {
- exceptionState.ThrowDOMException(HierarchyRequestError, "Document can only contain one Element.");
- return;
- }
- }
}
PassRefPtr<Node> ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionState& exceptionState)
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.cpp ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698