Bug 844473 - Honor mozdisallowselectionprint and moznomarginboxes in print preview and use child document. r=roc
authorOskar Eisemuth <dev_oskar@hotmail.com>
Sun, 02 Feb 2014 17:17:28 +0100
changeset 182590 543e8c09e7b073c4b7aa14d1d44d16a6e5e86281
parent 182589 4e7bf8e9f208f12f0f2e0979cbf4b81b2c67236a
child 182591 d8a9d899c0d33b33a2bc1778732ab0d6d36044c3
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs844473
milestone29.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 844473 - Honor mozdisallowselectionprint and moznomarginboxes in print preview and use child document. r=roc
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -3689,21 +3689,23 @@ nsDocumentViewer::PrintPreview(nsIPrintS
       mPrintEngine->Destroy();
       mPrintEngine = nullptr;
       return rv;
     }
   }
   if (mPrintEngine->HasPrintCallbackCanvas()) {
     mBeforeAndAfterPrint = beforeAndAfterPrint;
   }
-  dom::Element* root = mDocument->GetRootElement();
+  dom::Element* root = doc->GetRootElement();
   if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::mozdisallowselectionprint)) {
+    PR_PL(("PrintPreview: found mozdisallowselectionprint"));
     mPrintEngine->SetDisallowSelectionPrint(true);
   }
   if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::moznomarginboxes)) {
+    PR_PL(("PrintPreview: found moznomarginboxes"));
     mPrintEngine->SetNoMarginBoxes(true);
   }
   rv = mPrintEngine->PrintPreview(aPrintSettings, aChildDOMWin, aWebProgressListener);
   mPrintPreviewZoomed = false;
   if (NS_FAILED(rv)) {
     OnDonePrinting();
   }
   return rv;