Bug 1257242 - Improve RTL checks to actually check for RTL instead of using a hardcoded list. r=jimm draft
authorFelipe Gomes <felipc@gmail.com>
Wed, 16 Mar 2016 14:08:27 -0300
changeset 341119 a75671e7da0ad72faacbd08cbb673c756430368c
parent 341118 66c12a2665dbbbc7086a378faffb5e9d7d054f71
child 341165 2e5fb3215f5fdec13ad9ce9b8dd52f967cf50f7c
child 341167 d92878cc6aba58f488dfeea590d939545af25e01
push id13153
push userfelipc@gmail.com
push dateWed, 16 Mar 2016 17:08:54 +0000
reviewersjimm
bugs1257242, 1234673
milestone48.0a1
Bug 1257242 - Improve RTL checks to actually check for RTL instead of using a hardcoded list. r=jimm This does the much more correct check instead of relying on the list proposed in bug 1234673. MozReview-Commit-ID: Kb4Tls3eZhb
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4706,40 +4706,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;
+     disabledForBidi = registry->IsLocaleRTL(NS_LITERAL_CSTRING("global"));
   }
 
   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();