Bug 1392757 - Be more resilient for data values we get in Android object navigation. r=yzen
authorEitan Isaacson <eitan@monotonous.org>
Tue, 22 Aug 2017 13:04:00 -0400
changeset 376601 a8aa84d9344ce606e48c66bd9abc4fa4f4773734
parent 376600 76c3595b3d37b89aeacb5d3c0a4a5d3188f9cb5d
child 376602 d796695719872ca0e1352663ee22482304ad0eae
push id32387
push userryanvm@gmail.com
push dateFri, 25 Aug 2017 00:13:42 +0000
treeherdermozilla-central@3199bacd6b38 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1392757
milestone57.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 1392757 - Be more resilient for data values we get in Android object navigation. r=yzen
accessible/jsat/AccessFu.jsm
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -301,19 +301,21 @@ this.AccessFu = { // jshint ignore:line
   onEvent: function(event, data, callback) {
     switch (event) {
       case "Accessibility:Settings":
         this._systemPref = data.enabled;
         this._enableOrDisable();
         break;
       case "Accessibility:NextObject":
       case "Accessibility:PreviousObject": {
-        let rule = data ?
-          data.rule.substr(0, 1).toUpperCase() + data.rule.substr(1).toLowerCase() :
-          "Simple";
+        let rule = "Simple";
+        if (data && data.rule && data.rule.length) {
+          rule = data.rule.substr(0, 1).toUpperCase() +
+            data.rule.substr(1).toLowerCase();
+        }
         let method = event.replace(/Accessibility:(\w+)Object/, "move$1");
         this.Input.moveCursor(method, rule, "gesture");
         break;
       }
       case "Accessibility:ActivateObject":
         this.Input.activateCurrent(data);
         break;
       case "Accessibility:LongPress":