Bug 844473 - Honor mozdisallowselectionprint and moznomarginboxes in print preview and use child document. r=roc

This commit is contained in:
Oskar Eisemuth 2014-02-02 17:17:28 +01:00
parent 49183c46ed
commit 49e65de1c8

View File

@ -3694,11 +3694,13 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
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);