Bug 1439288 - Remove unused synthesizeText function. r=ato
authorCameron McCormack <cam@mcc.id.au>
Mon, 19 Feb 2018 10:52:39 +0800
changeset 404395 d0406024a77bdbc9e1b868fc985e26ae97436ace
parent 404394 804713551b703c1c221d362c8334831326ebafb9
child 404396 1274d9304cecea8ab5a1093bcc20afaaf351a173
push id100000
push userncsoregi@mozilla.com
push dateMon, 19 Feb 2018 16:46:49 +0000
treeherdermozilla-inbound@176fb0d46b64 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1439288
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1439288 - Remove unused synthesizeText function. r=ato MozReview-Commit-ID: 6XjmPbUmXWq
testing/marionette/event.js
--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -1030,99 +1030,16 @@ event.synthesizeKeyExpectEvent = functio
  *     Window object.  Defaults to the current window.
  */
 event.synthesizeComposition = function(ev, window = undefined) {
   let domutils = getDOMWindowUtils(window);
   domutils.sendCompositionEvent(ev.type, ev.data || "", ev.locale || "");
 };
 
 /**
- * Synthesize a text event.
- *
- * 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.
- *
- *     ev
- *      +-- composition
- *      |     +-- string
- *      |     +-- clauses[]
- *      |           +-- length
- *      |           +-- attr
- *      +-- caret
- *            +-- start
- *            +-- length
- *
- * Set the composition string to |composition.string|.  Set its clauses
- * information to the |clauses| array.
- *
- * When it's composing, set the each clauses' length
- * to the |composition.clauses[n].length|.  The sum
- * of the all length values must be same as the length of
- * |composition.string|. Set nsIDOMWindowUtils.COMPOSITION_ATTR_* to the
- * |composition.clauses[n].attr|.
- *
- * When it's not composing, set 0 to the |composition.clauses[0].length|
- * and |composition.clauses[0].attr|.
- *
- * Set caret position to the |caret.start|. Its 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 {Object.<string, ?>} ev
- *     The text event's information,
- * @param {Window=} window
- *     Window object.  Defaults to the current window.
- */
-event.synthesizeText = function(ev, window = undefined) {
-  let domutils = getDOMWindowUtils(window);
-
-  if (!ev.composition ||
-      !ev.composition.clauses ||
-      !ev.composition.clauses[0]) {
-    return;
-  }
-
-  let firstClauseLength = ev.composition.clauses[0].length;
-  let firstClauseAttr   = ev.composition.clauses[0].attr;
-  let secondClauseLength = 0;
-  let secondClauseAttr = 0;
-  let thirdClauseLength = 0;
-  let thirdClauseAttr = 0;
-  if (ev.composition.clauses[1]) {
-    secondClauseLength = ev.composition.clauses[1].length;
-    secondClauseAttr   = ev.composition.clauses[1].attr;
-    if (event.composition.clauses[2]) {
-      thirdClauseLength = ev.composition.clauses[2].length;
-      thirdClauseAttr   = ev.composition.clauses[2].attr;
-    }
-  }
-
-  let caretStart = -1;
-  let caretLength = 0;
-  if (event.caret) {
-    caretStart = ev.caret.start;
-    caretLength = ev.caret.length;
-  }
-
-  domutils.sendTextEvent(
-      ev.composition.string,
-      firstClauseLength,
-      firstClauseAttr,
-      secondClauseLength,
-      secondClauseAttr,
-      thirdClauseLength,
-      thirdClauseAttr,
-      caretStart,
-      caretLength);
-};
-
-/**
  * Synthesize a query selected text event.
  *
  * @param {Window=}
  *     Window object.  Defaults to the current window.
  *
  * @return {(nsIQueryContentEventResult|null)}
  *     Event's result, or null if it failed.
  */