зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
75608b018c
Коммит
816ddd7744
|
@ -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) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче