Bug 1455511: Always prune the accessibility tree for sliders. r=surkov

It doesn't make sense for a slider to have descendants and this confuses NVDA.

MozReview-Commit-ID: 2A3gqTSu38g

--HG--
extra : rebase_source : 8776da7b23601eb3f1ec9e9711f9f9cd9eedd849
This commit is contained in:
James Teh 2018-04-23 17:23:00 +10:00
Родитель cc7fecadc3
Коммит fc5fc8afb1
1 изменённых файлов: 22 добавлений и 16 удалений

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

@ -436,21 +436,27 @@ nsAccUtils::MustPrune(Accessible* aAccessible)
{ {
roles::Role role = aAccessible->Role(); roles::Role role = aAccessible->Role();
// Don't prune the tree for certain roles if the tree is more complex than
// a single text leaf.
return return
(role == roles::MENUITEM || // Always prune the tree for sliders, as it doesn't make sense for a slider
role == roles::COMBOBOX_OPTION || // to have descendants and this confuses NVDA.
role == roles::OPTION || role == roles::SLIDER ||
role == roles::ENTRY || // Don't prune the tree for certain roles if the tree is more complex than
role == roles::FLAT_EQUATION || // a single text leaf.
role == roles::PASSWORD_TEXT || (
role == roles::PUSHBUTTON || (
role == roles::TOGGLE_BUTTON || role == roles::MENUITEM ||
role == roles::GRAPHIC || role == roles::COMBOBOX_OPTION ||
role == roles::SLIDER || role == roles::OPTION ||
role == roles::PROGRESSBAR || role == roles::ENTRY ||
role == roles::SEPARATOR) && role == roles::FLAT_EQUATION ||
aAccessible->ContentChildCount() == 1 && role == roles::PASSWORD_TEXT ||
aAccessible->ContentChildAt(0)->IsTextLeaf(); role == roles::PUSHBUTTON ||
role == roles::TOGGLE_BUTTON ||
role == roles::GRAPHIC ||
role == roles::PROGRESSBAR ||
role == roles::SEPARATOR
) &&
aAccessible->ContentChildCount() == 1 &&
aAccessible->ContentChildAt(0)->IsTextLeaf()
);
} }