Bug 622121 - Opening Android softkb at facebook login adjusts urlbar to the right [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Tue, 04 Jan 2011 15:54:38 +0100
changeset 67203 96527fcfe62cb0cf6590155cc38f334d95cac05f
parent 67202 c34f1e8ffbe76549b256eebd12db10b0bd44d180
child 67204 a58bc442244ebdbd2028c9ee7c06317d8194c6d6
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)
reviewersmfinkle
bugs622121
Bug 622121 - Opening Android softkb at facebook login adjusts urlbar to the right [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -242,29 +242,31 @@ var Browser = {
       let index = stylesheet.insertRule("." + style + " {}", stylesheet.cssRules.length);
       this.styles[style] = stylesheet.cssRules[index].style;
     }
 
     // Init the cache used in the resize handler
     window.cachedWidth = window.innerWidth;
 
     // Saved the scrolls values before the resizing of the window, to restore
-    // the scrollbox position once the resize has finished
+    // the scrollbox position once the resize has finished.
+    // The last parameter of addEventListener is true to be sure we performed
+    // the computation before something else could happened (bug 622121)
     window.addEventListener("MozBeforeResize", function(aEvent) {
       if (aEvent.target != window)
         return;
 
       let { x: x1, y: y1 } = Browser.getScrollboxPosition(Browser.controlsScrollboxScroller);
       let { x: x2, y: y2 } = Browser.getScrollboxPosition(Browser.pageScrollboxScroller);
       let [,, leftWidth, rightWidth] = Browser.computeSidebarVisibility();
 
       let shouldHideSidebars = Browser.controlsPosition ? Browser.controlsPosition.hideSidebars : true;
       Browser.controlsPosition = { x: x1, y: y2, hideSidebars: shouldHideSidebars,
                                    leftSidebar: leftWidth, rightSidebar: rightWidth };
-    }, false);
+    }, true);
 
     function resizeHandler(e) {
       if (e.target != window)
         return;
 
       let w = window.innerWidth;
       let h = window.innerHeight;