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
|
nsIntPoint
|
||||||
nsGlobalWindow::GetScreenXY(ErrorResult& aError)
|
nsGlobalWindow::GetScreenXY(ErrorResult& aError)
|
||||||
{
|
{
|
||||||
FORWARD_TO_OUTER_OR_THROW(GetScreenXY, (aError), aError, nsIntPoint(0, 0));
|
MOZ_ASSERT(IsOuterWindow());
|
||||||
|
|
||||||
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow();
|
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = GetTreeOwnerWindow();
|
||||||
if (!treeOwnerAsWin) {
|
if (!treeOwnerAsWin) {
|
||||||
@ -4742,6 +4742,8 @@ nsGlobalWindow::GetScreenXY(ErrorResult& aError)
|
|||||||
int32_t
|
int32_t
|
||||||
nsGlobalWindow::GetScreenX(ErrorResult& aError)
|
nsGlobalWindow::GetScreenX(ErrorResult& aError)
|
||||||
{
|
{
|
||||||
|
FORWARD_TO_OUTER_OR_THROW(GetScreenX, (aError), aError, 0);
|
||||||
|
|
||||||
return DevToCSSIntPixels(GetScreenXY(aError).x);
|
return DevToCSSIntPixels(GetScreenXY(aError).x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5091,6 +5093,8 @@ nsGlobalWindow::SetScreenX(int32_t aScreenX)
|
|||||||
int32_t
|
int32_t
|
||||||
nsGlobalWindow::GetScreenY(ErrorResult& aError)
|
nsGlobalWindow::GetScreenY(ErrorResult& aError)
|
||||||
{
|
{
|
||||||
|
FORWARD_TO_OUTER_OR_THROW(GetScreenY, (aError), aError, 0);
|
||||||
|
|
||||||
return DevToCSSIntPixels(GetScreenXY(aError).y);
|
return DevToCSSIntPixels(GetScreenXY(aError).y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1291,7 +1291,7 @@ protected:
|
|||||||
|
|
||||||
void PreloadLocalStorage();
|
void PreloadLocalStorage();
|
||||||
|
|
||||||
// Returns device pixels.
|
// Returns device pixels. Outer windows only.
|
||||||
nsIntPoint GetScreenXY(mozilla::ErrorResult& aError);
|
nsIntPoint GetScreenXY(mozilla::ErrorResult& aError);
|
||||||
|
|
||||||
int32_t RequestAnimationFrame(const nsIDocument::FrameRequestCallbackHolder& aCallback,
|
int32_t RequestAnimationFrame(const nsIDocument::FrameRequestCallbackHolder& aCallback,
|
||||||
|
Loading…
Reference in New Issue
Block a user