Bug 1168487 - Update the last use site of ScrollbarAreaToExcludeFromCompositionBoundsFor to use LD pixels. r=tn
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 07 Aug 2015 14:23:13 -0400
changeset 288521 384766aad27e5dad9060b080091cd82f69bd0cce
parent 288520 d07f2c704518b2a81d4934a0dbc67a03e6254068
child 288522 decbc368c8b6d51a8bed94958c5a0e43dcbd5633
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1168487
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1168487 - Update the last use site of ScrollbarAreaToExcludeFromCompositionBoundsFor to use LD pixels. r=tn
layout/base/MobileViewportManager.cpp
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -185,21 +185,24 @@ MobileViewportManager::UpdateResolution(
 }
 
 void
 MobileViewportManager::UpdateSPCSPS(const ScreenIntSize& aDisplaySize,
                                     const CSSToScreenScale& aZoom)
 {
   ScreenSize compositionSize(aDisplaySize);
   ScreenMargin scrollbars =
-    CSSMargin::FromAppUnits(
+    LayoutDeviceMargin::FromAppUnits(
       nsLayoutUtils::ScrollbarAreaToExcludeFromCompositionBoundsFor(
-        mPresShell->GetRootScrollFrame()))
-    * CSSToScreenScale(1.0f); // Scrollbars are not subject to scaling, so
-                              // CSS pixels = layer pixels for them (modulo bug 1168487).
+        mPresShell->GetRootScrollFrame()),
+      mPresShell->GetPresContext()->AppUnitsPerDevPixel())
+    // Scrollbars are not subject to resolution scaling, so LD pixels =
+    // Screen pixels for them.
+    * LayoutDeviceToScreenScale(1.0f);
+
   compositionSize.width -= scrollbars.LeftRight();
   compositionSize.height -= scrollbars.TopBottom();
   CSSSize compSize = compositionSize / aZoom;
   MVM_LOG("%p: Setting SPCSPS %s\n", this, Stringify(compSize).c_str());
   nsLayoutUtils::SetScrollPositionClampingScrollPortSize(mPresShell, compSize);
 }
 
 void