Index: LayoutTests/fast/dom/dom-parser-text-html-mimetype-support.html |
diff --git a/LayoutTests/fast/dom/dom-parser-text-html-mimetype-support.html b/LayoutTests/fast/dom/dom-parser-text-html-mimetype-support.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d6bda3357c6385bed2acb64b6209f4b41c14622f |
--- /dev/null |
+++ b/LayoutTests/fast/dom/dom-parser-text-html-mimetype-support.html |
@@ -0,0 +1,44 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script> |
+function parseHTMLContent() |
+{ |
+ var htmlContent = |
+ "<!DOCTYPE html>" + |
+ "<html>" + |
+ "<head>" + |
+ "<noscript>" + |
+ "<p>Scripts must be disabled for the document created using DOMParser.parseFromString()</p>" + |
+ "</noscript>" + |
+ "</head>" + |
+ "<body>" + |
+ "<div id='text'></div>" + |
+ "<script>document.getElementById('text').textContent = 'Newly added text';<\/script>" + |
+ "</body>" + |
+ "</html>"; |
+ var parser = new DOMParser(); |
+ var htmlDocument = parser.parseFromString(htmlContent, "text/html"); |
+ if (!htmlDocument) |
+ document.getElementById("result").textContent = "FAIL"; |
+ else { |
+ document.getElementById("result").textContent = "PASS"; |
+ document.getElementById("content").innerHTML = htmlDocument.documentElement.innerHTML; |
+ } |
+} |
+ |
+function runTest() |
+{ |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ } |
+ parseHTMLContent(); |
+} |
+</script> |
+</head> |
+<body onload="runTest();"> |
+<p>This tests DOMParser supports creating Document for HTML content with mime-type "text/html".</p> |
+<div id="content"></div> |
+<div id="result"></div> |
+</body> |
+</html> |