|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=582181 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 582181</title> |
|
8 <meta charset="utf-8"> |
|
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> |
|
11 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
12 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
13 </head> |
|
14 <body onload="test()"> |
|
15 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=582181">Mozilla Bug 582181</a> |
|
16 <p id="display"></p> |
|
17 <div id="content" dir="rtl"> |
|
18 <textarea rows="5" id="testInput">Blah blah |
|
19 فلان فلان |
|
20 <ref>ooo</ref> |
|
21 <references /></textarea> |
|
22 </div> |
|
23 <pre id="test"> |
|
24 <script class="testbody" type="text/javascript"> |
|
25 |
|
26 /** Test for Bug 582181 **/ |
|
27 |
|
28 SimpleTest.waitForExplicitFinish(); |
|
29 |
|
30 function test() { |
|
31 var textInput = $("testInput"); |
|
32 var s1, s2, s3, equal, str1, str2; |
|
33 |
|
34 s1 = snapshotWindow(window); |
|
35 |
|
36 textInput.focus(); |
|
37 synthesizeKey("VK_DOWN", { }); |
|
38 synthesizeKey("VK_DOWN", { }); |
|
39 synthesizeKey("VK_DOWN", { }); |
|
40 synthesizeKey("VK_DOWN", { }); |
|
41 synthesizeKey("VK_BACK_SPACE", { }); |
|
42 textInput.blur(); |
|
43 s2 = snapshotWindow(window); |
|
44 |
|
45 [unequal, str1, str2] = compareSnapshots(s1, s2, false); |
|
46 ok(unequal, "backspace after text should change rendering: got " + str2); |
|
47 |
|
48 textInput.focus(); |
|
49 synthesizeKey(">", { }); |
|
50 textInput.blur(); |
|
51 s3 = snapshotWindow(window); |
|
52 |
|
53 [equal, str1, str2] = compareSnapshots(s1, s3, true); |
|
54 ok(equal, "entering '>' should restore original rendering: expected " + str1 + |
|
55 " but got " + str2); |
|
56 |
|
57 SimpleTest.finish(); |
|
58 } |
|
59 |
|
60 </script> |
|
61 </pre> |
|
62 </body> |
|
63 </html> |