Bug 1666827 - Mark browsing contexts where we host static documents as "printing". r=smaug

This prevents e.g. navigating the print preview document.

I can try to come up with a test for this, though testing for something
not happening is always a bit more annoying... :)

Depends on D91438

Differential Revision: https://phabricator.services.mozilla.com/D91439
This commit is contained in:
Emilio Cobos Álvarez
2020-09-27 12:07:19 +00:00
parent 1d86dbcf50
commit ac7be25ba8

View File

@@ -5357,6 +5357,8 @@ Nullable<WindowProxyHolder> nsGlobalWindowOuter::Print(
aError.ThrowNotAllowedError("No browsing context");
return nullptr;
}
Unused << bc->Top()->SetIsPrinting(true);
nsCOMPtr<nsIDocShell> cloneDocShell = bc->GetDocShell();
MOZ_DIAGNOSTIC_ASSERT(cloneDocShell);
cloneDocShell->GetContentViewer(getter_AddRefs(cv));