Bug 381048. Allow accessible names on ARIA elements with no child content, but with title. Patch by David Bolter. r=aaronlev
authoraaronleventhal@moonset.net
Tue, 29 May 2007 07:45:38 -0700
changeset 1942 20a44f00b49e08ed5b334996fed7e5040c5e9b97
parent 1941 2487927ce6dddc3f15734b52c6526ff0b1ec256b
child 1943 25704b50c8bf42ac158a5841282466412bcb539b
push idunknown
push userunknown
push dateunknown
reviewersaaronlev
bugs381048
milestone1.9a5pre
Bug 381048. Allow accessible names on ARIA elements with no child content, but with title. Patch by David Bolter. r=aaronlev
accessible/src/base/nsAccessible.cpp
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -1873,17 +1873,17 @@ nsresult nsAccessible::GetHTMLName(nsASt
       aLabel = label;
       return NS_OK;
     }
   }
 
   if (aCanAggregateSubtree) {
     // Don't use AppendFlatStringFromSubtree for container widgets like menulist
     nsresult rv = AppendFlatStringFromSubtree(content, &aLabel);
-    if (NS_SUCCEEDED(rv)) {
+    if (NS_SUCCEEDED(rv) && !aLabel.IsEmpty()) {
       return NS_OK;
     }
   }
 
   // Still try the title as as fallback method in that case.
   if (!content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::title,
                         aLabel)) {
     aLabel.SetIsVoid(PR_TRUE);