|
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 type="application/javascript" src="/MochiKit/packed.js"></script> |
|
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
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=612128">Mozilla Bug 612128</a> |
|
15 <p id="display"></p> |
|
16 <div id="content"> |
|
17 <input> |
|
18 <div contenteditable></div> |
|
19 </div> |
|
20 <pre id="test"> |
|
21 <script type="application/javascript"> |
|
22 |
|
23 /** Test for Bug 612128 **/ |
|
24 SimpleTest.waitForExplicitFinish(); |
|
25 addLoadEvent(function() { |
|
26 document.querySelector("input").focus(); |
|
27 var threw = false; |
|
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> |