-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.html
1374 lines (1373 loc) · 115 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Fragmentation Module Level 3</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="testing" name="csswg-work-status">
<meta content="CR" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<link href="https://www.w3.org/StyleSheets/TR/W3C-CR" rel="stylesheet" type="text/css">
<meta content="Bikeshed 1.0.0" name="generator">
<script defer="" src="//test.csswg.org/harness/annotate.js#css-break-3_dev/css-break-3" type="text/javascript"></script>
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">CSS Fragmentation Module Level 3</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">W3C Candidate Recommendation, <time class="dt-updated" datetime="2016-01-14">14 January 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://www.w3.org/TR/2016/CR-css-break-3-20160114/">http://www.w3.org/TR/2016/CR-css-break-3-20160114/</a>
<dt>Latest version:
<dd><a href="https://www.w3.org/TR/css-break-3/">https://www.w3.org/TR/css-break-3/</a>
<dt>Editor's Draft:
<dd><a href="https://drafts.csswg.org/css-break/">https://drafts.csswg.org/css-break/</a>
<dt>Previous Versions:
<dd><a href="https://www.w3.org/TR/2015/WD-css3-break-20150129/" rel="previous">https://www.w3.org/TR/2015/WD-css3-break-20150129/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-break%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-break] <i data-lt="">… message topic …</i></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Test Suite:
<dd><a href="http://test.csswg.org/suites/css-break-3_dev/nightly-unstable/">http://test.csswg.org/suites/css-break-3_dev/nightly-unstable/</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:ratan@microsoft.com">Rossen Atanassov</a> (<span class="p-org org">Microsoft</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad / fantasai</a> (<span class="p-org org">Invited Expert</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2016 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>This module describes the fragmentation model that partitions a flow into pages, columns, or regions.
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>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<p> <em>This section describes the status of this document at the time of its publication.
Other documents may supersede this document.
A list of current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em> </p>
<p> This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of the <a href="http://www.w3.org/Style/">Style Activity</a>)
as a Candidate Recommendation. This document is intended to become a W3C Recommendation.
This document will remain a Candidate Recommendation at least until <time class="status-deadline" datetime="2016-06-15">15 June 2016</time> in order
to ensure the opportunity for wide review. </p>
<p> The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-break%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a> (see <a href="http://www.w3.org/Mail/Request">instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-break” in the subject,
preferably like this:
“[css-break] <em>…summary of comment…</em>” </p>
<p> Publication as a Candidate Recommendation does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress. </p>
<p> This document was produced by a group operating under
the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
<p> This document is governed by the <a href="http://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p>
<p> For changes since the last draft,
see the <a href="#changes">Changes</a> section. </p>
<p></p>
</div>
<div data-fill-with="at-risk">
<p>The following features are at-risk, and may be dropped during the CR period: </p>
<ul>
<li>the <a class="css" data-link-type="maybe" href="#valdef-break-before-region">region</a> and <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-region">avoid-region</a> values of <a class="property" data-link-type="propdesc">break-*</a>
</ul>
<p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulting being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>
</div>
<nav data-fill-with="table-of-contents" id="toc">
<h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
<ol class="toc" role="directory">
<li>
<a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a>
<ol class="toc">
<li><a href="#placement"><span class="secno">1.1</span> <span class="content"> Module Interactions</span></a>
<li><a href="#values"><span class="secno">1.2</span> <span class="content"> Values</span></a>
</ol>
<li>
<a href="#fragmentation-model"><span class="secno">2</span> <span class="content"> Fragmentation Model and Terminology</span></a>
<ol class="toc">
<li><a href="#parallel-flows"><span class="secno">2.1</span> <span class="content"> Parallel Fragmentation Flows</span></a>
<li><a href="#nested-flows"><span class="secno">2.2</span> <span class="content"> Nested Fragmentation Flows</span></a>
</ol>
<li>
<a href="#breaking-controls"><span class="secno">3</span> <span class="content"> Controlling Breaks</span></a>
<ol class="toc">
<li>
<a href="#break-between"><span class="secno">3.1</span> <span class="content"> Breaks Between Boxes: the <span class="property">break-before</span> and <span class="property">break-after</span> properties</span></a>
<ol class="toc">
<li><a href="#generic-break-values"><span class="secno"></span> <span class="content"> Generic Break Values</span></a>
<li><a href="#page-break-values"><span class="secno"></span> <span class="content"> Page Break Values</span></a>
<li><a href="#column-break-values"><span class="secno"></span> <span class="content"> Column Break Values</span></a>
<li><a href="#region-break-values"><span class="secno"></span> <span class="content"> Region Break Values</span></a>
</ol>
<li><a href="#break-within"><span class="secno">3.2</span> <span class="content"> Breaks Within Boxes: the <span class="property">break-inside</span> property</span></a>
<li><a href="#widows-orphans"><span class="secno">3.3</span> <span class="content"> Breaks Between Lines: <span class="property">orphans</span>, <span class="property">widows</span></span></a>
<li><a href="#page-break-properties"><span class="secno">3.4</span> <span class="content"> Page Break Aliases: the <span class="property">page-break-before</span>, <span class="property">page-break-after</span>, and <span class="property">page-break-inside</span> properties</span></a>
</ol>
<li>
<a href="#breaking-rules"><span class="secno">4</span> <span class="content"> Rules for Breaking</span></a>
<ol class="toc">
<li><a href="#possible-breaks"><span class="secno">4.1</span> <span class="content"> Possible Break Points</span></a>
<li><a href="#break-types"><span class="secno">4.2</span> <span class="content"> Types of Breaks</span></a>
<li><a href="#forced-breaks"><span class="secno">4.3</span> <span class="content"> Forced Breaks</span></a>
<li><a href="#unforced-breaks"><span class="secno">4.4</span> <span class="content"> Unforced Breaks</span></a>
<li><a href="#best-breaks"><span class="secno">4.5</span> <span class="content"> Optimizing Unforced Breaks</span></a>
</ol>
<li>
<a href="#breaking-boxes"><span class="secno">5</span> <span class="content"> Box Model for Breaking</span></a>
<ol class="toc">
<li><a href="#varying-size-boxes"><span class="secno">5.1</span> <span class="content"> Breaking into Varying-size Fragmentainers</span></a>
<li><a href="#break-margins"><span class="secno">5.2</span> <span class="content"> Adjoining Margins at Breaks</span></a>
<li><a href="#box-splitting"><span class="secno">5.3</span> <span class="content"> Splitting Boxes</span></a>
<li>
<a href="#break-decoration"><span class="secno">5.4</span> <span class="content"> Fragmented Borders and Backgrounds: the <span class="property">box-decoration-break</span> property</span></a>
<ol class="toc">
<li><a href="#joining-boxes"><span class="secno">5.4.1</span> <span class="content"> Joining Boxes for <span class="css">slice</span></span></a>
</ol>
<li><a href="#transforms"><span class="secno">5.5</span> <span class="content"> Transforms, Positioning, and Pagination</span></a>
</ol>
<li><a href="#changes"><span class="secno"></span> <span class="content"> Changes</span></a>
<li><a href="#acknowledgments"><span class="secno"></span> <span class="content"> Acknowledgments</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ol class="toc">
<li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li>
<a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
<ol class="toc">
<li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
<li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
<li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
</ol>
<li><a href="#cr-exit-criteria"><span class="secno"></span> <span class="content"> CR exit criteria</span></a>
</ol>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ol class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ol>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ol class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ol>
<li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
</ol>
</nav>
<main>
<h2 class="no-num no-toc heading settled" id="tagline"><span class="content">Breaking the Web, one fragment at a time</span></h2>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></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="https://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 data-dfn-type="dfn" data-noexport="" id="pagination">pagination<a class="self-link" href="#pagination"></a></dfn>. </p>
<p> In CSS, in addition to paged media, certain layout features such as <a href="https://www.w3.org/TR/css3-regions/">regions</a> <a data-link-type="biblio" href="#biblio-css3-regions">[CSS3-REGIONS]</a> and <a href="https://www.w3.org/TR/css3-multicol/">multi-column layout</a> <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a> create a similarly fragmented environment.
The generic term for breaking content across containers is <a data-link-type="dfn" href="#fragmentation">fragmentation</a>.
This module explains how content breaks across <a data-link-type="dfn" href="#fragmentation-container">fragmentation containers</a> (<a data-link-type="dfn" href="#fragmentainer">fragmentainers</a>)
such as pages and columns and how such breaks can be <a href="#breaking-controls">controlled by the author</a>. </p>
<h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content"> Module Interactions</span><a class="self-link" href="#placement"></a></h3>
<p> This module replaces and extends the pagination controls defined in <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> <a href="https://www.w3.org/TR/CSS21/page.html#page-breaks">section 13.3</a> and in <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a>. </p>
<h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content"> Values</span><a class="self-link" href="#values"></a></h3>
<p> This specification follows the <a href="https://www.w3.org/TR/CSS21/about.html#property-defs"> CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Value types not defined
in this specification are defined in CSS Level 2 Revision 1 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. Other CSS
modules may expand the definitions of these value types: for example <a data-link-type="biblio" href="#biblio-css3val">[CSS3VAL]</a>,
when combined with this module, adds the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-cascade-4/#valdef-all-initial">initial</a> value
to the properties defined here.</p>
<p> In addition to the property-specific values listed in their definitions, all properties
defined in this specification also accept the <a href="https://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 class="heading settled" data-level="2" id="fragmentation-model"><span class="secno">2. </span><span class="content"> Fragmentation Model and Terminology</span><a class="self-link" href="#fragmentation-model"></a></h2>
<dl>
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation-container">fragmentation container<a class="self-link" href="#fragmentation-container"></a></dfn> (<dfn data-dfn-type="dfn" data-export="" id="fragmentainer">fragmentainer<a class="self-link" href="#fragmentainer"></a></dfn>)
<dd> A box—such as a page box, column box, or region—that contains
a portion (or all) of a <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a>.
Fragmentainers can be pre-defined, or generated as needed.
When breakable content would overflow a fragmentainer in the block dimension,
it breaks into the next container in its <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a> instead.
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation-context">fragmentation context<a class="self-link" href="#fragmentation-context"></a></dfn>
<dd> An ordered series of <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a>,
such as created by a <a href="https://www.w3.org/TR/css3-multicol/">multi-column element</a>,
a chain of <a href="https://www.w3.org/TR/css3-regions">CSS regions</a>,
or a <a href="https://www.w3.org/TR/css3-page/">paged media display</a>.
A given fragmentation context can only have one block flow direction
across all its <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a>.
(Descendants of the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a> may have other block flow directions,
but fragmentation proceeds according to the block flow direction applied to the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a>.)
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmented-flow">fragmented flow<a class="self-link" href="#fragmented-flow"></a></dfn>
<dd> Content that is being laid out in a <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>.
The <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a> consists of the content of a (possibly anonymous) box
called the <dfn data-dfn-type="dfn" data-export="" id="fragmentation-root">fragmentation root<a class="self-link" href="#fragmentation-root"></a></dfn>.
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation-direction">fragmentation direction<a class="self-link" href="#fragmentation-direction"></a></dfn>
<dd> The block flow direction of the <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>,
i.e. the direction in which content is fragmented.
(In this level of CSS, content only fragments in one dimension.)
<dt><dfn data-dfn-type="dfn" data-export="" id="fragmentation">fragmentation<a class="self-link" href="#fragmentation"></a></dfn>
<dd> The process of splitting a content flow across the <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a> that form a <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>.
<dt><dfn data-dfn-type="dfn" data-export="" id="box-fragment">box fragment<a class="self-link" href="#box-fragment"></a></dfn> or <dfn data-dfn-type="dfn" data-export="" id="fragment">fragment<a class="self-link" href="#fragment"></a></dfn>
<dd> The portion of a box that belongs to exactly one <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>.
A box in continuous flow always consists of only one fragment.
A box in a fragmented flow consists of one or more fragments.
Each fragment has its own share of the box’s border, padding, and margin,
and therefore has its own <a href="https://www.w3.org/TR/CSS2/box.html#box-padding-area">padding area</a>, <a href="https://www.w3.org/TR/CSS2/box.html#box-border-area">border area</a>,
and <a href="https://www.w3.org/TR/CSS2/box.html#box-margin-area">margin area</a>.
(See <a class="property" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break</a>, which controls how these are affected by fragmentation.)
<dt><dfn data-dfn-type="dfn" data-export="" id="remaining-fragmentainer-extent">remaining fragmentainer extent<a class="self-link" href="#remaining-fragmentainer-extent"></a></dfn>
<dd> The remaining <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-axis">block-axis</a> space in the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> available to a given element,
i.e. between the end of preceding content in <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> and the edge of the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>.
</dl>
<p> Each <dfn data-dfn-type="dfn" data-noexport="" id="fragmentation-break">fragmentation break<a class="self-link" href="#fragmentation-break"></a></dfn> (hereafter, <dfn data-dfn-type="dfn" data-noexport="" id="break">break<a class="self-link" href="#break"></a></dfn>)
ends layout of the fragmented box in the current <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> and causes the remaining content to be laid out in the next <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>,
in some cases causing a new <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> to be generated
to hold the deferred content. </p>
<p class="note" role="note"> Breaking inline content into lines is another form of fragmentation,
and similarly creates box fragments when it breaks <a href="https://www.w3.org/TR/CSS21/visuren.html#inline-boxes">inline boxes</a> across <a href="https://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
However, inline breaking is not covered here; see <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>/<a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a>. </p>
<h3 class="heading settled" data-level="2.1" id="parallel-flows"><span class="secno">2.1. </span><span class="content"> Parallel Fragmentation Flows</span><a class="self-link" href="#parallel-flows"></a></h3>
<p> When multiple <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#formatting-context">formatting contexts</a> are laid out parallel to each other,
fragmentation is performed independently in each <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#formatting-context">formatting context</a>.
For example, if an element is floated,
then a forced break inside the float
will not affect the content outside the float
(except insofar as it may increase the height of the float).
UAs <em>may</em> (but are not required to)
adjust the placement of <a data-link-type="dfn" href="#unforced-break">unforced breaks</a> in parallel <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#formatting-context">formatting contexts</a> to visually balance such side-by-side content,
but <em>must not</em> do so to match a <a data-link-type="dfn" href="#forced-break">forced break</a>. </p>
<p> The following are examples of parallel flows
whose contents will fragment independently: </p>
<ul>
<li>The contents of a float vs. the content wrapping outside the float.
<li>The contents of a float vs. the contents of an adjacent float.
<li>The contents of each table cell in a single table row.
<li>The contents of each grid item in a single grid row.
<li>The contents of each flex item in a flex layout row.
<li>The contents of absolutely-positioned elements
that cover the same range of their containing block’s fragmentation context.
</ul>
<p> Content overflowing the content edge of a fixed-size box
is considered parallel to the content after the fixed-size box
and follows the normal fragmentation rules.
Although overflowing content doesn’t affect the size of the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a> box,
it does increase the length of the <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a>,
spilling into or generating additional <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a> as necessary. </p>
<h3 class="heading settled" data-level="2.2" id="nested-flows"><span class="secno">2.2. </span><span class="content"> Nested Fragmentation Flows</span><a class="self-link" href="#nested-flows"></a></h3>
<p> Breaking a <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> <var>F</var> effectively splits the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> into two <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a> (<var>F<sub>1</sub></var> and <var>F<sub>2</sub></var>).
The only difference is that,
with regards to the content of <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> <var>F</var>,
the type of break
between the two pieces <var>F<sub>1</sub></var> and <var>F<sub>2</sub></var> is the <a href="#break-types">type of break</a> created
by the <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a> that split <var>F</var>,
not the type of break normally created by <var>F</var>’s own <a data-link-type="dfn" href="#fragmentation-context">fragmentation context</a>. </p>
<div class="example" id="example-336a11b1"><a class="self-link" href="#example-336a11b1"></a> For example, if a region box is broken at a page boundary,
then the content of the region will be affected by a page break at that point
(but not by a region break). </div>
<div class="note" role="note"> Note that when a multi-column element breaks across pages,
it generates a new row of columns on the next page for the rest of its content,
so that a page break within a multi-column element
is always both a page break and a column break. </div>
<h2 class="heading settled" data-level="3" id="breaking-controls"><span class="secno">3. </span><span class="content"> Controlling Breaks</span><a class="self-link" href="#breaking-controls"></a></h2>
<p> The following sections explain how breaks are controlled in a <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a>.
A page/column/region break opportunity between two boxes
is under the influence of
the containing block’s <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> property,
the <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> property of the preceding element,
and the <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> property of the following element.
A page/column/region break opportunity between line boxes
is under the influence of
the containing block’s <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a>, <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a>, and <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> properties.
A fragmentation break can be
allowed, forced, or discouraged depending on the values of these properties.
A forced break overrides any break restrictions acting at that break point.
In the case of forced page breaks, the author can also specify
on which page (<a href="https://www.w3.org/TR/css3-page/#left-right-first">left or right</a>)
the subsequent content should resume. </p>
<p> See the section on <a href="#breaking-rules">rules for breaking</a> for the exact rules on how these properties affect fragmentation. </p>
<h3 class="heading settled" data-level="3.1" id="break-between"><span class="secno">3.1. </span><span class="content"> Breaks Between Boxes: the <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> and <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> properties</span><a class="self-link" href="#break-between"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-break-before">break-before<a class="self-link" href="#propdef-break-before"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-break-after">break-after<a class="self-link" href="#propdef-break-after"></a></dfn>
<tr>
<th>Value:
<td>auto | avoid |
avoid-page | page | left | right | recto | verso |
avoid-column | column | avoid-region | region
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>block-level elements, table row groups, table rows (but see prose)
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p> These properties specify page/column/region break behavior
before/after the generated box.
The <dfn data-dfn-type="dfn" data-noexport="" id="forced-break-values">forced break values<a class="self-link" href="#forced-break-values"></a></dfn> <a class="css" data-link-type="maybe" href="#valdef-break-before-left">left</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-right">right</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-recto">recto</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-verso">verso</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-page">page</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-column">column</a> and <a class="css" data-link-type="maybe" href="#valdef-break-before-region">region</a> create a <a href="#forced-breaks">forced break</a> in the flow
while the <dfn data-dfn-type="dfn" data-noexport="" id="avoid-break-values">avoid break values<a class="self-link" href="#avoid-break-values"></a></dfn> <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid">avoid</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-page">avoid-page</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-column">avoid-column</a> and <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-region">avoid-region</a> indicate that content should be kept together. </p>
<p> Since breaks are only allowed between siblings,
not between a box and its container (see <a href="#possible-breaks">Possible Break Points</a>),
a <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> value on a first-child box is propagated to its container.
Likewise a <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> value on a last-child box is propagated to its container.
(Conflicting values <a href="#forced-breaks">combine</a> as defined below.)
This propagation stops before it breaks through the nearest matching fragmentation context. </p>
<p> Values for <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> and <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> are defined in the sub-sections below.
User Agents must apply these properties to boxes in the normal flow of the <a data-link-type="dfn" href="#fragmentation-root">fragmentation root</a>.
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>
<h4 class="no-num heading settled" id="generic-break-values"><span class="content"> Generic Break Values</span><a class="self-link" href="#generic-break-values"></a></h4>
<p> These values have an effect regardless of
the type of fragmented context containing the flow. </p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-auto">auto<a class="self-link" href="#valdef-break-before-auto"></a></dfn>
<dd> Neither force nor forbid a break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid">avoid<a class="self-link" href="#valdef-break-before-avoid"></a></dfn>
<dd> Avoid a break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
</dl>
<h4 class="no-num heading settled" id="page-break-values"><span class="content"> Page Break Values</span><a class="self-link" href="#page-break-values"></a></h4>
<p> These values only have an effect in paginated contexts;
if the flow is not paginated, they have no effect. </p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid-page">avoid-page<a class="self-link" href="#valdef-break-before-avoid-page"></a></dfn>
<dd> Avoid a page break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-page">page<a class="self-link" href="#valdef-break-before-page"></a></dfn>
<dd> Always force a page break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-left">left<a class="self-link" href="#valdef-break-before-left"></a></dfn>
<dd> Force one or two page breaks before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that the next page is formatted as a left page.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-right">right<a class="self-link" href="#valdef-break-before-right"></a></dfn>
<dd> Force one or two page breaks before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that the next page is formatted as a right page.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-recto">recto<a class="self-link" href="#valdef-break-before-recto"></a></dfn>
<dd> Force one or two page breaks before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that
the next page is formatted as either a left page or a right page,
whichever is second (according to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-page-3/#page-progression">page progression</a>) in a page spread.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-verso">verso<a class="self-link" href="#valdef-break-before-verso"></a></dfn>
<dd> Force one or two page breaks before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a> so that
the next page is formatted as either a left page or a right page,
whichever is first (according to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-page-3/#page-progression">page progression</a>) in a page spread.
</dl>
<h4 class="no-num heading settled" id="column-break-values"><span class="content"> Column Break Values</span><a class="self-link" href="#column-break-values"></a></h4>
<p> These values only have an effect in multi-column contexts;
if the flow is not within a multi-column context, they have no effect. </p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid-column">avoid-column<a class="self-link" href="#valdef-break-before-avoid-column"></a></dfn>
<dd> Avoid a column break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-column">column<a class="self-link" href="#valdef-break-before-column"></a></dfn>
<dd> Always force a column break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
</dl>
<h4 class="no-num heading settled" id="region-break-values"><span class="content"> Region Break Values</span><a class="self-link" href="#region-break-values"></a></h4>
<p> These values only have an effect in multi-region contexts;
if the flow is not linked across multiple regions, these values have no effect. </p>
<dl>
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-avoid-region">avoid-region<a class="self-link" href="#valdef-break-before-avoid-region"></a></dfn>
<dd> Avoid a region break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
<dt><dfn class="css" data-dfn-for="break-before,break-after" data-dfn-type="value" data-export="" id="valdef-break-before-region">region<a class="self-link" href="#valdef-break-before-region"></a></dfn>
<dd> Always force a region break before/after the <a href="https://www.w3.org/TR/CSS21/visuren.html#block-boxes">principal box</a>.
</dl>
<h3 class="heading settled" data-level="3.2" id="break-within"><span class="secno">3.2. </span><span class="content"> Breaks Within Boxes: the <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> property</span><a class="self-link" href="#break-within"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-break-inside">break-inside<a class="self-link" href="#propdef-break-inside"></a></dfn>
<tr>
<th>Value:
<td>auto | avoid | avoid-page | avoid-column | avoid-region
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>elements in the normal flow that establish formatting contexts,
or that are block containers, table row groups, or table rows
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
</table>
<p> This property specifies page/column/region break behavior
within the element’s principal box.
Values have the following meanings: </p>
<dl>
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-auto">auto<a class="self-link" href="#valdef-break-inside-auto"></a></dfn>
<dd> Impose no additional breaking constraints within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid">avoid<a class="self-link" href="#valdef-break-inside-avoid"></a></dfn>
<dd> Avoid breaks within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid-page">avoid-page<a class="self-link" href="#valdef-break-inside-avoid-page"></a></dfn>
<dd> Avoid a page break within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid-column">avoid-column<a class="self-link" href="#valdef-break-inside-avoid-column"></a></dfn>
<dd> Avoid a column break within the box.
<dt><dfn class="css" data-dfn-for="break-inside,page-break-inside" data-dfn-type="value" data-export="" id="valdef-break-inside-avoid-region">avoid-region<a class="self-link" href="#valdef-break-inside-avoid-region"></a></dfn>
<dd> Avoid a region break within the box.
</dl>
<h3 class="heading settled" data-level="3.3" id="widows-orphans"><span class="secno">3.3. </span><span class="content"> Breaks Between Lines: <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a>, <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a></span><a class="self-link" href="#widows-orphans"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-orphans">orphans<a class="self-link" href="#propdef-orphans"></a></dfn>, <dfn class="css" data-dfn-type="property" data-export="" id="propdef-widows">widows<a class="self-link" href="#propdef-widows"></a></dfn>
<tr>
<th>Value:
<td><integer>
<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 <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> property specifies the minimum number
of line boxes in a block container
that must be left in a <a data-link-type="dfn" href="#fragment">fragment</a> <em>before</em> a fragmentation break.
The <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> property specifies the minimum number
of line boxes of a block container
that must be left in a <a data-link-type="dfn" href="#fragment">fragment</a> <em>after</em> 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 <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> and <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a>.
Negative values and zero are invalid and must cause the declaration to be <a href="https://www.w3.org/TR/CSS21/conform.html#ignore">ignored</a>. </p>
<p> If a block contains fewer lines than the value of <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> or <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a>,
the rule simply becomes that all lines in the block must be kept together. </p>
<h3 class="heading settled" data-level="3.4" id="page-break-properties"><span class="secno">3.4. </span><span class="content"> Page Break Aliases: the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-before">page-break-before</a>, <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-after">page-break-after</a>, and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">page-break-inside</a> properties</span><a class="self-link" href="#page-break-properties"></a></h3>
<p>For compatibility with <a href="https://www.w3.org/TR/CSS21/page.html">CSS Level 2</a>,
UAs that conform to <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> must alias the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-before">page-break-before</a>, <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-after">page-break-after</a>, and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">page-break-inside</a> properties
to <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a>, <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a>, and <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> by treating the <a class="property" data-link-type="propdesc">page-break-*</a> properties as shorthands for the <a class="property" data-link-type="propdesc">break-*</a> properties
with the following value mappings: </p>
<table class="data">
<thead>
<tr>
<th>Shorthand (<a class="property" data-link-type="propdesc">page-break-*</a>) Values
<th>Longhand (<a class="property" data-link-type="propdesc">break-*</a>) Values
<tbody>
<tr>
<td><span class="css">auto | left | right | avoid</span>
<td><span class="css">auto | left | right | avoid</span>
<tr>
<td><span class="css">always</span>
<td><span class="css">page</span>
</table>
<h2 class="heading settled" data-level="4" id="breaking-rules"><span class="secno">4. </span><span class="content"> Rules for Breaking</span><a class="self-link" href="#breaking-rules"></a></h2>
<p> A <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a> may be broken across <a data-link-type="dfn" href="#fragmentainer">fragmentainers</a> 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> To guarantee progress, fragmentainers are assumed to have a minimum <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-size">block size</a> of 1px regardless of their used size. </p>
<h3 class="heading settled" data-level="4.1" id="possible-breaks"><span class="secno">4.1. </span><span class="content"> Possible Break Points</span><a class="self-link" href="#possible-breaks"></a></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"><a class="self-link" href="#btw-blocks"></a>Class A
<dd>
Between sibling boxes of the following types:
<dl>
<dt>Block-parallel Fragmentation
<dd> When the block flow direction of the siblings' containing block
is parallel to that of the fragmentation context: <a href="https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#positioning-scheme">in-flow</a> block-level boxes,
a float and an immediately-adjacent in-flow or floated box,
table row group boxes,
table row boxes,
multi-column column row boxes.
<dt>Block-perpendicular Fragmentation
<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.
</dl>
<dt id="btw-lines"><a class="self-link" href="#btw-lines"></a>Class B
<dd> Between line boxes inside a block container box.
<dt id="end-block"><a class="self-link" href="#end-block"></a>Class C
<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.
</dl>
<p class="note" role="note"> There is no inherent prioritization among these classes of break points.
However, individual break points may be prioritized or de-prioritized
by using the <a href="#breaking-controls">breaking controls</a>. </p>
<p class="note" role="note"> Other layout models may add breakpoints to the above classes.
For example, <a data-link-type="biblio" href="#biblio-css3-flexbox">[CSS3-FLEXBOX]</a> adds certain points within a flex formatting context
to classes A and C. </p>
<p> Some content is not fragmentable, for example many types of <a href="https://www.w3.org/TR/CSS21/conform.html#replaced-element">replaced elements</a> <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> (such as images or video),
scrollable elements, or a single line of text content.
Such content is considered <dfn data-dfn-type="dfn" data-noexport="" id="monolithic">monolithic<a class="self-link" href="#monolithic"></a></dfn>:
it contains no possible break points.
Any forced breaks within such boxes
therefore cannot split the box,
and must therefore also be ignored by the box’s own fragmentation context. </p>
<p> In addition to any content which is not generally fragmentable,
UAs may consider as <a data-link-type="dfn" href="#monolithic">monolithic</a> any elements with <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-overflow-3/#overflow">overflow</a> set to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-auto">auto</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-scroll">scroll</a> and
any elements with <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/css-overflow-3/#overflow">overflow: hidden</a> and a non-<span class="css">auto</span> <a href="https://www.w3.org/TR/css3-writing-modes/#block-size">logical height</a> (and no specified maximum logical height). </p>
<p> Since line boxes contain no possible break points, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-inline-block">inline-block</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-inline-table">inline-table</a> boxes
(and other inline-level <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#display-type">display types</a> that establish a new <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#formatting-context">formatting context</a>)
may also be considered <a data-link-type="dfn" href="#monolithic">monolithic</a>. </p>
<h3 class="heading settled" data-level="4.2" id="break-types"><span class="secno">4.2. </span><span class="content"> Types of Breaks</span><a class="self-link" href="#break-types"></a></h3>
<p> There are different types of breaks in CSS, defined based on the type of
fragmentainers they span: </p>
<dl>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="page-break">page break<a class="self-link" href="#page-break"></a></dfn>
<dd> A break between two <a href="https://www.w3.org/TR/css3-page/#page-box">page boxes</a>. <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="spread-break">spread break<a class="self-link" href="#spread-break"></a></dfn>
<dd> A break between two page boxes that are not associated with <a href="https://www.w3.org/TR/css3-page/#facing-pages">facing pages</a>.
A spread break is always also a page break. <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="column-break">column break<a class="self-link" href="#column-break"></a></dfn>
<dd> A break between two <a href="https://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 <a data-link-type="dfn" href="#page-break">page break</a>.
Similarly, if the column boxes are in different regions,
then the break is also a <a data-link-type="dfn" href="#region-break">region break</a>. <a data-link-type="biblio" href="#biblio-css3col">[CSS3COL]</a>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="region-break">region break<a class="self-link" href="#region-break"></a></dfn>
<dd> A break between two <a href="https://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 <a data-link-type="dfn" href="#page-break">page break</a>. <a data-link-type="biblio" href="#biblio-css3-regions">[CSS3-REGIONS]</a>
</dl>
<p class="note" role="note"> A fifth type of break is the <dfn data-dfn-type="dfn" data-noexport="" id="line-break">line break<a class="self-link" href="#line-break"></a></dfn>, which is a break between
two <a href="https://www.w3.org/TR/CSS21/visuren.html#line-box">line boxes</a>.
These are not covered in this specification; see <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> <a data-link-type="biblio" href="#biblio-css3text">[CSS3TEXT]</a>. </p>
<h3 class="heading settled" data-level="4.3" id="forced-breaks"><span class="secno">4.3. </span><span class="content"> Forced Breaks</span><a class="self-link" href="#forced-breaks"></a></h3>
<p> A <dfn data-dfn-type="dfn" data-noexport="" id="forced-break">forced break<a class="self-link" href="#forced-break"></a></dfn> is one explicitly indicated by the style sheet author.
A <a data-link-type="dfn" href="#forced-break">forced break</a> occurs at a <a href="#btw-blocks">class A break point</a> if,
among the <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> properties specified on or propagated to the earlier sibling box
and the <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> properties specified on or propagated to the later sibling box
there is at least one with a <a data-link-type="dfn" href="#forced-break-values">forced break value</a>.
(Thus a <a data-link-type="dfn" href="#forced-break-values">forced break value</a> effectively overrides any <a data-link-type="dfn" href="#avoid-break-values">avoid break value</a> that also applies at that break point.) </p>
<p> When multiple <a data-link-type="dfn" href="#forced-break-values">forced break values</a> apply to a single break point,
they combine such that all types of break are honored.
When <a class="css" data-link-type="maybe" href="#valdef-break-before-left">left</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-right">right</a>, <a class="css" data-link-type="maybe" href="#valdef-break-before-recto">recto</a>, and/or <a class="css" data-link-type="maybe" href="#valdef-break-before-verso">verso</a> are combined,
the value specified on the latest element in the flow wins. </p>
<p class="note" role="note"> A forced page break must also occur at a <a href="#btw-blocks">class A break point</a> if the last line box above this margin and the first one below it do not have the
same value for <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-page/#page">page</a>. See <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a> </p>
<p> When a forced break occurs,
it forces ensuing content into the next fragmentainer of the type associated with the break,
breaking through as many fragmentation contexts as necessary
until the specified break types are all satisfied.
If the forced break is not contained within a matching type of fragmentation context,
then the forced break has no effect. </p>
<h3 class="heading settled" data-level="4.4" id="unforced-breaks"><span class="secno">4.4. </span><span class="content"> Unforced Breaks</span><a class="self-link" href="#unforced-breaks"></a></h3>
<p> While <a href="#breaking-controls">breaking controls</a> can force breaks,
they can also discourage them.
An <dfn data-dfn-type="dfn" data-noexport="" id="unforced-break">unforced break<a class="self-link" href="#unforced-break"></a></dfn> is one that is inserted automatically by the UA
in order to prevent content from overflowing the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>.
The following rules control whether unforced breaking
at a <a href="#possible-breaks">possible break point</a> is allowed: </p>
<dl>
<dt>Rule 1
<dd> A <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a> may break at a <a href="#btw-blocks">class A break point</a> only if
all the <a class="property" data-link-type="propdesc" href="#propdef-break-after">break-after</a> and <a class="property" data-link-type="propdesc" href="#propdef-break-before">break-before</a> values applicable to this
break point allow it, which is when at least one of them forces a
break or when none of them forbid it
(<a class="css" data-link-type="maybe" href="#valdef-break-before-avoid">avoid</a> or <a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-page">avoid-page</a>/<a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-column">avoid-column</a>/<a class="css" data-link-type="maybe" href="#valdef-break-before-avoid-region">avoid-region</a>, depending on the <a href="#break-types">break type</a>).
<dt>Rule 2
<dd> However, if all of them are <a class="css" data-link-type="maybe" href="#valdef-break-before-auto">auto</a> and a common ancestor of all
the elements has a <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> value of <a class="css" data-link-type="maybe" href="#valdef-break-inside-avoid">avoid</a>, then breaking
here is not allowed.
<dt>Rule 3
<dd> Breaking at a <a href="#btw-lines">class B break point</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 <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> or more, and the number of line boxes
between the break and the end of the box is the value of <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> or more.
<dt>Rule 4
<dd> Additionally, breaking at <a href="#btw-blocks">class B</a> or <a href="#end-block">class C</a> break points
is allowed only if the <a class="property" data-link-type="propdesc" href="#propdef-break-inside">break-inside</a> property of all ancestors is <a class="css" data-link-type="maybe" href="#valdef-break-inside-auto">auto</a>.
</dl>
<p> If the above doesn’t provide enough break points to keep content from
overflowing the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>,
then rule 3 is dropped to provide more break points. </p>
<p> If that still does not lead to sufficient break points,
then rules 1, 2 and 4 are dropped in order to find additional breakpoints.
In this case the UA may use the <span class="css">avoid</span>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 even that does not lead to sufficient break points, <a href="#valdef-box-decoration-break-clone">cloned margins/border/padding</a> at on the block-end side are truncated;
and if more room is still needed, <a href="#valdef-box-decoration-break-clone">cloned margins/border/padding</a> are truncated at the block-end side as well. </p>
<p> Finally, if there are no possible break points below the top of the fragmentainer,
and not all the content fits, the UA may break anywhere
in order to avoid losing content off the edge of the fragmentainer. <span id="monolithic-breaking"> In such cases, the UA may also fragment the contents of <a data-link-type="dfn" href="#monolithic">monolithic</a> elements
by slicing the element’s graphical representation.
However, the UA must not break at the top of the page,
i.e. it must place at least some content on each fragmentainer,
so that each fragmentainer has a non-zero amount of content,
in order to guarantee progress through the content. </span></p>
<h3 class="heading settled" data-level="4.5" id="best-breaks"><span class="secno">4.5. </span><span class="content"> Optimizing Unforced Breaks</span><a class="self-link" href="#best-breaks"></a></h3>
<p>While CSS3 requires that a <a data-link-type="dfn" href="#fragmented-flow">fragmented flow</a> 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>Make all fragmentainers that don’t end with a forced break appear
to be equally filled with content.
<li>Avoid breaking inside a replaced element.
</ul>
<div class="example" id="widows-orphans-example">
<a class="self-link" href="#widows-orphans-example"></a>
<p> Suppose, for example, that the style sheet contains <span class="css">orphans : 4</span>, <span class="css">widows : 2</span>, and there is space for 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> If the block contains 21 or 22 line boxes, the second fragment of
the paragraph must not violate the <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> 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> 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.
</ul>
<p> Now suppose that <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> is <span class="css">10</span>, <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> is <span class="css">20</span>, 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> If the block contains 9 lines or more, it must NOT be split
(that would violate the <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> constraint), so it must
move as a block to the next page.
</ul>
</div>
<h2 class="heading settled" data-level="5" id="breaking-boxes"><span class="secno">5. </span><span class="content"> Box Model for Breaking</span><a class="self-link" href="#breaking-boxes"></a></h2>
<p class="note" role="note"> The sizing terminology used in this section is defined in <a data-link-type="biblio" href="#biblio-css3-sizing">[CSS3-SIZING]</a>. </p>
<h3 class="heading settled" data-level="5.1" id="varying-size-boxes"><span class="secno">5.1. </span><span class="content"> Breaking into Varying-size Fragmentainers</span><a class="self-link" href="#varying-size-boxes"></a></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 fragmentation context.
<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/remaining fragmentainer extent and in amount of
used/remaining content.
However, when laying out <a data-link-type="dfn" href="#monolithic">monolithic</a> elements,
the UA may instead maintain a consistent <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#inline-size">inline size</a> and resolved <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-size">block size</a> across fragmentainers.
<li>
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 <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-start">block-start</a> edge of the fragmentainer.
If this results in a box’s continuation fragment
shifting away from the <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-start">block-start</a> edge of the fragmentainer, then <a class="css" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break: clone</a>, if specified, wraps the fragment
with the box’s margin in addition to its padding and border.
<div class="figure">
<p><img alt="Illustration: Breaking in varying-size fragmentainers" src="images/Varying-Size-Fragmentainers.svg" style="width: 75%"> </p>
<p class="caption"> Illustration of breaking in varying-size fragmentainers. </p>
</div>
</ul>
<p class="note" role="note"> Since document order of elements doesn’t change during fragmentation,
fragments are processed following the same rules that apply to continuous
media. In particular, the order of floats is preserved across all
fragments and follows the same rules as defined in CSS 2.1 9.5. </p>
<p>Below are listed (informatively) some implications of these rules:</p>
<ul>
<li> Boxes (including tables) fullfilling layout constraints at their <a data-link-type="dfn" href="https://drafts.csswg.org/css-sizing-3/#fill-available-size">fill-available</a> or percentage-based size
may change <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#inline-size">inline size</a> across pages.
<li> Boxes (including tables) fulfilling layout constraints at their <a data-link-type="dfn" href="https://drafts.csswg.org/css-sizing-3/#min-content">min-content</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css-sizing-3/#max-content">max-content</a>, or absolute-length size
will maintain their <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#inline-size">inline size</a> across pages.
<li> 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> An element adjacent to a preceding float on one page may wind up above
the float’s continuation 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 onto this narrower page.
<li> A left float may appear on a page <em>before</em> the remaining fragments of a preceding right float
if that right float does not fit on the earlier page.
However another right float will be forced down until
the preceding right float’s remaining fragment can be placed.
</ul>
<div class="example" id="example-9765ba0a">
<a class="self-link" href="#example-9765ba0a"></a>
<p>Here is an example that shows the use of percentage-based progress:
Suppose we have an absolutely-positioned element that is positioned <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/css3-positioning/#propdef-top">top: calc(150% + 30px)</a> and has <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visudet.html#propdef-height">height: calc(100% - 10px)</a>. If
it is placed into a paginated context with a first page height of 400px,
a second page of 200px, and a third page of 600px, its layout progresses
as follows: </p>
<ul>
<li>First, the top position is resolved against the height of the first page.
This results in 630px. Since the first page has a height of only 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 height of the second page. This results in 330px. The
remaining 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 58.16%
left to go.
<li>On the third page, the height resolves to 590px. The remaining
58.16% of progress thus resolves to 343.1px, which fits on this page
and completes the element.
</ul>
</div>
<h3 class="heading settled" data-level="5.2" id="break-margins"><span class="secno">5.2. </span><span class="content"> Adjoining Margins at Breaks</span><a class="self-link" href="#break-margins"></a></h3>
<p> When an unforced break occurs between block-level boxes,
any margins adjoining the break truncate to the <a data-link-type="dfn" href="#remaining-fragmentainer-extent">remaining fragmentainer extent</a> before the break,
and are truncated to zero after the break.
When a forced break occurs there, adjoining margins before the break are truncated,
but margins after the break are preserved. <a href="#valdef-box-decoration-break-clone">Cloned margins</a> are always truncated to zero on block-level margins. </p>
<h3 class="heading settled" data-level="5.3" id="box-splitting"><span class="secno">5.3. </span><span class="content"> Splitting Boxes</span><a class="self-link" href="#box-splitting"></a></h3>
<p> When a box breaks,
its content box extends to fill any <a data-link-type="dfn" href="#remaining-fragmentainer-extent">remaining fragmentainer extent</a> (leaving room for any margins/borders/padding applied by <a class="css" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break: clone</a>)
before the content resumes on the next <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>.
(A <a data-link-type="dfn" href="#fragmentation-break">fragmentation break</a> that pushes content to the next <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a> effectively increases the <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-size">block size</a> of a box’s contents.) </p>
<p class="note" role="note"> The extra <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-size">block size</a> contributed by fragmenting the box
(i.e. the distance from the break point to the edge of the <a data-link-type="dfn" href="#fragmentainer">fragmentainer</a>)
contributes progress towards any specified limits on the box’s <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-size">block size</a>. </p>
<div class="figure">
<p><img alt="Illustration: Filling remaining fragmentainer extent" src="images/Remaining-Fragmentainer-Extent.svg" style="width: 80%"> </p>
<p class="caption"> Illustration of filling the <a data-link-type="dfn" href="#remaining-fragmentainer-extent">remaining fragmentainer extent</a>. </p>
</div>
<h3 class="heading settled" data-level="5.4" id="break-decoration"><span class="secno">5.4. </span><span class="content"> Fragmented Borders and Backgrounds: the <a class="property" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break</a> property</span><a class="self-link" href="#break-decoration"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-box-decoration-break">box-decoration-break<a class="self-link" href="#propdef-box-decoration-break"></a></dfn>
<tr>
<th><a href="#values">Value</a>:
<td>slice | clone
<tr>
<th>Initial:
<td>slice
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p> When a break (page/column/region/line) splits a box,
the <a class="property" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break</a> property controls </p>
<ul>
<li>whether the box’s margins, borders, padding, and other decorations
wrap the broken edges of the box fragments
<li>how the <a href="https://www.w3.org/TR/css3-background/#background-positioning-area"><i data-lt="background positioning area">background positioning area</i></a> <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a> (and <a data-link-type="dfn" href="http://www.w3.org/TR/css-masking-1/#mask-positioning-area">mask positioning area</a> <a data-link-type="biblio" href="#biblio-css-masking-1">[CSS-MASKING-1]</a>,
shape <a data-link-type="dfn">reference box</a> <a data-link-type="biblio" href="#biblio-css-shapes-1">[CSS-SHAPES-1]</a>, etc.)
is derived from or duplicated across the box fragments
and how the element’s background is drawn within them.
</ul>
<p> Values have the following meanings: </p>
<dl>
<dt><dfn class="css" data-dfn-for="box-decoration-break" data-dfn-type="value" data-export="" id="valdef-box-decoration-break-clone">clone<a class="self-link" href="#valdef-box-decoration-break-clone"></a></dfn>
<dd>
Each box fragment is independently wrapped with the border, padding, and margin.
The <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#border-radius">border-radius</a> and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#border-image">border-image</a> and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#box-shadow">box-shadow</a>, if any,
are applied to each fragment independently.
The background is drawn independently in each fragment of the element.
A no-repeat background image will thus be rendered once in each fragment of the element.
<p class="note" role="note">Note: Cloned margins are <a href="#break-margins">truncated</a> on block-level boxes.</p>
<dt><dfn class="css" data-dfn-for="box-decoration-break" data-dfn-type="value" data-export="" id="valdef-box-decoration-break-slice">slice<a class="self-link" href="#valdef-box-decoration-break-slice"></a></dfn>
<dd>
<p> The effect is as though the element were rendered with no breaks present,
and then sliced by the breaks afterward:
no border and no padding are inserted at a break;
no box-shadow is drawn at a broken edge;
and backgrounds, <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#border-radius">border-radius</a>, and the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#border-image">border-image</a> are applied to the geometry of the whole box
as if it were unbroken. </p>
</dl>
<div class="figure">
<p><img alt="Illustration:
(1) a single box cut in two in between two lines of text by a page break and
(2) two boxes, one before and one after the page break,
both with a border all around and their own background image" src="images/box-break.png"> </p>
<p class="caption">Two possibilities for <a class="property" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break</a>:
on the left, the value <a class="css" data-link-type="maybe" href="#valdef-box-decoration-break-slice">slice</a>, on the right the value <a class="css" data-link-type="maybe" href="#valdef-box-decoration-break-clone">clone</a>. </p>
</div>
<p>UAs may also apply <a class="property" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break</a> to control rendering
at bidi-imposed breaks, i.e. when bidi reordering causes an inline
to split into non-contiguous fragments. Otherwise such breaks are
always handled as <a class="css" data-link-type="maybe" href="#valdef-box-decoration-break-slice">slice</a>. </p>
<p class="note" role="note"> For inline elements, which side of a fragment is considered the broken edge
is determined by the parent element’s inline progression direction.
For example, if an inline element whose parent has <a class="css" data-link-type="propdesc" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-direction">direction: rtl</a> breaks across two lines, the <em>left</em> edge of the fragment on
the first line will be the broken edge. (Note in particular that
neither the element’s own <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-direction">direction</a> nor its containing block’s <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-direction">direction</a> is used.) See <a data-link-type="biblio" href="#biblio-css3-writing-modes">[CSS3-WRITING-MODES]</a>. </p>
<h4 class="heading settled" data-level="5.4.1" id="joining-boxes"><span class="secno">5.4.1. </span><span class="content"> Joining Boxes for <a class="css" data-link-type="maybe" href="#valdef-box-decoration-break-slice">slice</a></span><a class="self-link" href="#joining-boxes"></a></h4>
<p>For <a class="css" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break: slice</a>, backgrounds (and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css3-background/#border-image">border-image</a>)
are drawn as if applied to a composite box
consisting of all of the box’s fragments
reassembled in visual order.
This theoretical assembly occurs after the element has been laid out
(including any justification, bidi reordering, page breaks, etc.).
To assemble the composite box... </p>
<dl>
<dt>For boxes broken across lines
<dd> First, fragments on the same line are connected in visual order.
Then, fragments on subsequent lines are ordered
according to the element’s <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> and aligned on the element’s dominant baseline.
For example, in a left-to-right containing block (<a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-direction">direction</a> is <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/css-writing-modes-3/#valdef-direction-ltr">ltr</a>),
the first fragment is the leftmost fragment on the first line
and fragments from subsequent lines are put to the right of it.
In a right-to-left containing block,
the first fragment is the rightmost on the first line
and subsequent fragments are put to the left of it.
<dt>For boxes broken across columns
<dd> Fragments are connected as if the column boxes were glued together
in the <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> of the multi-column element.
<dt>For boxes broken across pages
<dd> Fragments are connected as if page content areas were glued together
in the <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> of the root element.
<dt>For boxes broken across regions
<dd> Fragments are connected as if region content areas were glued together
in the <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> of the <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#principal-writing-mode">principal writing mode</a> of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-regions-1/#region-chain">region chain</a>.
</dl>
<p>If the box fragments have different widths
(heights, if the fragments are joined horizontally),
then each piece draws its portion of the background
assuming that the whole element has the same width (height) as this piece.
However, if the used height (width) of an image is derived from the width (height) of the box,
then it is calculated using the widest fragment’s width
and maintained as a fixed size.
This ensures that right-aligned images stay aligned to the right edge,
left-aligned images stay aligned to the left edge,
centered images stay centered,
and stretched images cover the background area as intended
while preserving continuity across fragments. </p>
<h3 class="heading settled" data-level="5.5" id="transforms"><span class="secno">5.5. </span><span class="content"> Transforms, Positioning, and Pagination</span><a class="self-link" href="#transforms"></a></h3>
<p> Fragmentation interacts with layout, and thus occurs <em>before</em> relative positioning <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>, transforms <a data-link-type="biblio" href="#biblio-css3-transforms">[CSS3-TRANSFORMS]</a>,
and any other graphical effects.
Such effects are applied per fragment:
for example, rotation applied to a fragmented box
will calculate a rotation origin for each fragment
and independently rotate that fragment around its origin.
(The origin of an overflow-only fragment is determined
as if that content were overflowing an empty box with zero margins/borders/padding
at the start of the fragmentainer.)
However, the separation and transfer of page boxes <em>should</em> occur last;
thus a transformed fragment that spans pages <em>should</em> be sliced at the page breaks and print in its entirety
rather than being clipped by its originating page. </p>
<div class="figure">
<p><img alt="Illustration: Transformed overflow fragmentation" src="images/fragmented-transforms.png"> </p>
<p class="caption">A fixed-height box spanning 2.5 pages with overflow content spanning
to a total of 4 pages.
The transform origin of each fragment is the center of its border box;
the fragment without a border box assumes a zero-height box at the start of the overflow. </p>
</div>
<p> Absolute positioning affects layout and thus interacts with fragmentation.
Both the coordinate system and absolutely-positioned boxes belonging to a containing block
will fragment across pages in the same fragmentation flow as the containing block. </p>
<p> UAs are not required to correctly position boxes that span a <a data-link-type="dfn" href="#fragmentation-break">fragmentation break</a> and whose <a data-link-type="dfn" href="http://www.w3.org/TR/css-writing-modes-3/#block-start">block-start</a> edge position depends on where the box’s content fragments.
UAs with memory constraints that prevent them from manipulating an entire document in memory
are not required to correctly position absolutely-positioned elements
that end up on a previously-rendered page. </p>
<h2 class="no-num heading settled" id="changes"><span class="content"> Changes</span><a class="self-link" href="#changes"></a></h2>
<p>The following significant changes were made since the <a href="https://www.w3.org/TR/2015/WD-css3-break-20150129/">29 January 2015 Working Draft</a>: </p>
<ul>
<li>Dropped <span class="css">any</span> and <span class="css">always</span> values of <a class="property" data-link-type="propdesc">break-*</a>.
<li>Switched priority of <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> and <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> vs. <a class="property" data-link-type="propdesc">break-*</a> restrictions
to make <a class="property" data-link-type="propdesc" href="#propdef-widows">widows</a> and <a class="property" data-link-type="propdesc" href="#propdef-orphans">orphans</a> lower-priority rather than higher-priority.
<li>Defined that margins are also cloned for <a class="css" data-link-type="propdesc" href="#propdef-box-decoration-break">box-decoration-break: clone</a> (but are truncated in block-level layout).
<li>Corrected unforced breaking rules (Class A) to handle new break types
(original rules only handled page breaks).
<li>Allowed dropping cloned box decorations when running out of room.
</ul>
<p>A <a href="https://drafts.csswg.org/css-break-3/issues-lc-2015">Disposition of Comments</a> is available. </p>
<h2 class="no-num heading settled" id="acknowledgments"><span class="content"> Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2>
<p> The editors would like to thank
Mihai Balan,
Michael Day,
Alex Mogilevsky,
Shinyu Murakami,
Florian Rivoal,
and Alan Stearns
for their contributions to this module.
Special thanks go to the former <a data-link-type="biblio" href="#biblio-css3page">[CSS3PAGE]</a> editors
Jim Bigelow (HP),
Melinda Grant (HP),
Håkon Wium Lie (Opera),
and
Jacob Refstrup (HP)
for their contributions to this specification,
which is a successor of their work there. </p>
</main>
<h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
<h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words “MUST”,
“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification. </p>
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
<p>Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with <code>class="example"</code>,
like this: </p>
<div class="example" id="example-a13d9f9a">
<a class="self-link" href="#example-a13d9f9a"></a>
<p>This is an example of an informative example. </p>
</div>
<p>Informative notes begin with the word “Note” and are set apart from the
normative text with <code>class="note"</code>, like this: </p>
<p class="note" role="note">Note, this is an informative note. </p>
<p>Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with <code><strong class="advisement"></code>, like
this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
<h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
<p>Conformance to this specification
is defined for three conformance classes: </p>
<dl>
<dt>style sheet
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
style sheet</a>.
<dt>renderer
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
documents that use them.
<dt>authoring tool
<dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet.
</dl>
<p>A style sheet is conformant to this specification
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module. </p>
<p>A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.) </p>
<p>An authoring tool is conformant to this specification