Bug 1056205 - Fix screen reader activation. r=fabrice
authorEitan Isaacson <eitan@monotonous.org>
Wed, 20 Aug 2014 11:20:07 -0700
changeset 200623 76e9621b8a08ba875ba0de9a7639898c49b45e67
parent 200622 8427a3f3067f7e12680f451e4554b3f0338a9a86
child 200624 fb294a66c8ac872560e978564f4039dbc4f7319c
push id47949
push usereisaacson@mozilla.com
push dateWed, 20 Aug 2014 18:20:13 +0000
treeherdermozilla-inbound@76e9621b8a08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs1056205
milestone34.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 1056205 - Fix screen reader activation. r=fabrice
b2g/chrome/content/settings.js
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -299,22 +299,26 @@ setUpdateTrackingId();
   };
   req.onerror = function() {
     dump("Error configuring layers.composer2d.enabled setting");
   };
 
 })();
 
 // ================ Accessibility ============
-SettingsListener.observe("accessibility.screenreader", false, function(value) {
-  if (value && !("AccessFu" in this)) {
-    Cu.import('resource://gre/modules/accessibility/AccessFu.jsm');
-    AccessFu.attach(window);
-  }
-});
+(function setupAccessibility() {
+  let accessibilityScope = {};
+  SettingsListener.observe("accessibility.screenreader", false, function(value) {
+    if (!('AccessFu' in accessibilityScope)) {
+      Cu.import('resource://gre/modules/accessibility/AccessFu.jsm',
+                accessibilityScope);
+      accessibilityScope.AccessFu.attach(window);
+    }
+  });
+})();
 
 // ================ Theming ============
 (function themingSettingsListener() {
   let themingPrefs = ['ui.menu', 'ui.menutext', 'ui.infobackground', 'ui.infotext',
                       'ui.window', 'ui.windowtext', 'ui.highlight'];
 
   themingPrefs.forEach(function(pref) {
     SettingsListener.observe('gaia.' + pref, null, function(value) {