bug 1250882 - implement xpcAccessible::GetLanguage() for proxied accessibles r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Wed, 10 Feb 2016 18:04:15 -0500
changeset 321820 95fbea0ae932fae5b3917166e3aa9f02afe7b00a
parent 321819 46c8baf26119fccf8eca5ac84f6ec4347072b46d
child 321821 af47d1b6cde3fc6242db6674365c4a5c87f3cf7c
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1250882
milestone47.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 1250882 - implement xpcAccessible::GetLanguage() for proxied accessibles r=davidb
accessible/xpcom/xpcAccessible.cpp
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -263,20 +263,27 @@ xpcAccessible::GetDescription(nsAString&
   aDescription.Assign(desc);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetLanguage(nsAString& aLanguage)
 {
-  if (!Intl())
+  if (IntlGeneric().IsNull())
     return NS_ERROR_FAILURE;
 
-  Intl()->Language(aLanguage);
+  nsAutoString lang;
+  if (ProxyAccessible* proxy = IntlGeneric().AsProxy()) {
+    proxy->Language(lang);
+  } else {
+    Intl()->Language(lang);
+  }
+
+  aLanguage.Assign(lang);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetValue(nsAString& aValue)
 {
   if (!Intl())
     return NS_ERROR_FAILURE;