mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 298572. No name for xul:label and xul:description static text objects. Patch thanks to Peter Parente (parente@cs.unc.edu), r=aaronlev, sr=tor, a=mkaply
This commit is contained in:
parent
758a3e1394
commit
582bbcfcfa
@ -38,6 +38,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// NOTE: alphabetically ordered
|
||||
#include "nsAccessibilityAtoms.h"
|
||||
#include "nsIDOMXULDescriptionElement.h"
|
||||
#include "nsXULTextAccessible.h"
|
||||
|
||||
@ -56,10 +57,13 @@ NS_IMETHODIMP nsXULTextAccessible::GetName(nsAString& aName)
|
||||
if (!content) {
|
||||
return NS_ERROR_FAILURE; // Node shut down
|
||||
}
|
||||
if (content->Tag() == nsAccessibilityAtoms::label) {
|
||||
return content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::value, aName);
|
||||
nsresult rv = content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::value, aName);
|
||||
if (rv == NS_CONTENT_ATTR_NOT_THERE) {
|
||||
// if the value doesn't exist, flatten the inner content as the name (for descriptions)
|
||||
return AppendFlatStringFromSubtree(content, &aName);
|
||||
}
|
||||
return nsTextAccessibleWrap::GetName(aName);
|
||||
// otherwise, use the value attribute as the name (for labels)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsXULTextAccessible::GetState(PRUint32 *_retval)
|
||||
|
Loading…
Reference in New Issue
Block a user