Bug 1092525 - Enable e10s for Windows systems that activate accessibility through UIA. r=trev
authorJim Mathies <jmathies@mozilla.com>
Fri, 23 Jan 2015 15:41:55 -0600
changeset 225556 c4ae38a60a427649c8c0f921c601323bd1bd65ed
parent 225555 11540adce3b616c36314a7d278deed6c73fdc68a
child 225557 a510d4f839bfdab8ad8f2a857f02749dee14a7b4
push id28167
push userryanvm@gmail.com
push dateSun, 25 Jan 2015 00:24:46 +0000
treeherdermozilla-central@c18776175a69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstrev
bugs1092525
milestone38.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 1092525 - Enable e10s for Windows systems that activate accessibility through UIA. r=trev
browser/components/nsBrowserGlue.js
toolkit/xre/nsAppRunner.cpp
xpcom/system/nsIXULRuntime.idl
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2535,17 +2535,18 @@ let E10SUINotification = {
 
       if (!activationNoticeShown) {
         this._showE10sActivatedNotice();
       }
 
       // e10s doesn't work with accessibility, so we prompt to disable
       // e10s if a11y is enabled, now or in the future.
       Services.obs.addObserver(this, "a11y-init-or-shutdown", true);
-      if (Services.appinfo.accessibilityEnabled) {
+      if (Services.appinfo.accessibilityEnabled &&
+          !Services.appinfo.accessibilityIsUIA) {
         this._showE10sAccessibilityWarning();
       }
     } else {
       let displayFeedbackRequest = false;
       try {
         displayFeedbackRequest = Services.prefs.getBoolPref("browser.requestE10sFeedback");
       } catch (e) {}
 
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -888,16 +888,31 @@ nsXULAppInfo::GetAccessibilityEnabled(bo
 NS_IMETHODIMP
 nsXULAppInfo::GetKeyboardMayHaveIME(bool* aResult)
 {
   *aResult = KeyboardMayHaveIME();
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsXULAppInfo::GetAccessibilityIsUIA(bool* aResult)
+{
+  *aResult = false;
+#if defined(ACCESSIBILITY) && defined(XP_WIN)
+  // This is the same check the a11y service does to identify uia clients.
+  if (GetAccService() != nullptr &&
+      (::GetModuleHandleW(L"uiautomation") ||
+       ::GetModuleHandleW(L"uiautomationcore"))) {
+    *aResult = true;
+  }
+#endif
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsXULAppInfo::EnsureContentProcess()
 {
   if (XRE_GetProcessType() != GeckoProcessType_Default)
     return NS_ERROR_NOT_AVAILABLE;
 
   nsRefPtr<ContentParent> unused = ContentParent::GetNewOrUsedBrowserProcess();
   return NS_OK;
 }
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -18,17 +18,17 @@ bool BrowserTabsRemoteAutostart();
 
 /**
  * Provides information about the XUL runtime.
  * @status UNSTABLE - This interface is not frozen and will probably change in
  *                    future releases. If you need this functionality to be
  *                    stable/frozen, please contact Benjamin Smedberg.
  */
 
-[scriptable, uuid(15b0e6cf-83da-4672-814e-cfa0b06ba31b)]
+[scriptable, uuid(fb861ca6-426f-4edf-844e-bbabec9bbc1a)]
 interface nsIXULRuntime : nsISupports
 {
   /**
    * Whether the application was launched in safe mode.
    */
   readonly attribute boolean inSafeMode;
 
   /**
@@ -99,16 +99,22 @@ interface nsIXULRuntime : nsISupports
   /**
    * This returns a very rough approximation of whether IME is likely
    * to be used for the browser session. DO NOT USE! This is temporary
    * and will be removed.
    */
   readonly attribute boolean keyboardMayHaveIME;
 
   /**
+   * Indicates if the active accessibility client is UIA.
+   * DO NOT USE! This is temporary and will be removed.
+   */
+  readonly attribute boolean accessibilityIsUIA;
+
+  /**
    * Signal the apprunner to invalidate caches on the next restart.
    * This will cause components to be autoregistered and all
    * fastload data to be re-created.
    */
   void invalidateCachesOnRestart();
 
   /**
    * Starts a child process. This method is intented to pre-start a