Bug 425213 – FOCUSABLE state not exposed for descendants of container with aria-activedescendant

p=aaronleventhal@moonset.net (Aaron Leventhal)
r=surkov.alexander@gmail.com (Alexander Surkov)
a=beltzner@mozilla.com (Mike Beltzner)


git-svn-id: svn://10.0.0.236/trunk@248834 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gijskruitbosch%gmail.com 2008-03-29 22:04:04 +00:00
parent cb285e6248
commit 8b743bb455
2 changed files with 13 additions and 2 deletions

View File

@ -1284,9 +1284,8 @@ static PRBool HasRelatedContent(nsIContent *aContent)
}
nsIContent *ancestorContent = aContent;
nsAutoString activeID;
while ((ancestorContent = ancestorContent->GetParent()) != nsnull) {
if (ancestorContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_activedescendant, activeID)) {
if (ancestorContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_activedescendant)) {
// ancestor has activedescendant property, this content could be active
return PR_TRUE;
}

View File

@ -2430,6 +2430,18 @@ nsAccessible::GetARIAState(PRUint32 *aState)
// Once DHTML role is used, we're only readonly if DHTML readonly used
*aState &= ~nsIAccessibleStates::STATE_READONLY;
if (content->HasAttr(kNameSpaceID_None, content->GetIDAttributeName())) {
// If has a role & ID and aria-activedescendant on the container, assume focusable
nsIContent *ancestorContent = content;
while ((ancestorContent = ancestorContent->GetParent()) != nsnull) {
if (ancestorContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_activedescendant)) {
// ancestor has activedescendant property, this content could be active
*aState |= nsIAccessibleStates::STATE_FOCUSABLE;
break;
}
}
}
*aState |= mRoleMapEntry->state;
if (MappedAttrState(content, aState, &mRoleMapEntry->attributeMap1) &&
MappedAttrState(content, aState, &mRoleMapEntry->attributeMap2) &&