mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 943668 - ensure window.screenX and .screenY return css pixels. r=roc
This commit is contained in:
parent
2f884a142f
commit
abca27fb7c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user