diff --git a/accessible/src/atk/nsMaiInterfaceComponent.cpp b/accessible/src/atk/nsMaiInterfaceComponent.cpp index c75dd1c53f8..1ab1c592198 100644 --- a/accessible/src/atk/nsMaiInterfaceComponent.cpp +++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp @@ -72,9 +72,13 @@ refAccessibleAtPointCB(AtkComponent *aComponent, if (!accWrap || nsAccessibleWrap::MustPrune(accWrap)) return nsnull; - // or ATK_XY_SCREEN what is definition this in nsIAccessible ??? + // nsIAccessible getChildAtPoint (x,y) is in screen pixels. if (aCoordType == ATK_XY_WINDOW) { - /* deal with the coord type */ + nsCOMPtr domNode; + accWrap->GetDOMNode(getter_AddRefs(domNode)); + nsIntPoint winCoords = nsAccUtils::GetScreenCoordsForWindow(domNode); + aAccX += winCoords.x; + aAccY += winCoords.y; } nsCOMPtr pointAcc; diff --git a/accessible/src/atk/nsMaiInterfaceImage.cpp b/accessible/src/atk/nsMaiInterfaceImage.cpp index 5e06671dab1..75a0a9f4ef1 100644 --- a/accessible/src/atk/nsMaiInterfaceImage.cpp +++ b/accessible/src/atk/nsMaiInterfaceImage.cpp @@ -69,8 +69,18 @@ getImagePositionCB(AtkImage *aImage, gint *aAccX, gint *aAccY, return; PRInt32 width, height; // dummy - image->GetImageBounds(aAccX, aAccY, &width, &height); - // TODO: translate (x,y) accroding aCoordType. see bug 369821 + // Returned in screen coordinates + nsresult rv = image->GetImageBounds(aAccX, aAccY, &width, &height); + if (NS_FAILED(rv)) + return; + + if (aCoordType == ATK_XY_WINDOW) { + nsCOMPtr domNode; + accWrap->GetDOMNode(getter_AddRefs(domNode)); + nsIntPoint winCoords = nsAccUtils::GetScreenCoordsForWindow(domNode); + *aAccX -= winCoords.x; + *aAccY -= winCoords.y; + } } const gchar *