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

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: 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index c8483299b8882c185fa46d5458be3c3d5118effb..c4264fbe4a34ee8c5245f64646c4e57eadb0db3e 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -789,6 +789,11 @@ PassRefPtr<CDATASection> Document::createCDATASection(const String& data, Except
return CDATASection::create(*this, data);
}
+PassRefPtr<DocumentType> Document::createDocumentType(const String& qualifiedName, const String& publicId, const String& systemId)
+{
+ return DocumentType::create(this, qualifiedName, publicId, systemId);
esprehn 2013/12/09 17:19:08 Remove this method, the other ones are real JS API
+}
+
PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const String& target, const String& data, ExceptionState& exceptionState)
{
if (!isValidName(target)) {
@@ -828,6 +833,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 = static_cast<DocumentType*>(importedNode);
esprehn 2013/12/09 17:19:08 toDocumentType(importedNode), you might need to ad
+ return createDocumentType(doctype->name(), doctype->publicId(), doctype->systemId());
esprehn 2013/12/09 17:19:08 DocumentType::create(...)
+ }
case ELEMENT_NODE: {
Element* oldElement = toElement(importedNode);
// FIXME: The following check might be unnecessary. Is it possible that
@@ -881,7 +890,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;
}
« LayoutTests/fast/dom/DocumentType/clone-node.html ('K') | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698