1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/parser/htmlparser/tests/mochitest/test_bug339350.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.5 +<!-- 1.6 +Tests by Sam Ruby - WTFPL License (http://sam.zoy.org/wtfpl/) 1.7 + 1.8 +http://www.intertwingly.net/blog/2006/10/03/Firefox-XHTML-innerHTML-quirk#comments 1.9 +https://bugzilla.mozilla.org/show_bug.cgi?id=339350 1.10 +--> 1.11 +<head> 1.12 + <!-- XHTML needs the packed version --> 1.13 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"/> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339350">Mozilla Bug 339350</a> 1.18 +<div style="display: none"> 1.19 + <table border="1" cellspacing="0"> 1.20 + <thead> 1.21 + <th></th> 1.22 + <th>plain</th> 1.23 + <th>brackets</th> 1.24 + <th>braces</th> 1.25 + </thead> 1.26 + 1.27 + <tr> 1.28 + <th>innerHTML</th> 1.29 + <td><div id="i1"/></td> 1.30 + <td style="background:yellow"><div id="i2"/></td> 1.31 + <td><div id="i3"/></td> 1.32 + </tr> 1.33 + <tr> 1.34 + <th>textNode</th> 1.35 + <td><div id="t1"/></td> 1.36 + <td><div id="t2"/></td> 1.37 + <td><div id="t3"/></td> 1.38 + </tr> 1.39 + </table> 1.40 +</div> 1.41 +<pre id="test"> 1.42 +<script type="text/javascript"> 1.43 +var text1 = 'foo bar'; 1.44 +var text2 = 'foo [bar]'; 1.45 +var text3 = 'foo {bar}'; 1.46 + 1.47 +<!-- This is the long way to write this stuff, 1.48 + you can use MochiKit functions too --> 1.49 +document.getElementById('i1').innerHTML = text1; 1.50 +document.getElementById('i2').innerHTML = text2; 1.51 +document.getElementById('i3').innerHTML = text3; 1.52 + 1.53 +document.getElementById('t1').appendChild(document.createTextNode(text1)); 1.54 +document.getElementById('t2').appendChild(document.createTextNode(text2)); 1.55 +document.getElementById('t3').appendChild(document.createTextNode(text3)); 1.56 + 1.57 +<!-- The is() function is one way to add a test --> 1.58 +is(document.getElementById('i2').innerHTML, text2, "XHTML innerHTML with trailing brackets ']]'"); 1.59 + 1.60 +</script> 1.61 +</pre> 1.62 +</body> 1.63 +</html>