Stop saving print settings in JavaScript code
Categories
(Core :: Printing: Setup, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
(Whiteboard: [print2020_v78])
Attachments
(1 file)
There are two sources of triggers for initiating a print and opening the print dialog:
- UI "Print" menu items/Ctrl-P, which triggers PrintingChild.print
- window.print, which triggers nsGlobalWindowOuter::PrintOuter
Both PrintingChild.print and nsGlobalWindowOuter::PrintOuter have their own code to call SavePrintSettingsToPrefs to persist the print settings after triggering the print.
I think we should remove the SavePrintSettingsToPrefs calls from these methods and instead have a single call in nsPrintingPromptService::ShowPrintDialog just after the nsIPrintDialogService::Show call returns, so long as the user didn't cancel the dialog (the returned error code is a success code).
My immediate reason for wanting to do this is because it makes refactoring PrintingChild code to get rid of the message passing implementation (part of the Fission work) easier. But I think it's the correct thing to do anyway. As soon as a user confirms some print settings they should really be accepted and saved, I think.
It may be that moving the save all the way back to nsPrintingPromptService::ShowPrintDialog is more risk than we want to take at the moment while we're trying to keep risk low while so many people around the world are working from home. In that case we could centralize the save in nsPrintJob::Print.
Assignee | ||
Comment 1•4 years ago
|
||
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/b0216ee8d221 Centralize saving of the print setting the user chooses from the print dialog. r=bobowen
Comment 3•4 years ago
|
||
bugherder |
Description
•