parser/htmlparser/tests/mochitest/test_bug339350.xhtml

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.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 2 <!--
michael@0 3 Tests by Sam Ruby - WTFPL License (http://sam.zoy.org/wtfpl/)
michael@0 4
michael@0 5 http://www.intertwingly.net/blog/2006/10/03/Firefox-XHTML-innerHTML-quirk#comments
michael@0 6 https://bugzilla.mozilla.org/show_bug.cgi?id=339350
michael@0 7 -->
michael@0 8 <head>
michael@0 9 <!-- XHTML needs the packed version -->
michael@0 10 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
michael@0 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 12 </head>
michael@0 13 <body>
michael@0 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339350">Mozilla Bug 339350</a>
michael@0 15 <div style="display: none">
michael@0 16 <table border="1" cellspacing="0">
michael@0 17 <thead>
michael@0 18 <th></th>
michael@0 19 <th>plain</th>
michael@0 20 <th>brackets</th>
michael@0 21 <th>braces</th>
michael@0 22 </thead>
michael@0 23
michael@0 24 <tr>
michael@0 25 <th>innerHTML</th>
michael@0 26 <td><div id="i1"/></td>
michael@0 27 <td style="background:yellow"><div id="i2"/></td>
michael@0 28 <td><div id="i3"/></td>
michael@0 29 </tr>
michael@0 30 <tr>
michael@0 31 <th>textNode</th>
michael@0 32 <td><div id="t1"/></td>
michael@0 33 <td><div id="t2"/></td>
michael@0 34 <td><div id="t3"/></td>
michael@0 35 </tr>
michael@0 36 </table>
michael@0 37 </div>
michael@0 38 <pre id="test">
michael@0 39 <script type="text/javascript">
michael@0 40 var text1 = 'foo bar';
michael@0 41 var text2 = 'foo [bar]';
michael@0 42 var text3 = 'foo {bar}';
michael@0 43
michael@0 44 <!-- This is the long way to write this stuff,
michael@0 45 you can use MochiKit functions too -->
michael@0 46 document.getElementById('i1').innerHTML = text1;
michael@0 47 document.getElementById('i2').innerHTML = text2;
michael@0 48 document.getElementById('i3').innerHTML = text3;
michael@0 49
michael@0 50 document.getElementById('t1').appendChild(document.createTextNode(text1));
michael@0 51 document.getElementById('t2').appendChild(document.createTextNode(text2));
michael@0 52 document.getElementById('t3').appendChild(document.createTextNode(text3));
michael@0 53
michael@0 54 <!-- The is() function is one way to add a test -->
michael@0 55 is(document.getElementById('i2').innerHTML, text2, "XHTML innerHTML with trailing brackets ']]'");
michael@0 56
michael@0 57 </script>
michael@0 58 </pre>
michael@0 59 </body>
michael@0 60 </html>

mercurial