Bug 1014054 - Use the right screen size when computing the displayport margins. r=Cwiiis
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 23 May 2014 09:42:38 -0400
changeset 184714 1139dcf8c2ea47cd4ed080061669b01038610c05
parent 184713 11090a9486634348cc3da3cfb3a885db326d93a4
child 184715 3b14af86b2d6bf6cb1ebbda51786d0172ec66be0
push id26831
push userkwierso@gmail.com
push dateSat, 24 May 2014 00:19:43 +0000
treeherdermozilla-central@51b7091471a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis
bugs1014054
milestone32.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 1014054 - Use the right screen size when computing the displayport margins. r=Cwiiis
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3280,21 +3280,23 @@ Tab.prototype = {
     } else if (!fuzzyEquals(resolution, zoom)) {
       dump("Warning: setDisplayPort resolution did not match zoom for background tab! (" + resolution + " != " + zoom + ")");
     }
 
     // Finally, we set the display port as a set of margins around the visible viewport.
 
     let scrollx = this.browser.contentWindow.scrollX * zoom;
     let scrolly = this.browser.contentWindow.scrollY * zoom;
+    let screenWidth = gScreenWidth - gViewportMargins.left - gViewportMargins.right;
+    let screenHeight = gScreenHeight - gViewportMargins.top - gViewportMargins.bottom;
     let displayPortMargins = {
       left: scrollx - aDisplayPort.left,
       top: scrolly - aDisplayPort.top,
-      right: aDisplayPort.right - (scrollx + gScreenWidth),
-      bottom: aDisplayPort.bottom - (scrolly + gScreenHeight)
+      right: aDisplayPort.right - (scrollx + screenWidth),
+      bottom: aDisplayPort.bottom - (scrolly + screenHeight)
     };
 
     if (this._oldDisplayPortMargins == null ||
         !fuzzyEquals(displayPortMargins.left, this._oldDisplayPortMargins.left) ||
         !fuzzyEquals(displayPortMargins.top, this._oldDisplayPortMargins.top) ||
         !fuzzyEquals(displayPortMargins.right, this._oldDisplayPortMargins.right) ||
         !fuzzyEquals(displayPortMargins.bottom, this._oldDisplayPortMargins.bottom)) {
       cwu.setDisplayPortMarginsForElement(displayPortMargins.left,