Bug 943668 - ensure window.screenX and .screenY return css pixels. r=roc

This commit is contained in:
Mark Hammond 2013-12-03 16:36:33 +11:00
parent 2f884a142f
commit abca27fb7c
2 changed files with 6 additions and 2 deletions

View File

@ -4726,7 +4726,7 @@ nsGlobalWindow::SetOuterHeight(int32_t aOuterHeight)
nsIntPoint
nsGlobalWindow::GetScreenXY(ErrorResult& aError)
{
FORWARD_TO_OUTER_OR_THROW(GetScreenXY, (aError), aError, nsIntPoint(0, 0));
MOZ_ASSERT(IsOuterWindow());
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow();
if (!treeOwnerAsWin) {
@ -4742,6 +4742,8 @@ nsGlobalWindow::GetScreenXY(ErrorResult& aError)
int32_t
nsGlobalWindow::GetScreenX(ErrorResult& aError)
{
FORWARD_TO_OUTER_OR_THROW(GetScreenX, (aError), aError, 0);
return DevToCSSIntPixels(GetScreenXY(aError).x);
}
@ -5091,6 +5093,8 @@ nsGlobalWindow::SetScreenX(int32_t aScreenX)
int32_t
nsGlobalWindow::GetScreenY(ErrorResult& aError)
{
FORWARD_TO_OUTER_OR_THROW(GetScreenY, (aError), aError, 0);
return DevToCSSIntPixels(GetScreenXY(aError).y);
}

View File

@ -1291,7 +1291,7 @@ protected:
void PreloadLocalStorage();
// Returns device pixels.
// Returns device pixels. Outer windows only.
nsIntPoint GetScreenXY(mozilla::ErrorResult& aError);
int32_t RequestAnimationFrame(const nsIDocument::FrameRequestCallbackHolder& aCallback,