Bug 877612 - Cannot enter into fullscreen mode after print dialog is opened. r=roc, a=lsblakk
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 07 Jun 2013 12:11:04 +0300
changeset 137766 8045665d2cde68f0842c596f51424f303bb8cfd4
parent 137765 32086e832050972cd0e9ad5524385a9e621743a5
child 137767 dcb5e3e05eb4c7a829c7d1356265e144727a9ca9
push id2550
push userryanvm@gmail.com
push dateFri, 07 Jun 2013 20:05:29 +0000
treeherdermozilla-beta@8045665d2cde [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs877612
milestone22.0
Bug 877612 - Cannot enter into fullscreen mode after print dialog is opened. r=roc, a=lsblakk
layout/printing/nsPrintEngine.cpp
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -525,20 +525,22 @@ nsPrintEngine::DoCommonPrint(bool       
   // Check to see if there is a "regular" selection
   bool isSelection = IsThereARangeSelection(mPrt->mCurrentFocusWin);
 
   // Get the docshell for this documentviewer
   nsCOMPtr<nsIDocShell> webContainer(do_QueryReferent(mContainer, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   {
-    nsCOMPtr<nsIContentViewer> viewer;
-    webContainer->GetContentViewer(getter_AddRefs(viewer));
-    if (viewer && viewer->GetDocument() && viewer->GetDocument()->IsShowing()) {
-      viewer->GetDocument()->OnPageHide(false, nullptr);
+    if (aIsPrintPreview) {
+      nsCOMPtr<nsIContentViewer> viewer;
+      webContainer->GetContentViewer(getter_AddRefs(viewer));
+      if (viewer && viewer->GetDocument() && viewer->GetDocument()->IsShowing()) {
+        viewer->GetDocument()->OnPageHide(false, nullptr);
+      }
     }
 
     nsAutoScriptBlocker scriptBlocker;
     mPrt->mPrintObject = new nsPrintObject();
     NS_ENSURE_TRUE(mPrt->mPrintObject, NS_ERROR_OUT_OF_MEMORY);
     rv = mPrt->mPrintObject->Init(webContainer, aDoc, aIsPrintPreview);
     NS_ENSURE_SUCCESS(rv, rv);