Closed Bug 1557983 Opened 7 years ago Closed 6 years ago

Simplify the complex and broken 'beforeprint'/'afterprint' dispatching code

Categories

(Core :: Printing: Setup, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(2 files)

No description provided.

This fixes two issue.

First, the code shouldn't be dispatching these events every time it gets a new
Print or PrintPreview call. It only needs to dispatch the events to the
original document that we're going to clone from. When cloning from existing
static clones any changes made by 'beforeprint' will be present in the existing
static clone.

Second, the code tries to delay the 'afterprint' event until after
mozPrintCallback callbacks have been invoked, but those callbacks are invoked
in the cloned document, whereas the events are sent to the original document!
So there is no reason to do this.

After refactoring the 'beforeprint'/'afterprint' code, this method is not used
any more.

Status: NEW → ASSIGNED
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/f91e5fbb9520 Remove nsPrintJob::HasPrintCallbackCanvas.
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/dfbaf61ce16a Significantly simplify and fix the 'beforeprint'/'afterprint' dispatching code. https://hg.mozilla.org/integration/autoland/rev/249eede42e9f Remove nsPrintJob::HasPrintCallbackCanvas.
Blocks: 1638162
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/25fa445f9702 Significantly simplify and fix the 'beforeprint'/'afterprint' dispatching code. https://hg.mozilla.org/integration/autoland/rev/907d8172c495 Remove nsPrintJob::HasPrintCallbackCanvas.
Type: defect → enhancement
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
Regressions: 1660189
Regressions: 1793627
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: