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

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

Issue 360463005: Add [TypeChecking=Interface] on various methods in Document.idl (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 6 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 | « LayoutTests/fast/dom/importNode-null-expected.txt ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 49708206a912e7d5abceb53aaf906916bba80f89..3353cc8af075a20655633ec7ad65e4ba162aba84 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -942,11 +942,6 @@ PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, ExceptionS
PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState)
{
- if (!importedNode) {
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
- return nullptr;
- }
-
switch (importedNode->nodeType()) {
case TEXT_NODE:
return createTextNode(importedNode->nodeValue());
@@ -1009,11 +1004,6 @@ PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep,
PassRefPtrWillBeRawPtr<Node> Document::adoptNode(PassRefPtrWillBeRawPtr<Node> source, ExceptionState& exceptionState)
{
- if (!source) {
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
- return nullptr;
- }
-
EventQueueScope scope;
switch (source->nodeType()) {
@@ -1544,11 +1534,6 @@ PassRefPtrWillBeRawPtr<Range> Document::createRange()
PassRefPtrWillBeRawPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow, PassRefPtrWillBeRawPtr<NodeFilter> filter, ExceptionState& exceptionState)
{
- // FIXME: Probably this should be handled within the bindings layer and Type Error should be thrown.
- if (!root) {
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
- return nullptr;
- }
// FIXME: It might be a good idea to emit a warning if |whatToShow| contains a bit that is not defined in
// NodeFilter.
return NodeIterator::create(root, whatToShow, filter);
@@ -1556,11 +1541,6 @@ PassRefPtrWillBeRawPtr<NodeIterator> Document::createNodeIterator(Node* root, un
PassRefPtrWillBeRawPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToShow, PassRefPtrWillBeRawPtr<NodeFilter> filter, ExceptionState& exceptionState)
{
- // FIXME: Probably this should be handled within the bindings layer and Type Error should be thrown.
- if (!root) {
- exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::argumentNullOrIncorrectType(1, "Node"));
- return nullptr;
- }
return TreeWalker::create(root, whatToShow, filter);
}
« no previous file with comments | « LayoutTests/fast/dom/importNode-null-expected.txt ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698