Bug 1623399 - Hide chrome invisible alerts and dialogs. r=morgan

Differential Revision: https://phabricator.services.mozilla.com/D68272

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eitan Isaacson 2020-03-25 21:29:43 +00:00
Родитель db7f4cc73e
Коммит 9de7172c6b
1 изменённых файлов: 10 добавлений и 6 удалений

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

@ -84,12 +84,16 @@ static id<mozAccessible, mozView> getNativeViewFromRootAccessible(Accessible* aA
filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(mozAccessible* child,
NSDictionary* bindings) {
AccessibleWrap* childAcc = [child getGeckoAccessible];
if (childAcc && childAcc->Role() == roles::MENUPOPUP &&
((childAcc->VisibilityState() & states::INVISIBLE) != 0)) {
// Filter out all invisible XUL popup menus. Invisible elements in our browser
// chrome are unique in the sense that we want screen readers to ignore them.
// These only exist in the top level process so we don't do a similar check on proxies.
return NO;
if (childAcc) {
role r = childAcc->Role();
if ((r == roles::MENUPOPUP || r == roles::DIALOG || r == roles::ALERT) &&
((childAcc->VisibilityState() & states::INVISIBLE) != 0)) {
// Filter out all invisible XUL popup menus, dialogs and alerts. Invisible elements in
// our browser chrome are unique in the sense that we want screen readers to ignore
// them. These only exist in the top level process so we don't do a similar check on
// proxies.
return NO;
}
}
return YES;