Bug 960871 part.11 Rename EventUtils.synthesizeText() to EventUtils.synthesizeCompositionChange() r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 07 Oct 2014 19:01:50 +0900
changeset 232361 6a965889d97e1c5b6ca436908d382e8bad146686
parent 232360 52273860a2cda1e83b127d8f8ba53673db03f5f0
child 232362 f17271ef08d3b9fab8416bc98821e21bbd18f934
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewerssmaug
bugs960871
milestone35.0a1
Bug 960871 part.11 Rename EventUtils.synthesizeText() to EventUtils.synthesizeCompositionChange() r=smaug
editor/libeditor/tests/test_bug1026397.html
editor/libeditor/tests/test_bug697842.html
editor/libeditor/tests/test_bug795785.html
editor/libeditor/tests/test_contenteditable_text_input_handling.html
layout/base/tests/bug613807-1.html
testing/mochitest/tests/Harness_sanity/test_sanityEventUtils.html
testing/mochitest/tests/SimpleTest/EventUtils.js
toolkit/content/tests/chrome/file_autocomplete_with_composition.js
toolkit/content/tests/chrome/findbar_window.xul
widget/tests/test_assign_event_data.html
widget/tests/test_imestate.html
widget/tests/test_input_events_on_deactive_window.xul
widget/tests/window_composition_text_querycontent.xul
--- a/editor/libeditor/tests/test_bug1026397.html
+++ b/editor/libeditor/tests/test_bug1026397.html
@@ -42,30 +42,30 @@ function runTests()
     input.selectionStart = input.selectionEnd = aCaretOffset;
     if (aAdditionalExplanation) {
       aAdditionalExplanation = " " + aAdditionalExplanation;
     } else {
       aAdditionalExplanation = "";
     }
 
     synthesizeComposition({ type: "compositionstart" });
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": aInsertString,
           "clauses":
           [
             { "length": aInsertString.length, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": aInsertString.length, "length": 0 }
       });
     is(input.value, aExpectedValueDuringComposition,
        "The value of input whose maxlength is " + maxLengthStr + " should be "
          + aExpectedValueDuringComposition + " during composition" + aAdditionalExplanation);
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": aInsertString,
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": aInsertString.length, "length": 0 }
--- a/editor/libeditor/tests/test_bug697842.html
+++ b/editor/libeditor/tests/test_bug697842.html
@@ -48,55 +48,55 @@ function runTests()
     editor.addEventListener("compositionupdate", handler, true);
     editor.addEventListener("text", handler, true);
 
     // start composition
     synthesizeComposition({ type: "compositionstart" });
 
     // input first character
     composingString = "\u306B";
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": composingString,
           "clauses":
           [
             { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 1, "length": 0 }
       });
 
     // input second character
     composingString = "\u306B\u3085";
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": composingString,
           "clauses":
           [
             { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 2, "length": 0 }
       });
 
     // convert them
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": composingString,
           "clauses":
           [
             { "length": 2,
               "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
           ]
         },
         "caret": { "start": 2, "length": 0 }
       });
 
     // commit
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": composingString,
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 2, "length": 0 }
--- a/editor/libeditor/tests/test_bug795785.html
+++ b/editor/libeditor/tests/test_bug795785.html
@@ -117,29 +117,29 @@ function doCompositionTest(aElement, aEl
     var str = "Web \u958b\u767a\u8005\u306e\u7686\u3055\u3093\u306f\u3001" +
               "Firefox \u306b\u5b9f\u88c5\u3055\u308c\u3066\u3044\u308b HTML5" +
               " \u3084 CSS \u306e\u65b0\u6a5f\u80fd\u3092\u6d3b\u7528\u3059" +
               "\u308b\u3053\u3068\u3067\u3001\u9b45\u529b\u3042\u308b Web " +
               "\u30b5\u30a4\u30c8\u3084\u9769\u65b0\u7684\u306a Web \u30a2" +
               "\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u3088\u308a" +
               "\u77ed\u6642\u9593\u3067\u7c21\u5358\u306b\u4f5c\u6210\u3067" +
               "\u304d\u307e\u3059\u3002";
-    synthesizeText({
+    synthesizeCompositionChange({
         composition: {
           string: str,
           clauses: [
             { length: str.length, attr: COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         caret: { start: str.length, length: 0 }
       });
     hitEventLoop(function () {
       isnot(aElement.scrollTop, 0,
             aElementDescription + " was not scrolled by composition");
-      synthesizeText({
+      synthesizeCompositionChange({
         composition: { string: "", clauses: [ { length: 0, attr: 0 } ] },
         caret: { start: 0, length: 0 }
       });
       synthesizeComposition({ type: "compositionend", data: "" });
       hitEventLoop(function () {
         is(aElement.scrollTop, 0,
            aElementDescription + " was not scrolled back to the top by canceling composition");
         aCallback();
--- a/editor/libeditor/tests/test_contenteditable_text_input_handling.html
+++ b/editor/libeditor/tests/test_contenteditable_text_input_handling.html
@@ -217,17 +217,17 @@ function runTests()
     if (!aFocus._isEditable) {
       return;
     }
 
     // IME
     // start composition
     synthesizeComposition({ type: "compositionstart" });
     // input first character
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": "\u3089",
           "clauses":
           [
             { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 1, "length": 0 }
@@ -252,17 +252,17 @@ function runTests()
     if (!querySelectedText.succeeded) {
       return;
     }
     is(querySelectedText.offset, 1,
        "query selected text event returns wrong offset" + when);
     is(querySelectedText.text, "",
        "query selected text event returns wrong selected text" + when);
     // commit composition
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": "\u3089",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 1, "length": 0 }
--- a/layout/base/tests/bug613807-1.html
+++ b/layout/base/tests/bug613807-1.html
@@ -45,48 +45,48 @@
     area.focus();
 
     var domWindowUtils = SpecialPowers.getDOMWindowUtils(window);
 
     // start composition
     synthesizeComposition({ type: "compositionstart" });
 
     // input raw characters
-    synthesizeText(
+    synthesizeCompositionChange(
       { composition:
         { string: "\u306D",
           clauses: [
             { length: 1, attr: domWindowUtils.COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         caret: { start: 1, length: 0 }
       });
-    synthesizeText(
+    synthesizeCompositionChange(
       { composition:
         { string: "\u306D\u3053",
           clauses: [
             { length: 2, attr: domWindowUtils.COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         caret: { start: 2, length: 0 }
       });
 
     // convert
-    synthesizeText(
+    synthesizeCompositionChange(
       { composition:
         { string: "\u732B",
           clauses: [
             { length: 1, attr: domWindowUtils.COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
           ]
         },
         caret: { start: 1, length: 0 }
       });
 
     // commit
-    synthesizeText(
+    synthesizeCompositionChange(
       { composition:
         { string: "\u732B",
           clauses: [
             { length: 0, attr: 0 }
           ]
         },
         caret: { start: 1, length: 0 }
       });
--- a/testing/mochitest/tests/Harness_sanity/test_sanityEventUtils.html
+++ b/testing/mochitest/tests/Harness_sanity/test_sanityEventUtils.html
@@ -123,30 +123,30 @@ function starttest() {
     
       check = false;
       window.addEventListener("compositionupdate", function() { check = true; }, false);
       synthesizeComposition({ type: "compositionupdate", data: "a" });
       is(check, false, 'synthesizeComposition() should not dispatch compositionupdate without error');
 
       check = false;
       window.addEventListener("text", function() { check = true; }, false);
-      synthesizeText(
+      synthesizeCompositionChange(
         { "composition":
           { "string": "a",
             "clauses":
             [
               { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
             ]
           },
           "caret": { "start": 1, "length": 0 }
         }
       );
-      is(check, true, "synthesizeText should dispatch text event");
+      is(check, true, "synthesizeCompositionChange should cause dispatching a DOM text event");
 
-      synthesizeText(
+      synthesizeCompositionChange(
         { "composition":
           { "string": "a",
             "clauses":
             [
               { "length": 0, "attr": 0 }
             ]
           },
           "caret": { "start": 1, "length": 0 }
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -884,23 +884,24 @@ function synthesizeComposition(aEvent, a
   if (!utils) {
     return;
   }
 
   utils.sendCompositionEvent(aEvent.type, aEvent.data ? aEvent.data : "",
                              aEvent.locale ? aEvent.locale : "");
 }
 /**
- * Synthesize a text event.
+ * Synthesize a compositionchange event which causes a DOM text event and
+ * compositionupdate event if it's necessary.
  *
- * @param aEvent   The text event's information, this has |composition|
- *                 and |caret| members.  |composition| has |string| and
- *                 |clauses| members.  |clauses| must be array object.  Each
- *                 object has |length| and |attr|.  And |caret| has |start| and
- *                 |length|.  See the following tree image.
+ * @param aEvent   The compositionchange event's information, this has
+ *                 |composition| and |caret| members.  |composition| has
+ *                 |string| and |clauses| members.  |clauses| must be array
+ *                 object.  Each object has |length| and |attr|.  And |caret|
+ *                 has |start| and |length|.  See the following tree image.
  *
  *                 aEvent
  *                   +-- composition
  *                   |     +-- string
  *                   |     +-- clauses[]
  *                   |           +-- length
  *                   |           +-- attr
  *                   +-- caret
@@ -923,17 +924,17 @@ function synthesizeComposition(aEvent, a
  *                 Set caret position to the |caret.start|. It's offset from
  *                 the start of the composition string.  Set caret length to
  *                 |caret.length|.  If it's larger than 0, it should be wide
  *                 caret.  However, current nsEditor doesn't support wide
  *                 caret, therefore, you should always set 0 now.
  *
  * @param aWindow  Optional (If null, current |window| will be used)
  */
-function synthesizeText(aEvent, aWindow)
+function synthesizeCompositionChange(aEvent, aWindow)
 {
   var utils = _getDOMWindowUtils(aWindow);
   if (!utils) {
     return;
   }
 
   if (!aEvent.composition || !aEvent.composition.clauses ||
       !aEvent.composition.clauses[0]) {
--- a/toolkit/content/tests/chrome/file_autocomplete_with_composition.js
+++ b/toolkit/content/tests/chrome/file_autocomplete_with_composition.js
@@ -83,47 +83,47 @@ nsDoTestsForAutoCompleteWithComposition.
     // Simple composition when popup hasn't been shown.
     // The autocomplete popup should not be shown during composition, but
     // after compositionend, the popup should be shown.
     { description: "compositionstart shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "M",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "M", searchString: ""
     },
     { description: "modifying composition string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "Mo",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mo", searchString: ""
     },
     { description: "compositionend should open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "Mo",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 2, "length": 0 }
@@ -134,47 +134,47 @@ nsDoTestsForAutoCompleteWithComposition.
     },
     // If composition starts when popup is shown, the compositionstart event
     // should cause closing the popup.
     { description: "compositionstart should close the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("z", { type: "keydown" }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "z",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Moz", searchString: "Mo"
     },
     { description: "modifying composition string shouldn't reopen the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "zi",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mozi", searchString: "Mo"
     },
     { description: "compositionend should research the result and open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "zi",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 2, "length": 0 }
@@ -184,62 +184,62 @@ nsDoTestsForAutoCompleteWithComposition.
       }, popup: true, value: "Mozi", searchString: "Mozi"
     },
     // If composition is cancelled, the value shouldn't be changed.
     { description: "compositionstart should reclose the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("l", { type: "keydown" }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "l",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mozil", searchString: "Mozi"
     },
     { description: "modifying composition string shouldn't reopen the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "ll",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mozill", searchString: "Mozi"
     },
     { description: "modifying composition string to empty string shouldn't reopen the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mozi", searchString: "Mozi"
     },
     { description: "cancled compositionend should reopen the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
@@ -252,62 +252,62 @@ nsDoTestsForAutoCompleteWithComposition.
     // string should be the latest value.
     { description: "compositionstart with selected string should close the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow);
         synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow);
         synthesizeKey("z", { type: "keydown" }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "z",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Moz", searchString: "Mozi"
     },
     { description: "modifying composition string shouldn't reopen the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "zi",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mozi", searchString: "Mozi"
     },
     { description: "modifying composition string to empty string shouldn't reopen the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mo", searchString: "Mozi"
     },
     { description: "canceled compositionend should seach the result with the latest value",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
@@ -325,62 +325,62 @@ nsDoTestsForAutoCompleteWithComposition.
       }, popup: false, value: "", searchString: ""
     },
     // composition which is canceled shouldn't cause opening the popup.
     { description: "compositionstart shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "M",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "M", searchString: ""
     },
     { description: "modifying composition string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "Mo",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mo", searchString: ""
     },
     { description: "modifying composition string to empty string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
           }, aWindow);
       }, popup: false, value: "", searchString: ""
     },
     { description: "canceled compositionend shouldn't open the popup if it was closed",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
@@ -398,62 +398,62 @@ nsDoTestsForAutoCompleteWithComposition.
     },
     // If popup is open at starting composition, the popup should be reopened
     // after composition anyway.
     { description: "compositionstart shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "M",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "M", searchString: ""
     },
     { description: "modifying composition string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "Mo",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mo", searchString: ""
     },
     { description: "modifying composition string to empty string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
           }, aWindow);
       }, popup: false, value: "", searchString: ""
     },
     { description: "canceled compositionend should open the popup if it was opened",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
@@ -474,62 +474,62 @@ nsDoTestsForAutoCompleteWithComposition.
     // Even if the popup is closed, composition which is canceled should open
     // the popup if the value isn't empty.
     // XXX This might not be good behavior, but anyway, this is minor issue...
     { description: "compositionstart shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
         synthesizeKey("z", { type: "keydown", shiftKey: true }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "z",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Moz", searchString: "Mo"
     },
     { description: "modifying composition string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "zi",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mozi", searchString: "Mo"
     },
     { description: "modifying composition string to empty string shouldn't open the popup",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mo", searchString: "Mo"
     },
     { description: "canceled compositionend shouldn't open the popup if the popup was closed",
       completeDefaultIndex: false,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 0, "length": 0 }
@@ -547,47 +547,47 @@ nsDoTestsForAutoCompleteWithComposition.
       }, popup: false, value: "", searchString: ""
     },
     // Testing for nsIAutoCompleteInput.completeDefaultIndex being true.
     { description: "compositionstart shouldn't open the popup (completeDefaultIndex is true)",
       completeDefaultIndex: true,
       execute: function (aWindow) {
         synthesizeKey("m", { type: "keydown", shiftKey: true }, aWindow);
         synthesizeComposition({ type: "compositionstart" }, aWindow);
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "M",
               "clauses":
               [
                 { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 1, "length": 0 }
           }, aWindow);
       }, popup: false, value: "M", searchString: ""
     },
     { description: "modifying composition string shouldn't open the popup (completeDefaultIndex is true)",
       completeDefaultIndex: true,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "Mo",
               "clauses":
               [
                 { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
               ]
             },
             "caret": { "start": 2, "length": 0 }
           }, aWindow);
       }, popup: false, value: "Mo", searchString: ""
     },
     { description: "compositionend should open the popup (completeDefaultIndex is true)",
       completeDefaultIndex: true,
       execute: function (aWindow) {
-        synthesizeText(
+        synthesizeCompositionChange(
           { "composition":
             { "string": "Mo",
               "clauses":
               [
                 { "length": 0, "attr": 0 }
               ]
             },
             "caret": { "start": 2, "length": 0 }
--- a/toolkit/content/tests/chrome/findbar_window.xul
+++ b/toolkit/content/tests/chrome/findbar_window.xul
@@ -240,31 +240,31 @@
         clicked = true;
       }
 
       gFindBar._findField.inputField.focus();
 
       var searchStr = "text";
 
       synthesizeComposition({ type: "compositionstart" });
-      synthesizeText(
+      synthesizeCompositionChange(
         { "composition":
           { "string": searchStr,
             "clauses":
             [
               { "length": searchStr.length, "attr": COMPOSITION_ATTR_RAWINPUT }
             ]
           },
           "caret": { "start": searchStr.length, "length": 0 }
         });
 
       ok(gBrowser.contentWindow.getSelection().toString().toLowerCase() != searchStr,
          "testNormalFindWithComposition: text shouldn't be found during composition");
 
-      synthesizeText(
+      synthesizeCompositionChange(
         { "composition":
           { "string": searchStr,
             "clauses":
             [
               { "length": 0, "attr": 0 }
             ]
           },
           "caret": { "start": searchStr.length, "length": 0 }
--- a/widget/tests/test_assign_event_data.html
+++ b/widget/tests/test_assign_event_data.html
@@ -171,27 +171,27 @@ const kTests = [
   },
   { description: "WidgetKeyboardEvent (keyup during composition)",
     targetID: "input-text", eventType: "keyup",
     dispatchEvent: function () {
       document.getElementById(this.targetID).value = "";
       document.getElementById(this.targetID).focus();
       synthesizeKey("a", { type: "keydown" });
       synthesizeComposition({ type: "compositionstart" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u306D",
           "clauses":
           [
             { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 1, "length": 0 }
       });
       synthesizeKey("a", { type: "keyup" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u306D",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 1, "length": 0 }
       });
@@ -203,27 +203,27 @@ const kTests = [
     todoMismatch: [ ],
   },
   { description: "WidgetKeyboardEvent (keydown during composition)",
     targetID: "input-text", eventType: "keydown",
     dispatchEvent: function () {
       document.getElementById(this.targetID).value = "";
       document.getElementById(this.targetID).focus();
       synthesizeComposition({ type: "compositionstart" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u306D",
           "clauses":
           [
             { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 1, "length": 0 }
       });
       synthesizeKey("VK_RETURN", { type: "keydown" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u306D",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 1, "length": 0 }
       });
@@ -283,17 +283,17 @@ const kTests = [
     todoMismatch: [],
   },
   { description: "WidgetTextEvent (text)",
     targetID: "input-text", eventType: "text",
     dispatchEvent: function () {
       document.getElementById(this.targetID).value = "";
       document.getElementById(this.targetID).focus();
       synthesizeComposition({ type: "compositionstart" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u306D",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 1, "length": 0 }
       });
@@ -305,17 +305,17 @@ const kTests = [
     todoMismatch: [ ],
   },
   { description: "WidgetCompositionEvent (compositionupdate)",
     targetID: "input-text", eventType: "compositionupdate",
     dispatchEvent: function () {
       document.getElementById(this.targetID).value = "";
       document.getElementById(this.targetID).focus();
       synthesizeComposition({ type: "compositionstart" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u30E9\u30FC\u30E1\u30F3",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 4, "length": 0 }
       });
@@ -340,17 +340,17 @@ const kTests = [
     todoMismatch: [],
   },
   { description: "InternalEditorInputEvent (input at composing)",
     targetID: "input-text", eventType: "input",
     dispatchEvent: function () {
       document.getElementById(this.targetID).value = "";
       document.getElementById(this.targetID).focus();
       synthesizeComposition({ type: "compositionstart" });
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u30E9\u30FC\u30E1\u30F3",
           "clauses":
           [
             { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 4, "length": 0 }
       });
@@ -358,17 +358,17 @@ const kTests = [
     canRun: function () {
       return true;
     },
     todoMismatch: [ ],
   },
   { description: "InternalEditorInputEvent (input at committing)",
     targetID: "input-text", eventType: "input",
     dispatchEvent: function () {
-      synthesizeText({ "composition":
+      synthesizeCompositionChange({ "composition":
         { "string": "\u30E9\u30FC\u30E1\u30F3",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 4, "length": 0 }
       });
--- a/widget/tests/test_imestate.html
+++ b/widget/tests/test_imestate.html
@@ -1231,17 +1231,17 @@ function runEditorFlagChangeTests()
   var editorIMESupport =
     editor.QueryInterface(Components.interfaces.nsIEditorIMESupport);
   var flags = editor.flags;
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3078\u3093\u3057\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
@@ -1261,17 +1261,17 @@ function runEditorFlagChangeTests()
 
   editor.flags = flags;
   ok(editorIMESupport.composing,
      description + "#3 IME composition was committed unexpectedly");
   is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
      description + "#3 IME isn't enabled on HTML editor");
 
   // cancel the composition
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
--- a/widget/tests/test_input_events_on_deactive_window.xul
+++ b/widget/tests/test_input_events_on_deactive_window.xul
@@ -154,17 +154,17 @@ function startTests()
 
     // IME events
     clear();
     // start composition
     synthesizeComposition({ type: "compositionstart" });
     checkCompositionEvents(true, false, false, false, "compositionstart");
     clear();
     // input first character
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": "\u3089",
           "clauses":
           [
             { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
           ]
         },
         "caret": { "start": 1, "length": 0 }
@@ -190,17 +190,17 @@ function startTests()
       return;
     }
     is(querySelectedText.offset, 1,
        "query selected text event returns wrong offset");
     is(querySelectedText.text, "",
        "query selected text event returns wrong selected text");
     clear();
     // commit composition
-    synthesizeText(
+    synthesizeCompositionChange(
       { "composition":
         { "string": "\u3089",
           "clauses":
           [
             { "length": 0, "attr": 0 }
           ]
         },
         "caret": { "start": 1, "length": 0 }
--- a/widget/tests/window_composition_text_querycontent.xul
+++ b/widget/tests/window_composition_text_querycontent.xul
@@ -189,53 +189,53 @@ function runUndoRedoTest()
 {
   textarea.value = "";
   textarea.focus();
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input raw characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306D",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306D\u3053",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
   // convert
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u732B",
         "clauses":
         [
           { "length": 1,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   // commit
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u732B",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -243,29 +243,29 @@ function runUndoRedoTest()
 
   // end composition
   synthesizeComposition({ type: "compositionend", data: "\u732B" });
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input raw characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u307E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   // cancel the composition
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
@@ -273,64 +273,64 @@ function runUndoRedoTest()
 
   // end composition
   synthesizeComposition({ type: "compositionend", data: "" });
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input raw characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3080",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3080\u3059",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3080\u3059\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
     });
 
   // convert
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u5A18",
         "clauses":
         [
           { "length": 1,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   // commit
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u5A18",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -371,74 +371,74 @@ function runUndoRedoTest()
   synthesizeKey(" ", {});
   synthesizeKey("a", {});
   synthesizeKey(" ", {});
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input raw characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3088",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3088\u3046",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3088\u3046\u304b",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3088\u3046\u304b\u3044",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
     });
 
   // convert
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u5996\u602a",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
   // commit
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u5996\u602a",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 2, "length": 0 }
@@ -626,17 +626,17 @@ function runCompositionTest()
     return false;
   }
   caretRects[0] = caretRect;
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input first character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -650,17 +650,17 @@ function runCompositionTest()
   caretRect = synthesizeQueryCaretRect(1);
   if (!checkQueryContentResult(caretRect,
         "runCompositionTest: synthesizeQueryCaretRect #1-1")) {
     return false;
   }
   caretRects[1] = caretRect;
 
   // input second character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
@@ -683,17 +683,17 @@ function runCompositionTest()
   is(caretRects[2].top, caretRects[1].top,
      "runCompositionTest: caret is moved to another line (#1-2)");
   is(caretRects[2].width, caretRects[1].width,
      "runCompositionTest: caret width is wrong (#1-2)");
   is(caretRects[2].height, caretRects[1].height,
      "runCompositionTest: caret width is wrong (#1-2)");
 
   // input third character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
@@ -716,17 +716,17 @@ function runCompositionTest()
   is(caretRects[3].top, caretRects[2].top,
      "runCompositionTest: caret is moved to another line (#1-3)");
   is(caretRects[3].width, caretRects[2].width,
      "runCompositionTest: caret width is wrong (#1-3)");
   is(caretRects[3].height, caretRects[2].height,
      "runCompositionTest: caret height is wrong (#1-3)");
 
   // moves the caret left
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
@@ -750,17 +750,17 @@ function runCompositionTest()
      "runCompositionTest: caret rects are different (#1-3-1, top)");
   // by bug 335359, the caret width depends on the right side's character.
   is(caretRect.width, caretRects[2].width + 1,
      "runCompositionTest: caret rects are different (#1-3-1, width)");
   is(caretRect.height, caretRects[2].height,
      "runCompositionTest: caret rects are different (#1-3-1, height)");
 
   // moves the caret left
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -783,17 +783,17 @@ function runCompositionTest()
   is(caretRect.top, caretRects[1].top,
      "runCompositionTest: caret rects are different (#1-3-2, top)");
   // by bug 335359, the caret width depends on the right side's character.
   is(caretRect.width, caretRects[1].width + 1,
      "runCompositionTest: caret rects are different (#1-3-2, width)");
   is(caretRect.height, caretRects[1].height,
      "runCompositionTest: caret rects are different (#1-3-2, height)");
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
@@ -801,98 +801,98 @@ function runCompositionTest()
 
   if (!checkContent("\u3089\u30FC\u3081\u3093", "runCompositionTest", "#1-4") ||
       !checkSelection(4, "", "runCompositionTest", "#1-4")) {
     return;
   }
 
 
   // backspace
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081", "runCompositionTest", "#1-5") ||
       !checkSelection(3, "", "runCompositionTest", "#1-5")) {
     return;
   }
 
   // re-input
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093", "runCompositionTest", "#1-6") ||
       !checkSelection(4, "", "runCompositionTest", "#1-6")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055",
         "clauses":
         [
           { "length": 5, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 5, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055", "runCompositionTest", "#1-7") ||
       !checkSelection(5, "", "runCompositionTest", "#1-7")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044",
         "clauses":
         [
           { "length": 6, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 6, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044", "runCompositionTest", "#1-8") ||
       !checkSelection(6, "", "runCompositionTest", "#1-8")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
         "clauses":
         [
           { "length": 7, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 7, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053", "runCompositionTest", "#1-8") ||
       !checkSelection(7, "", "runCompositionTest", "#1-8")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
         "clauses":
         [
           { "length": 8, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 8, "length": 0 }
@@ -900,17 +900,17 @@ function runCompositionTest()
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
                     "runCompositionTest", "#1-9") ||
       !checkSelection(8, "", "runCompositionTest", "#1-9")) {
     return;
   }
 
   // convert
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
         "clauses":
         [
           { "length": 4,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT },
           { "length": 2,
             "attr": COMPOSITION_ATTR_CONVERTEDTEXT }
@@ -921,17 +921,17 @@ function runCompositionTest()
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
                     "runCompositionTest", "#1-10") ||
       !checkSelection(4, "", "runCompositionTest", "#1-10")) {
     return;
   }
 
   // change the selected clause
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
         "clauses":
         [
           { "length": 4,
             "attr": COMPOSITION_ATTR_CONVERTEDTEXT },
           { "length": 2,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
@@ -942,17 +942,17 @@ function runCompositionTest()
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
                     "runCompositionTest", "#1-11") ||
       !checkSelection(6, "", "runCompositionTest", "#1-11")) {
     return;
   }
 
   // reset clauses
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
         "clauses":
         [
           { "length": 5,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT },
           { "length": 3,
             "attr": COMPOSITION_ATTR_CONVERTEDTEXT }
@@ -973,17 +973,17 @@ function runCompositionTest()
   if (!checkQueryContentResult(textRect1,
         "runCompositionTest: synthesizeQueryTextRect #1-12-1") ||
       !checkQueryContentResult(textRect2,
         "runCompositionTest: synthesizeQueryTextRect #1-12-2")) {
     return false;
   }
 
   // commit the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 8, "length": 0 }
@@ -1010,68 +1010,68 @@ function runCompositionTest()
 
   checkRect(textRect3, textRect1, "runCompositionTest: textRect #1-13-1");
   checkRect(textRect4, textRect2, "runCompositionTest: textRect #1-13-2");
 
   // restart composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3057",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3057",
                     "runCompositionTest", "#2-1") ||
       !checkSelection(8 + 1, "", "runCompositionTest", "#2-1")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3058",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058",
                     "runCompositionTest", "#2-2") ||
       !checkSelection(8 + 1, "", "runCompositionTest", "#2-2")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3058\u3087",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087",
                     "runCompositionTest", "#2-3") ||
       !checkSelection(8 + 2, "", "runCompositionTest", "#2-3")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3058\u3087\u3046",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
@@ -1079,17 +1079,17 @@ function runCompositionTest()
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087\u3046",
                     "runCompositionTest", "#2-4") ||
       !checkSelection(8 + 3, "", "runCompositionTest", "#2-4")) {
     return;
   }
 
   // commit the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3058\u3087\u3046",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 3, "length": 0 }
@@ -1109,17 +1109,17 @@ function runCompositionTest()
 
   if (!checkSelection(4, "\u3055\u884C\u3053\u3046\u3058\u3087\u3046", "runCompositionTest", "#3-1")) {
     return;
   }
 
   // start composition with selection
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u304A",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1127,17 +1127,17 @@ function runCompositionTest()
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u304A",
                     "runCompositionTest", "#3-2") ||
       !checkSelection(4 + 1, "", "runCompositionTest", "#3-2")) {
     return;
   }
 
   // remove the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
@@ -1145,17 +1145,17 @@ function runCompositionTest()
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
                     "runCompositionTest", "#3-3") ||
       !checkSelection(4, "", "runCompositionTest", "#3-3")) {
     return;
   }
 
   // re-input the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3046",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1163,17 +1163,17 @@ function runCompositionTest()
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3046",
                     "runCompositionTest", "#3-4") ||
       !checkSelection(4 + 1, "", "runCompositionTest", "#3-4")) {
     return;
   }
 
   // cancel the composition
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
@@ -1187,51 +1187,51 @@ function runCompositionTest()
     return;
   }
 
   // bug 271815, some Chinese IMEs for Linux make empty composition string
   // and compty clause information when it lists up Chinese characters on
   // its candidate window.
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
                     "runCompositionTest", "#4-1") ||
       !checkSelection(4, "", "runCompositionTest", "#4-1")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
                     "runCompositionTest", "#4-2") ||
       !checkSelection(4, "", "runCompositionTest", "#4-2")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u6700",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1249,34 +1249,34 @@ function runCompositionTest()
                     "runCompositionTest", "#4-4") ||
       !checkSelection(5, "", "runCompositionTest", "#4-4")) {
     return;
   }
 
   // testing the canceling case
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
                     "runCompositionTest", "#4-5") ||
       !checkSelection(5, "", "runCompositionTest", "#4-5")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
@@ -1296,34 +1296,34 @@ function runCompositionTest()
     return;
   }
 
   // testing whether the empty composition string deletes selected string.
   synthesizeKey("VK_LEFT", { shiftKey: true });
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
                     "runCompositionTest", "#4-8") ||
       !checkSelection(4, "", "runCompositionTest", "#4-8")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u9AD8",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1349,51 +1349,51 @@ function runCompositionTest()
       !checkSelection(4, "", "runCompositionTest", "#4-11")) {
     return;
   }
 
   // bug 23558, ancient Japanese IMEs on Window may send empty text event
   // twice at canceling composition.
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u6700",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
                     "runCompositionTest", "#5-1") ||
       !checkSelection(4 + 1, "", "runCompositionTest", "#5-1")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
                     "runCompositionTest", "#5-2") ||
       !checkSelection(4, "", "runCompositionTest", "#5-2")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 0, "length": 0 }
@@ -1539,17 +1539,17 @@ function runCompositionEventTest()
                          true, true);
   input.addEventListener("input", formEventHandlerForInput,
                          true, true);
 
   // test for normal case
   initResults();
 
   synthesizeComposition({ type: "compositionstart" });
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1590,17 +1590,17 @@ function runCompositionEventTest()
      kDescription + "input hasn't been handled by window #1");
   is(windowEventData["input"], "\u3089",
      kDescription + "value of input element wasn't modified (window) #1");
   is(inputEventCounts["input"], 1,
      kDescription + "input hasn't been handled by input #1");
   is(inputEventData["input"], "\u3089",
      kDescription + "value of input element wasn't modified (input) #1");
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
@@ -1634,17 +1634,17 @@ function runCompositionEventTest()
   is(windowEventData["input"], "\u3089\u30FC",
      kDescription + "value of input element wasn't modified (window) #2");
   is(inputEventCounts["input"], 2,
      kDescription + "input hasn't been handled by input #2");
   is(inputEventData["input"], "\u3089\u30FC",
      kDescription + "value of input element wasn't modified (input) #2");
 
   // text event shouldn't cause composition update, e.g., at committing.
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 2, "length": 0 }
@@ -1686,28 +1686,28 @@ function runCompositionEventTest()
 
   // select the second character, then, data of composition start should be
   // the selected character.
   initResults();
   synthesizeKey("VK_LEFT", { shiftKey: true });
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1766,28 +1766,28 @@ function runCompositionEventTest()
   // preventDefault() should effect nothing.
   preventDefault = true;
 
   initResults();
   synthesizeKey("A", { accelKey: true }); // Select All
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306D",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306D",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -1848,28 +1848,28 @@ function runCompositionEventTest()
   // stopPropagation() should effect nothing (except event count)
   stopPropagation = true;
 
   initResults();
   synthesizeKey("A", { accelKey: true }); // Select All
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2233,17 +2233,17 @@ function runForceCommitTest()
 
   // Make the composition in textarea commit by click in the textarea
   textarea.focus();
   textarea.value = "";
 
   events = [];
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2286,17 +2286,17 @@ function runForceCommitTest()
 
   // Make the composition in textarea commit by click in another editor (input)
   textarea.focus();
   textarea.value = "";
   input.value = "";
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2331,17 +2331,17 @@ function runForceCommitTest()
      "runForceCommitTest: the input has the committed text? #3");
 
   // Make the composition in textarea commit by blur()
   textarea.focus();
   textarea.value = "";
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2373,17 +2373,17 @@ function runForceCommitTest()
 
   // Make the composition in textarea commit by input.focus()
   textarea.focus();
   textarea.value = "";
   input.value = "";
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2419,17 +2419,17 @@ function runForceCommitTest()
 
   // Make the composition in textarea commit by click in another document's editor
   textarea.focus();
   textarea.value = "";
   textareaInFrame.value = "";
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2465,17 +2465,17 @@ function runForceCommitTest()
 
   // Make the composition in textarea commit by another document's editor's focus()
   textarea.focus();
   textarea.value = "";
   textareaInFrame.value = "";
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2512,17 +2512,17 @@ function runForceCommitTest()
   // Make the composition in a textarea commit by click in another editable document
   textarea.focus();
   textarea.value = "";
   iframe2.contentDocument.body.innerHTML = "Text in the Body";
   var iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2558,17 +2558,17 @@ function runForceCommitTest()
 
   // Make the composition in an editable document commit by click in it
   iframe2.contentWindow.focus();
   iframe2.contentDocument.body.innerHTML = "Text in the Body";
   iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
 
   synthesizeComposition({ type: "compositionstart" }, iframe2.contentWindow);
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2602,17 +2602,17 @@ function runForceCommitTest()
   // Make the composition in an editable document commit by click in another document's editor
   textarea.value = "";
   iframe2.contentWindow.focus();
   iframe2.contentDocument.body.innerHTML = "Text in the Body";
   iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
 
   synthesizeComposition({ type: "compositionstart" }, iframe2.contentWindow);
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2651,17 +2651,17 @@ function runForceCommitTest()
   iframe2.contentWindow.focus();
   iframe2.contentDocument.body.innerHTML = "Text in the Body";
   iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
   iframe3.contentDocument.body.innerHTML = "Text in the Body";
   iframe3BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
 
   synthesizeComposition({ type: "compositionstart" }, iframe2.contentWindow);
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2754,34 +2754,34 @@ function runIsComposingTest()
   expectedIsComposing = false;
   description = "events before dispatching compositionstart";
   synthesizeKey("VK_LEFT", {});
 
   synthesizeKey("a", { type: "keydown" });
   synthesizeComposition({ type: "compositionstart" });
   expectedIsComposing = true;
   description = "events after dispatching compositionstart";
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3042",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
   synthesizeKey("a", { type: "keyup" });
 
   // Although, firing keypress event during composition is a bug.
   synthesizeKey("VK_INSERT", {});
 
   description = "events for committing composition string";
   synthesizeKey("VK_RETURN", { type: "keydown" });
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3042",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2815,17 +2815,17 @@ function runRemoveContentTest(aCallback)
   textarea.addEventListener("input", eventHandler, true);
   textarea.addEventListener("text", eventHandler, true);
 
   textarea.focus();
   textarea.value = "";
 
   synthesizeComposition({ type: "compositionstart" });
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u306E",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -2914,34 +2914,34 @@ function runTestOnAnotherContext(aPanelO
                      "height": r.bottom - r.top };
   checkRectContainsRect(editorRect, parentRect, aTestName +
                         ": the editor rect coordinates are wrong");
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3078\u3093\u3057\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
     });
 
   if (!checkContent("\u3078\u3093\u3057\u3093", aTestName, "#1-1") ||
       !checkSelection(4, "", aTestName, "#1-1")) {
     return;
   }
 
   // convert them #1
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u8FD4\u4FE1",
         "clauses":
         [
           { "length": 2,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
         ]
       },
@@ -2949,17 +2949,17 @@ function runTestOnAnotherContext(aPanelO
     });
 
   if (!checkContent("\u8FD4\u4FE1", aTestName, "#1-2") ||
       !checkSelection(2, "", aTestName, "#1-2")) {
     return;
   }
 
   // convert them #2
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u5909\u8EAB",
         "clauses":
         [
           { "length": 2,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT }
         ]
       },
@@ -2967,17 +2967,17 @@ function runTestOnAnotherContext(aPanelO
     });
 
   if (!checkContent("\u5909\u8EAB", aTestName, "#1-3") ||
       !checkSelection(2, "", aTestName, "#1-3")) {
     return;
   }
 
   // commit them
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u5909\u8EAB",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 2, "length": 0 }
@@ -3067,68 +3067,68 @@ function runMaxLengthTest()
   input.focus();
 
   var kDesc ="runMaxLengthTest";
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input first character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   if (!checkContent("\u3089", kDesc, "#1-1") ||
       !checkSelection(1, "", kDesc, "#1-1")) {
     return;
   }
 
   // input second character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC", kDesc, "#1-2") ||
       !checkSelection(2, "", kDesc, "#1-2")) {
     return;
   }
 
   // input third character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081", kDesc, "#1-3") ||
       !checkSelection(3, "", kDesc, "#1-3")) {
     return;
   }
 
   // input fourth character
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
@@ -3136,99 +3136,99 @@ function runMaxLengthTest()
 
   if (!checkContent("\u3089\u30FC\u3081\u3093", kDesc, "#1-4") ||
       !checkSelection(4, "", kDesc, "#1-4")) {
     return;
   }
 
 
   // backspace
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081",
         "clauses":
         [
           { "length": 3, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 3, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081", kDesc, "#1-5") ||
       !checkSelection(3, "", kDesc, "#1-5")) {
     return;
   }
 
   // re-input
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093",
         "clauses":
         [
           { "length": 4, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 4, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093", kDesc, "#1-6") ||
       !checkSelection(4, "", kDesc, "#1-6")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055",
         "clauses":
         [
           { "length": 5, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 5, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055", kDesc, "#1-7") ||
       !checkSelection(5, "", kDesc, "#1-7")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044",
         "clauses":
         [
           { "length": 6, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 6, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044", kDesc, "#1-8") ||
       !checkSelection(6, "", kDesc, "#1-8")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
         "clauses":
         [
           { "length": 7, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 7, "length": 0 }
     });
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
                     kDesc, "#1-8") ||
       !checkSelection(7, "", kDesc, "#1-8")) {
     return;
   }
 
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
         "clauses":
         [
           { "length": 8, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 8, "length": 0 }
@@ -3236,17 +3236,17 @@ function runMaxLengthTest()
 
   if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
                     kDesc, "#1-9") ||
       !checkSelection(8, "", kDesc, "#1-9")) {
     return;
   }
 
   // convert
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
         "clauses":
         [
           { "length": 4,
             "attr": COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT },
           { "length": 2,
             "attr": COMPOSITION_ATTR_CONVERTEDTEXT }
@@ -3256,17 +3256,17 @@ function runMaxLengthTest()
     });
 
   if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8", kDesc, "#1-10") ||
       !checkSelection(4, "", kDesc, "#1-10")) {
     return;
   }
 
   // commit the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 6, "length": 0 }
@@ -3279,34 +3279,34 @@ function runMaxLengthTest()
 
   synthesizeComposition({ type: "compositionend",
                           data: "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8" });
 
   // restart composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3057",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   if (!checkContent("\u30E9\u3057", kDesc, "#2-1") ||
       !checkSelection(1 + 1, "", kDesc, "#2-1")) {
     return;
   }
 
   // commit the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u3058",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -3353,34 +3353,34 @@ function runMaxLengthTest()
   // the carest is at start of the content.
   input.value = "X";
   input.selectionStart = input.selectionEnd = 0;
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u9B54",
         "clauses":
         [
           { "length": 1, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 1, "length": 0 }
     });
 
   if (!checkContent("\u9B54X", kDesc, "#4-1") ||
       !checkSelection(1, "", kDesc, "#4-1")) {
     return;
   }
 
   // commit the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u9B54",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 1, "length": 0 }
@@ -3394,34 +3394,34 @@ function runMaxLengthTest()
   }
 
   synthesizeComposition({ type: "compositionend", data: "\u9B54" });
 
   // start composition
   synthesizeComposition({ type: "compositionstart" });
 
   // input characters
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u9B54\u6CD5",
         "clauses":
         [
           { "length": 2, "attr": COMPOSITION_ATTR_RAWINPUT }
         ]
       },
       "caret": { "start": 2, "length": 0 }
     });
 
   if (!checkContent("\u9B54\u6CD5X", kDesc, "#5-1") ||
       !checkSelection(2, "", kDesc, "#5-1")) {
     return;
   }
 
   // commit the composition string
-  synthesizeText(
+  synthesizeCompositionChange(
     { "composition":
       { "string": "\u9B54\u6CD5",
         "clauses":
         [
           { "length": 0, "attr": 0 }
         ]
       },
       "caret": { "start": 2, "length": 0 }