forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
2490 lines (2119 loc) · 145 KB
/
Overview.html
File metadata and controls
2490 lines (2119 loc) · 145 KB
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 Regions Module Level 1</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<script defer src=//test.csswg.org/harness/annotate.js#css-regions-1_dev 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=http://www.w3.org/Icons/w3c_home width=72>
</a>
</p>
<h1 class="p-name no-ref" id=title>CSS Regions Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20140407>7 April 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-regions/>http://dev.w3.org/csswg/css-regions/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-regions/>http://www.w3.org/TR/css-regions/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-regions/>http://dev.w3.org/csswg/css-regions/</a>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-regions%5D%20feedback">www-style@w3.org</a>
with subject line
“<kbd>[css-regions] <var>… message topic …</var></kbd>”(<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)<dt>Test Suite:<dd><a href=http://test.csswg.org/suites/css3-regions/nightly-unstable/>http://test.csswg.org/suites/css3-regions/nightly-unstable/</a><dt>Editors:
<dd class="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 Corporation</span>)<dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:stearns@adobe.com>Alan Stearns</a> (<span class="p-org org">Adobe Systems, Inc.</span>)<dt>Former Editors:
<dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:vhardy@adobe.com>Vincent Hardy</a> (<span class="p-org org">Adobe Systems, Inc.</span>)<dt>Issues List:<dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Regions&resolution=---&cmdtype=doit">In Bugzilla</a></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> © 2014 <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>), All Rights Reserved. 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 heading" id=abstract><span class=content>Abstract</span></h2>
<p class=p-summary data-fill-with=abstract>The CSS Regions module allows content from one or more elements to flow through one or more boxes called CSS Regions, fragmented as defined in <a data-biblio-type=normative data-link-type=biblio href=#css3-break title=css3-break>[CSS3-BREAK]</a>. This module also defines CSSOM to expose both the inputs and outputs of this fragmentation.
<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.</p>
<h2 class="no-num no-toc no-ref heading settled heading" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<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-regions%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-regions” in the subject,
preferably like this:
“[css-regions] <em>…summary of comment…</em>”
<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>).
<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>.</div>
<div data-fill-with=at-risk></div>
<h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class=content>Table of Contents</span></h2>
<div data-fill-with=table-of-contents><ul class=toc>
<li><a href=#introduction><span class=secno>1</span> Introduction</a>
<li><a href=#css-regions-concepts><span class=secno>2</span> CSS Regions concepts</a>
<ul class=toc>
<li><a href=#regions><span class=secno>2.1</span> Regions</a>
<li><a href=#region-chain><span class=secno>2.2</span> Region chain</a>
<li><a href=#named-flow><span class=secno>2.3</span> Named flows</a>
<li><a href=#regions-flow-breaking-rules><span class=secno>2.4</span> Regions flow breaking rules</a></ul>
<li><a href=#properties><span class=secno>3</span> Properties</a>
<ul class=toc>
<li><a href=#the-flow-into-property><span class=secno>3.1</span> The <span class=property data-link-type=propdesc title=flow-into>flow-into</span> property</a>
<li><a href=#the-flow-from-property><span class=secno>3.2</span> The <span class=property data-link-type=propdesc title=flow-from>flow-from</span> property</a>
<ul class=toc>
<li><a href=#circular-dependencies><span class=secno>3.2.1</span> Cycle Detection</a>
<li><a href=#fragmenting-regions><span class=secno>3.2.2</span> Nested fragmentation contexts</a></ul>
<li><a href=#region-flow-break><span class=secno>3.3</span> Region flow break properties: <span class=property data-link-type=propdesc title=break-before>break-before</span>, <span class=property data-link-type=propdesc title=break-after>break-after</span>, <span class=property data-link-type=propdesc title=break-inside>break-inside</span></a>
<li><a href=#the-region-fragment-property><span class=secno>3.4</span> The region-fragment property</a></ul>
<li><a href=#cssom_view_and_css_regions><span class=secno>4</span> CSSOM</a>
<ul class=toc>
<li><a href=#the-namedflow-interface><span class=secno>4.1</span> The NamedFlow interface</a>
<li><a href=#the-region-interface><span class=secno>4.2</span> The Region interface</a>
<li><a href=#named-flow-events><span class=secno>4.3</span> Named flow events</a>
<li><a href=#cssomview-and-regions><span class=secno>4.4</span> Clarifications on pre-existing APIs</a>
<ul class=toc>
<li><a href=#cssomview-getclientrects-and-getboundingclientrect><span class=secno>4.4.1</span> <code class=idl>getClientRects()</code> and <code>getBoundingClientRect()</code></a>
<li><a href=#cssomview-offset-attributes><span class=secno>4.4.2</span> <code class=idl>offsetTop</code>, <code class=idl>offsetLeft</code>, <code class=idl>offsetWidth</code>, <code class=idl>offsetHeight</code> and <code class=idl>offsetParent</code></a></ul></ul>
<li><a href=#multi-column-regions><span class=secno>5</span> Multi-column regions</a>
<li><a href=#pseudo_elements><span class=secno>6</span> Pseudo-elements</a>
<li><a href=#regions-visual-formatting-details><span class=secno>7</span> Regions visual formatting details</a>
<ul class=toc>
<li><a href=#processing-model><span class=secno>7.1</span> Processing model</a>
<li><a href=#regions-flow-content-box><span class=secno>7.2</span> The Region Flow Content Box (RFCB)</a>
<ul class=toc>
<li><a href=#rfcb-width-resolution><span class=secno>7.2.1</span> RFCB <span class=property data-link-type=propdesc title=width>width</span> resolution</a></ul>
<li><a href=#regions-visual-formatting-steps><span class=secno>7.3</span> Regions visual formatting steps</a>
<ul class=toc>
<li><a href=#rfcb-flow-fragment-height-resolution><span class=secno>7.3.1</span> Step 1: RFCB flow fragment height resolution</a>
<ul class=toc>
<li><a href=#rfcb-flow-fragment-height-resolution-phase-1><span class=secno>7.3.1.1</span> RFCB flow fragment height resolution, Phase 1</a>
<li><a href=#rfcb-flow-fragment-height-resolution-phase-2><span class=secno>7.3.1.2</span> RFCB flow fragment height resolution, Phase 2</a></ul>
<li><a href=#regions-boxes-layout><span class=secno>7.3.2</span> Step 2: region boxes layout</a>
<li><a href=#named-flows-layout><span class=secno>7.3.3</span> Step 3: named flows layout</a></ul>
<li><a href=#regions-visual-formatting-implementation-note><span class=secno>7.4</span> Regions visual formatting: implementation note</a>
<li><a href=#regions-visual-formatting-examples><span class=secno>7.5</span> Regions visual formatting example</a>
<ul class=toc>
<li><a href=#step1-phase1-example><span class=secno>7.5.1</span> Step 1 - Phase 1: Laying out RFCBs with used height of zero</a>
<li><a href=#step1-phase2-example><span class=secno>7.5.2</span> Step 1 - Phase 2: Layout flow to compute the RFCBs' flow fragments heights</a>
<li><a href=#step2-example><span class=secno>7.5.3</span> Step 2: Layout document and regions without named flows</a>
<li><a href=#step3-example><span class=secno>7.5.4</span> Step 3: named flows layout</a></ul></ul>
<li><a href=#relation-to-document-events><span class=secno>8</span> Relation to document events</a>
<li><a href=#relation-to-other-specifications><span class=secno>9</span> Relation to other specifications</a>
<li><a href=#usecases><span class=secno>10</span> Use Cases</a>
<li><a href=#changes><span class=secno>11</span> Changes</a>
<ul class=toc>
<li><a href=#changes_from_Feb_18_2014><span class=secno>11.1</span> Changes from <span>February 18<sup>th</sup> 2014</span> version</a>
<li><a href=#changes_from_May_28_2013><span class=secno>11.2</span> Changes from <span>May 28<sup>th</sup> 2013</span> version</a>
<li><a href=#changes_from_Aug_28_2012><span class=secno>11.3</span> Changes from <span>August 28<sup>th</sup> 2012</span> version</a>
<li><a href=#changes_from_May_03_2012><span class=secno>11.4</span> Changes from <span>May 3<sup>rd</sup> 2012</span> version</a>
<li><a href=#older_changes><span class=secno>11.5</span>Older Changes</a></ul>
<li><a href=#acknowledgments><span class=secno></span> Acknowledgments</a>
<li><a href=#conformance><span class=secno></span> Conformance</a>
<ul class=toc>
<li><a href=#conventions><span class=secno></span> Document conventions</a>
<li><a href=#conformance-classes><span class=secno></span> Conformance classes</a>
<li><a href=#partial><span class=secno></span> Partial implementations</a>
<li><a href=#experimental><span class=secno></span> Experimental implementations</a>
<li><a href=#testing><span class=secno></span> Non-experimental implementations</a></ul>
<li><a href=#references><span class=secno></span> References</a>
<ul class=toc>
<li><a href=#normative><span class=secno></span> Normative References</a>
<li><a href=#informative><span class=secno></span> Informative References</a></ul>
<li><a href=#index><span class=secno></span> Index</a>
<li><a href=#property-index><span class=secno></span> Property index</a></ul></div>
<h2 class="heading settled heading" data-level=1 id=introduction><span class=secno>1 </span><span class=content>
Introduction</span><a class=self-link href=#introduction></a></h2>
<p><em>This section is non-normative.</em>
<p> The core concept behind CSS Regions
is the ability to say,
"Display <em>this</em> content (a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>)
over <em>there</em> (a <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>)."
The simplest example is:
<div class=example>
<pre><code class=css>
#this {
flow-into: my-flow;
}
#there {
flow-from: my-flow;
}
</code></pre> </div>
<p> These two declarations will take
the element that matches <code>#this</code>,
put it into a flow named "my-flow",
and display the contents of "my-flow"
in the box from the element that matches <code>#there</code>.
This example has a single content source for the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>,
and a single box for the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>.
Named flows can also have multiple sources
and use multiple boxes for the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>.
<p> The <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> mechanism can be used
in several different ways -
some of which are
custom overflow handling,
aggregating content,
linked display boxes,
magazine-style layout,
and flowing content through areas in a paginated view.
<div class=example>
Linked display boxes can be created
to display article content above and below
other content on a page.
Given markup like this:
<pre><code class=html>
<article> ...some content... </article>
<aside> ad or image content </aside>
</code></pre>
<p> The <aside> content will be displayed
below all of the article content.
On a large screen the page might display without scrolling,
but on a small screen the <aside> content
might not be visible until the view scrolls.
If it’s important to show at least some
of the <aside> content in the initial view,
CSS Regions can fragment the article content across two boxes -
one above the <aside> and one below.
<p> In this example (for simplicity’s sake)
we create the boxes with additional elements:
<pre><code class=html>
<article> ...some content... </article>
<div class="top region"></div>
<aside> ad or image content </aside>
<div class="region"></div>
</code></pre>
<pre><code class=css>
article {
flow-into: article-flow;
}
.region {
flow-from: article-flow;
}
.top {
max-height: 80vh;
}
</code></pre>
<p> So the top box in the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
is limited to 80% of the viewport height.
If the article content doesn’t fit in that box,
the article will continue
in the second box after the <aside> content.
</p><figure style="float:left; margin:1em;">
<img alt="Article and aside rendering without CSS Regions" src=images/linked-boxes-before.png>
<figcaption>
Rendering without CSS Regions
</figcaption>
</figure>
<figure style="float:left; margin:1em;">
<img alt="Article and aside rendering with CSS Regions" src=images/linked-boxes-after.png>
<figcaption>
Rendering with CSS Regions
</figcaption>
</figure>
<p style=clear:left;>In the images above,
the gray area represents
the content below the screen edge
in the initial view.
<p> This example links just two boxes together,
but more boxes could be added to the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
to regularly interleave other content with the article.
</div>
<div class=example>
<p> Custom overflow handling can be accomplished by linking a separate overflow box. In this example, the overflow box is nestled inside a menu in the markup, and only displays if the menu is toggled.
<pre><code class=html>
<nav> ...some links... </nav>
<div class="menu">
<nav></nav>
...some more links...
</div>
</code></pre>
<p> If the links in the main nav element are placed in a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>, that flow can be directed through both the main nav element and the overflow nav box in the menu:
<pre><code class=css>
nav a {
flow-into: nav-link-flow;
}
nav {
flow-from: nav-link-flow;
}
</code></pre>
<p> Then the main nav element and the menu can be arranged with constraints such that when the screen is too narrow for the main nav element to display all of the navigation links, the overflow moves to the menu.
</p><figure>
<img alt="Wide nav bar showing all of the links" src=images/menu-wide.png>
<figcaption>
Wide rendering with menu shown
</figcaption>
</figure>
<figure>
<img alt="Narrow nav bar with some of the links in the menu" src=images/menu-narrow.png>
<figcaption>
Narrow rendering with menu shown
</figcaption>
</figure>
</div>
<div class=example>
<p> Since content is assigned to a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> using a CSS selector, the content can come from multiple sources. The resulting aggregation can be displayed in a single box or flowed through multiple boxes as above.
<p> So given this markup:
<pre><code class=html>
<div class="breaking-news"></div>
<article>News story</article>
<article class="breaking">Sports story</article>
A3CA
<article>News story</article>
<article class="breaking">Entertainment story</article>
<article>Sports story</article>
</code></pre>
<p> You can take the "breaking" stories and display them above all the others using two lines of CSS:
<pre><code class=css>
.breaking {
flow-into: breaking-news;
}
.breaking-news {
flow-from: breaking-news;
}
</code></pre>
<p> Given more data accessible to CSS selectors, you could rearrange the articles in other ways (sports on top, etc.) depending on the user’s preferences.
</div>
<div class=note><span class=note-prefix>Note </span>
<p> <strong><a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a> are independent from layout</strong>
<p> Any of the CSS layout facilities can be used
to create, position and size boxes that can become <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>.
<p> The CSS Regions module does not
define a layout mechanism
and is meant to integrate
with existing and future CSS layout facilities.
</div>
<div class=note><span class=note-prefix>Note </span>
<p> <strong><a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a> do not have to be elements</strong>
<p> The CSS Regions module is independent
of the layout of boxes and
the mechanisms used to create them.
<p> For simplicity,
our examples tend to
use elements to define the boxes.
Any other mechanism available
in markup or style
to create stylable boxes could be used instead,
such as pseudo-elements
or the @slot rule proposed
by the CSS Page Template Module <a data-biblio-type=informative data-link-type=biblio href=#css3-page-template title=css3-page-template>[CSS3-PAGE-TEMPLATE]</a>.
<p> The only requirement
for box to become a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>
is that the <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> property applies to the box.
</div>
<h2 class="heading settled heading" data-level=2 id=css-regions-concepts><span class=secno>2 </span><span class=content>
CSS Regions concepts</span><a class=self-link href=#css-regions-concepts></a></h2>
<h3 class="heading settled heading" data-level=2.1 id=regions><span class=secno>2.1 </span><span class=content>
Regions</span><a class=self-link href=#regions></a></h3>
<p> A <dfn data-dfn-type=dfn data-noexport="" id=css-region>CSS Region<a class=self-link href=#css-region></a></dfn>
is a block container
that has an associated
<em><a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a></em>
(see the <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> property).
<h3 class="heading settled heading" data-level=2.2 id=region-chain><span class=secno>2.2 </span><span class=content>
Region chain</span><a class=self-link href=#region-chain></a></h3>
<p> A <dfn data-dfn-type=dfn data-noexport="" id=region-chain0>region chain<a class=self-link href=#region-chain0></a></dfn>
is the sequence of regions
that are associated with
a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
<a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a> in a
region chain receive content from the
<a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> following their order in the chain.
<a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a> are organized
into a <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
according to the document order.
<h3 class="heading settled heading" data-level=2.3 id=named-flow><span class=secno>2.3 </span><span class=content>
Named flows</span><a class=self-link href=#named-flow></a></h3>
<p> A <dfn data-dfn-type=dfn data-noexport="" id=named-flow0>named flow<a class=self-link href=#named-flow0></a></dfn> is the ordered sequence of content
associated with a flow with a given identifier.
Contents in a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> are ordered
according to the document order.
<p> Content is placed into a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
with the <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property.
The content in a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> is laid out
in the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
that is associated with this <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
using the <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> property.
<p> Content from a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
is broken up between regions
according to the regions flow breaking rules.
<p> A <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> is created when
some content is moved
into the flow with the given identifier
or when at least one <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>
requests content from that flow.
<h3 class="heading settled heading" data-level=2.4 id=regions-flow-breaking-rules><span class=secno>2.4 </span><span class=content>
Regions flow breaking rules</span><a class=self-link href=#regions-flow-breaking-rules></a></h3>
<p> Breaking a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> across a region chain
is similar to breaking a document’s content across pages
(see <a data-biblio-type=informative data-link-type=biblio href=#css3page title=css3page>[CSS3PAGE]</a>)
or a multi-column element’s content across column boxes
(see <a data-biblio-type=informative data-link-type=biblio href=#css3col title=css3col>[CSS3COL]</a>).
One difference is that page boxes are generated
based on the available content
whereas a region chain is a set of recipient boxes
for the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> content
whose dynamic generation is not in the scope
of this specification.
<p> Each <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> in turn
consumes content from its associated <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
The <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> content is positioned
in the current region
until a natural or forced region break occurs,
at which point the next region
in the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
becomes the current region.
If there are no more <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>
in the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
and there is still content in the flow,
the positioning of the remaining content
is controlled by the <a class=property data-link-type=propdesc href=#propdef-region-fragment title=region-fragment>region-fragment</a> property
on the last <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> in the chain.
<p> The CSS regions module follows
the fragmentation rules defined
in the CSS Fragmentation Module Level 3
(see <a data-biblio-type=normative data-link-type=biblio href=#css3-break title=css3-break>[CSS3-BREAK]</a>).
<h2 class="heading settled heading" data-level=3 id=properties><span class=secno>3 </span><span class=content>
Properties</span><a class=self-link href=#properties></a></h2>
<h3 class="heading settled hea
67F6
ding" data-level=3.1 id=the-flow-into-property><span class=secno>3.1 </span><span class=content>
The <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property</span><a class=self-link href=#the-flow-into-property></a></h3>
<div class="issue-marker wrapper">
<div class=issue-marker>
<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16527">Issue-16527</a>
<div class=issue-details>
<p class=short-desc>[Shadow]: getFlowByName and shadow DOM</p>
</div>
</div>
</div>
<p> The ‘flow-into’ property can place an element
or its contents
into a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
Content that belongs to the same flow
is laid out in the region chain
associated with that flow.
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-flow-into>flow-into<a class=self-link href=#propdef-flow-into></a></dfn><tr><th>Value:<td class=prod>none | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/mediaqueries-4/#typedef-ident title="<ident>"><ident></a> [element|content]?<tr><th>Initial:<td>none<tr><th>Applies to:<td>All elements, but not <a href=http://www.w3.org/TR/selectors/#pseudo-elements>pseudo-elements</a> such as <code class=css>::first-line</code>, <code class=css>::first-letter</code>, <code class=css>::before</code> or <code class=css>::after</code>.<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified</table>
<dl>
<dt>none</dt>
<dd>
The element is not moved
to a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
and normal CSS processing takes place.
</dd>
<dt><a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a></dt>
<dd>
If the keyword <dfn data-dfn-type=dfn data-noexport="" id=element>element<a class=self-link href=#element></a></dfn> is present
or neither keyword is present,
then the element is taken out
of its parent’s flow
and placed into the flow
with the name '<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>'.
If the keyword <dfn data-dfn-type=dfn data-noexport="" id=content>content<a class=self-link href=#content></a></dfn> is present,
then only the element’s contents
are placed into the named flow.
The element or content is said to have
a <dfn data-dfn-type=dfn data-noexport="" id=specified-flow>specified flow<a class=self-link href=#specified-flow></a></dfn>.
The values <span class=css data-link-type=maybe title=none>none</span>, <span class=css data-link-type=maybe title=inherit>inherit</span>, <span class=css data-link-type=maybe title=default>default</span>, <span class=css data-link-type=maybe title=auto>auto</span> and <span class=css data-link-type=maybe title=initial>initial</span>
are invalid flow names.
</dd>
</dl>
<p> The <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property affects
the visual formatting of elements or contents
placed into a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
and of the region chain laying out content
from a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
The <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property does not affect
the CSS cascade and inheritance
for the elements on which it is specified.
The <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property does not affect the
<a href=http://www.w3.org/TR/2012/WD-dom-20120405/#introduction-to-the-dom>DOM</a>
<a data-biblio-type=normative data-link-type=biblio href=#dom title=dom>[DOM]</a> position of an element or its contents.
The <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property does not affect ordering
in non-visual media
(such as <a href=http://www.w3.org/TR/css3-speech/>speech</a>).
Likewise, <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> does not affect
the default traversal order
of sequential navigation modes
(such as cycling through links,
see e.g. <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-ui-3/#nav-index0 title=nav-index>nav-index</a> <a data-biblio-type=informative data-link-type=biblio href=#css3ui title=css3ui>[CSS3UI]</a>
or <a href=http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#sequential-focus-navigation-and-the-tabindex-attribute><code>tabindex</code></a> <a data-biblio-type=informative data-link-type=biblio href=#html40 title=html40>[HTML40]</a>).
<p> A <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> needs to be associated
with a region chain
(one or more <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>)
for its content to be visually formatted.
If no region chain is associated
with a given <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>,
the content in the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
is not rendered:
it does not generate boxes
and is not displayed.
<p> The children of an element or content
with a specified flow
may themselves have a specified flow,
in which case they become
the next sibling of the latest element
or content collected in that flow.
In some cases,
the child can become the next sibling
for one of its ancestors in the same flow.
<p> Content in a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
is sequenced in document order.
The visual formatting model
uses the relationships between content
in the named flow as input,
rather than the contents’ position
in the DOM.
<p> Each <a class=css data-link-type=maybe href=#css-region title="css region">CSS region</a> in a <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
establishes a containing block for absolutely positioned
elements in the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> (see <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>).
That first <a class=css data-link-type=maybe href=#css-region title="css region">CSS region</a> in a <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
establishes the initial containing block for such absolutely
positioned elements.
<span>Regions</span> don’t establish a containing block for
fixed positioned elements in the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
Such fixed positioned elements are still positioned relative
to the viewport or the page area even if they have been
redirected into a named flow
<p> The first region defines the principal
<a href=http://www.w3.org/TR/css3-writing-modes/#writing-mode>writing mode</a>
for the entire flow.
The writing mode
on subsequent regions is ignored.
<div class=note><span class=note-prefix>Note </span>
<p> The <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property moves an element into the flow
and the interplay with selectors should be considered carefully.
<p> For example,
<pre>table {flow-into: table-content}</pre>
<p> will move all tables in the "table-content"
<a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
However, the
<pre>table > * {flow-into: table-content} ...</pre>
<p> selector will move all immediate children
of all table elements
into the "table-content" <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
(which may be useful as it will usually result,
if the immediate children are rows,
in merging rows of multiple tables),
but the
<pre>table * {flow-into: table-content}</pre>
<p> selector will move all descendants
of table elements into the "table-content" <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>,
transforming the element tree
into a flat list in order of opening tags
(which is probably not intentional).
This will make all the descendants
of table elements siblings
in the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
Having the descendants become siblings
in the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
results in a different processing
(see <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/tables.html#anonymous-boxes>CSS 2.1’s anonymous table objects</a>).
This note illustrates how authors must exercise caution
when choosing a particular selector
for setting the <a class=property data-link-type=propdesc href=#propdef-flow-into title=flow-into>flow-into</a> property
to avoid unintended results.
</div>
<div class=note><span class=note-prefix>Note </span>
<p> Another consequence of moving elements
into named flows is that surrounding whitespace
is not moved into the named flow.
If you have code like this:
<pre>span {flow-into: span-content}
<span>one</span>
<span>two</span>
</pre>
<p> Then the "span-content" named flow contents
will contain this:
<pre><span>one</span><span>two</span>
</pre>
<p> Which will change the display
from "one two" to "onetwo".
If whitespace is significant,
then moving the parent
that contains the whitespace
to the named flow
is required.
</div>
<h3 class="heading settled heading" data-level=3.2 id=the-flow-from-property><span class=secno>3.2 </span><span class=content>
The <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> property</span><a class=self-link href=#the-flow-from-property></a></h3>
<p> The <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> property makes
a block container a region
and associates it with
a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-flow-from>flow-from<a class=self-link href=#propdef-flow-from></a></dfn><tr><th>Value:<td class=prod><a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/mediaqueries-4/#typedef-ident title="<ident>"><ident></a> | none | inherit<tr><th>Initial:<td>none<tr><th>Applies to:<td>Non-replaced <a href=http://www.w3.org/TR/CSS21/visuren.html#block-boxes>block containers</a>. <br> This might be expanded in future versions of the specification to allow other types of containers to receive flow content.<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified</table>
<dl>
<dt><strong>none</strong></dt>
<dd>
The block container is not a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>.
</dd>
<dt><strong><a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a></strong></dt>
<dd>
The block container becomes a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>
(except as detailed in the text below),
and is ordered in a <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>
according to its document order.
The content from the flo
2334
w
with the <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>
name will be <a href=#region-flow-break>broken
into fragments</a> and visually formatted in the
<a href=http://www.w3.org/TR/CSS21/visuren.html#principal-box>principal boxes</a>
of the <span>regions</span>
in the <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>.
<br>
If there is no flow with name
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>,
then the block container does not
format any content visually.
</dd>
</dl>
<p> If the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-content-3/#content title=content>content</a> property computes
to something else than <span class=css data-link-type=maybe title=normal>normal</span>
(or <span class=css data-link-type=maybe title=none>none</span> for a pseudo-element),
the block container does not become
a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>.
If the <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visuren.html#propdef-display title=display>display</a> property
of the block container
or one of its ancestors
computes to <span class=css data-link-type=maybe title=none>none</span>,
the block container does not become
a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>.
<p> A <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>’s document children
are not visually formatted
unless they are directed
to a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
with an associated <a class=css data-link-typ
E88C
e=maybe href=#region-chain0 title="region chain">region chain</a>.
<p> Block container pseudo-elements where
the value of <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> computes to an
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>
and the value of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-content-3/#content title=content>content</a> computes to <span class=css data-link-type=maybe title=none>none</span>
are generated as <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>,
which is an update to the behavior
described in <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>.
<div class=note><span class=note-prefix>Note </span>
<p> A block container becomes a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>
when its <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> property is set
to a valid <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a> value,
even if there is no content contributing
to the referenced flow.
For example:
<pre><style>
.article{
flow-into: thread;
}
.region{
flow-from: thread;
}
</style>
<html>
<body>
<div class=region>div content</div>
</body>
</html>
</pre>
<p> There is no element matching
the <code>.article</code> selector
and therefore no content
in the <code>thread</code> flow.
However, the block container matching
the <code>.region</code> selector
is still associated with
that empty <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
and, consequently,
its children are not formatted visually.
</div>
<div class=note><span class=note-prefix>Note </span>
<p> At the time of this note-writing, the <code>display</code> values that
always result in a non-replaced block container include
<code>block</code>, <code>inline-block</code>, <code>table-cell</code>,
<code>table-caption</code>, and <code>list-item</code>. All of these
display values work as regions with non-replaced elements.
<p> The <code>flex</code> and <code>grid</code> display values do not
result in block containers (they are defined as flex containers and grid
elements, respectively). So ‘<a href=#flow-from><code class=property>flow-from</code></a>’ combined with those display values
does not result in a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>.
</div>
<p> <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>
create a new
<a href=http://www.w3.org/TR/CSS2/visuren.html#z-index>stacking context</a>.
<a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>
establish a new
<a href=http://www.w3.org/TR/CSS2/visuren.html#block-formatting>block formatting Context</a>.
Exclusions (see <a data-biblio-type=informative data-link-type=biblio href=#css3-exclusions title=css3-exclusions>[CSS3-EXCLUSIONS]</a>)
potentially impact the content
laid out in region chains,
just as for non-regions.
<div class=note><span class=note-prefix>Note </span>
<p> With <a class=css data-link-type=maybe href=#region-chain0 title="region chains">region chains</a>,
an element may be split across multiple boxes
and these boxes may overlap
(for example if they are absolutely positioned).
So fragments of the same element
can overlap each other.
Since each element has a single z-index,
it would be required to find another mechanism
to decide in which order
the fragments are rendered.
Since each <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> creates
a new stacking context,
it is clear that each fragment is rendered separately
and their rendering order follows
the regular CSS rendering model.
<p> Fragments rendering separately
is also relevant to elements that might normally
be rendered as a unit
(for example,
an element with its own stacking context,
or with transparency).
Each fragment of these elements
is separately contained in the stacking context
created by the <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>,
so each fragment of these elements
is rendered separately.
</div>
<p> See the
<a href=#regions-visual-formatting-details>regions visual formatting details</a>
section for a description of how
<a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-width title=width>width</a> and <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/visudet.html#propdef-height title=height>height</a> values are resolved
for <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> boxes.
<h4 class="heading settled heading" data-level=3.2.1 id=circular-dependencies><span class=secno>3.2.1 </span><span class=content>
Cycle Detection</span><a class=self-link href=#circular-dependencies></a></h4>
<p> <a class=css data-link-type=maybe href=#named-flow0 title="named flows">named flows</a> containing elements
where the value of <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> computes to an
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>
can produce nonsensical circular relationships,
such as a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
containing <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>
in its own <a class=css data-link-type=maybe href=#region-chain0 title="region chain">region chain</a>.
These relationships can be easily
and reliably detected and resolved, however,
by keeping track of a dependency graph
and using common cycle-detection algorithms.
<p> The dependency graph consists of edges such that:
<p><ul>
<li>
Every <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> depends on its elements
where the value of <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> computes to an
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>.
</li>
<li>
Every element in a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
where the value of <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a> computes to an
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>
depends on the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> with the
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>
name.
</li>
</ul>
<p> If the graph contains a cycle,
any elements where the value of <a class=property data-link-type=propdesc href=#propdef-flow-from title=flow-from>flow-from</a>
computes to an
<a href=http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier><ident></a>
participating in the cycle
do not become <a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a>.
<div class=note><span class=note-prefix>Note </span>
<p> For example, styling like this:
<pre>#id {
flow-into: foolish;
flow-from: foolish;
}
</pre>
<p> would move the <code>#id</code> element to a "foolish" <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>,
and try to make the <code>#id</code> element
a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> for the "foolish" <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
The "foolish" <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> would then contain its own region,
creating a cycle.
So the <code>#id</code> element does not become a <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>.
</div>
<h4 class="heading settled heading" data-level=3.2.2 id=fragmenting-regions><span class=secno>3.2.2 </span><span class=content>
Nested fragmentation contexts</span><a class=self-link href=#fragmenting-regions></a></h4>
<p> A <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> that contains
a fragment of a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>
can itself be fragmented if it is nested
within a fragmentation context <a data-biblio-type=normative data-link-type=biblio href=#css3-break title=css3-break>[CSS3-BREAK]</a>,
such as when a layout
using a region chain is printed.
In these cases break opportunities
in the named flow fragment
contained by the <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>
are determined using the standard
<a href=http://www.w3.org/TR/css3-break/>fragmentation rules</a>.
In other words,
each region box and its associated fragment
should break as if it were a simple div
containing the fragment contents.
This can be controlled by using
an avoid break value on the <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>,
if that is desired.
<p> A <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a> can be part
of the contents of a separate named flow,
as long as there are no cycles broken
by the <a href=#circular-dependencies>Cycle Detection</a>
described above.
This case is a <dfn data-dfn-type=dfn data-noexport="" id=nested-region-context>nested region context<a class=self-link href=#nested-region-context></a></dfn>,
which has an effect
on the <a href=#regions-visual-formatting-steps>Visual Formatting Steps</a>
described below.
<h3 class="heading settled heading" data-level=3.3 id=region-flow-break><span class=secno>3.3 </span><span class=content>
Region flow break properties: <a class=property data-link-type=propdesc href=#propdef-break-before title=break-before>break-before</a>, <a class=property data-link-type=propdesc href=#propdef-break-after title=break-after>break-after</a>, <a class=property data-link-type=propdesc href=#propdef-break-inside title=break-inside>break-inside</a></span><a class=self-link href=#region-flow-break></a></h3>
<div class=note><span class=note-prefix>Note </span>
<p> This section is also defined in <a data-biblio-type=normative data-link-type=biblio href=#css3-break title=css3-break>[CSS3-BREAK]</a>.
If that specification moves to last call
with the region values,
the section here can be replaced by a reference.
</div>
<p> User agents laying out content in multiple regions
must determine where content breaks occur.
The problem of breaking
2334
content into fragments fitting in regions
is similar to breaking content into pages or columns.
<p> Each break ends layout in the current region
and causes remaining pieces of content
from the <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a> to be visually formatted
in the following region in the region chain,
if there is one.
<p> The following extends
the <a class=property data-link-type=propdesc href=#propdef-break-before title=break-before>break-before</a>, <a class=property data-link-type=propdesc href=#propdef-break-after title=break-after>break-after</a> and <a class=property data-link-type=propdesc href=#propdef-break-inside title=break-inside>break-inside</a> properties
from the <a data-biblio-type=normative data-link-type=biblio href=#css3col title=css3col>[CSS3COL]</a> specification to account for regions.
The additional values are described below.
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-break-before>break-before<a class=self-link href=#propdef-break-before></a></dfn><tr><th>Value:<td class=prod>auto | always | avoid | left | right | page | column | region | avoid-page | avoid-column | avoid-region<tr><th>Initial:<td>auto<tr><th>Applies to:<td>block-level elements<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified</table>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code 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 class=prod>auto | always | avoid | left | right | page | column | region | avoid-page | avoid-column | avoid-region<tr><th>Initial:<td>auto<tr><th>Applies to:<td>block-level elements<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified</table>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code 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 class=prod>auto | avoid | avoid-page | avoid-column | avoid-region<tr><th>Initial:<td>auto<tr><th>Applies to:<td>block-level elements<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified</table>
<p> These properties describe page, column and region break behavior
before/after/inside the generated box. These values are normatively defined
in <a data-biblio-type=normative data-link-type=biblio href=#css3col title=css3col>[CSS3COL]</a>:
<p> This specification adds the following new values:
<dl>
<dt>region</dt>
<dd>Always force a region break before (after) the generated box.</dd>
<dt>avoid-region</dt>
<dd>Avoid a region break before (after, inside) the generated box.</dd>
</dl>
<p> The behavior of region breaks with regards to regions
is identical to the behavior of page breaks with regards to pages,
as defined in the <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>.
<h3 class="heading settled heading" data-level=3.4 id=the-region-fragment-property><span class=secno>3.4 </span><span class=content>
The region-fragment property</span><a class=self-link href=#the-region-fragment-property></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-region-fragment>region-fragment<a class=self-link href=#propdef-region-fragment></a></dfn><tr><th>Value:<td class=prod>auto | break<tr><th>Initial:<td>auto<tr><th>Applies to:<td><a class=css data-link-type=maybe href=#css-region title="css regions">CSS Regions</a><tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified</table>
<p> The <a class=property data-link-type=propdesc href=#propdef-region-fragment title=region-fragment>region-fragment</a> property controls the behavior
of the <em id=last-region>last region</em>
associated with a <a class=css data-link-type=maybe href=#named-flow0 title="named flow">named flow</a>.
<dl>
<dt>auto</dt>
<dd>
Content flows as it would in a regular content box.
If the content exceeds the container box,
it is subject to the
<a href=http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow>overflow</a>
property’s computed value on the <a class=css data-link-type=maybe href=#css-region title="css region">CSS Region</a>.
Region breaks must be ignored on the last region.
</dd>
<dt>break</dt>
<dd>