Bug 1291839 - Fix setting rate in narrate. r?jaws
MozReview-Commit-ID: 66Fucl99eGO
--- 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.