bug 544898 - resize window due to softkb popping up results in an usable add-ons manager r=mfinkle
authorBrad Lassey <blassey@mozilla.com>
Tue, 09 Feb 2010 22:15:06 -0500
changeset 66004 9cb6a4e5392440270afd9f320961152a799556fd
parent 66003 bd527d18c61cdfb25dbb6f4c6f8636d4bd5e50c9
child 66005 60230151cf1e91730bd2cd2a7f59edcb93720e2a
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
bugs544898
bug 544898 - resize window due to softkb popping up results in an usable add-ons manager r=mfinkle
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.js
mobile/chrome/content/browser.xul
mobile/themes/hildon/browser.css
mobile/themes/wince/browser.css
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -614,19 +614,16 @@ var BrowserUI = {
     // The _1, _2 and _3 are to make the js2 emacs mode happy
     let [leftvis,_1,_2,_3] = Browser.computeSidebarVisibility();
     return (leftvis > 0.002);
   },
 
   showPanel: function showPanel(aPage) {
     Elements.panelUI.left = 0;
     Elements.panelUI.hidden = false;
-    Elements.panelUI.width = window.innerWidth;
-    Elements.panelUI.height = window.innerHeight;
-
     Elements.contentShowing.setAttribute("disabled", "true");
 
     if (aPage != undefined)
       this.switchPane(aPage);
   },
 
   hidePanel: function hidePanel() {
     Elements.panelUI.hidden = true;
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -410,16 +410,20 @@ var Browser = {
 
       bv.updateDefaultZoom();
       if (bv.isDefaultZoom())
         // XXX this should really only happen on browser startup, not every resize
         Browser.hideSidebars();
       bv.onAfterVisibleMove();
 
       bv.commitBatchOperation();
+      
+      let curEl = document.activeElement;
+      if (curEl && curEl.scrollIntoView)
+        curEl.scrollIntoView();
     }
     window.addEventListener("resize", resizeHandler, false);
 
     function fullscreenHandler() {
       if (!window.fullScreen)
         document.getElementById("toolbar-main").setAttribute("fullscreen", "true");
       else
         document.getElementById("toolbar-main").removeAttribute("fullscreen");
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -324,17 +324,17 @@
       <hbox id="bookmark-form" align="start">
         <image id="bookmark-image"/>
       </hbox>
       <hbox pack="center">
         <button class="button-dark" label="&editBookmarkDone.label;" oncommand="BookmarkHelper.save();"/>
       </hbox>
     </vbox>
 
-    <box id="panel-container" class="panel-dark" style="-moz-stack-sizing: ignore" left="10000" hidden="true">
+    <box id="panel-container" class="panel-dark window-width window-height" style="-moz-stack-sizing: ignore" left="10000" hidden="true">
       <box id="panel-controls" oncommand="BrowserUI.switchPane(event.target.getAttribute('linkedpanel'));">
         <toolbarbutton id="tool-panel-close" class="page-button button-image" command="cmd_panel"/>
         <toolbarbutton id="tool-addons" type="radio" group="1" class="panel-button button-image" linkedpanel="addons-container"/>
         <toolbarbutton id="tool-downloads" type="radio" group="1" class="panel-button button-image" linkedpanel="downloads-container"/>
         <toolbarbutton id="tool-preferences" type="radio" group="1" checked="true" class="panel-button button-image" linkedpanel="prefs-container"/>
         <toolbarbutton id="tool-console" type="radio" group="1" hidden="true" class="panel-button button-image" linkedpanel="console-container"/>
       </box>
       <deck id="panel-items" selectedIndex="2" flex="1">
--- a/mobile/themes/hildon/browser.css
+++ b/mobile/themes/hildon/browser.css
@@ -273,33 +273,33 @@ toolbarbutton.page-button {
 
 /* button overflows off the left edge */
 #tool-panel-close {
   list-style-image: url("chrome://browser/skin/images/settings-open-64.png");
   margin-left: -40px; /* big number just to make sure the image overflows the edge */
 }
 
 /* browser tools panel UI   ------------------------------------------------ */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #panel-container {
     -moz-box-orient: horizontal;
   }
   
   #panel-controls {
     -moz-box-orient: vertical;
     -moz-box-ordinal-group: 1;
     -moz-box-pack: end;
   }
   
   #tool-panel-close {
     -moz-box-ordinal-group: 1000;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 499px) {
   #panel-container {
     -moz-box-orient: vertical;
   }
   
   #panel-controls {
     -moz-box-orient: horizontal;
     -moz-box-ordinal-group: 1000;
     -moz-box-pack: start;
@@ -354,24 +354,24 @@ toolbarbutton.page-button {
 }
 
 #tool-console:hover:active,
 #tool-console[checked="true"] {
   list-style-image: url("chrome://browser/skin/images/console-active-64.png");
 }
 
 /* addons panel UI   ------------------------------------------------------- */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #addons-repo {
     -moz-box-orient: horizontal;
     -moz-box-align: center;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 499px) {
   #addons-repo {
     -moz-box-orient: vertical;
     -moz-box-pack: center;
   }
 }
 
 .addon-rating[rating] {
   width: 78px;
@@ -433,24 +433,24 @@ richlistitem[isDisabled="true"] image {
 
 #dl-empty-message > label {
   text-align: center;
   color: grey;
 }
 
 
 /* console panel UI   ------------------------------------------------------ */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #console-filter-warnings,
   #console-filter-messages {
     visibility: visible;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 499px) {
   #console-filter-warnings,
   #console-filter-messages {
     visibility: collapse;
   }
 }
 
 /* bookmarks navigation popup ------------------------------ */
 #tool-bookmarks-close {
@@ -885,23 +885,23 @@ box[type="documenttab"]:only-child .docu
 
 /* XXX should be a richlistitem description.normal */
 .prefdesc {
   font-size: 18px !important;
   color: grey;
 }
 
 /* alerts popup ----------------------------------------------------------- */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #alerts-container {
     width: 300px;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 499px) {
   #alerts-container {
     width: 200px;
   }
 }
 
 #alerts-text {
   font-size: 18px !important;
   white-space: pre-wrap;
--- a/mobile/themes/wince/browser.css
+++ b/mobile/themes/wince/browser.css
@@ -116,33 +116,33 @@ toolbarbutton.urlbar-cap-button {
 toolbarbutton.browser-control-button,
 toolbarbutton.panel-button,
 toolbarbutton.page-button {
   /* space out the buttons a bit vertically */
   margin-bottom: 1.1mm; /* core spacing */
 }
 
 /* browser tools panel UI   ------------------------------------------------ */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #panel-container {
     -moz-box-orient: horizontal;
   }
   
   #panel-controls {
     -moz-box-orient: vertical;
     -moz-box-ordinal-group: 1;
     -moz-box-pack: end;
   }
   
   #tool-panel-close {
     -moz-box-ordinal-group: 1000;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 500px) {
   #panel-container {
     -moz-box-orient: vertical;
   }
   
   #panel-controls {
     -moz-box-orient: horizontal;
     -moz-box-ordinal-group: 1000;
     -moz-box-pack: start;
@@ -161,24 +161,24 @@ toolbarbutton.page-button {
   -moz-box-align: end;
 }
 
 .panel-header {
   padding: 1.1mm; /* core spacing */
 }
 
 /* addons panel UI   ------------------------------------------------------- */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #addons-repo {
     -moz-box-orient: horizontal;
     -moz-box-align: center;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 500px) {
   #addons-repo {
     -moz-box-orient: vertical;
     -moz-box-pack: center;
   }
 
   /* let the buttons in a selected addon wrap */
   #addons-list > richlistitem .buttons-box {
     display: block;
@@ -214,24 +214,24 @@ richlistitem[isDisabled="true"] image {
 }
 
 #dl-empty-message > label {
   text-align: center;
   color: grey;
 }
 
 /* console panel UI   ------------------------------------------------------ */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #console-filter-warnings,
   #console-filter-messages {
     visibility: visible;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 500px) {
   #console-filter-warnings,
   #console-filter-messages {
     visibility: collapse;
   }
 }
 
 /* bookmark list panel UI   ------------------------------------------------ */
 #bookmarklist-container {
@@ -563,23 +563,23 @@ box[type="documenttab"]:only-child .docu
 .prefdesc {
   font-size: 8pt !important;
   color: grey;
   background-color: white;
 }
 
 /* alerts popup ----------------------------------------------------------- */
 /* not dependent on high and low */
-@media (orientation: landscape) {
+@media (min-width: 500px) {
   #alerts-container {
     width: 300px;
   }
 }
 
-@media (orientation: portrait) {
+@media (max-width: 500px) {
   #alerts-container {
     width: 200px;
   }
 }
 
 #alerts-text {
   font-size: 8pt !important;
   white-space: pre-wrap;