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
1961 lines (1476 loc) · 66.5 KB
/
Overview.html
File metadata and controls
1961 lines (1476 loc) · 66.5 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 PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html dir=ltr lang=en>
<head profile="http://www.w3.org/2006/03/hcard"><meta content="IE=edge"
http-equiv=X-UA-Compatible>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Regions Module</title>
<link href="http://dev.w3.org/csswg/default.css" rel=stylesheet
type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=Stylesheet
type="text/css">
<link href=alternate-spec-style.css id=st rel=stylesheet title="additional
spec styles" type="text/css">
<script src=style-toggle.js type="text/javascript">
</script>
<body>
<div class=head id=div-head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo--></p>
<h1>CSS Regions Module</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 10 May 2011</h2>
<dl>
<dt>This version:
<dd><a
href="http://www.w3.org/TR/2011/ED-css3-regions-20110510/">http://www.w3.org/csswg/css3-regions</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-regions">http://www.w3.org/csswg/css3-regions</a>
<dt>Previous version:
<dd>none
<dt>Editors:
<dd class=vcard><span class=fn>Vincent Hardy</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>vhardy@adobe.com</span>
<dt>Authors and Former Editors:
<dd class=vcard><span class=fn>Stephen Zilles</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>szilles@adobe.com</span>
<dd class=vcard><span class=fn>Alexandru Chiculita</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>achicu@adobe.com</span>
<dd class=vcard><span class=fn>Andrei Bucur</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>abucur@adobe.com</span>
<dd class=vcard><span class=fn>Mihnea Ovidenie</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>mihnea@adobe.com</span>
<dd class=vcard><span class=fn>Peter Sorotokin</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>psorotok@adobe.com</span>
<dd class=vcard><span class=fn>Virgil Palanciuc</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>virgilp@adobe.com</span>
<dd class=vcard><span class=fn>Arno Gourdol</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>agourdol@adobe.com</span>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2011 <a
href="http://www.w3.org/"><acronym title="World Wide Web
Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym
title="European Research Consortium for Informatics and
Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</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>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>The CSS Regions module allows content to flow across multiple areas
called regions. The regions do not necessarily follow the document order.
The CSS Regions module provides an advanced content flow mechanism, which
can be combined with positioning schemes as defined by other CSS modules
such as the Multi-Column Module <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a> or the Grid Layout Module
<a href="#CSS3-GRID-LAYOUT"
rel=biblioentry>[CSS3-GRID-LAYOUT]<!--{{CSS3-GRID-LAYOUT}}--></a> to
position the regions where content flows.
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-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=%5Bcss3-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
“css3-regions” in the subject, preferably like this:
“[<!---->css3-regions<!---->] <em>…summary of
comment…</em>”
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
Policy</a>. W3C maintains a <a href="/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="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<!--end-status-->
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
<ul class=toc>
<li><a href="#named-flows-and-regions"><span class=secno>1.1.
</span>Named flows and regions</a>
<li><a href="#region-styling"><span class=secno>1.2. </span>Regions
Styling</a>
</ul>
<li><a href="#css-regions-model"><span class=secno>2. </span>CSS Regions
Model</a>
<ul class=toc>
<li><a href="#named-flows"><span class=secno>2.1. </span>Named flows</a>
<li><a href="#regions"><span class=secno>2.2. </span>Regions</a>
<li><a href="#flow-breaking-rules"><span class=secno>2.3. </span>Flow
breaking rules</a>
<li><a href="#formatting-model-considerations"><span class=secno>2.4.
</span>The Visual Formatting Model and Flows</a>
<ul class=toc>
<li><a href="#normal-flow"><span class=secno>2.4.1. </span>Normal
flow</a>
<li><a href="#positioned-flow"><span class=secno>2.4.2.
</span>Positioned flow</a>
<li><a href="#column-flow"><span class=secno>2.4.3. </span>Column
flow</a>
<li><a href="#generated-flow"><span class=secno>2.4.4.
</span>Generated flow</a>
</ul>
<li><a href="#relation-to-document-events"><span class=secno>2.5.
</span>Relation to document events</a>
</ul>
<li><a href="#regions-properties"><span class=secno>3. </span>Properties
and Rules</a>
<ul class=toc>
<li><a href="#the-flow-property"><span class=secno>3.1. </span>The
‘<code class=property>flow</code>’ property</a>
<li><a href="#the-content-property"><span class=secno>3.2. </span>The
‘<code class=property>content</code>’ property</a>
<li><a href="#the-content-order-property"><span class=secno>3.3.
</span>The ‘<code class=property>content-order</code>’
property</a>
<li><a href="#region-flow-break-properties-break-befor"><span
class=secno>3.4. </span>Region flow break properties: ‘<code
class=property>break-before</code>’, ‘<code
class=property>break-after</code>’, ‘<code
class=property>break-inside</code>’</a>
<li><a href="#the-region-style-rule"><span class=secno>3.5. </span>The
region-style rule</a>
</ul>
<li><a href="#om_regions"><span class=secno>4. </span>CSSOM View and CSS
Regions</a>
<li><a href="#integration"><span class=secno>5. </span>Integration with
other specifications</a>
<ul class=toc>
<li><a href="#region-requirements"><span class=secno>5.1. </span>Region
requirements</a>
<li><a href="#integration-examples"><span class=secno>5.2.
</span>Integration Examples</a>
<ul class=toc>
<li><a href="#css-grid-layout"><span class=secno>5.2.1. </span>CSS
Grid Layout</a>
<li><a href="#css-multi-column-layout"><span class=secno>5.2.2.
</span>CSS Multi-Column Layout</a>
<li><a href="#css-flexible-box-layout-module"><span class=secno>5.2.3.
</span>CSS Flexible Box Layout Module</a>
<li><a href="#css-visual-formatting"><span class=secno>5.2.4.
</span>CSS Visual Formatting</a>
</ul>
</ul>
<li><a href="#relation-to-other-specs"><span class=secno>6.
</span>Relation to other specifications</a>
<li><a href="#conformance"><span class=secno>7. </span>Conformance</a>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<h2 id=introduction><span class=secno>1. </span>Introduction</h2>
<p>Capturing the complex layouts of a typical magazine, newspaper, or
textbook requires capabilities beyond those available in existing CSS
modules. This is the purpose of the CSS Regions module.
<p>
<p>The CSS Regions module can be seen as an extension of the concept of
multi-column elements. With CSS Multi-column layout <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>, columns share the same
dimensions and define column boxes organized in rows. Content flows from
one column to the next.
<p>
<p>The multi-column model is an example of flowing content from one area to
another, where the areas are the multi-column element's column boxes and
the flow is made of the multi-column element's children.
<p>
<p>However, for more complex layouts, content needs to flow from one area
of the page to the next without limitation of the areas' sizes and
positions. These arbitrary areas are the target of specific content flows.
In this document these areas are called regions, and the content flows are
called named flows. Regions are based on the rectangular geometry of the
CSS box model. Elements in a named flow are taken out of the normal visual
formatting and rendered in a chain of regions.
<h3 id=named-flows-and-regions><span class=secno>1.1. </span>Named flows
and regions</h3>
<p>Consider the layout illustrated in figure 1.
<div class=figure> <img alt="multiple chained regions which should receive
content from a flow" src="images/regions-intro.svg" width=400>
<p class=caption>Layout requiring sophisticated content flow</p>
</div>
<p>The designer's intent is to position an image in region ‘<code
class=property>A</code>’ and to flow an article's text from region
‘<code class=css>1</code>’, to region ‘<code
class=css>2</code>’, ‘<code class=css>3</code>’ and
‘<code class=css>4</code>’.
<p>The following code snippet shows the content to flow between the regions
1, 2, 3 and 4.
<pre>
<div <em>id="article"</em>>
<h1>Introduction</h1>
<p>This is an example ...</p>
<h1>More Details</h1>
<p>This illustrates ...</p>
<p>Then, the example ...</p>
<p>Finally, this ...</p>
</div>
</pre>
<p>CSS layout facilities can position and size regions as needed. However,
there is no existing mechanism to associate the content with the regions
so that content flows as intended. Figure 2 shows an example of the
intended visual rendering of the content.
<div class=figure> <img alt="Sample rendering showing a single thread of
text flowing through a chain of regions"
src="images/regions-intro-rendering.png" width=450>
<p class=caption>Sample rendering for desired layout</p>
</div>
<p>Since the CSS Regions module is independent of the layout of regions and
the mechanism used to create them, the following assumes there is a CSS
selector for the regions and, for the purpose of the example, the
selectors for regions 1, 2, 3 and 4 are showing as
<<code>region1_sel</code>>, <<code>region2_sel</code>>,
<<code>region3_sel</code>> and <<code>region4_sel</code>>
respectively. Such a selector could be an id selector (e.g.,
<code>#region_1</code>) or a grid cell selector (e.g.,
<code>#myGrid::grid-cell([cell-name])</code>) if using the CSS Grid Layout
module, for example.
<div class=example>
<pre>
<style>
#article {
<strong>flow: article_flow;</strong>
}
<region1_sel>, <region2_sel>,
<region3_sel>, <region4_sel> {
<strong>content: from(article_flow);</strong>
}
</style>
</pre>
</div>
<p>The above stylesheet directs the <code>#article</code> element to a
named flow called ‘<code class=css>article_flow</code>’ by
setting the ‘<a href="#flow2"><code
class=property>flow</code></a>’ property. Then, content is "poured"
from that named flow into the desired regions by setting the regions'
‘<a href="#content-from"><code
class=property>content</code></a>’ property to
<code>from(article_flow)</code>.
<h3 id=region-styling><span class=secno>1.2. </span>Regions Styling</h3>
<p>Region styling allows content to be styled depending on the region it
flows into. It is a form of context-based styling, similar to <a
href="#CSSMEDIAQUERIES">Media Queries</a> <a href="#MEDIAQ"
rel=biblioentry>[MEDIAQ]<!--{{MEDIAQ}}--></a> which enable or disable
selectors depending on the rendering context. With region styling,
additional selectors may apply depending on the region into which content
flows.
<p>In our example, the designer wants to make text that falls into region 1
larger, bold and dark blue. In addition, <h1> headers should be
run-ins and crimson.
<p>This design can be expressed with region styling as shown below.
<div class=example>
<pre>
<style>
/*
* Default article styling.
*/
#article {
color:#777;
text-align: justify;
}
#article h1 {
border-left: 1px solid #777;
padding-left: 2ex;
}
/*
* Additional styling to apply to content when it falls into
* region_1
*/
<strong>@region_style <region1_sel> {</strong>
#article {
font-weight: bold;
color: #0C3D5F;
font-size: larger;
}
#article h1 {
color: crimson;
display: run-in;
border: none;
padding: 0px;
}
<strong>}</strong>
</style>
</pre>
</div>
<p>The ‘<code class=css>@region_style</code>’ rule for region 1
limits its selectors to content flowing into region 1. The following
figure shows how the rendering changes if we do not increase the font size
nor make it bold for content flowing into region 1. As more content can be
fitted, more content is subject to the contextual selectors, resulting in
more dark blue text into region 1.
<div class=figure> <img alt="Illustrate how changing region styling affects
the flow of content." src="images/region-styling.png" width=450>
<p class=caption>Different rendering with a different region styling</p>
</div>
<h2 id=css-regions-model><span class=secno>2. </span>CSS Regions Model</h2>
<h3 id=named-flows><span class=secno>2.1. </span>Named flows</h3>
<p>In the <a href="http://www.w3.org/TR/CSS21/visuren.html">CSS formatting
model</a>, elements can be in the <a href="#normal-flow-def"><em>normal
flow</em></a> or out of the <a href="#normal-flow-def"><em>(normal)
flow</em></a>. Boxes generated by elements in the normal flow are subject
to their container box's normal layout scheme. Boxes generated by elements
out of the normal flow are subject to a different layout scheme. For
example, absolutely positioned elements are subject to absolute
positioning into their <a
href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details">containing
block</a>. This can be described by saying that the absolutely positioned
elements are part of a special flow (called ‘<a
href="#positioned-flow-def"><code class=css>positioned
flow</code></a>’) which is subject to a special layout by its
container box (i.e., its container box positions it into the containing
block's box).
<p>
<p>In both cases, there is a notion of flow containing a sequence of
elements and there is a notion of <a
href="http://www.w3.org/Style/Group/css2-src/visuren.html#block-boxes">(block)
container box</a> into which the elements flow.
<p>
<p>The CSS Regions module generalizes the concept of flow by adding the
concept of a <em>named flow</em>. This module lets authors explicitly
place elements into a <em>named flow</em>.
<p>
<p>With this model, all elements are moved to a flow as part of the visual
formatting. That flow may be the normal flow, a named flow or a positioned
flow, for example. A flow gets formatted visually when associated with one
or several elements' container box(es). When an flow is associated with
container boxes, the boxes generated by the flow's elements are laid out
according to the container box's layout scheme and the flow is subject to
the <a href="#flow-breaking-rules">‘<code class=css>flow breaking
rules</code>’</a> described below.
<p>A container's layout scheme is the strategy used by a container to
position the boxes generated by its children and itself. Examples are the
normal layout (block and inline formatting) (<a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{CSS21}}--></a>), table layout (<a
href="#CSS21" rel=biblioentry>[CSS21]<!--{{CSS21}}--></a>), the
multi-column layout (<a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>) or the grid layout (<a
href="#CSS3-GRID-LAYOUT"
rel=biblioentry>[CSS3-GRID-LAYOUT]<!--{{CSS3-GRID-LAYOUT}}--></a>).
<h3 id=regions><span class=secno>2.2. </span>Regions</h3>
<p class=index id=region title=region>A region is an element that generates
a <a href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">block
container box</a> and has an associated <em>named flow</em> (see the
‘<a href="#content-from"><code
class=property>content</code></a>’ property).
<div class=issue> Could inline elements also be regions?</div>
<h3 id=flow-breaking-rules><span class=secno>2.3. </span>Flow breaking
rules</h3>
<p>This section describes how container boxes consume content from a flow.
The previous sections described how a flow may be referenced by one or
more regions. The regions are the flow consumers and are ordered in a
chain (see the ‘<a href="#content-order"><code
class=property>content-order</code></a>’ property). The current flow
consumer is initially the first one in the chain.
<p>
<p><strong>Positioning recursion</strong> -- while there are remaining
boxes in the flow, the current flow consumer is allowed to take more boxes
from the flow and position them. If the consumer is unable to position
additional boxes without overflowing, then one of two things happen:
<ol>
<li>If the flow consumer is the last in the chain, then it should proceed
to the end of the flow and position all remaining generated boxes, even
if they overflow.
<li>Otherwise, the next flow consumer becomes the current one and a new
iteration of the positioning recursion starts.
</ol>
<div class=issue> The above describes the simple case. It should explain
how breaks influence this recursion. It should also discuss how boxes are
split in general.</div>
<div class=issue> Should the model provide a way to <a
href="http://www.w3.org/TR/css3-multicol/#column-fill">balance</a>
regions, as in the <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a> module?</div>
<div class=issue> Is there a way to allow regions to be generated when
content that does not fit into the last region remains. This would be
analogous to the way the additional columns are generated when a
multi-column box <a
href="http://www.w3.org/TR/css3-multicol/#pagination-and-overflow-outside-multicol">
overflows</a> (see <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>).</div>
<h3 id=formatting-model-considerations><span class=secno>2.4. </span>The
Visual Formatting Model and Flows</h3>
<p>This section describes the flows to which elements formatted according
to the CSS <a href="http://www.w3.org/TR/CSS21/visuren.html">Visual
Formatting Model</a> and other layout modules (such as Multi-Column Layout
<a href="#CSS3COL" rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>) belong
to.
<p>In particular, this section describes the ‘<a
href="#generated-flow-def"><code class=css>generated
flow</code></a>’ where generated content of pseudo-elements is
placed and several <dfn id=auto-flow title="auto flows">‘<code
class=css>auto flows</code>’</dfn> where children of content
elements are automatically placed.
<h4 id=normal-flow><span class=secno>2.4.1. </span>Normal flow</h4>
<p>In the CSS formatting model, elements are by default placed in the <dfn
id=normal-flow-def>normal flow</dfn> of their container. Also by default,
a container element gets its content from its <a
href="#normal-flow-def"><em>normal flow</em></a>. This means that by
default, a container element will visually format its children elements
and will be the only container associated with its normal flow.
<p>Note that floats and relatively positioned elements, in this model, are
part of the same flow of content and flow into the same container but are
positioned in different ways.
<p>The <a href="#normal-flow-def"><em>normal flow</em></a> is one of the <a
href="#auto-flow"><em>auto flows</em></a>.
<h4 id=positioned-flow><span class=secno>2.4.2. </span>Positioned flow</h4>
<p>An absolutely positioned element is placed into the <dfn
id=positioned-flow-def>positioned flow</dfn> of its container. The
container positions this element into its <em>containing block</em>.
<p>If a container has children in the <a href="#normal-flow-def"><em>normal
flow</em></a> and in the <a href="#positioned-flow-def"><em>positioned
flow</em></a>, it applies different positioning schemes to each flow.
<p>The <a href="#positioned-flow-def"><em>positioned flow</em></a> is one
of the <a href="#auto-flow"><em>auto flows</em></a>.
<h4 id=column-flow><span class=secno>2.4.3. </span>Column flow</h4>
<p>Children of the multi-column element are placed in the element's <dfn
id=column-flow-def>column flow</dfn>. The column boxes are then implicitly
associated with the element's ‘<a href="#column-flow-def"><code
class=css>column flow</code></a>’. In this model, multiple regions
(column boxes) get their content from a single flow (the element's
‘<a href="#column-flow-def"><code class=css>column
flow</code></a>’, which is the content of the element).
<p>The <a href="#column-flow-def"><em>column flow</em></a> is one of the <a
href="#auto-flow"><em>auto flows</em></a>.
<div class=issue> Need to add a <dfn id=grid-cell-flow>grid cell flow</dfn>
section.</div>
<h4 id=generated-flow><span class=secno>2.4.4. </span>Generated flow</h4>
<p>In the CSS formatting model, when the <code>::before</code> or
<code>::after</code> pseudo-elements have their content property set to
one of <code><string></code>, <code><uri></code>,
<code><counter></code>, <code>attr(<identifier>)</code>,
<code>open-quote</code>, <code>close-quote</code>,
<code>no-open-quote</code> or <code>no-close-quote</code>, they create a
<dfn id=generated-flow-def>generated flow</dfn> which they format
visually.
<h3 id=relation-to-document-events><span class=secno>2.5. </span>Relation
to document events</h3>
<p>The CSS Region module does not alter in any way the normal processing of
events in the document tree. In particular, if an event occurs on an
element that is part of a named flow, the <a
href="http://www.w3.org/TR/DOM-Level-3-Events/#dom-event-architecture">event's
bubble and capture phases</a> happen following the document tree order.
<h2 id=regions-properties><span class=secno>3. </span>Properties and Rules</h2>
<p>The main CSS Regions module properties are the ‘flow’ and ‘<a
href="#content-from"><code class=property>content</code></a>’
properties. The ‘flow’ property is places an element into a specific
named flow or lets the <a href=auto-flows>automatic flow assignment</a>
take place. The ‘content’ property binds a region with a flow. When
multiple regions are bound to the same flow, the ‘<a
href="#content-order"><code class=property>content-order</code></a>’
property determines the order in which content flows into the sequence of
regions. This sequences of regions is called a <dfn
id=chain-of-regions>chain of regions</dfn>.
<p>
<p>The way in which the content is broken into segments that fit in a
region can be controlled by the “break” properties. Finally, styling
that is unique to the region can be specified by ‘region-style’ rules.
<h3 id=the-flow-property><span class=secno>3.1. </span>The ‘<a
href="#flow2"><code class=property>flow</code></a>’ property</h3>
<p>The ‘flow’ property places an element into a named flow or
automatically places it in the appropriate flow (see the <a
href="#formatting-model-considerations">Visual Formatting Model and
Flows</a> section). Elements that belong to the same flow are laid out in
the regions associated with that flow.
<table class=propdef summary="flow property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=flow2>flow</dfn>
<tr>
<th>Value:
<td><name>
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>any element
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<dl>
<dt>auto
<dd>The element is automatically moved to the appropriate flow according
to the <a href="#formatting_model_considerations">Visual Formatting Model
and Flows</a> definitions.
<dt><name>
<dd>The element is placed (appended) to the flow with that name. The
element is said to have a <dfn id=specified-flow>specified flow</dfn>.
</dl>
<p>A named flow needs to be associated with one or more regions for its
elements to be visually formatted. If no region is associated with a given
named flow, the elements in the named flow are not rendered: they do not
generate boxes and are not displayed.
<p>The children of an element with a specified flow may themselves have a
specified flow.
<p>If an element has a the same specified flow value as one of its
ancestors, it is moved out of its parent's normal flow and becomes a
sibling of it's ancestor for the purpose of layout in the regions taking
content from this flow.
<p>The ‘<a href="#flow2"><code class=property>flow</code></a>’
property does not affect the CSS cascade and inheritance for the elements
on which it is specified. The flow property affects the visual formatting
of elements associated to a named flow and of regions getting their
content from a named flow.
<p>The containing block for absolutely positioned descendants of an element
with a specified flow is the region into which the element is rendered.
<p>All the elements participating inside a named flow are rendered as
children of an anonymous block that spans across all the regions
associated with the specified named flow. The elements flowed inside the
same named flow are taken in document order.
<h3 id=the-content-property><span class=secno>3.2. </span>The ‘<a
href="#content-from"><code class=property>content</code></a>’
property</h3>
<p>This specification extends the definition of the ‘<a
href="#content-from"><code class=property>content</code></a>’
property and makes it applicable to all block elements and
pseudo-elements.
<table class=propdef summary="content property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=content-from>content</dfn>
<tr>
<th>Value:
<td>normal | none | from(<name>)| [ <string> | <uri> |
<counter> | attr(<identifier>) | open-quote | close-quote |
no-open-quote | no-close-quote ]+ | inherit
<tr>
<th>Initial:
<td>normal
<tr>
<th>Applies to:
<td>any block element
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<dl>
<dt><a id=x9 name=x9><span class=index-inst id=none
title=none><strong>none</strong></span></a>
<dd>For <code>::before</code> and <code>::after</code> pseudo-elements,
the pseudo-element is not generated. For other elements, the element will
not get any content for its visual formatting. If the children of the
element are not directed to a flow referenced by another region, then
they are not visually formatted. An element with its value set to
‘<code class=property>none</code>’ is said to be <dfn
id=disconnected>disconnected</dfn>
<dt><strong>normal</strong>
<dd>Computes to ‘<code class=property>none</code>’ for the
<code>::before</code> and <code>::after</code> pseudo-elements. For other
elements, the element uses the flow assigned to its children following
the <a href=auto-flows>automatic flow assignment for the Visual
Formatting Model..</a>
<dt><strong><string></strong>
<dd>Text content (see the section on <a
href="syndata.html#strings">strings</a>).
<dt><strong><uri></strong>
<dd>The value is a URI that designates an external resource (such as an
image). If the user agent cannot display the resource it must either
leave it out as if it were not specified or display some indication that
the resource cannot be displayed.
<dt><strong><counter></strong>
<dd><a href="syndata.html#counter">Counters</a> may be specified with two
different functions: ‘<code class=css>counter()</code>’ or
‘<code class=css>counters()</code>’. The former has two
forms: ‘<code class=css>counter(<var>name</var>)</code>’ or
‘<code class=css>counter(<var>name</var>,
<var>style</var>)</code>’. The generated text is the value of the
innermost counter of the given name in scope at this pseudo-element; it
is formatted in the indicated <a href="#counter-styles">style</a>
(‘<code class=property>decimal</code>’ by default). The
latter function also has two forms: ‘<code
class=css>counters(<var>name</var>, <var>string</var>)</code>’ or
‘<code class=css>counters(<var>name</var>, <var>string</var>,
<var>style</var>)</code>’. The generated text is the value of all
counters with the given name in scope at this pseudo-element, from
outermost to innermost separated by the specified string. The counters
are rendered in the indicated <a href="#counter-styles">style</a>
(‘<code class=property>decimal</code>’ by default). See the
section on <a href="#counters">automatic counters and numbering</a> for
more information. The name must not be ‘<code
class=property>none</code>’, ‘<code
class=property>inherit</code>’ or ‘<code
class=property>initial</code>’. Such a name causes the declaration
to be ignored.
<dt><strong>open-quote</strong> and <strong>close-quote</strong>
<dd>These values are replaced by the appropriate string from the <a
class=noxref
href="http://www.w3.org/TR/CSS21/generate.html#propdef-quotes"><span
class=propinst-quotes><strong>‘<code
class=property>quotes</code>’</strong></span></a> property.
<dt><strong>no-open-quote</strong> and <strong>no-close-quote</strong>
<dd>Introduces no content, but increments (decrements) the level of
nesting for quotes.
<dt><strong>attr(X)</strong>
<dd>This function returns as a string the value of attribute X for the
subject of the selector. The string is not parsed by the CSS processor.
If the subject of the selector does not have an attribute X, an empty
string is returned. The case-sensitivity of attribute names depends on
the document language.
<dt><dfn id=from-name>from(<name>)</dfn>
<dd>The element will visually format the available elements in the named
flow with name <name>. If there is no flow with name <name>,
then the element is disconnected and does not format any children
visually. Multiple elements may be associated with the same named flow.
See the ‘<a href="#content-order"><code
class=property>content-order</code></a>’ property discussion to
understand how content segments are associated with different regions.
</dl>
<div class=issue>
<p>Should we consider adding the ability to do the following:</p>
<ul>
<li>Support repeatable content. For example, have a repeatable heading at
the start of each region where content flows.
<li>Support flow breaking marks. It might be very useful to support a
<em>mark</em> (such as <code>...</code>) at the region breaking points
to indicate that content has been broken out and is continuing on a
different region.
</ul>
</div>
<div class=issue> Should the ‘<a href="#content-from"><code
class=property>content</code></a>’ property be limited to block
elements or should it be allowed on all elements?</div>
<h3 id=the-content-order-property><span class=secno>3.3. </span>The
‘<a href="#content-order"><code
class=property>content-order</code></a>’ property</h3>
<p>Defines the ordering of the chain of regions into which content flows.
If region A and region B are in the same chain of regions and the
‘content-order’ of region A is lower than that of region B, then
region A will precede region B in that chain: content will flow into
region A before it flows into region B.
<table class=propdef summary="content-order property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=content-order>content-order</dfn>
<tr>
<th>Value:
<td><float>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td>any block container
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<dl>
<dt><float>
<dd>Specifies the region's priority in the chain it belongs to, i.e.., the
chain of regions associated with the same content flow. Negative values
are allowed.
</dl>
<p>If two or more regions with the same ‘<code class=css>from(
<name>)</code>’ value for their ‘<a
href="#content-from"><code class=property>content</code></a>’
property, they are first sorted according to their ‘<a
href="#content-order"><code class=property>content-order</code></a>’
value. If multiple regions in have the same ‘<a
href="#content-order"><code class=property>content-order</code></a>’
value, they are sorted according to the document order.
<div class=issue> CSS Modules should define the document order for pseudo
elements. For example, the [CSSGRID] specification should define the
document order for the ‘<code class=css>::grid-cell</code>’
pseudo elements (e.g., row-major sorting or column major sorting of
cells).</div>
<h3 id=region-flow-break-properties-break-befor><span class=secno>3.4.
</span>Region flow break properties: ‘<a href="#break-before"><code
class=property>break-before</code></a>’, ‘<a
href="#break-after"><code class=property>break-after</code></a>’,
‘<a href="#break-inside"><code
class=property>break-inside</code></a>’</h3>
<p>When content is laid out in multiple regions, the user agent must
determine where content breaks occur. The problem of breaking content into
segments 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 named flow to be visually formatted in the following
region, in the order defined by the ‘<a href="#content-order"><code
class=property>content-order</code></a>’ computed values. Note that
there is no region break in the last region associated to a named flow.
<p>The following extends the ‘<a href="#break-before"><code
class=property>break-before</code></a>’, ‘<a
href="#break-after"><code class=property>break-after</code></a>’ and
‘<a href="#break-inside"><code
class=property>break-inside</code></a>’ properties from the <a
href="#CSS3COL" rel=biblioentry>[CSS3COL]<!--{{!CSS3COL}}--></a>
specification to account for regions. The additional values are described
below.
<table class=propdef summary="break-before property definition">
<tbody>
<tr>