Bug 722248 - Some chrome accessibles report incorrect visibility states. r=MarcoZ

Timothy wants us to stop using views, so we'll use frame API instead.
This is a pseudo-revert of some of bug 591363.
This commit is contained in:
David Bolter 2012-01-30 22:03:31 -05:00
Родитель a3af5a89c9
Коммит 581e0a724d
1 изменённых файлов: 6 добавлений и 19 удалений

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

@ -593,30 +593,13 @@ nsAccessible::VisibilityState()
{
PRUint64 vstates = states::INVISIBLE | states::OFFSCREEN;
// We need to check the parent chain for visibility.
nsAccessible* accessible = this;
do {
// We don't want background tab page content to be aggressively invisible.
// Otherwise this foils screen reader virtual buffer caches.
roles::Role role = accessible->Role();
if (role == roles::PROPERTYPAGE || role == roles::PANE)
break;
nsIFrame* frame = accessible->GetFrame();
if (!frame)
return vstates;
const nsIView* view = frame->GetView();
if (view && view->GetVisibility() == nsViewVisibility_kHide)
return vstates;
} while (accessible = accessible->Parent());
nsIFrame* frame = GetFrame();
if (!frame)
return vstates;
const nsCOMPtr<nsIPresShell> shell(GetPresShell());
if (!shell)
return vstates;
// We need to know if at least a kMinPixels around the object is visible,
// otherwise it will be marked states::OFFSCREEN.
@ -644,6 +627,10 @@ nsAccessible::VisibilityState()
}
// XXX Do we really need to cross from content to chrome ancestor?
if (!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY))
return vstates;
// Assume we are visible enough.
return vstates &= ~states::INVISIBLE;
}