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

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

Issue 102533002: Implemented DocumentType.cloneNode(bool) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed review issues Created 7 years 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/DocumentType/clone-node-expected.txt ('k') | no next file » | 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 2e9ebcf57b3a5d410e775ff3202f8586cbf684aa..189eb69bfd32898b22f469763957b31bc1f6ac75 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -837,6 +837,10 @@ PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt
return createProcessingInstruction(importedNode->nodeName(), importedNode->nodeValue(), exceptionState);
case COMMENT_NODE:
return createComment(importedNode->nodeValue());
+ case DOCUMENT_TYPE_NODE: {
+ DocumentType* doctype = toDocumentType(importedNode);
+ return DocumentType::create(this, doctype->name(), doctype->publicId(), doctype->systemId());
+ }
case ELEMENT_NODE: {
Element* oldElement = toElement(importedNode);
// FIXME: The following check might be unnecessary. Is it possible that
@@ -890,7 +894,6 @@ PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt
// FIXME: It should be possible to import these node types, however in DOM3 the DocumentType is readonly, so there isn't much sense in doing that.
// Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM.
case DOCUMENT_NODE:
- case DOCUMENT_TYPE_NODE:
case XPATH_NAMESPACE_NODE:
break;
}
« no previous file with comments | « LayoutTests/fast/dom/DocumentType/clone-node-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698