layout/generic/test/test_bug970363.html

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:c1cf70e41732
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=970363
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 970363</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <script type="application/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=970363">Mozilla Bug 970363</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
17 </div>
18 <div contenteditable="true" id='editablediv'>
19 <div id='t'>S<span contenteditable="false">readonly</span>E</div>
20 </div>
21 <pre id="test">
22
23 <script type="application/javascript">
24
25 /** Test for Bug 970363 **/
26
27 SimpleTest.waitForExplicitFinish();
28
29 SimpleTest.waitForFocus(function() {
30 var t = document.getElementById("t");
31 var editablediv = document.getElementById("editablediv");
32 var sel = window.getSelection();
33 editablediv.focus();
34 sel.collapse(t, 0);
35
36 // Move past the 'S' char.
37 synthesizeKey("VK_RIGHT", {});
38 // Move across the span.
39 synthesizeKey("VK_RIGHT", {});
40 // Insert an 'I' to show when IP currently is.
41 synthesizeKey("I", {});
42
43 is(t.textContent, "SreadonlyIE", "the 'I' char should be inserted between 'readonly' and 'E'");
44 SimpleTest.finish();
45 });
46
47 </script>
48
49 </pre>
50 </body>
51 </html>

mercurial