Intent to Prototype: Expose unprintable areas via CSS

89 views
Skip to first unread message

Morten Stenshorne

unread,
Jun 24, 2025, 4:12:05 AMJun 24
to blink-dev

Contact emails

mste...@chromium.org

Explainer

https://github.com/mstensho/unprintable-areas

Specification

https://drafts.csswg.org/css-env-1

Summary

Printers usually have a small area at each of the four edges of a sheet of paper that they are not capable of marking reliably, usually due to the printer’s paper handling mechanism. The default page margins are expected to be bigger than these areas, but if authors set margins on their own, and even want to add @page margin boxes (e.g. for custom headers and footers), they need a way of telling where it's safe to print and not. The CSS environment variable env(safe-printable-inset) can be used to obtain this information. It will be the inset of the largest unprintable area. Although some printers don't have the same unprintable area inset along each of the four paper edges, printers may rotate the print output at their own discretion. The user agent cannot make assumptions about which edge (will it be the long or short edge?) is going to be fed first into the printer. Therefore, only one value can be reliably provided here: The larger of these four values.



Blink component

Blink>Layout>Printing

Motivation

The browser itself has access to information about unprintable areas, so that it can place UA-generated headers and footers within the printable area, and also make the default page margins large enough to prevent loss of content. But once authors want to set their own page margins, or add page margin boxes (for e.g. custom headers and footers), the problem becomes clear, since this information isn't exposed via CSS. When developers want to place content near the paper sheet edges, be it due to small @page margins or page margin boxes (for custom headers and footers, for instance), without this change, the author would either have to hope for the best, or add some "reasonably large" margin to steer clear of potentially unprintable regions on the sheet.



Initial public proposal

https://github.com/w3c/csswg-drafts/issues/11395

TAG review

https://github.com/w3ctag/design-reviews/issues/1115

TAG review status

Pending

Risks



Interoperability and Compatibility

None



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1258)

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/519)

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



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

No

Need to add WPT support for this. For example: A: Define a default printable inset and/or B: Add a META tag for it



Flag name on about://flags

None

Finch feature name

CSSSafePrintableInset

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/368070327

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5515971464527872?gate=5172211375407104

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages