Bug 1301876, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 13 Sep 2016 12:10:54 +0100
changeset 315822 b6f62be719ae36609cde88c878c35c5160ff502f
parent 315821 01cd7a8a158d425c216cb319898832c4891ec35e
child 315823 41dd7c0d25eb7a0639cab67893f8885d6a178b0d
push id20634
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:10:13 +0000
treeherderfx-team@afe79b010d13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1301876
milestone52.0a1
Bug 1301876, r=mconley MozReview-Commit-ID: EV40sJD6yR2
browser/base/content/browser.js
browser/base/content/tabbrowser.xml
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3300,16 +3300,21 @@ var PrintPreviewListener = {
   getSimplifiedSourceBrowser: function () {
     return this._simplifyPageTab ?
       gBrowser.getBrowserForTab(this._simplifyPageTab) : null;
   },
   getNavToolbox: function () {
     return gNavToolbox;
   },
   onEnter: function () {
+    // We might have accidentally switched tabs since the user invoked print
+    // preview
+    if (gBrowser.selectedTab != this._printPreviewTab) {
+      gBrowser.selectedTab = this._printPreviewTab;
+    }
     gInPrintPreviewMode = true;
     this._toggleAffectedChrome();
   },
   onExit: function () {
     gBrowser.selectedTab = this._tabBeforePrintPreview;
     this._tabBeforePrintPreview = null;
     gInPrintPreviewMode = false;
     this._toggleAffectedChrome();
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3044,16 +3044,19 @@
       </method>
 
       <property name="selectedTab">
         <getter>
           return this.mCurrentTab;
         </getter>
         <setter>
           <![CDATA[
+          if (gNavToolbox.collapsed) {
+            return this.mTabBox.selectedTab;
+          }
           // Update the tab
           this.mTabBox.selectedTab = val;
           return val;
           ]]>
         </setter>
       </property>
 
       <property name="selectedBrowser"