Bug 986908 - Lightning modifies Thunderbird's min-width when installed (failing TB mozmill tests). r=mkmelin, r=redDragon
authorPhilipp Kewisch <mozilla@kewis.ch>
Sat, 29 Mar 2014 10:54:25 +0100
changeset 15960 86ee54b4f7bb9561b94e5b0633a0135e4ad560f9
parent 15959 8fb24ee695c2b358ce18c565df6eb4f5051ced66
child 15961 9d9a9045b462b7ed86c4d619c12ba9c54922ca1b
push id9997
push userryanvm@gmail.com
push dateTue, 01 Apr 2014 11:58:27 +0000
treeherdercomm-central@86ee54b4f7bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, redDragon
bugs986908
Bug 986908 - Lightning modifies Thunderbird's min-width when installed (failing TB mozmill tests). r=mkmelin, r=redDragon CLOSED TREE
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/lightning/jar.mn
calendar/lightning/themes/common/lightning.css
calendar/lightning/themes/linux/lightning.css
calendar/lightning/themes/osx/lightning.css
calendar/lightning/themes/windows/lightning.css
mail/base/content/tabmail.xml
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -398,16 +398,19 @@ function ltnSwitch2Calendar() {
     let deck = document.getElementById("calendarDisplayDeck");
     deck.selectedPanel = document.getElementById("calendar-view-box");
 
     // show the last displayed type of calendar view
     switchToView(gLastShownCalendarView);
 
     document.commandDispatcher.updateCommands('calendar_commands');
     window.setCursor("auto");
+
+    // make sure the view is sized correctly
+    onCalendarViewResize();
   }
 }
 
 /**
  * ltnSwitch2Task() switches to the task mode
  */
 
 function ltnSwitch2Task() {
--- a/calendar/lightning/jar.mn
+++ b/calendar/lightning/jar.mn
@@ -100,12 +100,13 @@ calendar.jar:
     content/calendar/datetimepickers/datetimepickers.css   (/calendar/resources/content/datetimepickers/datetimepickers.css)
     content/calendar/datetimepickers/datetimepickers.xml   (/calendar/resources/content/datetimepickers/datetimepickers.xml)
     content/calendar/mouseoverPreviews.js                  (/calendar/resources/content/mouseoverPreviews.js)
     content/calendar/publish.js                            (/calendar/resources/content/publish.js)
     content/calendar/publishDialog.js                      (/calendar/resources/content/publishDialog.js)
     content/calendar/publishDialog.xul                     (/calendar/resources/content/publishDialog.xul)
     content/calendar/sound.wav                             (/calendar/resources/content/sound.wav)
     ../skin/lightning-common/imip.css                      (themes/common/imip.css)
+    ../skin/lightning-common/lightning.css                 (themes/common/lightning.css)
     ../skin/lightning-common/lightning-toolbar.css         (themes/common/lightning-toolbar.css)
     ../skin/linux/calendar/datetimepickers/datetimepickers.css    (/calendar/resources/skin/classic/datetimepickers/datetimepickers.css)
     ../skin/osx/calendar/datetimepickers/datetimepickers.css      (/calendar/resources/skin/classic/datetimepickers/datetimepickers.css)
     ../skin/windows/calendar/datetimepickers/datetimepickers.css  (/calendar/resources/skin/classic/datetimepickers/datetimepickers.css)
new file mode 100644
--- /dev/null
+++ b/calendar/lightning/themes/common/lightning.css
@@ -0,0 +1,8 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* avoids contributing to the min width when Lightning is not selected */
+#calendarTabPanel:not([selected]) {
+  visibility: collapse;
+}
--- a/calendar/lightning/themes/linux/lightning.css
+++ b/calendar/lightning/themes/linux/lightning.css
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+@import url(chrome://lightning-common/skin/lightning.css);
+
 #calendarContent {
   color: -moz-DialogText;
   background-color: -moz-Dialog;
 }
 
 #calsidebar_splitter,
 #today-splitter {
   -moz-appearance: none;
--- a/calendar/lightning/themes/osx/lightning.css
+++ b/calendar/lightning/themes/osx/lightning.css
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+@import url(chrome://lightning-common/skin/lightning.css);
+
 /* Calendar list rules */
 #calendar-panel {
     padding-bottom: 5px;
 }
 
 /* Lightning preferences icon */
 radio[pane=paneLightning] {
     list-style-image: url("chrome://calendar/skin/cal-icon32.png");
--- a/calendar/lightning/themes/windows/lightning.css
+++ b/calendar/lightning/themes/windows/lightning.css
@@ -1,12 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
- 
+
+@import url(chrome://lightning-common/skin/lightning.css);
 @import url(chrome://calendar-windows/skin/lightning.css);
 
 #calendarContent {
     color: -moz-DialogText;
     background-color: -moz-Dialog;
 }
 
 #calsidebar_splitter {
--- a/mail/base/content/tabmail.xml
+++ b/mail/base/content/tabmail.xml
@@ -505,16 +505,17 @@
           t.className = "tabmail-tab";
           this.tabContainer.appendChild(t);
           if (this.tabContainer.mCollapseToolbar.collapsed) {
             this.tabContainer.mCollapseToolbar.collapsed = false;
             this.tabContainer.adjustTabstrip();
           }
 
           let oldTab = this._mostRecentTabInfo = this.currentTabInfo;
+          let oldPanel = this.panelContainer.selectedPanel;
 
           let disregardOpener = ("disregardOpener" in aArgs)
                                 && aArgs.disregardOpener;
 
           // If we're not disregarding the opening, hold a reference to opener
           // so that if the new tab is closed without switching, we can switch
           // back to the opener tab.
           if (disregardOpener)
@@ -545,16 +546,20 @@
             }
             this.panelContainer.appendChild(tab.panel);
             if (!background)
               this.panelContainer.selectedPanel = tab.panel;
           }
           else if (!background)
             this.panelContainer.selectedPanel = tab.mode.tabType.panel;
 
+          // Make sure the new panel is marked selected.
+          oldPanel.removeAttribute("selected");
+          this.panelContainer.selectedPanel.setAttribute("selected", "true");
+
           let tabOpenFunc = tab.mode.openTab || tab.mode.tabType.openTab;
           tabOpenFunc.apply(tab.mode.tabType, [tab, aArgs]);
 
           let restoreState = this._restoringTabState;
           for each (let [i, tabMonitor] in Iterator(this.tabMonitors)) {
             if (("onTabRestored" in tabMonitor) && restoreState &&
                 (tabMonitor.monitorName in restoreState.ext))
               tabMonitor.onTabRestored(tab,
@@ -1101,22 +1106,27 @@
         <body>
           <![CDATA[
             if (this.currentTabInfo != this.tabInfo[this.tabContainer.selectedIndex])
             {
               if (this.currentTabInfo)
                 this.saveCurrentTabState();
 
               let oldTab = this.currentTabInfo;
+              let oldPanel = this.panelContainer.selectedPanel;
               let tab = this.currentTabInfo =
                 this.tabInfo[this.tabContainer.selectedIndex];
 
               this.panelContainer.selectedPanel = tab.panel ||
                                                   tab.mode.tabType.panel;
 
+              // Update the selected attribute on the current and old tab panel.
+              oldPanel.removeAttribute("selected");
+              this.panelContainer.selectedPanel.setAttribute("selected", "true");
+
               let showTabFunc = tab.mode.showTab || tab.mode.tabType.showTab;
               showTabFunc.call(tab.mode.tabType, tab);
 
               for each (let [i, tabMonitor] in Iterator(this.tabMonitors))
                 tabMonitor.onTabSwitched(tab, oldTab);
 
               // always update the cursor status when we switch tabs
               SetBusyCursor(window, tab.busy);