Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 65 additions & 4 deletions css-page-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ properties:
is larger than the height of the top page margin,
then any ''margin-top/auto'' values for 'margin-top' or 'margin-bottom' are,
for the following rules,
treated as zero.
treated as <<safe-printable-inset>>.

<li>
If at this point all of 'height', 'margin-top', and 'margin-bottom'
Expand All @@ -1271,14 +1271,20 @@ properties:
follows from the equality.

<li>
If 'height' is set to ''height/auto'', any other <css>auto</css> values become ''0'' and
'height' follows from the resulting equality
If 'height' is set to ''height/auto'', any <css>auto</css> margin
values become <<safe-printable-inset>> and 'height' follows from the
resulting equality.

<li>
If both 'margin-top' and 'margin-bottom' are ''margin-top/auto'',
their used values are equal.
their used values become equal.
This vertically centers the page-margin box content
within the top page margin.
If <<safe-printable-inset>> is not ''0'' here, an additional adjustment step
is performed: If the resulting 'margin-top' in the previous step became
less than <<safe-printable-inset>>, subtract as much as possible of this
difference from 'margin-bottom' without making it negative. Then add
this value to 'margin-top'.
</ol>

The same rules apply to the bottom page-margin boxes (bottom-left-corner,
Expand Down Expand Up @@ -2060,6 +2066,61 @@ Positioning the page box on the sheet</h3>
The user agent may wish to consult the user in this
regard.<!-- "Page selector and page context" -->

<h3 id="page-margin-safety">
Staying within the printable area: the '@page/page-margin-safety' property</h3>

<pre class='descdef'>
Name: page-margin-safety
For: @page
Value: none | clamp | add
Initial: auto
Computed Value: as specified
</pre>

Most printers have a small region along each edge of the page sheet
which is unprintable, typically due to the printer's paper handling
mechanism. This property can be used to help staying within the
<a>printable area</a>, by adjusting the page margins and page margin box
margins.

Some printers don't have a uniform unprintable area width along each of
the four paper edges, and the printer may rotate the print output at
their own discretion. The user agent may therefore not be able to make
assumptions about which edge will be fed first into the printer, or what
orientation the sheet of paper has. If the user agent cannot make such
assumptions, only one will be provided (to be used on all 4 sides): The
larger of these four values. Otherwise, if the user agent can trust that
the four values are usable individually, and that no rotation is going
to take place, and so on, each side of the page may have individual
values.

Let this value be <dfn><<safe-printable-inset>></dfn>, which is a <<length>>.

This property only affects margins that are adjacent to one of the edges
of a sheet. For all other margins, i.e. those margins facing the
page's <a>page area</a>, its value is 0. In other words, when
page-margin-safety is specified in a margin context, it will only have
an effect at one or two sides. For instance, @page { @top-right-corner {
page-margin-safety: clamp; } } may only clamp top and right margin
values, as the bottom and left margins face the document's contents, not
the page's edges.

<dl dfn-for="@page/page-margin-safety" dfn-type=value>
<dt><dfn>none</dfn></dt>
<dd>Margins are not affected by unprintable regions</dd>
<dt><dfn>clamp</dfn></dt>
<dd>
The used margin values will be the maximum of the
resolved value, and <<safe-printable-inset>> for the
given side.
</dd>
<dt><dfn>add</dfn></dt>
<dd>
The used margin values will be the resolved value, plus
<<safe-printable-inset>> for the given side.
</dd>
</dl>

<h2 id="page-breaks">
<span id="pg-br-before-after"></span>
<span id="page-break-before"></span>
Expand Down