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

Side by Side Diff: LayoutTests/fast/dom/dom-parser-text-html-mimetype-support.html

Issue 23903014: DOMParser.parseFromString() should support creating HTML Document with mimetype text/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function parseHTMLContent()
6 {
7 var htmlContent =
8 "<!DOCTYPE html>" +
9 "<html>" +
10 "<head>" +
11 "<noscript>" +
12 "<p>Scripts must be disabled for the document cr eated using DOMParser.parseFromString()</p>" +
13 "</noscript>" +
14 "</head>" +
15 "<body>" +
16 "<div id='text'></div>" +
17 "<script>document.getElementById('text').textContent = 'Newly added text';<\/script>" +
18 "</body>" +
19 "</html>";
20 var parser = new DOMParser();
21 var htmlDocument = parser.parseFromString(htmlContent, "text/html");
22 if (!htmlDocument)
23 document.getElementById("result").textContent = "FAIL";
24 else {
25 document.getElementById("result").textContent = "PASS";
26 document.getElementById("content").innerHTML = htmlDocument.documentElem ent.innerHTML;
27 }
28 }
29
30 function runTest()
31 {
32 if (window.testRunner) {
33 testRunner.dumpAsText();
34 }
35 parseHTMLContent();
36 }
37 </script>
38 </head>
39 <body onload="runTest();">
40 <p>This tests DOMParser supports creating Document for HTML content with mime-ty pe "text/html".</p>
41 <div id="content"></div>
42 <div id="result"></div>
43 </body>
44 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/dom-parser-text-html-mimetype-support-expected.txt » ('j') | Source/core/xml/DOMParser.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698