Closed Bug 1430910 Opened 4 years ago Closed 2 years ago
The 'afterprint' event doesn't fire if there's a <canvas> with moz
The 'beforeprint' event should file to give a print docs a chance to make any changes it wants to make to the document so that it can print better, and 'afterprint' should be sent at a later point once reverting those changes will no longer interfere with the printed output. Other than that, the time spanned by the two events should be as short as possible to avoid any changes made by the 'beforeprint' handler from sticking around unnecessarily long in the original document. I noticed that for documents that have a canvas with a mozPrintCallback callback 'afterprint' doesn't fire until nsDocumentViewer::Destroy is called on the original document's nsDocumentViewer. That essentially means that 'afterprint' will never be called and the document will be stuck with the 'beforeprint' changes.
Attachment #8943049 - Attachment mime type: text/plain → text/html
Presumably this isn't a problem in general because mozPrintCallback isn't widely used on the Web, and PDF.js (which does use mozPrintCallback) doesn't use beforeprint/afterprint.
[ Triage 2017/02/20: P3 ]
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.