Bug 865997 - Don't prune complex subtrees for roles usually having no children, r=tbsaunde

This commit is contained in:
Alexander Surkov 2013-05-08 18:26:54 +09:00
parent 84bfe510d9
commit 1bbfb14e1e
2 changed files with 18 additions and 15 deletions

View File

@ -439,18 +439,21 @@ nsAccUtils::MustPrune(Accessible* aAccessible)
{
roles::Role role = aAccessible->Role();
// We don't prune buttons any more however AT don't expect children inside of
// button in general, we allow menu buttons to have children to make them
// accessible.
return role == roles::MENUITEM ||
role == roles::COMBOBOX_OPTION ||
role == roles::OPTION ||
role == roles::ENTRY ||
role == roles::FLAT_EQUATION ||
role == roles::PASSWORD_TEXT ||
role == roles::TOGGLE_BUTTON ||
role == roles::GRAPHIC ||
role == roles::SLIDER ||
role == roles::PROGRESSBAR ||
role == roles::SEPARATOR;
// Don't prune the tree for certain roles if the tree is more complex than
// a single text leaf.
return
(role == roles::MENUITEM ||
role == roles::COMBOBOX_OPTION ||
role == roles::OPTION ||
role == roles::ENTRY ||
role == roles::FLAT_EQUATION ||
role == roles::PASSWORD_TEXT ||
role == roles::PUSHBUTTON ||
role == roles::TOGGLE_BUTTON ||
role == roles::GRAPHIC ||
role == roles::SLIDER ||
role == roles::PROGRESSBAR ||
role == roles::SEPARATOR) &&
aAccessible->ContentChildCount() == 1 &&
aAccessible->ContentChildAt(0)->IsTextLeaf();
}

View File

@ -49,7 +49,7 @@ if (!MAC) {
// Not specific case, point is inside of btn accessible.
var btn = getAccessible("btn");
var btnText = btn.firstChild;
testChildAtPoint(btn, 1, 1, btnText, btnText);
testChildAtPoint(btn, 1, 1, btn, btn);
// Not specific case, point is outside of btn accessible.
testChildAtPoint(btn, -1, 1, null, null);