зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1697525 - Prevent calling printPreview().print() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107918
This commit is contained in:
Родитель
91fdeec18c
Коммит
258f0f6b52
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
window.addEventListener('load', () => {
|
||||
SpecialPowers.wrap(self).printPreview()?.print()
|
||||
})
|
||||
</script>
|
|
@ -260,3 +260,4 @@ asserts(0-1) load 1623918.html # May hit an assertion if the <input> element's a
|
|||
load 1656925.html
|
||||
skip-if(Android) load 1665792.html # Print preview on android doesn't fly
|
||||
load 1681729.html
|
||||
load 1697525.html
|
||||
|
|
|
@ -5241,7 +5241,12 @@ Nullable<WindowProxyHolder> nsGlobalWindowOuter::Print(
|
|||
if (docToPrint->IsStaticDocument() &&
|
||||
(aIsPreview == IsPreview::Yes ||
|
||||
StaticPrefs::print_tab_modal_enabled())) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aForWindowDotPrint == IsForWindowDotPrint::No);
|
||||
if (aForWindowDotPrint == IsForWindowDotPrint::Yes) {
|
||||
aError.ThrowNotSupportedError(
|
||||
"Calling print() from a print preview is unsupported, did you intend "
|
||||
"to call printPreview() instead?");
|
||||
return nullptr;
|
||||
}
|
||||
// We're already a print preview window, just reuse our browsing context /
|
||||
// content viewer.
|
||||
bc = sourceBC;
|
||||
|
|
Загрузка…
Ссылка в новой задаче