зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1661873 - Generate nsRootPresShell for printing ducuments only if the document has no parent OR the parent is not going to be printed AND GetParentViewForRoot() is not null. r=smaug
Though there is no automated test for this change, I think the test cases in the previous commit well cover the original issue (bug 468568) that downloadable fonts are not rendered in printing. Depends on D89095 Differential Revision: https://phabricator.services.mozilla.com/D89096
This commit is contained in:
Родитель
b15a8fe457
Коммит
c9ac4c645c
|
@ -1803,11 +1803,11 @@ nsresult nsPrintJob::ReflowPrintObject(const UniquePtr<nsPrintObject>& aPO) {
|
|||
nsPresContext::nsPresContextType type =
|
||||
mIsCreatingPrintPreview ? nsPresContext::eContext_PrintPreview
|
||||
: nsPresContext::eContext_Print;
|
||||
nsView* parentView = aPO->mParent && aPO->mParent->PrintingIsEnabled()
|
||||
? nullptr
|
||||
: GetParentViewForRoot();
|
||||
aPO->mPresContext = parentView ? new nsPresContext(aPO->mDocument, type)
|
||||
: new nsRootPresContext(aPO->mDocument, type);
|
||||
const bool shouldBeRoot =
|
||||
(!aPO->mParent || !aPO->mParent->PrintingIsEnabled()) &&
|
||||
!GetParentViewForRoot();
|
||||
aPO->mPresContext = shouldBeRoot ? new nsRootPresContext(aPO->mDocument, type)
|
||||
: new nsPresContext(aPO->mDocument, type);
|
||||
aPO->mPresContext->SetPrintSettings(printData->mPrintSettings);
|
||||
|
||||
// set the presentation context to the value in the print settings
|
||||
|
|
Загрузка…
Ссылка в новой задаче