Bug 1291839 - Fix setting rate in narrate. r?jaws draft
authorEitan Isaacson <eitan@monotonous.org>
Wed, 03 Aug 2016 09:54:39 -0700
changeset 396386 1a9c0790d2a84eee64d0b8487dac0456cf4764d5
parent 395624 6608e5864780589b25d5421c3d3673ab30c4c318
child 527188 20fe1b0ca70d58cd534d44f23740166657d226a4
push id24985
push userbmo:eitan@monotonous.org
push dateWed, 03 Aug 2016 19:51:08 +0000
reviewersjaws
bugs1291839
milestone51.0a1
Bug 1291839 - Fix setting rate in narrate. r?jaws MozReview-Commit-ID: 66Fucl99eGO
toolkit/components/narrate/NarrateControls.jsm
--- a/toolkit/components/narrate/NarrateControls.jsm
+++ b/toolkit/components/narrate/NarrateControls.jsm
@@ -134,26 +134,31 @@ function NarrateControls(mm, win) {
   }
 
   let tb = win.document.getElementById("reader-toolbar");
   tb.appendChild(dropdown);
 }
 
 NarrateControls.prototype = {
   handleEvent: function(evt) {
+    if (evt.target.id == "narrate-rate-input") {
+      switch (evt.type) {
+        case "mousedown":
+          this._rateMousedown = true;
+          break;
+        case "mouseup":
+          this._rateMousedown = false;
+          /* fall through to "input" */
+        case "input":
+          this._onRateInput(evt);
+          break;
+      }
+    }
+
     switch (evt.type) {
-      case "mousedown":
-        this._rateMousedown = true;
-        break;
-      case "mouseup":
-        this._rateMousedown = false;
-        break;
-      case "input":
-        this._onRateInput(evt);
-        break;
       case "change":
         this._onVoiceChange();
         break;
       case "click":
         this._onButtonClick(evt);
         break;
       case "voiceschanged":
         // We disable this entire feature if there are no synthesis voices.