Intent to Implement and Ship: beforeprint and afterprint events

86 views
Skip to first unread message

TAMURA, Kent

unread,
Jun 28, 2017, 8:09:44 PM6/28/17
to blink-dev

Contact emails

tk...@chromium.org



Spec

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#printing-steps



Summary

Synchronous events dispatched before and after printing.



Motivation

- This feature is helpful to make and clean printing-only content which can't be implemented with CSS media query.

- Edge, Firefox, and IE have shipped it for years.



Interoperability and Compatibility Risk

Very low. Small additional feature.


Edge: Shipped

Firefox: Shipped

Safari: No signals

Web developers: Positive. The feature request bug has 42 stars.



Ongoing technical constraints

None.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.



OWP launch tracking bug

crbug.com/218205



Link to entry on the feature dashboard

https://www.chromestatus.com/features/5700595042222080



Requesting approval to ship?

Yes.



--
TAMURA Kent
Software Engineer, Google


TAMURA, Kent

unread,
Jun 28, 2017, 8:15:43 PM6/28/17
to blink-dev
Oops, missed wpt section.

Is this feature fully tested by web-platform-tests?

Multiple test files in WPT check existence of onbeforeprint and onafterprint attributes, however I think there are no tests for event dispatching. It's difficult to test printing with interoperable ways.

PhistucK

unread,
Jun 29, 2017, 2:09:22 AM6/29/17
to TAMURA, Kent, blink-dev
I think printing is sort of asynchronous in Chrome (which causes or has caused web development issues) - interoperability here is very important, so I am not really sure how, but I think this needs to be tested for interoperability extensively, otherwise this feature may be rendered useless in Chrome.


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqHp0uqHUPRtketvgXdt_vsxoi0%2BibO0Z__Ybp0jqCYTZw%40mail.gmail.com.

Philip Jägenstedt

unread,
Jun 30, 2017, 6:19:43 AM6/30/17
to TAMURA, Kent, blink-dev
AFAIK, you're right that this couldn't currently be tested without adding some bits of infrastructure, so I've filed https://crbug.com/738393 to track that.

If you'd like, you can still write a manual test for this, I did something related in https://github.com/w3c/web-platform-tests/pull/970 a few years ago. Manual tests aren't super valuable right now, so it's up to you.

LGTM1, thanks for taking care of these cases where we are the last to ship, I'm confident that web developers will appreciate it!

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Mike West

unread,
Jun 30, 2017, 8:01:23 AM6/30/17
to Philip Jägenstedt, TAMURA, Kent, blink-dev

Chris Harrelson

unread,
Jun 30, 2017, 3:47:42 PM6/30/17
to Mike West, Philip Jägenstedt, TAMURA, Kent, blink-dev
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

TAMURA, Kent

unread,
Jul 2, 2017, 9:48:53 PM7/2/17
to PhistucK, blink-dev
If we still have asynchronous issues like crbug.com/449109, adding afterprint event might introduce another pattern of unable-to-print issues.  We should check the current behavior, and should fix existing issues before implementing afterprint.



Reply all
Reply to author
Forward
0 new messages