Back out 4aad8e3db7e9 (bug 384336) for Valgrind leaks and a variety of mochitest bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 26 Nov 2015 09:00:54 -0800
changeset 274379 b9e69115c83246737582ccf0577ba2e20d1a76a9
parent 274378 b7d8d9b1e8334cbfe01793f8dcc6cd36a3015fce
child 274380 ad985ade8a2e5e58123f0a774605d273834c3ba1
child 274478 d1667f3f465389b4a5c75e5832756238fde49aa3
push id29729
push usercbook@mozilla.com
push dateFri, 27 Nov 2015 10:05:25 +0000
treeherdermozilla-central@ad985ade8a2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs384336
milestone45.0a1
backs out4aad8e3db7e990ccd2dfc6e7840632559272b22b
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
Back out 4aad8e3db7e9 (bug 384336) for Valgrind leaks and a variety of mochitest bustage CLOSED TREE
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1015,27 +1015,51 @@ var gBrowserInit = {
     // Certain kinds of automigration rely on this notification to complete
     // their tasks BEFORE the browser window is shown. SessionStore uses it to
     // restore tabs into windows AFTER important parts like gMultiProcessBrowser
     // have been initialized.
     Services.obs.notifyObservers(window, "browser-window-before-show", "");
 
     // Set a sane starting width/height for all resolutions on new profiles.
     if (!document.documentElement.hasAttribute("width")) {
-      const TARGET_WIDTH = 1280;
-      const TARGET_HEIGHT = 1040;
-      let width = Math.min(screen.availWidth * .9, TARGET_WIDTH);
-      let height = Math.min(screen.availHeight * .9, TARGET_HEIGHT);
-
-      document.documentElement.setAttribute("width", width);
-      document.documentElement.setAttribute("height", height);
-
-      if (width < TARGET_WIDTH && height < TARGET_HEIGHT) {
+      let defaultWidth;
+      let defaultHeight;
+
+      // Very small: maximize the window
+      // Portrait  : use about full width and 3/4 height, to view entire pages
+      //             at once (without being obnoxiously tall)
+      // Widescreen: use about half width, to suggest side-by-side page view
+      // Otherwise : use 3/4 height and width
+      if (screen.availHeight <= 600) {
         document.documentElement.setAttribute("sizemode", "maximized");
+        defaultWidth = 610;
+        defaultHeight = 450;
       }
+      else {
+        if (screen.availWidth <= screen.availHeight) {
+          defaultWidth = screen.availWidth * .9;
+          defaultHeight = screen.availHeight * .75;
+        }
+        else if (screen.availWidth >= 2048) {
+          defaultWidth = (screen.availWidth / 2) - 20;
+          defaultHeight = screen.availHeight - 10;
+        }
+        else {
+          defaultWidth = screen.availWidth * .75;
+          defaultHeight = screen.availHeight * .75;
+        }
+
+#if MOZ_WIDGET_GTK == 2
+        // On X, we're not currently able to account for the size of the window
+        // border.  Use 28px as a guess (titlebar + bottom window border)
+        defaultHeight -= 28;
+#endif
+      }
+      document.documentElement.setAttribute("width", defaultWidth);
+      document.documentElement.setAttribute("height", defaultHeight);
     }
 
     if (!window.toolbar.visible) {
       // adjust browser UI for popups
       if (gURLBar) {
         gURLBar.setAttribute("readonly", "true");
         gURLBar.setAttribute("enablehistory", "false");
       }