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

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

Issue 385073015: Node.replaceChild and Node.removeChild do not use custom binding anymore (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take review comment into consideration 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 8af4165eb24a4b736848148c34141be39e915632..b1c3ea7eedd4aed7a462f78b0b11324cacd95fed 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -479,20 +479,22 @@ PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> new
return nullptr;
}
-void Node::replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, Node* oldChild, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Node> Node::replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& exceptionState)
{
if (isContainerNode())
- toContainerNode(this)->replaceChild(newChild, oldChild, exceptionState);
- else
- exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
+ return toContainerNode(this)->replaceChild(newChild, oldChild, exceptionState);
+
+ exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
+ return nullptr;
}
-void Node::removeChild(Node* oldChild, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Node> Node::removeChild(PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& exceptionState)
{
if (isContainerNode())
- toContainerNode(this)->removeChild(oldChild, exceptionState);
- else
- exceptionState.throwDOMException(NotFoundError, "This node type does not support this method.");
+ return toContainerNode(this)->removeChild(oldChild, exceptionState);
+
+ exceptionState.throwDOMException(NotFoundError, "This node type does not support this method.");
+ return nullptr;
}
PassRefPtrWillBeRawPtr<Node> Node::appendChild(PassRefPtrWillBeRawPtr<Node> newChild, 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