Bug 975276 - Fix cursor parameter mistake of setComposition. r=masayuki
authorYuan Xulei <xyuan@mozilla.com>
Tue, 17 Jun 2014 12:05:49 +0800
changeset 190143 543203ca7ebedc88d77503538511152b229589f9
parent 190142 3a05fcd14cabbeadb1a9209a51a21f15264405f7
child 190144 32c4e06960f2226702e6c6a55c9fc6bfe4f60fe6
push id8293
push userryanvm@gmail.com
push dateMon, 23 Jun 2014 15:57:26 +0000
treeherderb2g-inbound@32c4e06960f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs975276
milestone33.0a1
Bug 975276 - Fix cursor parameter mistake of setComposition. r=masayuki
dom/inputmethod/MozKeyboard.js
--- a/dom/inputmethod/MozKeyboard.js
+++ b/dom/inputmethod/MozKeyboard.js
@@ -569,17 +569,17 @@ MozInputContext.prototype = {
 
   setComposition: function ic_setComposition(text, cursor, clauses) {
     let self = this;
     return this._sendPromise(function(resolverId) {
       cpmm.sendAsyncMessage('Keyboard:SetComposition', {
         contextId: self._contextId,
         requestId: resolverId,
         text: text,
-        cursor: cursor || text.length,
+        cursor: (typeof cursor !== 'undefined') ? cursor : text.length,
         clauses: clauses || null
       });
     });
   },
 
   endComposition: function ic_endComposition(text) {
     let self = this;
     return this._sendPromise(function(resolverId) {