Skip to content

Commit f541930

Browse files
authored
[css-page-3] Proposed spec changes for safe printable insets. #11395 (#13190)
* Proposed spec changes for safe printable insets. See #11395 (comment) * Update Overview.bs Issue for multiple at-rules not supported by bikeshed.
1 parent a709d01 commit f541930

File tree

1 file changed

+77
-4
lines changed

1 file changed

+77
-4
lines changed

css-page-3/Overview.bs

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ properties:
12581258
is larger than the height of the top page margin,
12591259
then any ''margin-top/auto'' values for 'margin-top' or 'margin-bottom' are,
12601260
for the following rules,
1261-
treated as zero.
1261+
treated as <<safe-printable-inset>>.
12621262

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

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

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

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

2069+
<h3 id="page-margin-safety">
2070+
Staying within the printable area: the '@page/page-margin-safety' property</h3>
2071+
2072+
<pre class='descdef'>
2073+
Name: page-margin-safety
2074+
For: @page
2075+
Value: none | clamp | add
2076+
Initial: auto
2077+
Computed Value: as specified
2078+
</pre>
2079+
2080+
<div class=issue>
2081+
<p>
2082+
The "For:" field above should also include the at-rules
2083+
@top-left-corner, @top-left, @top-center, @top-right,
2084+
@top-right-corner, @right-top, @right-middle,
2085+
@right-bottom, @bottom-right-corner, @bottom-right,
2086+
@bottom-center, @bottom-left, @bottom-left-corner,
2087+
@left-bottom, @left-middle, @left-top.
2088+
</p>
2089+
<p>However, multiple at-rules here are currently not supported by bikeshed.</p>
2090+
</div>
2091+
2092+
Most printers have a small region along each edge of the page sheet
2093+
which is unprintable, typically due to the printer's paper handling
2094+
mechanism. This property can be used to help staying within the
2095+
<a>printable area</a>, by adjusting the page margins and page margin box
2096+
margins.
2097+
2098+
Some printers don't have a uniform unprintable area width along each of
2099+
the four paper edges, and the printer may rotate the print output at
2100+
their own discretion. The user agent may therefore not be able to make
2101+
assumptions about which edge will be fed first into the printer, or what
2102+
orientation the sheet of paper has. If the user agent cannot make such
2103+
assumptions, only one will be provided (to be used on all 4 sides): The
2104+
larger of these four values. Otherwise, if the user agent can trust that
2105+
the four values are usable individually, and that no rotation is going
2106+
to take place, and so on, each side of the page may have individual
2107+
values.
2108+
2109+
Let this value be <dfn><<safe-printable-inset>></dfn>, which is a <<length>>.
2110+
2111+
This property only affects margins that are adjacent to one of the edges
2112+
of a sheet. For all other margins, i.e. those margins facing the
2113+
page's <a>page area</a>, its value is 0. In other words, when
2114+
page-margin-safety is specified in a margin context, it will only have
2115+
an effect at one or two sides. For instance, @page { @top-right-corner {
2116+
page-margin-safety: clamp; } } may only clamp top and right margin
2117+
values, as the bottom and left margins face the document's contents, not
2118+
the page's edges.
2119+
2120+
<dl dfn-for="@page/page-margin-safety" dfn-type=value>
2121+
<dt><dfn>none</dfn></dt>
2122+
<dd>Margins are not affected by unprintable regions</dd>
2123+
<dt><dfn>clamp</dfn></dt>
2124+
<dd>
2125+
The used margin values will be the maximum of the
2126+
resolved value, and <<safe-printable-inset>> for the
2127+
given side.
2128+
</dd>
2129+
<dt><dfn>add</dfn></dt>
2130+
<dd>
2131+
The used margin values will be the resolved value, plus
2132+
<<safe-printable-inset>> for the given side.
2133+
</dd>
2134+
</dl>
2135+
20632136
<h2 id="page-breaks">
20642137
<span id="pg-br-before-after"></span>
20652138
<span id="page-break-before"></span>

0 commit comments

Comments
 (0)