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

Unified Diff: Source/core/dom/Node.cpp

Issue 375293002: Node.insertBefore and Node.appendChild do not use custom binding anymore (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replace assert with condition Created 6 years, 5 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 | « Source/core/dom/Node.h ('k') | Source/core/dom/Node.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 25d4bfeddc71f5eb1f27bfa574eac9c872386a53..8c0cf09a819b53743334de10b852cd2a9e0433e4 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -464,12 +464,13 @@ Node* Node::pseudoAwareLastChild() const
return lastChild();
}
-void Node::insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, ExceptionState& exceptionState)
{
if (isContainerNode())
- toContainerNode(this)->insertBefore(newChild, refChild, exceptionState);
- else
- exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
+ return toContainerNode(this)->insertBefore(newChild, refChild, exceptionState);
+
+ exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
+ return nullptr;
}
void Node::replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, Node* oldChild, ExceptionState& exceptionState)
@@ -488,12 +489,13 @@ void Node::removeChild(Node* oldChild, ExceptionState& exceptionState)
exceptionState.throwDOMException(NotFoundError, "This node type does not support this method.");
}
-void Node::appendChild(PassRefPtrWillBeRawPtr<Node> newChild, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Node> Node::appendChild(PassRefPtrWillBeRawPtr<Node> newChild, ExceptionState& exceptionState)
{
if (isContainerNode())
- toContainerNode(this)->appendChild(newChild, exceptionState);
- else
- exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
+ return toContainerNode(this)->appendChild(newChild, exceptionState);
+
+ exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
+ return nullptr;
}
void Node::remove(ExceptionState& exceptionState)
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/Node.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698