Bug 682037 - Allow the browser width to be different from the window width [r=stechz]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 25 Aug 2011 13:44:25 -0700
changeset 77235 0edb2653d8fc7b88d54cd14aa2f03dbf5165fa87
parent 77234 53362b3e8894cc891921be6c29b447c87cf5484a
child 77236 840fcaead434bb04abb9a73093a6fe85f77fab47
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstechz
bugs682037
milestone9.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 682037 - Allow the browser width to be different from the window width [r=stechz]
mobile/chrome/content/browser.js
mobile/chrome/content/browser.xul
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -1087,17 +1087,17 @@ var Browser = {
                                                   browserRect.height / 2);
     let rect = this._getZoomRectForPoint(center.x, center.y, zoomLevel);
     AnimatedZoom.animateTo(rect);
   },
 
   /** Rect should be in browser coordinates. */
   _getZoomLevelForRect: function _getZoomLevelForRect(rect) {
     const margin = 15;
-    return this.selectedTab.clampZoomLevel(window.innerWidth / (rect.width + margin * 2));
+    return this.selectedTab.clampZoomLevel(ViewableAreaObserver.width / (rect.width + margin * 2));
   },
 
   /**
    * Find an appropriate zoom rect for an element bounding rect, if it exists.
    * @return Rect in viewport coordinates, or null
    */
   _getZoomRectForRect: function _getZoomRectForRect(rect, y) {
     let zoomLevel = this._getZoomLevelForRect(rect);
@@ -1959,17 +1959,17 @@ const ContentTouchHandler = {
 
   tapDouble: function tapDouble(aX, aY, aModifiers) {
     this._clearPendingMessages();
 
     let tab = Browser.selectedTab;
     if (!tab.allowZoom)
       return;
 
-    let width = window.innerWidth / Browser.getScaleRatio();
+    let width = ViewableAreaObserver.width / Browser.getScaleRatio();
     this._dispatchMouseEvent("Browser:ZoomToPoint", aX, aY, { width: width });
   },
 
   tapLong: function tapLong(aX, aY) {
     this._dispatchMouseEvent("Browser:MouseLong", aX, aY);
   },
 
   toString: function toString() {
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -214,17 +214,17 @@
 
       <!-- Page Area -->
       <stack>
         <scrollbox id="page-scrollbox">
           <vbox>
             <!-- Main Toolbar -->
             <box id="toolbar-container" class="panel-dark toolbar-height">
               <box id="toolbar-moveable-container" observes="bcast_uidiscovery">
-                <toolbar id="toolbar-main" class="panel-dark window-width" observes="bcast_urlbarState">
+                <toolbar id="toolbar-main" class="panel-dark viewable-width" observes="bcast_urlbarState">
                   <toolbarbutton id="tool-back2" class="tool-back button-actionbar" command="cmd_back"/>
                   <toolbarbutton id="tool-forward2" class="tool-forward button-actionbar" command="cmd_forward"/>
                   <toolbarbutton id="tool-tabs" class="button-actionbar" command="cmd_showTabs"/>
 #ifdef MOZ_PLATFORM_MAEMO
 #if MOZ_PLATFORM_MAEMO != 6
                   <toolbarbutton id="tool-app-switch" oncommand="BrowserUI.switchTask();"/>
 #endif
 #endif