test_bug430624.html (1447B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=430624 5 --> 6 <head> 7 <title>Test for Bug 430624</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 <script src="/tests/SimpleTest/EventUtils.js"></script> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=430624">Mozilla Bug 430624</a> 14 <p id="display"></p> 15 16 17 18 <div id="content" style="display: none"> 19 20 </div> 21 <pre id="test"> 22 <script class="testbody" type="text/javascript"> 23 24 /** Test for Bug 430624 */ 25 26 function onLoad() { 27 window.frames[0].frameElement.onload = onReload; 28 // eslint-disable-next-line no-self-assign 29 window.frames[0].frameElement.srcdoc = window.frames[0].frameElement.srcdoc; 30 } 31 32 function onReload() { 33 var iframe = window.frames[0].frameElement; 34 SimpleTest.waitForFocus(doTest, iframe.contentWindow); 35 iframe.contentDocument.body.focus(); 36 } 37 38 function doTest() { 39 var bodyElement = window.frames[0].frameElement.contentDocument.body; 40 bodyElement.focus(); 41 sendString("Still ", window.frames[0].frameElement.contentWindow); 42 43 is(bodyElement.innerHTML, "Still contentEditable", "Check we're contentEditable after reload"); 44 45 SimpleTest.finish(); 46 } 47 48 SimpleTest.waitForExplicitFinish(); 49 50 </script> 51 </pre> 52 53 <iframe onload="onLoad()" srcdoc="<body contenteditable>contentEditable</body>"></iframe> 54 55 </body> 56 </html>