Bug 1259735 - Guard against a rounding error that could lead to Java having a stale page size, rendering the page unscrollable. r=snorp
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 07 Apr 2016 08:59:14 -0400
changeset 330596 a68f4eb45a851e94f19fab3a780f3e329d2b2aa8
parent 330595 6cd73ef4a652798423cf0c95a621b16d986cda83
child 330597 927fe582c13f5406cc7c2af7b0dbe1b3ce99f57e
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1259735
milestone48.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 1259735 - Guard against a rounding error that could lead to Java having a stale page size, rendering the page unscrollable. r=snorp MozReview-Commit-ID: 8s3zmH0LhmU
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3751,18 +3751,18 @@ Tab.prototype = {
        * this causes the page size to jump around wildly during page load. After the page is loaded,
        * send updates regardless of page size; we'll zoom to fit the content as needed.
        *
        * In the check below, we floor the viewport size because there might be slight rounding errors
        * introduced in the CSS page size due to the conversion to and from app units in Gecko. The
        * error should be no more than one app unit so doing the floor is overkill, but safe in the
        * sense that the extra page size updates that get sent as a result will be mostly harmless.
        */
-      let pageLargerThanScreen = (cssPageRect.width >= Math.floor(viewport.cssWidth))
-                              && (cssPageRect.height >= Math.floor(viewport.cssHeight));
+      let pageLargerThanScreen = (Math.ceil(cssPageRect.width) >= Math.floor(viewport.cssWidth))
+                              && (Math.ceil(cssPageRect.height) >= Math.floor(viewport.cssHeight));
       if (doc.readyState === 'complete' || pageLargerThanScreen) {
         viewport.cssPageLeft = cssPageRect.left;
         viewport.cssPageTop = cssPageRect.top;
         viewport.cssPageRight = cssPageRect.right;
         viewport.cssPageBottom = cssPageRect.bottom;
         /* Transform the page width and height based on the zoom factor. */
         viewport.pageLeft = (viewport.cssPageLeft * viewport.zoom);
         viewport.pageTop = (viewport.cssPageTop * viewport.zoom);