4 https://bugzilla.mozilla.org/show_bug.cgi?id=1109465
7 <title>Test for Bug
1109465</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" />
16 <div id=
"content" style=
"display: none">
22 <script class=
"testbody" type=
"application/javascript">
24 /** Test for Bug
1109465 **/
25 SimpleTest.waitForExplicitFinish();
26 SimpleTest.waitForFocus(function() {
27 var t = document.querySelector(
"textarea");
30 // Type foo\nbar and place the caret at the end of the last line
32 synthesizeKey(
"KEY_Enter");
34 synthesizeKey(
"KEY_ArrowUp");
35 is(t.selectionStart,
3,
"Correct start of selection");
36 is(t.selectionEnd,
3,
"Correct end of selection");
38 // Compose an IME string
39 var composingString =
"\u306B";
40 // FYI:
"compositionstart" will be dispatched automatically.
41 synthesizeCompositionChange(
43 {
"string": composingString,
46 {
"length":
1,
"attr": COMPOSITION_ATTR_RAW_CLAUSE },
49 "caret": {
"start":
1,
"length":
0 },
51 synthesizeComposition({ type:
"compositioncommitasis" });
52 is(t.value,
"foo\u306B\nbar",
"Correct value after composition");
54 // Now undo to test that the transaction merger has correctly detected the
56 synthesizeKey(
"Z", {accelKey: true});
57 is(t.value,
"foo\nbar",
"Correct value after undo");