Bug 1202652 - Remove redundant and incorrect check when setting displayport margins. r=snorp
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 08 Sep 2015 14:04:48 -0400
changeset 293948 b337feb71c38797fbdfe4ff24ba34c5a74040c20
parent 293947 0724ac43fbcea5f320823d6b6d98c7e84381c542
child 293949 801e41b2781c12afae6e5aa6ee305d4298d2f77f
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1202652
milestone43.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 1202652 - Remove redundant and incorrect check when setting displayport margins. r=snorp The intent of this check is to avoid setting the same margins more than once. However this is redundant because the code in nsLayoutUtils::SetDisplayPortMargins already has an equivalent check. Further, this code is wrong because it stores the old margins per-tab, and so once a new document is loaded the margins may be the same as "before" but they apply to a different element. In order to be correct the check would have to track the target element as well as the margin values, but it's easier to just get rid of this and let nsLayoutUtils handle it.
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3713,28 +3713,21 @@ Tab.prototype = {
     let scrolly = this.browser.contentWindow.scrollY * zoom;
     let displayPortMargins = {
       left: scrollx - aDisplayPort.left,
       top: scrolly - aDisplayPort.top,
       right: aDisplayPort.right - (scrollx + gScreenWidth),
       bottom: aDisplayPort.bottom - (scrolly + gScreenHeight)
     };
 
-    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,
-                                          displayPortMargins.top,
-                                          displayPortMargins.right,
-                                          displayPortMargins.bottom,
-                                          element, 0);
-    }
-    this._oldDisplayPortMargins = displayPortMargins;
+    cwu.setDisplayPortMarginsForElement(displayPortMargins.left,
+                                        displayPortMargins.top,
+                                        displayPortMargins.right,
+                                        displayPortMargins.bottom,
+                                        element, 0);
   },
 
   setScrollClampingSize: function(zoom) {
     let viewportWidth = gScreenWidth / zoom;
     let viewportHeight = gScreenHeight / zoom;
     let screenWidth = gScreenWidth;
     let screenHeight = gScreenHeight;