Bug 844473: Honor mozdisallowselectionprint and moznomarginboxes in print preview as well as print. r=roc

This commit is contained in:
Oskar Eisemuth 2014-01-24 17:18:54 -05:00
parent 55dbf3e3b5
commit e8d1507857

View File

@ -3701,6 +3701,13 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
if (mPrintEngine->HasPrintCallbackCanvas()) {
mBeforeAndAfterPrint = beforeAndAfterPrint;
}
dom::Element* root = mDocument->GetRootElement();
if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::mozdisallowselectionprint)) {
mPrintEngine->SetDisallowSelectionPrint(true);
}
if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::moznomarginboxes)) {
mPrintEngine->SetNoMarginBoxes(true);
}
rv = mPrintEngine->PrintPreview(aPrintSettings, aChildDOMWin, aWebProgressListener);
mPrintPreviewZoomed = false;
if (NS_FAILED(rv)) {