From 3fc78fe48c74985fcf749da69b81e54e317ce59a Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Thu, 17 Nov 2011 14:37:27 +0800 Subject: [PATCH] Bug 702528 - IAccessible::get_accName should return S_FALSE when there's no accessible name, r=davidb --- accessible/src/msaa/nsAccessibleWrap.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/accessible/src/msaa/nsAccessibleWrap.cpp b/accessible/src/msaa/nsAccessibleWrap.cpp index 09fd4fa0244..592755cd577 100644 --- a/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/accessible/src/msaa/nsAccessibleWrap.cpp @@ -289,15 +289,12 @@ __try { 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)