-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Printing steps" should not run in parallel #4686
Comments
Seems like we are in the lucky case. On Firefox and Chrome (not sure about Safari), everything seems to be synchronous. In particular, the following onbeforeprint = () => { console.log('beforeprint'); };
onafterprint = () => { console.log('afterprint'); };
console.log('before calling print()');
window.print();
console.log('after print() returns'); prints
in both Chrome and Firefox. I'll go ahead and create a PR. |
TimothyGu
added a commit
to TimothyGu/html
that referenced
this issue
Jun 12, 2019
This was a slip-up in the larger clean-up commit in 61da493, where "synchronous" was changed to "in parallel". All browsers implement the synchronous behavior. Fixes whatwg#4686.
WebKit seems to not support the events. https://bugs.webkit.org/show_bug.cgi?id=19937 cc @cdumez |
domenic
pushed a commit
that referenced
this issue
Jun 24, 2019
This was a slip-up in the larger clean-up commit in 61da493, where "synchronous" was changed to "in parallel". All browsers implement the synchronous behavior. Fixes #4686. Tests: web-platform-tests/wpt#17439
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#printing
As pointed out by @TimothyGu in #4682, it seems like there are several steps inside the printing steps that should be run from a the main thread, not from in-parallel. E.g. steps 3 and 4 fire an event; and step 4 may pause (and pause seems to explicitly pause a task).
One thing to test here is whether beforeprint fires synchronously when calling print(). If that is true, then the solution is:
If that is not true, then the solution is a bit more complicated.
The text was updated successfully, but these errors were encountered: