Bug 877612 - Cannot enter into fullscreen mode after print dialog is opened, r=roc
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 07 Jun 2013 12:11:04 +0300
changeset 145844 ff5a4f1c83c12925a55f8de95bfa90c62d15ecfb
parent 145843 e5a427cac5cf96638c59f5e8339f08c3d29f1f88
child 145845 78214f394a9714bcc5876a62969f8959bb09ebc7
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs877612
milestone24.0a1
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
Bug 877612 - Cannot enter into fullscreen mode after print dialog is opened, r=roc
layout/printing/nsPrintEngine.cpp
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -524,20 +524,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);