Bug 658005. Part 3. Make accessibility use the new frame visibility API and remove code is obsoletes. r=roc,surkov

This commit is contained in:
Timothy Nikkel 2011-10-26 18:57:55 -05:00
Родитель f10d3e436c
Коммит 1e8e900527
4 изменённых файлов: 3 добавлений и 32 удалений

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

@ -654,7 +654,7 @@ nsAccessible::IsVisible(bool* aIsOffscreen)
}
// The frame intersects the viewport, but we need to check the parent view chain :(
bool isVisible = nsCoreUtils::CheckVisibilityInParentChain(frame);
bool isVisible = frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY);
if (isVisible && rectVisibility == nsRectVisibility_kVisible) {
*aIsOffscreen = false;
}

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

@ -758,31 +758,6 @@ nsCoreUtils::IsColumnHidden(nsITreeColumn *aColumn)
nsGkAtoms::_true, eCaseMatters);
}
bool
nsCoreUtils::CheckVisibilityInParentChain(nsIFrame* aFrame)
{
nsIView* view = aFrame->GetClosestView();
if (view && !view->IsEffectivelyVisible())
return false;
nsIPresShell* presShell = aFrame->PresContext()->GetPresShell();
while (presShell) {
if (!presShell->IsActive()) {
return false;
}
nsIFrame* rootFrame = presShell->GetRootFrame();
presShell = nsnull;
if (rootFrame) {
nsIFrame* frame = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
if (frame) {
presShell = frame->PresContext()->GetPresShell();
}
}
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
// nsAccessibleDOMStringList
////////////////////////////////////////////////////////////////////////////////

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

@ -370,11 +370,6 @@ public:
aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scope);
}
/**
* Check the visibility across both parent content and chrome.
*/
static bool CheckVisibilityInParentChain(nsIFrame* aFrame);
};

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

@ -311,7 +311,8 @@ nsDocAccessible::NativeState()
state |= states::BUSY;
nsIFrame* frame = GetFrame();
if (!frame || !nsCoreUtils::CheckVisibilityInParentChain(frame)) {
if (!frame ||
!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY)) {
state |= states::INVISIBLE | states::OFFSCREEN;
}