PageRenderTime 17ms CodeModel.GetById 5ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/parser/htmlparser/tests/mochitest/test_bug339350.xhtml

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