зеркало из https://github.com/mozilla/gecko-dev.git
b3926cc517
Bug 1376693 added a null-check to bail from print operations if mPresShell/mPresContext are null, to avoid some null-deref crashes. However, it turns out it's possible for these variables to be null under normal conditions -- for example, when nsPrintEngine is printing documents, mPrt->mPrintObject->mPresShell and mPrt->mPrintObject->mPresShell can be nullptr if the document has <frameset> element and it's printing only content of a <frame> element or all <frame> elements separately. This special frameset-printing mode can cause these variables to be null; however, the crash occurred only when mIsCreatingPrintPreview is true. So, we should check the variables only when it's true. Fortunately: * the null-deref crashes that Bug 1376693 wanted to avoid were all in code that we only visit when mIsCreatingPrintPreview is true (i.e. during print preview). * this special frameset-printing mode (which causes these variables to be null) _cannot be used during print preview_. So, we can avoid the print-preview-specific crashes without breaking frameset-printing by simply making our null-check bail-out conditional on mIsCreatingPrintPreview. MozReview-Commit-ID: FJ3ynrXTxnI --HG-- extra : rebase_source : 788ab55840c725dc401007b605c035c053049edf |
||
---|---|---|
.. | ||
crashtests | ||
ipc | ||
PrintTranslator.cpp | ||
PrintTranslator.h | ||
moz.build | ||
nsIPrintProgress.idl | ||
nsIPrintProgressParams.idl | ||
nsIPrintStatusFeedback.idl | ||
nsPagePrintTimer.cpp | ||
nsPagePrintTimer.h | ||
nsPrintData.cpp | ||
nsPrintData.h | ||
nsPrintEngine.cpp | ||
nsPrintEngine.h | ||
nsPrintObject.cpp | ||
nsPrintObject.h | ||
nsPrintPreviewListener.cpp | ||
nsPrintPreviewListener.h |