зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1305309, backout Bug 1214805, r=backout
--HG-- extra : rebase_source : d86f67ef53b26027d739725829a2ee736d71221e
This commit is contained in:
Родитель
d4aabe37f6
Коммит
bddafc48dd
|
@ -2768,16 +2768,6 @@ public:
|
|||
return mHasScrollLinkedEffect;
|
||||
}
|
||||
|
||||
bool MayHavePluginFramesForPrinting()
|
||||
{
|
||||
return mMayHavePluginFramesForPrinting;
|
||||
}
|
||||
|
||||
void SetMayHavePluginFramesForPrinting()
|
||||
{
|
||||
mMayHavePluginFramesForPrinting = true;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool GetUseCounter(mozilla::UseCounter aUseCounter)
|
||||
{
|
||||
|
@ -3074,10 +3064,6 @@ protected:
|
|||
// True is document has ever been in a foreground window.
|
||||
bool mEverInForeground : 1;
|
||||
|
||||
// True if this document is a static clone for printing and may
|
||||
// have elements referring to plugins in the original document.
|
||||
bool mMayHavePluginFramesForPrinting : 1;
|
||||
|
||||
enum Type {
|
||||
eUnknown, // should never be used
|
||||
eHTML,
|
||||
|
|
|
@ -2907,13 +2907,9 @@ nsObjectLoadingContent::CreateStaticClone(nsObjectLoadingContent* aDest) const
|
|||
aDest->mPrintFrame = const_cast<nsObjectLoadingContent*>(this)->GetExistingFrame();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content =
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(aDest));
|
||||
if (aDest->mPrintFrame) {
|
||||
content->OwnerDoc()->SetMayHavePluginFramesForPrinting();
|
||||
}
|
||||
|
||||
if (mFrameLoader) {
|
||||
nsCOMPtr<nsIContent> content =
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(aDest));
|
||||
nsFrameLoader* fl = nsFrameLoader::Create(content->AsElement(), false);
|
||||
if (fl) {
|
||||
aDest->mFrameLoader = fl;
|
||||
|
|
|
@ -3762,7 +3762,9 @@ nsDocumentViewer::Print(nsIPrintSettings* aPrintSettings,
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
if (mPrintEngine->HasPrintCallbackCanvas()) {
|
||||
mBeforeAndAfterPrint = beforeAndAfterPrint;
|
||||
}
|
||||
dom::Element* root = mDocument->GetRootElement();
|
||||
if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::mozdisallowselectionprint)) {
|
||||
mPrintEngine->SetDisallowSelectionPrint(true);
|
||||
|
@ -3770,18 +3772,7 @@ nsDocumentViewer::Print(nsIPrintSettings* aPrintSettings,
|
|||
rv = mPrintEngine->Print(aPrintSettings, aWebProgressListener);
|
||||
if (NS_FAILED(rv)) {
|
||||
OnDonePrinting();
|
||||
} else if (GetIsPrinting()) {
|
||||
if (mPrintEngine->HasPrintCallbackCanvas() ||
|
||||
mPrintEngine->MayHavePluginFrames()) {
|
||||
mBeforeAndAfterPrint = beforeAndAfterPrint;
|
||||
} else {
|
||||
// Since printing cloned the document and doesn't need plugin or canvas data
|
||||
// from the original document, we can clear the print flag in the docshell
|
||||
// tree early, before afterprint is dispatched.
|
||||
SetIsPrinting(false);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -3846,7 +3837,9 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
if (mPrintEngine->HasPrintCallbackCanvas()) {
|
||||
mBeforeAndAfterPrint = beforeAndAfterPrint;
|
||||
}
|
||||
dom::Element* root = doc->GetRootElement();
|
||||
if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::mozdisallowselectionprint)) {
|
||||
PR_PL(("PrintPreview: found mozdisallowselectionprint"));
|
||||
|
@ -3856,16 +3849,7 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
|
|||
mPrintPreviewZoomed = false;
|
||||
if (NS_FAILED(rv)) {
|
||||
OnDonePrinting();
|
||||
} else if (GetIsPrintPreview() &&
|
||||
(mPrintEngine->HasPrintCallbackCanvas() ||
|
||||
mPrintEngine->MayHavePluginFrames())) {
|
||||
mBeforeAndAfterPrint = beforeAndAfterPrint;
|
||||
}
|
||||
|
||||
// Unlike in printing case we don't explicitly call SetIsPrintPreview(false);
|
||||
// here, since this ContentViewer is for the cloned document, not for the
|
||||
// original document.
|
||||
|
||||
return rv;
|
||||
#else
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -3560,26 +3560,6 @@ nsPrintEngine::FirePrintCompletionEvent()
|
|||
NS_WARNING("failed to dispatch print completion event");
|
||||
}
|
||||
|
||||
bool
|
||||
nsPrintEngine::MayHavePluginFrames()
|
||||
{
|
||||
nsPrintData* prt = mPrt;
|
||||
if (!mPrt) {
|
||||
prt = mPrtPreview;
|
||||
if (!prt) {
|
||||
prt = mOldPrtPreview;
|
||||
}
|
||||
}
|
||||
if (prt) {
|
||||
for (uint32_t i = 0; i < prt->mPrintDocList.Length(); ++i) {
|
||||
if (prt->mPrintDocList[i]->MayHavePluginFrames()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
//---------------------------------------------------------------
|
||||
//-- Debug helper routines
|
||||
|
|
|
@ -203,8 +203,6 @@ public:
|
|||
mDisallowSelectionPrint = aDisallowSelectionPrint;
|
||||
}
|
||||
|
||||
bool MayHavePluginFrames();
|
||||
|
||||
protected:
|
||||
~nsPrintEngine();
|
||||
|
||||
|
|
|
@ -111,8 +111,3 @@ nsPrintObject::DestroyPresentation()
|
|||
mViewManager = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
nsPrintObject::MayHavePluginFrames()
|
||||
{
|
||||
return mDocument && mDocument->MayHavePluginFramesForPrinting();
|
||||
}
|
||||
|
|
|
@ -36,9 +36,6 @@ public:
|
|||
bool aPrintPreview);
|
||||
|
||||
bool IsPrintable() { return !mDontPrint; }
|
||||
|
||||
bool MayHavePluginFrames();
|
||||
|
||||
void DestroyPresentation();
|
||||
|
||||
// Data Members
|
||||
|
|
Загрузка…
Ссылка в новой задаче