test_bug340800.html (1481B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=340800 5 --> 6 <head> 7 <title>Test for Bug 340800</title> 8 <script 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=340800">Mozilla Bug 340800</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 <h1>iframe text/plain as DOM test</h1> 16 17 <div> 18 19 <iframe name="iframe1" width="100%" height="200" 20 src="bug340800_iframe.txt"></iframe> 21 </div> 22 23 <div> 24 <h2>textarea with iframe content</h2> 25 <textarea rows="10" cols="80" id="textarea1"></textarea> 26 </div> 27 28 <div> 29 <h2>div with white-space: pre and iframe content</h2> 30 <div id="div1"></div> 31 </div> 32 </div> 33 <pre id="test"> 34 <script class="testbody" type="text/javascript"> 35 36 /** Test for Bug 340800 */ 37 function populateIframes () { 38 var iframe, iframeBody; 39 if ((iframe = window.frames.iframe1) && (iframeBody = iframe.document.body)) { 40 $('div1').innerHTML = iframeBody.innerHTML; 41 $('textarea1').value = iframeBody.innerHTML; 42 } 43 is($('div1').firstChild.tagName, "PRE", "innerHTML from txt iframe works with div"); 44 ok($('textarea1').value.indexOf("<pre>") > -1, "innerHTML from txt iframe works with textarea.value"); 45 SimpleTest.finish(); 46 } 47 48 addLoadEvent(populateIframes); 49 SimpleTest.waitForExplicitFinish(); 50 51 </script> 52 </pre> 53 </body> 54 </html>