Bug 114687. Active Accessibility: Bounds calculation off by how far we're scrolled into the document. r=jgaunt, rs=waterson

git-svn-id: svn://10.0.0.236/trunk@110303 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronl%netscape.com 2001-12-11 22:40:25 +00:00
parent 24a7fc748c
commit b6f6f559d2

View File

@ -805,15 +805,18 @@ void nsAccessible::GetScreenOrigin(nsIPresContext *aPresContext, nsIFrame *aFram
// Look for a widget so we can get screen coordinates
nsIView* view = nsnull;
aFrame->GetView(aPresContext, &view);
nsPoint origin;
if (view) {
view->GetWidget(*getter_AddRefs(widget));
if (widget)
break;
// Include position of view in calculation of starting coordinates
view->GetPosition(&origin.x, &origin.y);
}
else {
// No widget yet, so count up the coordinates of the frame
aFrame->GetOrigin(origin);
}
// No widget yet, so count up the coordinates of the frame
nsPoint origin;
aFrame->GetOrigin(origin);
offsetX += origin.x;
offsetY += origin.y;