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

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

Issue 144063004: Add support for DOM4's XMLDocument interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove FIXME about XMLDocument.load() Created 6 years, 11 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/Document.h ('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 32f95f96692d01ed682a4467ca04465a261e3b3a..ba3dc9fe789ed6712c159ae1d9107492730d4a63 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -94,6 +94,7 @@
#include "core/dom/TransformSource.h"
#include "core/dom/TreeWalker.h"
#include "core/dom/VisitedLinkState.h"
+#include "core/dom/XMLDocument.h"
#include "core/dom/custom/CustomElementRegistrationContext.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -1202,10 +1203,13 @@ void Document::setContent(const String& content)
String Document::suggestedMIMEType() const
{
- if (isXHTMLDocument())
- return "application/xhtml+xml";
- if (isSVGDocument())
- return "image/svg+xml";
+ if (isXMLDocument()) {
+ if (isXHTMLDocument())
+ return "application/xhtml+xml";
+ if (isSVGDocument())
+ return "image/svg+xml";
+ return "application/xml";
+ }
if (xmlStandalone())
return "text/xml";
if (isHTMLDocument())
@@ -3160,8 +3164,11 @@ PassRefPtr<Node> Document::cloneNode(bool deep)
PassRefPtr<Document> Document::cloneDocumentWithoutChildren()
{
DocumentInit init(url());
- if (isXHTMLDocument())
- return createXHTML(init.withRegistrationContext(registrationContext()));
+ if (isXMLDocument()) {
+ if (isXHTMLDocument())
+ return XMLDocument::createXHTML(init.withRegistrationContext(registrationContext()));
+ return XMLDocument::create(init);
+ }
return create(init);
}
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698