Bug 638164 - Checkerboarding after zooming in, visiting other page, then going back in history [r=mbrubeck,wesj, a=blocking-fennec]
authorMark Finkle <mark.finkle>
Thu, 17 Mar 2011 09:49:00 -0700
changeset 67520 d049b5712a671e371a4ef052e61e23074930431a
parent 67519 1c9d8e59af397e6471f1bc18228b66cd6224638f
child 67521 777ac44fbe635e9cfb7aab78a30b43ea049d4672
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, wesj, blocking-fennec
bugs638164
Bug 638164 - Checkerboarding after zooming in, visiting other page, then going back in history [r=mbrubeck,wesj, a=blocking-fennec]
mobile/chrome/content/bindings/browser.js
--- a/mobile/chrome/content/bindings/browser.js
+++ b/mobile/chrome/content/bindings/browser.js
@@ -288,16 +288,17 @@ DOMEvents.init();
 let ContentScroll =  {
   _scrollOffset: { x: 0, y: 0 },
 
   init: function() {
     addMessageListener("Content:SetCacheViewport", this);
     addMessageListener("Content:SetWindowSize", this);
 
     addEventListener("scroll", this, false);
+    addEventListener("pagehide", this, false);
     addEventListener("MozScrolledAreaChanged", this, false);
   },
 
   getScrollOffset: function(aWindow) {
     let cwu = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
     let scrollX = {}, scrollY = {};
     cwu.getScrollXY(false, scrollX, scrollY);
     return { x: scrollX.value, y: scrollY.value };
@@ -377,16 +378,20 @@ let ContentScroll =  {
         cwu.setCSSViewport(json.width, json.height);
         break;
       }
     }
   },
 
   handleEvent: function(aEvent) {
     switch (aEvent.type) {
+      case "pagehide":
+        this._scrollOffset = { x: 0, y: 0 };
+        break;
+
       case "scroll": {
         let doc = aEvent.target;
         if (doc != content.document)
           break;
 
         this.sendScroll();
         break;
       }