Open Bug 1558671 Opened 5 years ago Updated 2 years ago

Remove nsIPrintSettings::printPageDelay and the print.print_page_delay pref

Categories

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

defect

Tracking

()

ASSIGNED

People

(Reporter: jwatt, Assigned: jwatt)

Details

We have a delay where we return to the event loop between each page as we're printing a document:

https://searchfox.org/mozilla-central/rev/c606cdd6d014fee4034da1702d484c0d41b604c9/layout/printing/nsPrintJob.cpp#3010

The comment here claims that the delay (of 50 ms) is to give the user more time to hit cancel. That clearly makes no sense.

Digging into this a bit, the delay was changed from 500 ms to 50 ms in bug 535794. It had been 500 ms (with that comment) going all the way back to the very first commit of the file in 2002.

The real reason to have a timeout between each page is to allow us to return to the event loop to service events. That allows us to service a cancel by the user, it makes sure that the content process doesn't hang for prolonged periods (potentially breaking pages by causing timeouts), and makes it possible for our progress observer to react to the progress notifications that we send out.

I don't think there's any actual reason for this timeout to be configurable. Possibly it should just have a value of 0.

(In reply to Jonathan Watt [:jwatt] from comment #0)

The real reason to have a timeout between each page is to allow us to return to the event loop to service events. That allows us to service a cancel by the user, it makes sure that the content process doesn't hang for prolonged periods (potentially breaking pages by causing timeouts), and makes it possible for our progress observer to react to the progress notifications that we send out.

Since nsPagePrintTimer is completely undocumented, we should at the same time add something like the above as a documenting comment to explain its existence.

Status: NEW → ASSIGNED
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.