Bug 1257242 - Improve RTL checks to actually check for RTL instead of using a hardcoded list. r=jimm a=lizzard
authorFelipe Gomes <felipc@gmail.com>
Wed, 16 Mar 2016 17:31:31 -0300
changeset 317549 10325f06d055fba546067b8ffd329ffe58a76731
parent 317548 62e7918cebc5069c9cafb8f62b89449315dd6243
child 317550 e093539be413c9d6b67f3453657a58527d8e86d6
push id5787
push userfelipc@gmail.com
push dateMon, 21 Mar 2016 18:31:10 +0000
treeherdermozilla-beta@6a05bf779c39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, lizzard
bugs1257242
milestone46.0
Bug 1257242 - Improve RTL checks to actually check for RTL instead of using a hardcoded list. r=jimm a=lizzard
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4727,40 +4727,28 @@ MultiprocessBlockPolicy() {
   }
 
   /**
    * Avoids enabling e10s for certain locales that require bidi selection,
    * which currently doesn't work well with e10s.
    */
   bool disabledForBidi = false;
 
-  nsAutoCString locale;
   nsCOMPtr<nsIXULChromeRegistry> registry =
    mozilla::services::GetXULChromeRegistryService();
   if (registry) {
-     registry->GetSelectedLocale(NS_LITERAL_CSTRING("global"), locale);
-  }
-
-  int32_t index = locale.FindChar('-');
-  if (index >= 0) {
-    locale.Truncate(index);
-  }
-
-  if (locale.EqualsLiteral("ar") ||
-      locale.EqualsLiteral("fa") ||
-      locale.EqualsLiteral("he") ||
-      locale.EqualsLiteral("ur")) {
-    disabledForBidi = true;
+     registry->IsLocaleRTL(NS_LITERAL_CSTRING("global"), &disabledForBidi);
   }
 
   if (disabledForBidi) {
     gMultiprocessBlockPolicy = kE10sDisabledForBidi;
     return gMultiprocessBlockPolicy;
   }
 
+
 #if defined(XP_MACOSX)
   // If for any reason we suspect acceleration will be disabled, disable
   // e10s auto start on mac.
 
   // Check prefs
   bool accelDisabled = gfxPrefs::GetSingleton().LayersAccelerationDisabled() &&
                        !gfxPrefs::LayersAccelerationForceEnabled();