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)

This commit is contained in:
gijskruitbosch@gmail.com 2008-03-29 15:04:04 -07:00
Родитель 75608b018c
Коммит 816ddd7744
2 изменённых файлов: 13 добавлений и 2 удалений

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

@ -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;
}

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

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