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

Unified Diff: Source/core/dom/DOMImplementation.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/DOMImplementation.h ('k') | Source/core/dom/DOMImplementation.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMImplementation.cpp
diff --git a/Source/core/dom/DOMImplementation.cpp b/Source/core/dom/DOMImplementation.cpp
index e85a2d044a6ecc3e03a501f44f19566a13c8bde0..16bd451ce404a089968b1d1fbbedc0c0574bcdc1 100644
--- a/Source/core/dom/DOMImplementation.cpp
+++ b/Source/core/dom/DOMImplementation.cpp
@@ -36,6 +36,7 @@
#include "core/dom/DocumentType.h"
#include "core/dom/Element.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/XMLDocument.h"
#include "core/dom/custom/CustomElementRegistrationContext.h"
#include "core/html/HTMLDocument.h"
#include "core/html/HTMLMediaElement.h"
@@ -202,17 +203,19 @@ DOMImplementation* DOMImplementation::getInterface(const String& /*feature*/)
return 0;
}
-PassRefPtr<Document> DOMImplementation::createDocument(const AtomicString& namespaceURI,
+PassRefPtr<XMLDocument> DOMImplementation::createDocument(const AtomicString& namespaceURI,
const AtomicString& qualifiedName, DocumentType* doctype, ExceptionState& exceptionState)
{
- RefPtr<Document> doc;
+ RefPtr<XMLDocument> doc;
DocumentInit init = DocumentInit::fromContext(m_document.contextDocument());
if (namespaceURI == SVGNames::svgNamespaceURI) {
+ // FIXME: This should be an XMLDocument as per DOM4 but we need to get rid of SVGDocument first.
+ // SVGDocument no longer exists in SVG2.
doc = SVGDocument::create(init);
} else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) {
- doc = Document::createXHTML(init.withRegistrationContext(m_document.registrationContext()));
+ doc = XMLDocument::createXHTML(init.withRegistrationContext(m_document.registrationContext()));
} else {
- doc = Document::create(init);
+ doc = XMLDocument::create(init);
}
doc->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy());
@@ -360,7 +363,7 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, const
if (type == "text/html")
return HTMLDocument::create(init);
if (type == "application/xhtml+xml")
- return Document::createXHTML(init);
+ return XMLDocument::createXHTML(init);
PluginData* pluginData = 0;
if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlugins(NotAboutToInstantiatePlugin))
@@ -387,7 +390,7 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, const
if (type == "image/svg+xml")
return SVGDocument::create(init);
if (isXMLMIMEType(type))
- return Document::create(init);
+ return XMLDocument::create(init);
return HTMLDocument::create(init);
}
« no previous file with comments | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/DOMImplementation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698