Bug 1200093 - Don't rely on finding the widget for a document in order to get the css-to-ld scale. r=botond

This commit is contained in:
Kartikaya Gupta 2015-09-11 15:12:29 -04:00
parent e6fab2c29e
commit 5b58cbd898

View File

@ -7898,9 +7898,9 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
// pixel an integer, and we want the adjusted value.
float fullZoom = context ? context->DeviceContext()->GetFullZoom() : 1.0;
fullZoom = (fullZoom == 0.0) ? 1.0 : fullZoom;
nsIWidget *widget = nsContentUtils::WidgetForDocument(this);
float widgetScale = widget ? widget->GetDefaultScale().scale : 1.0f;
CSSToLayoutDeviceScale layoutDeviceScale(widgetScale * fullZoom);
CSSToLayoutDeviceScale layoutDeviceScale(
(float)nsPresContext::AppUnitsPerCSSPixel() /
context->AppUnitsPerDevPixel());
CSSToScreenScale defaultScale = layoutDeviceScale
* LayoutDeviceToScreenScale(1.0);