Index: Source/core/xml/DOMParser.cpp |
diff --git a/Source/core/xml/DOMParser.cpp b/Source/core/xml/DOMParser.cpp |
index 25c1cb6d6d222de8bcb4086409d31592094b2c63..56aa75c3b6a079d17095752bc87bb50e483da5c4 100644 |
--- a/Source/core/xml/DOMParser.cpp |
+++ b/Source/core/xml/DOMParser.cpp |
@@ -20,14 +20,21 @@ |
#include "core/xml/DOMParser.h" |
#include "core/dom/DOMImplementation.h" |
+#include "core/dom/ExceptionCode.h" |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-PassRefPtr<Document> DOMParser::parseFromString(const String& str, const String& contentType) |
+PassRefPtr<Document> DOMParser::parseFromString(const String& str, const String& contentType, ExceptionState& es) |
{ |
- if (!DOMImplementation::isXMLMIMEType(contentType) && contentType != "text/html") |
+ if (contentType != "text/html" |
eseidel
2013/09/26 16:37:07
I might have put a comment and link to the spec:
|
+ && contentType != "text/xml" |
+ && contentType != "application/xml" |
+ && contentType != "application/xhtml+xml" |
+ && contentType != "image/svg+xml") { |
+ es.throwDOMException(TypeError); |
return 0; |
+ } |
RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, KURL(), false); |
doc->setContent(str); |