From 588accccdccca7a22463afb0efadab1d8adbc564 Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Thu, 30 Apr 2015 14:42:43 -0500 Subject: [PATCH] Bug 1159327 - Enable accessibility more broadly with e10s and add an e10s a11y blacklist for clients with known issues. r=tbsaunde --- accessible/windows/msaa/Compatibility.h | 20 ++++++++++++++++++++ browser/components/nsBrowserGlue.js | 3 +-- toolkit/xre/nsAppRunner.cpp | 16 ++++++++++------ xpcom/system/nsIXULRuntime.idl | 6 +++--- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/accessible/windows/msaa/Compatibility.h b/accessible/windows/msaa/Compatibility.h index dd9a82f7cdd9..d197f0755c45 100644 --- a/accessible/windows/msaa/Compatibility.h +++ b/accessible/windows/msaa/Compatibility.h @@ -39,6 +39,26 @@ public: */ static bool IsDolphin() { return !!(sConsumers & DOLPHIN); } + /** + * Return true if we should disable e10s due to a detected + * accessibility client. + */ + static bool IsBlacklistedForE10S() + { + // We currently blacklist everything except UNKNOWN and UIAUTOMATION + return !!(sConsumers & + (NVDA | + JAWS | + OLDJAWS | + WE | + DOLPHIN | + SEROTEK | + COBRA | + ZOOMTEXT | + KAZAGURU | + YOUDAO)); + } + private: Compatibility(); Compatibility(const Compatibility&); diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 95a7a1f998d5..a403048898a1 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -2811,8 +2811,7 @@ let E10SUINotification = { // 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 && - !Services.appinfo.accessibilityIsUIA) { + if (Services.appinfo.accessibilityIsBlacklistedForE10S) { this._showE10sAccessibilityWarning(); } } else { diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index c310213e854e..7967430d7232 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -105,6 +105,7 @@ #ifdef ACCESSIBILITY #include "nsAccessibilityService.h" +#include "mozilla/a11y/Compatibility.h" #endif #include "nsCRT.h" @@ -859,17 +860,20 @@ nsXULAppInfo::GetAccessibilityEnabled(bool* aResult) } NS_IMETHODIMP -nsXULAppInfo::GetAccessibilityIsUIA(bool* aResult) +nsXULAppInfo::GetAccessibilityIsBlacklistedForE10S(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"))) { +#if defined(ACCESSIBILITY) +#if defined(XP_WIN) + if (GetAccService() && mozilla::a11y::Compatibility::IsBlacklistedForE10S()) { + *aResult = true; + } +#elif defined(XP_MACOSX) + if (GetAccService()) { *aResult = true; } #endif +#endif // defined(ACCESSIBILITY) return NS_OK; } diff --git a/xpcom/system/nsIXULRuntime.idl b/xpcom/system/nsIXULRuntime.idl index a3215ef70cb5..4d7ac635d852 100644 --- a/xpcom/system/nsIXULRuntime.idl +++ b/xpcom/system/nsIXULRuntime.idl @@ -23,7 +23,7 @@ bool BrowserTabsRemoteAutostart(); * stable/frozen, please contact Benjamin Smedberg. */ -[scriptable, uuid(c4cd11c4-6e8e-49da-85a8-dad3b7605bc3)] +[scriptable, uuid(ce9d05f4-0c20-4f52-87e1-3a425e61e2f3)] interface nsIXULRuntime : nsISupports { /** @@ -97,10 +97,10 @@ interface nsIXULRuntime : nsISupports readonly attribute boolean accessibilityEnabled; /** - * Indicates if the active accessibility client is UIA. + * Indicates if the active accessibility client is blacklisted for e10s. * DO NOT USE! This is temporary and will be removed. */ - readonly attribute boolean accessibilityIsUIA; + readonly attribute boolean accessibilityIsBlacklistedForE10S; /** * Indicates whether the current Firefox build is 64-bit.