Bug 702528 - IAccessible::get_accName should return S_FALSE when there's no accessible name, r=davidb

This commit is contained in:
Alexander Surkov 2011-11-17 14:37:27 +08:00
Родитель e67c65485f
Коммит 3fc78fe48c
1 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -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)