From ac7be25ba8ed32d91b51adde764b65d649ec10ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 27 Sep 2020 12:07:19 +0000 Subject: [PATCH] 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 --- dom/base/nsGlobalWindowOuter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index b7ad84223a73..1a40d536a4d7 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -5357,6 +5357,8 @@ Nullable nsGlobalWindowOuter::Print( aError.ThrowNotAllowedError("No browsing context"); return nullptr; } + + Unused << bc->Top()->SetIsPrinting(true); nsCOMPtr cloneDocShell = bc->GetDocShell(); MOZ_DIAGNOSTIC_ASSERT(cloneDocShell); cloneDocShell->GetContentViewer(getter_AddRefs(cv));