Bug 967671 - Set nsGfxScrollFrame's mOriginOfLastScroll default to 'other', insures apzc will receive a scroll offset update when frames are created. Also remove display port reset in metrofx front end code when window size changes. r=kats, tnikkel
authorJim Mathies <jmathies@mozilla.com>
Sat, 15 Feb 2014 07:06:27 -0600
changeset 169283 fbcd1f3a17031475eaebe315defe0794bb1c4d39
parent 169282 aaa3019c7653b038a45dbd098be4ffc34f4eda04
child 169284 af48e36fd5a30299de9b8615f90e421ddafae17b
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerskats, tnikkel
bugs967671
milestone30.0a1
Bug 967671 - Set nsGfxScrollFrame's mOriginOfLastScroll default to 'other', insures apzc will receive a scroll offset update when frames are created. Also remove display port reset in metrofx front end code when window size changes. r=kats, tnikkel
browser/metro/base/content/apzc.js
layout/generic/nsGfxScrollFrame.cpp
--- a/browser/metro/base/content/apzc.js
+++ b/browser/metro/base/content/apzc.js
@@ -25,40 +25,36 @@ var APZCObserver = {
     this._enabled = Services.prefs.getBoolPref(kAsyncPanZoomEnabled);
     if (!this._enabled) {
       return;
     }
 
     let os = Services.obs;
     os.addObserver(this, "apzc-transform-begin", false);
 
-    // Fired by ContentAreaObserver
-    window.addEventListener("SizeChanged", this, true);
     Elements.tabList.addEventListener("TabSelect", this, true);
     Elements.browsers.addEventListener("pageshow", this, true);
     messageManager.addMessageListener("Content:ZoomToRect", this);
   },
 
   shutdown: function shutdown() {
     if (!this._enabled) {
       return;
     }
 
     let os = Services.obs;
     os.removeObserver(this, "apzc-transform-begin");
 
-    window.removeEventListener("SizeChanged", this, true);
     Elements.tabList.removeEventListener("TabSelect", this, true);
     Elements.browsers.removeEventListener("pageshow", this, true);
     messageManager.removeMessageListener("Content:ZoomToRect", this);
   },
 
   handleEvent: function APZC_handleEvent(aEvent) {
     switch (aEvent.type) {
-      case "SizeChanged":
       case 'TabSelect':
         this._resetDisplayPort();
         break;
 
       case 'pageshow':
         if (aEvent.target != Browser.selectedBrowser.contentDocument) {
           break;
         }
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1532,17 +1532,17 @@ ScrollFrameHelper::ScrollFrameHelper(nsC
                                              bool aIsRoot)
   : mHScrollbarBox(nullptr)
   , mVScrollbarBox(nullptr)
   , mScrolledFrame(nullptr)
   , mScrollCornerBox(nullptr)
   , mResizerBox(nullptr)
   , mOuter(aOuter)
   , mAsyncScroll(nullptr)
-  , mOriginOfLastScroll(nullptr)
+  , mOriginOfLastScroll(nsGkAtoms::other)
   , mScrollGeneration(0)
   , mDestination(0, 0)
   , mScrollPosAtLastPaint(0, 0)
   , mRestorePos(-1, -1)
   , mLastPos(-1, -1)
   , mScrollPosForLayerPixelAlignment(-1, -1)
   , mLastUpdateImagesPos(-1, -1)
   , mNeverHasVerticalScrollbar(false)