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
2448 lines (1889 loc) · 88 KB
/
Overview.html
File metadata and controls
2448 lines (1889 loc) · 88 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 lang=en>
<head profile="http://www.w3.org/2006/03/hcard"><meta
content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Regions Module Level 3</title>
<link href="../default.css" rel=stylesheet type="text/css">
<style type="text/css">
/* Alternate stylesheet fonts are here because in some browsers (Opera 11.5) */
/* The fonts are not applied if only loaded from the alternate stylesheet */
/* License font the following two fonts: fonts/Droid-Serif-fontfacekit/Google Android License.txt */
@import url(fonts/Droid-Serif-fontfacekit/stylesheet.css);
@import url(fonts/Droid-Sans-Mono-fontfacekit/stylesheet.css);
a.toggle {
position: fixed;
top: 0.5em;
right: 0.5em;
font-size: smaller;
color: gray;
opacity: 0.2;
}
a.toggle:hover {
opacity: 1;
color: #46A4E9;
}
.issue.resolved, .issue.stale, .issue.moved {
display: none;
}
#region-style-example p, #region-style-example pre {
clear: both;
}
#region_styling_illustration {
margin: 0px auto;
width: 70ex;
}
.big.note {
font-size: 1.2em;
line-height: 1.3em;
color: #2f2f2f;
}
#mobile-logo {
display: none;
}
@media screen and (min-width: 58em){
.issue-marker {
position: absolute;
width: 20ex;
margin-left: -22ex;
text-align: right;
}
}
@media screen and (max-width: 58em){
.issue-marker {
}
.issue-marker a:link {
padding-left: 0.5em;
}
}
.issue-marker {
background:#eee;
border:1px solid #ddd;
font-size: 1em;
}
.issue-marker a:link {
color: #c00;
background: none;
font-weight: normal;
padding-right: 0.5em;
}
.issue-details {
padding:0.5em;
font-size: 0.8em;
line-height: 1.5;
}
.issue-details p{
padding:0;
margin:0;
}
.issue-details .status{
background:#333;
color:white;
float:left;
padding:0.15em 0.8em;
font-size:0.8em;
margin-right:0.8em;
text-transform:uppercase;
}
</style>
<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="alternate spec style" type="text/css">
<!-- <script type="text/javascript" src="issue_tracker.js"></script> -->
<body>
<div class=head id=div-head>
<p><a href="http://www.w3.org/"><img alt=W3C height=53 id=mobile-logo
src="http://www.w3.org/2008/site/images/logo-w3c-mobile-lg" width=90></a>
<!--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 id=css-regions-module>CSS Regions Module Level 3</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 31 January
2012</h2>
<dl>
<dt>This version:
<dd><a
href="http://www.w3.org/TR/2012/ED-css3-regions-20120131/">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/TR/css3-regions/</a>
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2011/WD-css3-regions-20111129/">http://www.w3.org/TR/2011/WD-css3-regions-20111129/</a>
<dt>Issues:
<dd><a
href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&component=CSS%20Regions&resolution=---">Bugzilla
Bugs for CSS regions</a>
<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>
<dd class=vcard><span class=fn>Alex Mogilevsky</span>, <span
class=org>Microsoft</span>, <span
class=email>alexmog@microsoft.com</span>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2012 <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 are not necessarily contiguous in 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-of-this-document>Status of this
document</h2>
<p class="big note"><span class=note-prefix>Note </span>This document uses
an experimental style sheet. We welcome your feedback on the styles at <a
href="mailto:site-comments@w3.org">site-comments@w3.org</a>.</p>
<!--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-->
<p>This draft is related to the drafts about Multi-column Layout <a
href="#CSS3COL" rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>, Grid
Layout <a href="#CSS3GRID"
rel=biblioentry>[CSS3GRID]<!--{{CSS3GRID}}--></a>, Flexible Box Layout <a
href="#CSS3-FLEXBOX"
rel=biblioentry>[CSS3-FLEXBOX]<!--{{CSS3-FLEXBOX}}--></a>, and Template
Layout <a href="#CSS3LAYOUT"
rel=biblioentry>[CSS3LAYOUT]<!--{{CSS3LAYOUT}}--></a>.
<h2 class="no-num no-toc" id=table-of-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-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="#named-flow"><span class=secno>2.2. </span>Named flow</a>
<li><a href="#regions-flow-breaking-rules"><span class=secno>2.3.
</span>Regions flow breaking rules</a>
</ul>
<li><a href="#relation-to-document-events"><span class=secno>3.
</span>Relation to document events</a>
<li><a href="#properties-and-rules"><span class=secno>4. </span>Properties
and rules</a>
<ul class=toc>
<li><a href="#the-flow-into-property"><span class=secno>4.1. </span>The
‘<code class=property>flow-into</code>’ property</a>
<li><a href="#the-flow-from-property"><span class=secno>4.2. </span>The
‘<code class=property>flow-from</code>’ property</a>
<ul class=toc>
<li><a href="#auto-width-on-regions"><span class=secno>4.2.1.
</span>Auto width on regions</a>
<li><a href="#auto-height-on-regions"><span class=secno>4.2.2.
</span>Auto height on regions</a>
</ul>
<li><a href="#region-flow-break"><span class=secno>4.3. </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-overflow-property"><span class=secno>4.4.
</span>The region-overflow property</a>
<li><a href="#the-at-region-style-rule"><span class=secno>4.5.
</span>The @region rule</a>
</ul>
<li><a href="#pseudo_elements"><span class=secno>5.
</span>Pseudo-elements</a>
<ul class=toc>
<li><a href="#processing-model"><span class=secno>5.1. </span>Processing
model</a>
</ul>
<li><a href="#cssom_view_and_css_regions"><span class=secno>6.
</span>CSSOM view and CSS regions</a>
<ul class=toc>
<li><a href="#the-namedflow-interface"><span class=secno>6.1. </span>The
NamedFlow interface</a>
<li><a href="#extension-to-the-element-interface"><span class=secno>6.2.
</span>Extension to the Element interface</a>
<li><a href="#region-flow-layout-events"><span class=secno>6.3.
</span>Region flow layout events</a>
</ul>
<li><a href="#relation-to-other-specifications"><span class=secno>7.
</span>Relation to other specifications</a>
<li><a href="#usecases"><span class=secno>8. </span>Use Cases</a>
<li><a href="#conformance"><span class=secno>9. </span>Conformance</a>
<li><a href="#changes"><span class=secno>10. </span>Changes</a>
<ul class=toc>
<li><a href="#changes_from_June_09_2011"><span class=secno>10.1.
</span>Changes from November 29<sup>th</sup> 2011 version</a>
<li><a href="#changes_from_June_09_2011"><span class=secno>10.2.
</span>Changes from June 09<sup>th</sup> 2011 version</a>
</ul>
<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><em>This section is non-normative.</em>
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15159">Bug-15159</a>
<div class=issue-details>
<p class=short-desc>Add code samples to the CSS regions use cases page</p>
</div>
</div>
<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>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>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.
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15733">Bug-15733</a>
<div class=issue-details>
<p class=short-desc>Should the region specification define a mechanism to
create blocks that can be regions with CSS syntax?</p>
</div>
</div>
<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>
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15131">Bug-15131</a>
<div class=issue-details>
<p class=short-desc>Add layout to initial example</p>
</div>
</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>And the following snippet shows an example of elements that will be used
as regions.
<pre>
<div id="region1"></div>
<div id="region2"></div>
<div id="region3"></div>
<div id="region4"></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>The CSS regions module is independent of the layout of regions and the
mechanism used to create them. However, for simplicity, our example uses
elements as regions as shown in the previous code snippet.
<p>The following code example illustrates how the content of the
<code>article</code> element becomes a flow and how the areas ‘<code
class=css>region1</code>’, ‘<code
class=css>region2</code>’, ‘<code
class=css>region3</code>’ and ‘<code
class=css>region4</code>’ become regions that consume the
‘<code class=css>article_flow</code>’ content.
<div class=example>
<pre>
<style>
#article {
<strong>flow-into: article_flow;</strong>
}
#region1, #region2, #region3, #region4 {
<strong>flow-from: article_flow;</strong>
}
</style>
</pre>
</div>
<p>The ‘<code class=css>article_flow</code>’ value on the
‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property directs the
‘<code class=css>#article</code>’ element to the ‘<code
class=css>article_flow</code>’ named flow. Setting the elements'
‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ property to ‘<code
class=css>article_flow</code>’ on elements makes them regions and
associates these regions with the named flow: the flow is ‘<code
class=css>poured</code>’ into the desired regions.
<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 Media
Queries <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 flowing into region 1
larger, bold and dark blue. In addition, <code
class=html><h1></code> headers should be 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;
display: run-in;
}
/*
* Additional styling to apply to content when it falls into
* region1
*/
<strong>@region #region1 {</strong>
#article {
font-weight: bold;
color: #0C3D5F;
font-size: larger;
}
#article h1 {
color: crimson;
border: none;
padding: 0px;
}
<strong>}</strong>
</style>
</pre>
</div>
<p>The ‘<code class=css>@region</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-concepts><span class=secno>2. </span>CSS regions
concepts</h2>
<h3 id=regions><span class=secno>2.1. </span>Regions</h3>
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15186">Bug-15186</a>
<div class=issue-details>
<p class=short-desc>Is a mechanism to auto-generate regions necessary in
order to support reusable style sheets?</p>
</div>
</div>
<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 <a href="#named-flow0"><em>named
flow</em></a> (see the ‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ property).
<h3 id=named-flow><span class=secno>2.2. </span>Named flow</h3>
<p>A <dfn id=named-flow0>named flow</dfn> is the ordered sequence of
elements associated with a flow with a given identifier. Elements in a
named flow are ordered according to the document order.
<p>Elements are placed into a named flow with the ‘<a
href="#flow-into"><code class=property>flow-into</code></a>’
property. The elements in a named flow are laid out in the chain of
regions that are associated with this named flow. <span
title=region>Regions</span> are organized in to a <span
title=region-chain>region chain</span> according to the document order.
<p>Content from a named flow is broken up between regions according to the
regions flow breaking rules.
<h3 id=regions-flow-breaking-rules><span class=secno>2.3. </span>Regions
flow breaking rules</h3>
<p>Breaking a named flow across multiple regions is similar to breaking a
document's content across multiple pages (see <a href="#CSS3PAGE"
rel=biblioentry>[CSS3PAGE]<!--{{CSS3PAGE}}--></a>) or a multi-column
element's content across column boxes (see <a href="#CSS3COL"
rel=biblioentry>[CSS3COL]<!--{{CSS3COL}}--></a>). One difference is that
page boxes are generated based on the available content whereas regions
are a predefined set of recipient boxes for the named flow content.
<p><span title=region>Regions</span> are organized in to a <span
title=region-chain>region chain</span>.
<p>Each region in turn consumes content from its associated <a
href="#named-flow0">named flow</a>. The named flow content is positioned
in the <dfn id=current-region title=current-region>current region</dfn>
until a natural or forced region break occurs, at which point the <a
href="#current-region" title=current-region>current region</a> becomes the
next one in the <span title=region-chain>region chain</span>. If there are
no more <span>region</span>s in the region chain and there is still
content in the flow, the positioning of the remaining content is
controlled by the ‘<a href="#region-overflow"><code
class=property>region-overflow</code></a>’ property on the last
<span>region</span> in the chain.
<h2 id=relation-to-document-events><span class=secno>3. </span>Relation to
document events</h2>
<p>The CSS regions module does not alter 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=properties-and-rules><span class=secno>4. </span>Properties and
rules</h2>
<p><em>This section is normative.</em>
<h3 id=the-flow-into-property><span class=secno>4.1. </span>The ‘<a
href="#flow-into"><code class=property>flow-into</code></a>’
property</h3>
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15811">Bug-15811</a>
<div class=issue-details>
<p class=short-desc>Creating a named flow from external resource</p>
</div>
</div>
<p>The ‘flow-into’ property can place an element into a named flow.
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=flow-into>flow-into</dfn>
<tr>
<th>Value:
<td><ident> | none | inherit
<tr>
<th>Initial:
<td>none
<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>none
<dd>The element is not moved to a named flow and normal CSS processing
takes place.
<dt><a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a>
<dd>The element is taken out of its parent's flow and placed into the flow
with the name ‘<code class=css><ident></code>’. The
element is said to have a <dfn id=specified-flow>specified flow</dfn>.
The values ‘<code class=property>none</code>’, ‘<code
class=property>inherit</code>’, ‘<code
class=property>default</code>’, ‘<code
class=property>auto</code>’ and ‘<code
class=property>initial</code>’ are invalid flow names.
</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 the same specified flow as one of its ancestors, it
becomes a sibling of it's ancestor for the purpose of layout in the
regions laying out content from that flow.
<p>The ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property does not affect the
CSS cascade and inheritance for the elements on which it is specified. The
‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property affects the visual
formatting of elements placed into a named flow and of regions laying out
content from a named flow.
<p>The edges of the first region in a region chain associated with a named
flow establish the rectangle that is the initial containing block of the
named flow.
<p>The first region defines the <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.
<p>Elements in a named flow are sequenced in document order.
<div class=note><span class=note-prefix>Note </span>
<p>The ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property moves an element into
the flow and the interplay with selectors should be considered carefully.</p>
<p>For example,</p>
<pre>table {flow-into: table-content}</pre>
<p>will move all tables in the ‘<code
class=property>table-content</code>’ named flow. However, the</p>
<pre>table * {flow-into: table-content}</pre>
<p>selector will move all the descendants of table elements in the
‘<code class=property>table-content</code>’ named flow. This
will make all the descendants of table elements siblings in the named
flow. Having the descendants become siblings in the named flow results in
a different processing (see the <a
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/tables.html#anonymous-boxes">CSS
2.1‘<code class=css>s anonymous table objects</code></a>). This
note illustrates how authors must exercise caution when choosing a
particular selector for setting the ’flow-into' property to avoid
unintended results.</p>
</div>
<p>The ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ property does not apply to the
<code class=css>::first-line</code> and <code
class=css>::first-letter</code> pseudo-elements.
<p>The effect of ‘<a href="#flow-into"><code
class=property>flow-into</code></a>’ on generated content such as
<code class=css>::marker</code>, <code class=css>::before</code> and <code
class=css>::after</code> is undefined. This may change depending on
implementation feedback.
<h3 id=the-flow-from-property><span class=secno>4.2. </span>The ‘<a
href="#flow-from"><code class=property>flow-from</code></a>’
property</h3>
<p>The ‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ property makes an element a
region and associates it with a named flow.
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15191">Bug-15191</a>
<div class=issue-details>
<p class=short-desc>Should we allow multi-column elements to be regions?</p>
</div>
</div>
<table class=propdef summary="flow-from property definition">
<tbody>
<tr>
<th>Name:
<td><dfn id=flow-from>flow-from</dfn>
<tr>
<th>Value:
<td><ident> | none | inherit
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>Elements that generate a <a
href="http://www.w3.org/TR/CSS21/visuren.html#block-boxes">block
container box</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>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<dl>
<dt><strong>none</strong>
<dd>The element is not a <span title=region>region</span>.
<dt><strong><ident></strong>
<dd> If the ‘<code class=property>content</code>’ property
computes to something else than ‘<code
class=property>normal</code>’, the element does not become a
region. If the ‘<code class=property>content</code>’ property
computes to ‘<code class=property>normal</code>’, then the
element becomes a <span>region</span> and is ordered in a <span>region
chain</span> according to its document order. The content from the flow
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 segments</a> and
visually formatted in the <a
href="http://www.w3.org/TR/CSS21/visuren.html#principal-box">principal
boxes</a> of the regions in the region chain. If there is no flow with
name <ident>, then the element does not format any content
visually. <br>
Likewise, if the element is part of the flow with name <ident>,
then the element does not format any content visually.
</dl>
<p class=note><span class=note-prefix>Note </span>A region's document
children are not visually formatted unless they are directed to a named
flow referenced by one or more regions.
<div class=note><span class=note-prefix>Note </span>
<p>An element becomes a region when its ‘<a href="#flow-from"><code
class=property>flow-from</code></a>’ property is set to a valid
<ident> value, even if there is no content contributing to the
referenced flow. For example:</p>
<pre>
<style>
.article{
flow-into: thread;
}
.region{
flow-from: thread;
}
</style>
<html>
<body>
<div class=region>div content</div>
</body>
</html>
</pre>
There is no element matching the <code>.article</code> selector and
therefore no content in the <code>thread</code> flow. However, the element
matching the <code>.region</code> selector is still associated with that
empty named flow and, consequently, its children are not formatted
visually.</div>
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15189">Bug-15189</a>
<div class=issue-details>
<p class=short-desc>Should regions be non-breakable?</p>
</div>
</div>
<p><span title=region>Regions</span> create a new <a
href="http://www.w3.org/TR/CSS2/visuren.html#z-index">stacking
context</a>. <span title=region>Regions</span> establish a new <a
href="http://www.w3.org/TR/CSS2/visuren.html#block-formatting">block
formatting Context</a>.
<div class=note><span class=note-prefix>Note </span>
<p>With regions, an element may be split across multiple regions and these
regions 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 region
creates a new stacking context, it is clear that each region is rendered
separately and their rendering order follows the regular CSS rendering
model.</p>
</div>
<p> Floats or other exclusions (see <a href="#CSS3-EXCLUSIONS"
rel=biblioentry>[CSS3-EXCLUSIONS]<!--{{CSS3-EXCLUSIONS}}--></a>)
potentially impact the content laid out in regions, just as for
non-regions.
<div class=example>
<p>In the following example, the inline content coming from the <code
class=html>body_text</code> <a href="#named-flow0">named flow</a> wraps
around the <code class=html>#float</code> box.</p>
<pre>
<style>
#float {
float: left;
width: 100px;
height: 300px;
}
#region1, #region2 {
width: 200px;
height: 200px;
flow-from: body_text;
}
#content {
flow-into: body_text;
}
</style>
<div id="float"></div>
<div id="region1"></div>
<div id="region2"></div>
<div id="content"></div>
</pre>
</div>
<h4 id=auto-width-on-regions><span class=secno>4.2.1. </span>Auto width on
regions</h4>
<div class=issue-marker> <a
href="https://www.w3.org/Bugs/Public/show_bug.cgi?15741">Bug-15741</a>
<div class=issue-details>
<p class=short-desc>Regions intrinsic size</p>
</div>
</div>
<p>A computed value of ‘<code class=property>auto</code>’ for a
region's ‘<code class=property>width</code>’ property becomes
a used value calculated based on the region's <em>::before</em> and
<em>::after</em> generated content only.
<h4 id=auto-height-on-regions><span class=secno>4.2.2. </span>Auto height
on regions</h4>
<p>A computed value of ‘<code class=property>auto</code>’ for a
region's ‘<code class=property>height</code>’ property becomes
a used value calculated based on the region's <em>::before</em> and
<em>::after</em> generated content only.
<h3 id=region-flow-break><span class=secno>4.3. </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>User agents laying out content in multiple regions 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 region chain. Note that there is no region break in the last
region associated with a named flow.
<p>The following extends the ‘<a href="#break-before"><code