test_bug612128.html (1229B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=612128 5 --> 6 <head> 7 <title>Test for Bug 612128</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=612128">Mozilla Bug 612128</a> 14 <p id="display"></p> 15 <div id="content"> 16 <input> 17 <div contenteditable></div> 18 </div> 19 <pre id="test"> 20 <script type="application/javascript"> 21 22 /* eslint-disable no-useless-concat */ 23 24 /** Test for Bug 612128 */ 25 SimpleTest.waitForExplicitFinish(); 26 addLoadEvent(function() { 27 document.querySelector("input").focus(); 28 try { 29 is(document.execCommand("inserthtml", null, "<span>f" + "oo</span>"), 30 false, "The insertHTML command should return false"); 31 } catch (e) { 32 ok(false, "insertHTML should not throw here"); 33 } 34 is(document.querySelectorAll("span").length, 0, "No span element should be injected inside the page"); 35 is(document.body.innerHTML.indexOf("f" + "oo"), -1, "No text should be injected inside the page"); 36 SimpleTest.finish(); 37 }); 38 39 </script> 40 </pre> 41 </body> 42 </html>