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

This commit is contained in:
aaronl%netscape.com 2001-12-11 22:40:25 +00:00
parent 266d5c3d9d
commit 80e7ab4873

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;