content/base/test/test_bug500937.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial