Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=500937 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 500937</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 10 | </head> |
michael@0 | 11 | <body> |
michael@0 | 12 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=500937">Mozilla Bug 500937</a> |
michael@0 | 13 | <p id="display"></p> |
michael@0 | 14 | <div id="content" style="display: none"> |
michael@0 | 15 | <iframe id=iframe src="about:blank"></iframe> |
michael@0 | 16 | </div> |
michael@0 | 17 | <pre id="test"> |
michael@0 | 18 | <script type="application/javascript"> |
michael@0 | 19 | |
michael@0 | 20 | /** Test for Bug 500937 **/ |
michael@0 | 21 | |
michael@0 | 22 | var d = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); |
michael@0 | 23 | var h = d.documentElement; |
michael@0 | 24 | h.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "head")); |
michael@0 | 25 | var b = d.createElementNS("http://www.w3.org/1999/xhtml", "body"); |
michael@0 | 26 | h.appendChild(b); |
michael@0 | 27 | |
michael@0 | 28 | b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "div")); |
michael@0 | 29 | b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "script")); |
michael@0 | 30 | b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "br")); |
michael@0 | 31 | b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "source")); |
michael@0 | 32 | b.appendChild(d.createElementNS("http://www.w3.org/1999/xhtml", "param")); |
michael@0 | 33 | b.appendChild(d.createTextNode("\u00A0")); |
michael@0 | 34 | |
michael@0 | 35 | is(new XMLSerializer().serializeToString(d), |
michael@0 | 36 | '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><div></div><script><\/script><br /><source /><param />\u00A0</body></html>', |
michael@0 | 37 | "XML DOM input to XMLSerializer"); |
michael@0 | 38 | |
michael@0 | 39 | d = document.getElementById('iframe').contentWindow.document; |
michael@0 | 40 | |
michael@0 | 41 | while(d.documentElement.previousSibling) { |
michael@0 | 42 | d.removeChild(d.documentElement.previousSibling); |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | d.replaceChild(h, d.documentElement); |
michael@0 | 46 | |
michael@0 | 47 | is(new XMLSerializer().serializeToString(d), |
michael@0 | 48 | '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><div></div><script><\/script><br /><source /><param />\u00A0</body></html>', |
michael@0 | 49 | "HTML DOM input to XMLSerializer"); |
michael@0 | 50 | |
michael@0 | 51 | </script> |
michael@0 | 52 | </pre> |
michael@0 | 53 | </body> |
michael@0 | 54 | </html> |