-
Notifications
You must be signed in to change notification settings - Fork 10
Description
It's plausible that after preparePrint() has been called and executed, the browser may perform layout again before script has a chance to call print(). The browser may then decide that the loaded resources are not needed and release them. This creates a race condition on calling print() before resources are released. Regardless of resources, it will create style and layout churn.
Firefox would not have this problem because it snapshots the document before printing. But Chrome and Safari probably both have this potential problem.
The solution is to roll prepare and print together as, for example, requestPrint() which is essentially an async print().
Another option is to return some handle that will keep the print-ready document alive, though it would be challenging for Chromium and Safari, I think.