8000 csswg-drafts/css3-break/Overview.src.html at d2872180a3d4302d57cadbc07281ac32a5280f0a · simonwuelker/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
1201 lines (1110 loc) · 44.8 KB

File metadata and controls

1201 lines (1110 loc) · 44.8 KB
<!DOCTYPE html public '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html lang="en">
<head profile="http://www.w3.org/2006/03/hcard">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Fragmentation Module Level 3</title>
<link rel="stylesheet" type="text/css" href="../default.css">
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS].css">
</head>
<body>
<div class="head">
<!--logo-->
<h1 id="css-fragmentation-module">CSS Fragmentation Module Level 3</h1>
<h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
<dl>
<dt>This version:</dt>
<!-- <dd><a href="[VERSION]">http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]/</a></dd> -->
<dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a></dd>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/css3-break/</a></dd>
<dt>Editor's Draft:</dt>
<dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a></dd>
<dt>Previous version:</dt>
<dd>None</dd>
<dt>Editors:</dt>
<dd class="vcard"><span class="fn">Rossen Atanassov</span>, <span class="org"><a class="fn org url" href="http://www.microsoft.com/">Microsoft Corporation</a></span>, <span class="email">ratan@microsoft.com</span></dd>
<dd class="vcard"><span class="fn"><a class="fn" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a></span>, <span class="org"><a class="fn org url" href="http://www.mozilla.org/">Mozilla Corporation</a></span></dd>
<dt>Issues List:</dt>
<dd><a href="http://wiki.csswg.org/spec/[SHORTNAME]">http://wiki.csswg.org/spec/[SHORTNAME]</a></dd>
<dt>Discussion:</dt>
<dd><a href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a> with subject line "<code>[css3-break] …message topic…</code>"</dd>
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">
Abstract</h2>
<p>
This module describes the fragmentation model that partitions a flow into pages.
It builds on the Page model module and introduces and defines the fragmentation
model. It adds functionality for pagination, breaking variable fragment size and
orientation, widows and orphans.
</p>
<h2 class="no-num no-toc" id="status">
Status of this document</h2>
<!--status-->
<!--<p>The following features are at risk: &hellip;</p>-->
<h2 class="no-num no-toc" id="contents">
Table of contents</h2>
<!--toc-->
<h2 id="intro">
Introduction</h2>
<p><em>This section is not normative.</em></p>
<p>
In paged media (e.g., paper, transparencies, photo album pages, pages
displayed on computer screens as printed output simulations), as
opposed to <a href="http://www.w3.org/TR/CSS2/media.html#continuous-media-group">
continuous media</a>, the content of the document is split into one or
more discrete display surfaces. In order to avoid awkward breaks
(such as halfway through a line of text), the layout engine must be
able to shift around content that would fall across the page break.
This process is called <dfn>pagination</dfn>.
</p>
<p>
In CSS, in addition to paged media, certain layout features such as
<a href="http://www.w3.org/TR/css3-regions/">regions</a> [[CSS3-REGIONS]]
and <a href="http://www.w3.org/TR/css3-multicol/">multi-column layout</a>
[[CSS3COL]] create a similarly fragmented environment.
The generic term for breaking content across containers is
<dfn>fragmentation</dfn>.
This module explains how content breaks across <i>fragmentainers</i>
such as pages and columns and how such breaks can be
<a href="#breaking-controls">controlled by the author</a>.
</p>
<h3 id="placement">
Module Interactions</h3>
<p>
This module replaces and extends the pagination controls defined in
[[CSS21]] <a href="http://www.w3.org/TR/CSS21/page.html#page-breaks">section 13.3</a>
and in [[CSS3PAGE]].
</p>
<!-- End section "Modules Interactions" -->
<h3 id="values">
Values</h3>
<p>
This specification follows the <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">
CSS property definition conventions</a> from [[!CSS21]]. Value types not defined
in this specification are defined in CSS Level 2 Revision 1 [[!CSS21]]. Other CSS
modules may expand the definitions of these value types: for example [[CSS3COLOR]],
when combined with this module, expands the definition of the &lt;color&gt; value
type as used in this specification.</p>
<p>
In addition to the property-specific values listed in their definitions, all properties
defined in this specification also accept the <a href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">
inherit</a> keyword as their property value. For readability it has not been
repeated explicitly.
</p>
<h2 id="fragmentation-model">
Fragmentation Model and Terminology</h2>
<dl>
<dt><dfn>fragmented flow</dfn></dt>
<dd>
A content flow that is being laid out in a <i>fragmentation context</i>,
such as a <a href="http://www.w3.org/TR/css3-multicol/">multi-column element</a>,
a chain of <a href="http://www.w3.org/TR/css3-regions">CSS regions</a>,
or a <a href="http://www.w3.org/TR/css3-page/">paged media display</a>.
</dd>
<dt><dfn>fragmentation container</dfn> (<dfn>fragmentainer</dfn>)</dt>
<dd>
A box&mdash;such as a page box, column box, or region&mdash;that contains
a portion (or all) of a <i>fragmented flow</i>.
Fragmentainers can be pre-defined, or generated as needed.
When breakable content overflows a fragmentainer in the block dimension,
instead of overflowing it breaks into the next container in its
<i>fragmentation context</i>.
</dd>
<dt><dfn>fragmentation context</dfn></dt>
<dd>
An ordered series of <i>fragmentainers</i>.
A given fragmentation context can only have one block flow direction
across all its fragmentainers.
</dd>
<dt><dfn>fragmentation direction</dfn></dt>
<dd>
The block flow direction of the fragmentation context,
i.e. the direction in which content is fragmented.
</dd>
<dt><dfn>fragmentation</dfn></dt>
<dd>
The process of splitting a content flow across the <i>fragmentainers</i>
that form a <i>fragmentation context</i>.
</dd>
<dt><dfn>box fragment</dfn> or <dfn>fragment</dfn></dt>
<dd>
The portion of a box that belongs to exactly one <i>fragmentainer</i>.
A box in continuous flow always consists of only one fragment.
A box in a fragmented flow consists of one or more fragments.
<dt><dfn>available fragmentainer extent</dfn></dt>
<dd>
The remaining extent on the fragmentainer available to a given element,
i.e. between the end of preceding content on fragmentainer and the
edge of the fragmentainer.
</dl>
<p>
Each <dfn>fragmentation break</dfn> (hereafter, <dfn>break</dfn>) ends
layout of the fragmented box in the current <i>fragmentainer</i> and
causes the remaining content to be laid out in the next <i>fragmentainer</i>,
in some cases causing a new fragmentainer to be generated to hold the
deferred content. When multiple flows are laid out in parallel,
fragmentation is performed independently in each flow.
</p>
<p>
Breaking a fragmentainer F effectively splits the fragmentainer into two
fragmentainers (F<sub>1</sub> and F<sub>2</sub>). The only difference
is that the type of break between the two pieces F<sub>1</sub> and
F<sub>2</sub> is the <a href="#break-types">type of break</a> created
by the fragmentation context that split F, not the type of break
normally created by F's own fragmentation context.
</p>
<p class="note">
Breaking inline content into lines is another form of fragmentation,
and similarly creates box fragments when it breaks
<a href="http://www.w3.org/TR/CSS21/visuren.html#inline-boxes">inline boxes</a>
across <a href="http://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
However, inline breaking is not covered here; see [[CSS3TEXT]] and
the 'box-decoration-break' property in [[CSS3BG]].
</p>
<h2 id="breaking-controls">
Controlling Breaks</h2>
<p>
The following sections explain how breaks are controlled in a fragmented
flow. Five properties indicate where the user agent may or should break
the content flow. In the case of pagination, the author can also specify
on which page (<a href="http://www.w3.org/TR/css3-page/#left-right-first">left or right</a>)
the subsequent content should resume.
</p>
<h3 id="break-properties">
Forced breaks and keep-together: the 'break-before', 'break-after', 'break-inside'
properties</h3>
<table class="propdef" summary="property definition">
<tr>
<td><em>Name:</em>
<td><dfn>break-before</dfn>
<tr>
<td><em>Value:</em>
<td>auto | always | left | right | page | column | region | avoid | avoid-page | avoid-column | avoid-region
<tr>
<td><em>Initial:</em>
<td>auto
<tr>
<td><em>Applies to:</em>
<td>block-level elements, table row groups, table rows (but see prose)
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed&nbsp;value:</em>
<td>specified value
</table>
<table class="propdef" summary="property definition">
<tr>
<td><em>Name:</em>
<td><dfn>break-after</dfn>
<tr>
<td><em>Value:</em>
<td>auto | always | left | right | page | column | region | avoid | avoid-page | avoid-column | avoid-region
<tr>
<td><em>Initial:</em>
<td>auto
<tr>
<td><em>Applies to:</em>
<td>block-level elements, table row groups, table rows (but see prose)
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed&nbsp;value:</em>
<td>specified value
</table>
<table class="propdef" summary="property definition">
<tr>
<td><em>Name:</em>
<td><dfn>break-inside</dfn>
<tr>
<td><em>Value:</em>
<td>auto | avoid | avoid-page | avoid-column | avoid-region
<tr>
<td><em>Initial:</em>
<td>auto
<tr>
<td><em>Applies to:</em>
<td>block-level elements, block containers, table row groups, table rows (but see prose)
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed&nbsp;value:</em>
<td>specified value
</table>
<p>
These properties describe page/column/region break behavior before/after/inside the generated
box. These values have the following meaning:
</p>
<dl>
<dt>
auto
</dt>
<dd>
Neither force nor forbid a break before/after/inside the principle box.
</dd>
<dt>
always
</dt>
<dd>
Always force a break before/after the principle box.
</dd>
<dt>
avoid
</dt>
<dd>
Avoid a break before/after/inside the principle box.
</dd>
<dt>
left
</dt>
<dd>
Force one or two page breaks before/after the principle box so that the next page is formatted as a left page.
</dd>
<dt>
right
</dt>
<dd>
Force one or two page breaks before/after the principle box so that the next page is formatted as a right page.
</dd>
<dt>
page
</dt>
<dd>
Always force a page break before/after the principle box.
</dd>
<dt>
column
</dt>
<dd>
Always force a column break before/after the principle box.
</dd>
<dt>
region
</dt>
<dd>
Always force a region break before/after the principle box.
</dd>
<dt>
avoid-page
</dt>
<dd>
Avoid a page break before/after/inside the principle box.
</dd>
<dt>
avoid-column
</dt>
<dd>
Avoid a column break before/after/inside the principle box.
</dd>
<dt>
avoid-region
</dt>
<dd>
Avoid a region break before/after/inside the principle box.
</dd>
</dl>
<p>
A potential page/column/region break location is typically under the influence of
the containing block's 'break-inside' property,
the 'break-after' property of the preceding element,
and the 'break-before' property of the following element.
When these properties have values other than ''auto'',
the <dfn>forced break values</dfn>
(''always'', ''left'', ''right'', ''page'', ''column'' and ''region'')
take precedence over the <dfn>avoid break values</dfn>
(''avoid'', ''avoid-page'', ''avoid-column'' and ''avoid-region'').
See the section on <a href="#breaking-rules">rules for breaking</a>
for the exact rules on how these properties affect forced breaks.
</p>
<p>
User Agents must apply these properties to block-level boxes and to table rows,
table row groups, and&#8212;in the case of 'break-inside'&#8212;block containers
in the normal flow of the root fragmented element. User agents should also apply
these properties to floated boxes whose containing block is in the normal flow
of the root fragmented element. User agents may also apply these properties to
other boxes.
</p>
<h3 id="widows-orphans">
Breaks inside elements: 'orphans', 'widows'</h3>
<table class="propdef" summary="property definition">
<tr>
<th>Name:
<td><dfn id="orphans">orphans</dfn>
<tr>
<th>Value:
<td>&lt;integer&gt;
<tr>
<th>Initial:
<td>2
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<table class="propdef" summary="property definition">
<tr>
<th>Name:
<td><dfn id="widows">widows</dfn>
<tr>
<th>Value:
<td>&lt;integer&gt;
<tr>
<th>Initial:
<td>2
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p>
The 'orphans' property specifies the minimum number of line boxes in
a block container that must be left in a <i>fragment</i> before a
fragment break. The 'widows' property specifies the minimum number
of line boxes of a block container that must be left in a
<i>fragment</i> after a break. Examples of how they are used to
control fragmentation breaks are given
<a href="#widows-orphans-example">below</a>.
</p>
<p>
Only positive integers are allowed as values of 'orphans' and 'widows'. Negative
values and zero are invalid must cause the declaration to be
<a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignored</a>.
</p>
<p>
If a block contains fewer lines than the value of 'widows' or 'orphans', the rule
simply becomes that all lines in the block must be kept together.
</p>
<h2 id="breaking-rules">
Rules for Breaking</h2>
<p>
A fragmented flow may be broken across fragmentainers at a number of
<a href="#possible-breaks">possible break points</a>. In the case of
<a href="#forced-breaks">forced breaks</a>, the UA is required to
break the flow at that point. In the case of
<a href="#unforced-breaks">unforced breaks</a> the UA has to choose
among the possible breaks that are allowed.
</p>
<p>
Some content is not fragmentable, for example many types of
<a href="">replaced elements</a> (such as images or video),
scrollable elements, or a single line of text content.
Such content is considered <dfn>monolithic</dfn>:
it contains no possible break points.
In addition to any content which is not fragmentable,
UAs may consider as <i>monolithic</i> any elements with
'overflow' set to ''auto'' or ''scroll'' and
any elements with ''overflow: hidden'' and a non-''auto''
<a href="http://www.w3.org/TR/css3-writing-modes/#extent">logical height</a>
(and no specified maximum logical height).
<h3 id="possible-breaks">
Possible Break Points</h3>
<p>
Fragmentation splits boxes in the block flow dimension.
In block-and-inline flow, breaks may occur at the following places:
</p>
<dl>
<dt id="btw-blocks">Class 1</dt>
<dd>
Between sibling boxes of the following types:
<dl>
<dt>Block-parallel Fragmentation</dt>
<dd>
When the block flow direction of the siblings' containing block
is parallel to that of the fragmentation context:
block-level boxes, table row group boxes, table row boxes,
multi-column column row boxes
</dd>
<dt>Block-perpendicular Fragmentation</dt>
<dd>
When the block flow direction of the siblings' containing block
is perpendicular
to that of the fragmentation context:
table column group boxes, table column boxes, multi-column column boxes
</dd>
</dl>
<dt id="btw-lines">Class 2</dt>
<dd>
Between line boxes inside a block container box.
</dd>
<dt id="end-block">Class 3</dt>
<dd>
Between the content edge of a block container box and the outer edges of its
child content (margin edges of block-level children or line box
edges for inline-level children) <em>if</em> there is a (non-zero)
gap between them.
</dd>
</dl>
<p class="note">
Other layout models may add breakpoints to the above classes.
</p>
<p>
Since breaks are only allowed between siblings (1),
not between a box and its container,
a 'break-before' value on a first-child box is propagated to its container.
Likewise a 'break-after' value on a last-child box is propagated to its container.
</p>
<p id=monolithic-breaking>
The UA is not required to fragment the contents of <i>monolithic</i> elements,
and may instead either slice the element's graphical representation
as necessary to fragment it
or treat its box as unbreakable and overflow the fragmentainer.
In both cases it must treat the element as having ''break-inside: avoid'',
i.e. only slice or overflow at the fragmentainer edge
if there are no <a href="#possible-breaks">possible break points</a>
on the fragmentainer.
</p>
<p>
When paginating, if there are no possible break points below the top
of the page, and not all the content fits, the UA may break anywhere
in order to avoid losing content off the edge of the page.
</p>
<h3 id="break-types">
Types of Breaks</h3>
<p>
There are different types of breaks in CSS, defined based on the type of
fragmentainers they span:
</p>
<dl>
<dt><dfn>page break</dfn></dt>
<dd>
A break between two <a href="http://www.w3.org/TR/css3-page/#page-box">page boxes</a>.
[[!CSS3PAGE]]
</dd>
<dt><dfn>spread break</dfn></dt>
<dd>
A break between two page boxes that are not associated with
<a href="http://www.w3.org/TR/css3-page/#facing-pages">facing pages</a>.
A spread break is always also a page break.
[[!CSS3PAGE]]
</dd>
<dt><dfn>column break</dfn></dt>
<dd>
A break between two <a href="http://www.w3.org/TR/css3-multicol/#column-box">column boxes</a>.
Note that if the column boxes are on different pages, then the break is
also a <i>page break</i>.
[[!CSS3COL]]
</dd>
<dt><dfn>region break</dfn></dt>
<dd>
A break between two <a href="http://www.w3.org/TR/css3-regions/#regions">regions</a>.
Note that if the region boxes are on different pages, then the break is
also a <i>page break</i>.
[[!CSS3-REGIONS]]
</dd>
</dl>
<p class="note">
A fifth type of break is the <dfn>line break</dfn>, which is a break between
two <a href="http://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
These are not covered in this specification; see [[!CSS21]].
</p>
<h3 id="forced-breaks">
Forced breaks</h3>
<p>
A forced break then occurs at <a href="#btw-blocks">(1)</a> if, among the
'break-after' properties specified on or propagated to the earlier
sibling box and the 'break-before' properties specified on or propagated
to the later sibling box there is at least one with a <i>forced break
value</i>.
</p>
<p>
When multiple <i>forced break values</i> apply to a single break point,
they combine such all types of break are honored and no content-empty
page boxes are generated, except for at most one content-empty page as
may be required by the ''right'' or ''left'' values to position ensuing
content on a right- or left-facing page.
When ''left'' and ''right'' are both combined, the value specified on the
latest element in the flow wins.
</p>
<p class="note">
A page break must also occur at <a href="#btw-blocks">(1)</a>
if the last line box above this margin and the first one below it do not have the
same value for 'page'. See [[!CSS3PAGE]]
</p>
<h3 id="unforced-breaks">
Unforced Breaks</h3>
<p>
While <a href="#breaking-controls">breaking controls</a> can force breaks,
they can also discourage them. The following rules control whether breaking
at a <a href="#possible-breaks">possible break point</a> is allowed:
</p>
<dl>
<dt>Rule A</dt>
<dd>
A fragmented flow may break at <a href="#btw-blocks">(1)</a> only if
all the 'break-after' and 'break-before' values applicable to this
break point allow it, which is when at least one of them forces a
break or when all of them are ''auto''.
</dd>
<dt>Rule B</dt>
<dd>
However, if all of them are ''auto'' and a common ancestor of all
the elements has a 'break-inside' value of ''avoid'', then breaking
here is not allowed.
</dd>
<dt>Rule C</dt>
<dd>
Breaking at <a href="#btw-lines">(2)</a> is allowed only if the number
of line boxes between the break and the start of the enclosing block
box is the value of 'orphans' or more, and the number of line boxes
between the break and the end of the box is the value of 'widows' or more.
</dd>
<dt>Rule D</dt>
<dd>
Additionally, breaking at <a href="#btw-blocks">(2)</a> or
<a href="#end-block">(3)</a> is allowed only if the 'break-inside'
property of all ancestors is ''auto''.
</dd>
</dl>
<p>
If the above doesn't provide enough break points to keep content from
overflowing the page boxes, then rules A, B and D are dropped in order
to find additional breakpoints.
In this case the UA may use the ''avoid''s that are in effect at those
points to weigh the appropriateness of the new breakpoints; however,
this specification does not suggest a precise algorithm.
</p>
<p>
If that still does not lead to sufficient break points, rule C is
dropped as well, to find still more break points.
</p>
<h3 id="best-breaks">
Optimizing Unforced Breaks</h3>
<p>While CSS3 requires that a fragmented flow must break at allowed
break points in order to avoid overflowing the fragmentainers in its
fragmentation context, it does not define whether content breaks
at a particular <a href="#unforced-breaks">allowed break</a>.
However, it is recommended that user agents observe the following
guidelines (while recognizing that they are sometimes contradictory):
</p>
<ul>
<li>Break as few times as possible.</li>
<li>Make all fragmentainers that don't end with a forced break appear
to be equally filled with content.</li>
<li>Avoid breaking inside a replaced element.</li>
</ul>
<div class="example" id="widows-orphans-example">
<p>
Suppose, for example, that the style sheet contains ''orphans : 4'',
''widows : 2'', and there are 20 lines (line boxes) available
at the bottom of the current page, and the next block in normal flow
is considered for placement:
</p>
<ul>
<li>
If the block contains 20 line boxes or fewer, it should be placed
on the current page.
</li>
<li>
If the block contains 21 or 22 line boxes, the second fragment of
the paragraph must not violate the 'widows' constraint, and so
the second fragment must contain at least two line boxes;
likewise the first fragment must contain at least four line boxes.
</li>
<li>
If the block contains 23 line boxes or more, the first fragment should
contain 20 lines and the second fragment the remaining lines. But if
any fragment of the block is placed on the current page, that fragment
must contain at least four line boxes and the second fragment at least
two line boxes.
</li>
</ul>
<p>
Now suppose that 'orphans' is ''10'', 'widows' is ''20'', and there
are 8 lines available at the bottom of the current page:
</p>
<ul>
<li>
If the block contains 8 lines or fewer, it should be placed
on the current page.
</li>
<li>
If the block contains 9 lines or more, it must NOT be split
(that would violate the 'orphans' constraint), so it must
move as a block to the next page.
</li>
</ul>
</div>
<h2 id="breaking-boxes">
Box Model for Breaking</h2>
<p class="note">
The sizing terminology used in this section is defined in Appendix D of
[[CSS3-WRITING-MODES]].
</p>
<h3 id="varying-size-boxes">
Breaking into Varying-size Fragmentainers</h3>
<p>
When a flow is fragmented into varying-size fragmentainers, the following
rules are observed for adapting layout:
</p>
<ul>
<li>
Intrinsic sizes are calculated and maintained across the entire element.
Where an initial containing block size is needed to resolve an intrinsic
size, assume the size of the first fragmentainer defining a pagination context.
</li>
<li>
Layout is performed per-fragmentainer, with each fragmentainer continuing
progress from the breakpoint on the previous, but recalculating sizes
and positions using its own size as if the entire element were fragmented
across fragmentainers of this size. Progress is measured in percentages
(not absolute lengths) of used/available fragmentainer extent and in amount of
used/remaining content.
However, when laying out <i>monolithic</i> elements,
the UA may instead maintain a consistent measure and resolved extent
across fragmentainers.
</li>
<li><strong class="issue">Option A:</strong>
Fragments of boxes that began on a previous fragmentainer must start at
the top of the new fragmentainer.
If this results in multiple boxes side-by-side that would otherwise
be staggered (if they were not continuations) in order to fit, the
elements' widths are reduced (on that fragmentainer only) in proportion to
their original widths until they fit. However they are not reduced
past their min-content width or in case the width copmutes to a
non-percent length value.
<div class="figure">
<pre>First page
<!-- -->+----------------------------------+
<!-- -->|########### ......... ############|
<!-- -->|# # ..... # #|
<!-- -->|# left # ....... # right #|
<!-- -->|# float # ......... # float #|
<!-- -->|# # ........ # #|
<!-- -->|# # ......... # #|
<!-- -->|# # ........ # #|
<!-- -->|#,,,,,,,,,# ......... #,,,,,,,,,,#|
<!-- -->+----------------------------------+
<!-- -->
<!-- -->Second page in case the 'width' computes to 'auto' or 'percent'
<!-- -->
<!-- -->+-----------------+
<!-- -->|#``````##```````#|
<!-- -->|# left ## right #|
<!-- -->|# float## float #|
<!-- -->|# cont.## cont. #|
<!-- -->|#################|
<!-- -->|.................|
<!-- -->|............... |
<!-- -->|.................|
<!-- -->|.... |
<!-- -->
<!-- -->Second page in case the 'width' computes to 'length' value
<!-- -->
<!-- -->+-----------------+
<!-- --> |#`````````##``````````#
<!-- --> |# left ## right #
<!-- --> |# float ## float #
<!-- --> |# cont. ## cont. #
<!-- --> |#######################
<!-- -->|.................|
<!-- -->|............... |
<!-- -->|.................|
<!-- -->|.... |</pre> </div>
</li>
<li><strong class="issue">Option B:</strong>
Fragments of boxes that began on a previous fragmentainer must obey
placement rules with the additional constraint that fragments must
not be positioned above the before edge of the fragmentainer and must
otherwise be placed as high as possible while not violating other
constraints. If this results in a box's continuation fragment
shifting away from the before edge of the fragmentainer, then
''box-decoration-break: clone'', if specified, wraps the fragment
with the box's margin in addition to its padding and border.
<div class="figure">
<pre>First page
<!-- -->+----------------------------------+
<!-- -->|########### ......... ############|
<!-- -->|# # ..... # #|
<!-- -->|# left # ....... # right #|
<!-- -->|# float # ......... # float #|
<!-- -->|# # ........ # #|
<!-- -->|# # ......... # #|
<!-- -->|# # ........ # #|
<!-- -->|#,,,,,,,,,# ......... #,,,,,,,,,,#|
<!-- -->+----------------------------------+
<!-- -->
<!-- -->Second page
<!-- -->
<!-- -->+-----------------+
<!-- -->|#`````````# .... |
<!-- -->|# left # ... |
<!-- -->|# float # .... |
<!-- -->|# cont. # .... |
<!-- -->|########### ... |
<!-- -->|.... #``````````#|
<!-- -->|... # right #|
<!-- -->|.... # float #|
<!-- -->|.... # cont. #|
<!-- -->|.... ############|
<!-- -->|............... |
<!-- -->|....... |</pre>
</div>
</li>
</ul>
<p>Below are listed some implications of these rules:</p>
<ul>
<li>
Boxes (including tables) fullfilling layout constraints at their
<i>fill-available</i> or percentage-based size may change measure
across pages.
</li>
<li>
Boxes (including tables) fulfilling layout constraints at their
<i>min-content</i>, <i>max-content</i>, or absolute-length size
will maintain their measure across pages.
</li>
<li><strong class="issue">Option A:</strong>
Opposite-side side-by-side floats might overlap if, e.g. both begin
on a wide page, but their min-content measures taken together are
too wide to fit on a later, narrower page. (Auto-sized floats will
not overlap if only their max-content measures are too wide, since
the shrink-wrap algorithm will give them narrower measures due to the
narrower available measure.)
</li>
<li><strong class="issue">Option A:</strong>
Same-side side-by-side floats might overflow their containing block
if, e.g. both begin on a wide page, but their min-content measures
taken together are too wide to fit on a later, narrower page.
</li>
<li><strong class="issue">Option B:</strong>
Float continuation fragments may be placed below the top of the
page if, e.g. multiple floats continue onto a new page that is
narrower than the previous page and their (recalculated) widths
together are wider than their containing block.
</li>
<li><strong class="issue">Option B:</strong>
A block-level continuation fragment may be placed below the top of
the page if, e.g. it establishes a block formatting context and
is placed beside a float and both it and the float continue onto
a narrower page that is too narrow to hold both of them side-by-side.
</li>
<li><strong class="issue">Option B:</strong>
Content adjacent to a preceding float on one page may wind up above
the float on the next page if, e.g. that float is pushed down because
it no longer fits side-by-side with an earlier float that also
continues to this narrower page.
</li>
</ul>
<div class="example">
<p>Here is an example that shows the use of percentage-based progress:
Suppose we have an absolutely-positioned element that is positioned
''top: calc(150% + 30px)'' and has ''height: calc(100% - 10px)''. If
it is placed into a paginated context with a first page of 400px,
a second page of 200px, and a third page of 600px, its layout progresses
as follows:
<ul>
<li>First, the top position is resolved against the first page's size.
This results in 630px. Since the first page only has 400px, layout
moves to the second page, recording progress of 400/630 = 63.49% with
36.51% left to go.
<li>Now on the second page, the top position is again resolved, this
time against the second page size. This results in 330px. The remining
36.51% of progress thus resolves to 120.5px, placing the top edge of
the element 120.5px down the second page.
<li>Now the height is resolved against the second page; it resolves
to 190px. Since there are only 79.5px left on the page, layout moves
to the third page, recording progress of 79.5/190 = 41.84%, with 48.16%
left to go.
<li>On the third page, the height resolves to 590px. The remaining
48.16% of progress thus resolves to 246.9px, which fits on this page
and completes the element.
</ul>
</div>
<h3 id="break-margins">
Margins at Breaks</h3>
<p>
When an unforced break occurs between block-level boxes, any adjoining
margins are set to zero. When a forced break occurs there, any margins
before the break are truncated, but margins after the break are preserved.
</p>
<h3 id="break-decoration">
Decorating Box Breaks</h3>
<p>
When a break splits a box, the 'box-decoration-break' property controls
whether the box's margins, borders, and padding wrap the fragment effect
where the split occurs. If they do not (i.e. ''slice'' is specified),
the box's background and side margins, border, and padding extend from
the effective break point to the end of the fragmentainer (and across the
ensuing blank fragmentainer if one is generated due to ''left'' or ''right''
breaking). <span class="issue">Does this use up height?</span>
</p>
<div class=issue style="counter-increment: none">
<p>For ''clone'', if the box is tight-wrapping around the content (which,
we believe it should), it makes sense not to use up specified height.
But there isn't a very strong reason for ''slice'' to use or not use up
specified height. So for consistency, we suggest that neither uses up
specified height.
<pre>
+-----------------+
| ............... |
| .............. |
| ............... |
| .............. |
| ............ |
| ############### |
| # this box # |
| # is # | &lt;&lt; box-break: clone
| # fragmented # |
| ############### | &lt;-+
| | | remaining
| | | blank
| | | space
+-----------------+ &lt;-+
+-----------------+
| ............... |
| .............. |
| ............... |
| .............. |
| ............ |
| ############### |
| # this box # |
| # is # | &lt;&lt; box-break: slice
| # fragmented # |
| # # | &lt;-+
| # # | | remaining
| # # | | blank
| # # | | space
+-----------------+ &lt;-+</pre>
</div>
<h2 id="conformance">
Conformance</h2>
<h3 id="conventions">
Document Conventions</h3>
<p>
Conformance requirements are expressed with a combination of descriptive assertions
and RFC 2119 terminology. The key words “must”, “must NOT”, “REQUIRED”, “SHALL”,