Bug 1507870 - add checks for whether Accessible actor has snapshot capability. r=pbro
authorYura Zenevich <yura.zenevich@gmail.com>
Fri, 30 Nov 2018 14:55:29 +0000
changeset 448985 5056bbebdb71a5d258f0173b4e39d7b4e16275c0
parent 448984 aa273e2036815104cb170ec0acf522aa4788e8e2
child 448986 e226f18cbdff3984d023430bd6f52ca3e0de6f19
push id35139
push userccoroiu@mozilla.com
push dateSat, 01 Dec 2018 02:30:08 +0000
treeherdermozilla-central@22425b629a9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1507870
milestone65.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 1507870 - add checks for whether Accessible actor has snapshot capability. r=pbro MozReview-Commit-ID: EhVlhvjDyS8 Differential Revision: https://phabricator.services.mozilla.com/D12503
devtools/client/accessibility/accessibility-startup.js
devtools/client/accessibility/panel.js
--- a/devtools/client/accessibility/accessibility-startup.js
+++ b/devtools/client/accessibility/accessibility-startup.js
@@ -47,18 +47,21 @@ class AccessibilityStartup {
     this._walker = await this._accessibility.getWalker();
 
     this._supports = {};
     // Only works with FF61+ targets
     this._supports.enableDisable =
       await this.target.actorHasMethod("accessibility", "enable");
 
     if (this._supports.enableDisable) {
-      this._supports.relations =
-        await this.target.actorHasMethod("accessible", "getRelations");
+      ([ this._supports.relations, this._supports.snapshot ] = await Promise.all([
+        this.target.actorHasMethod("accessible", "getRelations"),
+        this.target.actorHasMethod("accessible", "snapshot"),
+      ]));
+
       await this._accessibility.bootstrap();
     }
 
     return true;
   }
 
   /**
    * Fully initialize accessibility front. Also add listeners for accessibility
--- a/devtools/client/accessibility/panel.js
+++ b/devtools/client/accessibility/panel.js
@@ -235,18 +235,21 @@ AccessibilityPanel.prototype = {
     this.target.off("navigate", this.onTabNavigated);
     this._toolbox.off("select", this.onPanelVisibilityChange);
 
     this.panelWin.off(EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED,
       this.onNewAccessibleFrontSelected);
     this.panelWin.off(EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED,
       this.onAccessibilityInspectorUpdated);
 
-    this.picker.release();
-    this.picker = null;
+    // Older versions of debugger server do not support picker functionality.
+    if (this.picker) {
+      this.picker.release();
+      this.picker = null;
+    }
 
     if (this.front) {
       this.front.off("init", this.updateA11YServiceDurationTimer);
       this.front.off("shutdown", this.updateA11YServiceDurationTimer);
 
       this.front.off("init", this.forceUpdatePickerButton);
       this.front.off("shutdown", this.forceUpdatePickerButton);
     }