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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/Node.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 472
473 PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> new Child, Node* refChild, ExceptionState& exceptionState) 473 PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> new Child, Node* refChild, ExceptionState& exceptionState)
474 { 474 {
475 if (isContainerNode()) 475 if (isContainerNode())
476 return toContainerNode(this)->insertBefore(newChild, refChild, exception State); 476 return toContainerNode(this)->insertBefore(newChild, refChild, exception State);
477 477
478 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method."); 478 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
479 return nullptr; 479 return nullptr;
480 } 480 }
481 481
482 void Node::replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, Node* oldChild, E xceptionState& exceptionState) 482 PassRefPtrWillBeRawPtr<Node> Node::replaceChild(PassRefPtrWillBeRawPtr<Node> new Child, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& exceptionState)
483 { 483 {
484 if (isContainerNode()) 484 if (isContainerNode())
485 toContainerNode(this)->replaceChild(newChild, oldChild, exceptionState); 485 return toContainerNode(this)->replaceChild(newChild, oldChild, exception State);
486 else 486
487 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method."); 487 exceptionState.throwDOMException(HierarchyRequestError, "This node type doe s not support this method.");
488 return nullptr;
488 } 489 }
489 490
490 void Node::removeChild(Node* oldChild, ExceptionState& exceptionState) 491 PassRefPtrWillBeRawPtr<Node> Node::removeChild(PassRefPtrWillBeRawPtr<Node> oldC hild, ExceptionState& exceptionState)
491 { 492 {
492 if (isContainerNode()) 493 if (isContainerNode())
493 toContainerNode(this)->removeChild(oldChild, exceptionState); 494 return toContainerNode(this)->removeChild(oldChild, exceptionState);
494 else 495
495 exceptionState.throwDOMException(NotFoundError, "This node type does not support this method."); 496 exceptionState.throwDOMException(NotFoundError, "This node type does not sup port this method.");
497 return nullptr;
496 } 498 }
497 499
498 PassRefPtrWillBeRawPtr<Node> Node::appendChild(PassRefPtrWillBeRawPtr<Node> newC hild, ExceptionState& exceptionState) 500 PassRefPtrWillBeRawPtr<Node> Node::appendChild(PassRefPtrWillBeRawPtr<Node> newC hild, ExceptionState& exceptionState)
499 { 501 {
500 if (isContainerNode()) 502 if (isContainerNode())
501 return toContainerNode(this)->appendChild(newChild, exceptionState); 503 return toContainerNode(this)->appendChild(newChild, exceptionState);
502 504
503 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method."); 505 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
504 return nullptr; 506 return nullptr;
505 } 507 }
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2557 node->showTreeForThis(); 2559 node->showTreeForThis();
2558 } 2560 }
2559 2561
2560 void showNodePath(const WebCore::Node* node) 2562 void showNodePath(const WebCore::Node* node)
2561 { 2563 {
2562 if (node) 2564 if (node)
2563 node->showNodePathForThis(); 2565 node->showNodePathForThis();
2564 } 2566 }
2565 2567
2566 #endif 2568 #endif
OLDNEW
« 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