Bug 1219743 - remove special ARIA owns support for ARIA menus, r=yzen

This commit is contained in:
Alexander Surkov 2015-10-30 23:19:52 -04:00
parent 2834a412d0
commit 3b1f584fc6

View File

@ -299,33 +299,18 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
// Fire menu start/end events for ARIA menus.
if (target->IsARIARole(nsGkAtoms::menuitem)) {
// The focus was moved into menu.
bool tryOwnsParent = true;
Accessible* ARIAMenubar = nullptr;
Accessible* child = target;
Accessible* parent = child->Parent();
while (parent) {
nsRoleMapEntry* roleMap = parent->ARIARoleMap();
if (roleMap) {
if (roleMap->Is(nsGkAtoms::menubar)) {
ARIAMenubar = parent;
break;
}
// Go up in the parent chain of the menu hierarchy.
if (roleMap->Is(nsGkAtoms::menuitem) || roleMap->Is(nsGkAtoms::menu)) {
child = parent;
parent = child->Parent();
tryOwnsParent = true;
continue;
}
for (Accessible* parent = target->Parent(); parent; parent = parent->Parent()) {
if (parent->IsARIARole(nsGkAtoms::menubar)) {
ARIAMenubar = parent;
break;
}
// If no required context role then check aria-owns relation.
if (!tryOwnsParent)
// Go up in the parent chain of the menu hierarchy.
if (!parent->IsARIARole(nsGkAtoms::menuitem) &&
!parent->IsARIARole(nsGkAtoms::menu)) {
break;
parent = ARIAOwnedByIterator(child).Next();
tryOwnsParent = false;
}
}
if (ARIAMenubar != mActiveARIAMenubar) {