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

Unified Diff: Source/core/xml/DOMParser.cpp

Issue 855023002: Sync the DOMParser interface with spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert TypeChecking=Interface Created 5 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/xml/DOMParser.h ('k') | Source/core/xml/DOMParser.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/DOMParser.cpp
diff --git a/Source/core/xml/DOMParser.cpp b/Source/core/xml/DOMParser.cpp
index ed2770cf66ee3a6d4fbca5b2c93104d75a2a986d..a60572e2e5cfeace4f48d641b94b827eae2924dc 100644
--- a/Source/core/xml/DOMParser.cpp
+++ b/Source/core/xml/DOMParser.cpp
@@ -25,20 +25,9 @@
namespace blink {
-PassRefPtrWillBeRawPtr<Document> DOMParser::parseFromString(const String& str, const String& contentType, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Document> DOMParser::parseFromString(const String& str, const String& type)
{
- // HTML5 is very explicit about which types we're allowed to support here:
- // http://domparsing.spec.whatwg.org/#the-domparser-interface
- if (contentType != "text/html"
- && contentType != "text/xml"
- && contentType != "application/xml"
- && contentType != "application/xhtml+xml"
- && contentType != "image/svg+xml") {
- exceptionState.throwTypeError("Unsupported mime-type specified.");
- return nullptr;
- }
-
- RefPtrWillBeRawPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, KURL(), false);
+ RefPtrWillBeRawPtr<Document> doc = DOMImplementation::createDocument(type, 0, KURL(), false);
doc->setContent(str);
return doc.release();
}
« no previous file with comments | « Source/core/xml/DOMParser.h ('k') | Source/core/xml/DOMParser.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698