Bug 702528 - IAccessible::get_accName should return S_FALSE when there's no accessible name, r=davidb
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 17 Nov 2011 14:37:27 +0800
changeset 80373 e7d5dd9efecacc14b6828f79a28e6b59cb0c7a6b
parent 80372 b201f2434265d12621b3846b90ff595da685a6be
child 80374 fcaedef06327fc85f943a70dda0eaf3547eba88c
child 80378 6b42ff06457a4afe71d73d1711dad2b2af7beae6
push id3415
push usersurkov.alexander@gmail.com
push dateThu, 17 Nov 2011 06:38:04 +0000
treeherdermozilla-inbound@e7d5dd9efeca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs702528
milestone11.0a1
first release with
nightly win64
e7d5dd9efeca / 11.0a1 / 20111117030939 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 702528 - IAccessible::get_accName should return S_FALSE when there's no accessible name, r=davidb
accessible/src/msaa/nsAccessibleWrap.cpp
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -284,25 +284,22 @@ STDMETHODIMP nsAccessibleWrap::get_accNa
   *pszName = NULL;
   nsAccessible *xpAccessible = GetXPAccessibleFor(varChild);
   if (!xpAccessible)
     return E_FAIL;
   nsAutoString name;
   nsresult rv = xpAccessible->GetName(name);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);
-    
-  if (name.IsVoid()) {
-    // Valid return value for the name:
-    // The name was not provided, e.g. no alt attribute for an image.
-    // A screen reader may choose to invent its own accessible name, e.g. from
-    // an image src attribute.
-    // See nsHTMLImageAccessible::GetName()
-    return S_OK;
-  }
+
+  // The name was not provided, e.g. no alt attribute for an image. A screen
+  // reader may choose to invent its own accessible name, e.g. from an image src
+  // attribute. Refer to NS_OK_EMPTY_NAME return value.
+  if (name.IsVoid())
+    return S_FALSE;
 
   *pszName = ::SysAllocStringLen(name.get(), name.Length());
   if (!*pszName)
     return E_OUTOFMEMORY;
 
 } __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
 
   return S_OK;