Bug 1197497 - Convert the button rect to device coordinates correctly instead of casting CSS coordinates. r?jfkthame
MozReview-Commit-ID: EqyHnJpp2tU
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -14172,17 +14172,19 @@ nsGlobalWindow::NotifyDefaultButtonLoade
// Get the button rect in screen coordinates.
nsIFrame *frame = aDefaultButton.GetPrimaryFrame();
if (!frame) {
aError.Throw(NS_ERROR_FAILURE);
return;
}
LayoutDeviceIntRect buttonRect =
- LayoutDeviceIntRect::FromUnknownRect(frame->GetScreenRect());
+ LayoutDeviceIntRect::FromAppUnitsToNearest(
+ frame->GetScreenRectInAppUnits(),
+ frame->PresContext()->AppUnitsPerDevPixel());
// Get the widget rect in screen coordinates.
nsIWidget *widget = GetNearestWidget();
if (!widget) {
aError.Throw(NS_ERROR_FAILURE);
return;
}
LayoutDeviceIntRect widgetRect = widget->GetScreenBounds();