-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.src.html
More file actions
executable file
·2842 lines (2342 loc) · 111 KB
/
Overview.src.html
File metadata and controls
executable file
·2842 lines (2342 loc) · 111 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 http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Regions Module Level 3</title>
<link rel="stylesheet" type="text/css" href="../shared/style/default.css">
<script src='http://test.csswg.org/harness/annotate.js#CSS3-REGIONS_DEV' type='text/javascript' defer></script>
<style type="text/css">
#region-style-example p, #region-style-example pre {
clear: both;
}
#region_styling_illustration {
margin: 0px auto;
width: 70ex;
}
</style>
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-ED.css">
<link rel="stylesheet" type="text/css"
href="../shared/style/issues.css">
<link id="st" href="../shared/style/alternate-spec-style.css" rel="stylesheet"
type="text/css" title="alternate spec style">
</head>
<body>
<div class="head" id="div-head">
<p><a href="http://www.w3.org/"><img id="mobile-logo" alt="W3C" height="53" 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 id="logo" 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">[LONGSTATUS]
[DATE]</h2>
<dl>
<dt>This version:</dt>
<dd><a href=
"[VERSION]">http://dev.w3.org/csswg/css3-regions</a></dd>
<dt>Latest version:</dt>
<dd><a href=
"http://www.w3.org/TR/css3-regions/">http://www.w3.org/TR/css3-regions/</a></dd>
<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2011/WD-css3-regions-20111129/">http://www.w3.org/TR/2011/WD-css3-regions-20111129/</a></dd>
<dt>Editors:</dt>
<dd class="vcard"><span class="fn">Vincent Hardy</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">vhardy@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Rossen Atanassov</span>,
<span class="org">Microsoft Corporation</span>, <span class=
"email">ratan@microsoft.com</span></dd>
<dd class="vcard"><span class="fn">Alan Stearns</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">stearns@adobe.com</span></dd>
<dt>Authors and former editors:</dt>
<dd class="vcard"><span class="fn">Alex Mogilevsky</span>,
<span class="org">Microsoft Corporation</span>, <span class=
"email">alexmog@microsoft.com</span></dd>
<dt>Issues List:</dt>
<dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&component=Regions&resolution=---">Bugzilla Bugs for CSS regions</a></dd>
<dt>Feedback:
<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 rel="discussion" href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)</dd>
</dl><!--begin-copyright--><!--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 [[CSS3COL]] or the Grid Layout Module
[[CSS3-GRID-LAYOUT]] to position the regions where content flows.</p>
<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>
<!--status-->
<p>This draft is related to the drafts about Multi-column Layout
[[CSS3COL]], Grid Layout [[CSS3GRID]], Flexible Box Layout
[[CSS3-FLEXBOX]], and Template Layout [[CSS3LAYOUT]].</p>
<h2 class="no-num no-toc" id="table-of-contents">Table of contents</h2>
<!--begin-toc--><!--end-toc-->
<h2 id="introduction">Introduction</h2>
<p><em>This section is non-normative.</em></p>
<p>Displaying the complex layouts
of a typical magazine, newspaper, or textbook on the web
requires capabilities beyond those available in existing CSS modules.
Dynamic magazine layout in particular requires flexibility
in placement of boxes for content flows.
This is the purpose of the CSS regions module.</p>
<div class="issue-marker" data-bug_id="15733" data-bug_status="NEW">
<a href=
"https://www.w3.org/Bugs/Public/show_bug.cgi?id=15733">Issue-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>For more complex layouts,
content needs to flow from one area of the page to the next
without limitation on the areas' sizes and positions.
These arbitrary areas are the target of specific content flows
which this document calls <span>named flows</span>.
Each <span>named flow</span> can be associated
with a set of CSS Regions called a region chain.
CSS Regions are based on the rectangular geometry
of the CSS box model.
Content in a <span>named flow</span>
is taken out of the normal visual formatting
and rendered in a chain of CSS Regions.</p>
<h3 id="named-flows-and-regions">Named flows and region chains</h3>
<p>Consider the layout illustrated in figure 1.</p>
<div class="figure">
<img src="images/intro-example-layout.svg" width="400" alt=
"multiple chained regions which should receive content from a flow">
<p class="caption">Layout requiring sophisticated content flow</p>
</div>
<p>The designer's intent is
to position an image in box 'A'
and to flow an article's content
from box '1' through boxes '2', '3' and '4'.
Note that the second box should have two columns,
and the image is not contained in the article.
Box '4' should auto-size to render
the remainder of the article content
that did not fit in the earlier boxes.</p>
<p>Figure 2 shows an example
of the intended visual rendering
of the content.</p>
<div class="figure">
<img src="images/regions-intro-rendering.png" width="450" alt=
"Sample rendering showing a single thread of text flowing through a chain of regions">
<p class="caption">Sample rendering for desired layout</p>
</div>
<p>There is no existing mechanism in CSS
to associate the content with these boxes
arranged in this manner
so that content flows as intended.
The CSS regions module properties provide that mechanism.</p>
<p>The following example illustrates
how an <code><article></code> element
is placed in a <span>named flow</span>
and how boxes marked with 'region1', 'region2', 'region3' and 'region4' IDs
become CSS Regions that consume the 'article-flow' content.</p>
<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 'article-flow' value on the 'flow-into' property
directs the <code>article</code> element
to the 'article-flow' <span>named flow</span>.
Setting the 'flow-from' property on block containers
to 'article-flow' makes them CSS Regions
and associates the resulting region chain
with the <span>named flow</span>:
the flow is ''poured''
into the region chain.</p>
<p>See <a href="#intro-example-code">Appendix A</a>
for sample code using grid layout
and custom elements
that implements this example</p>
<div class="issue-marker" data-bug_id="16858" data-bug_status="ASSIGNED">
<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16858">Issue-16858</a>
<div class="issue-details">
<p class="short-desc">Should creation of regions from elements be disallowed?</p>
</div>
</div>
<div class="note"><span class="note-prefix">Note </span>
<p><strong>HTML Templates in example code</strong></p>
<p>All of the examples use
<a href="https://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html#custom-element-section">Custom Elements</a>
and
<a href="https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html">HTML Templates</a>
to contain the elements
used to create CSS Regions.
This is meant to show one way
of separating content markup from layout.
In each example,
the <code>body</code> element becomes a custom element
and a copy of the template gets inserted
into the <code>body</code> element's
<a href="http://www.w3.org/TR/shadow-dom/">Shadow DOM</a>.
</div>
<div class="note"><span class="note-prefix">Note </span>
<p><strong>CSS Regions are independent from layout</strong></p>
<p>Any of the CSS layout facilities can be used
to create, position and size boxes that can become CSS Regions.
For instance,
the code in <a href="#intro-example-code">Appendix A</a>
uses a grid layout [[CSS3-GRID-LAYOUT]] as an example.
This example could use
a flexible box layout [[CSS3-FLEXBOX]] instead.</p>
<p>The CSS regions specification does not
define a layout mechanism
and is meant to integrate
with existing and future CSS layout facilities.</p>
</div>
<div class="note"><span class="note-prefix">Note </span>
<p><strong>CSS Regions do not have to be elements</strong></p>
<p>The CSS regions module is independent
of the layout of boxes and
the mechanisms used to create them.
<p>For simplicity,
our example code in <a href="#intro-example-code">Appendix A</a>
uses 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 [[CSS3-PAGE-TEMPLATE]].</p>
<p>The only requirement
for box to become a CSS Region
is that the 'flow-from' property applies to the box. </p>
</div>
<h3 id="region-styling">CSS Region names and styling</h3>
<div class="issue-marker" data-bug_id="16859" data-bug_status="NEW">
<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16859">Issue-16859</a>
<div class="issue-details">
<p class="short-desc">Reconsider using @rule for region styling</p>
</div>
</div>
<p>Content can be styled depending on
the CSS Region it flows into.
It is an extension
of pseudo-element styling such as
<a href="http://www.w3.org/TR/css3-selectors/#first-line">
<code class="css">::first-line</code>
</a>
which applies a particular style
to a fragment of content.
With CSS Region styling,
additional selectors may apply
depending on the CSS Region
into which content flows.</p>
<p>In our example,
the designer wants to make
text flowing into #region1
dark blue and bold.</p>
<p>This design can be expressed as shown below.</p>
<div class="example">
<pre>
<style>
@region #region1 {
p {
color: #0C3D5F;
font-weight: bold;
}
</style></pre>
</div>
<p>The <code class="css">@region #region1</code> rule
limits its selectors to content
flowing into <code class="css">#region1</code>.
The following figure shows how
the rendering changes
if we apply styling specific to <code>#region1</code>.
Note how less text fits into this box
now that the 'font-weight' is
bold instead of normal.</p>
<div class="figure">
<img src="images/region-styling.png" width="450" alt=
"Illustrate how changing region styling affects the flow of content.">
<p class="caption">Different rendering with a different region
styling</p>
</div>
<h2 id="css-regions-concepts">CSS regions concepts</h2>
<h3 id="regions">Regions</h3>
<p id="region">
A <dfn title="region">CSS Region</dfn>
is a block container
that has an associated
<em><span>named flow</span></em>
(see the 'flow-from' property).</p>
<h3 id="region-chain">Region chain</h3>
<p>A <dfn>region chain</dfn> is the sequence of regions that are associated with
a <span>named flow</span>. <span title="region">CSS Regions</span> in a
region chain receive content from the
named flow following their order in the chain. <span title="region">CSS Regions</span> are organized
into a <span title="region-chain">region chain</span>
according to the document order.</p>
<h3 id="named-flow">Named flows</h3>
<p>A <dfn>named flow</dfn> is the ordered sequence of content
associated with a flow with a given identifier.
Contents in a <span>named flow</span> are ordered
according to the document order.</p>
<p>Content is placed into a <span>named flow</span>
with the 'flow-into' property.
The content in a <span>named flow</span> is laid out
in the <span title="region-chain">region chain</span>
that is associated with this <span>named flow</span>
using the 'flow-from' property.
</p>
<p>Content from a <span>named flow</span>
is broken up between regions
according to the regions flow breaking rules.</p>
<p>A <span>named flow</span> is created when
some content is moved
into the flow with the given identifier
or when at least one CSS Region
requests content from that flow.</p>
<h3 id="regions-flow-breaking-rules">Regions flow breaking rules</h3>
<p>Breaking a <span>named flow</span> across a region chain
is similar to breaking a document's content across pages
(see [[CSS3PAGE]])
or a multi-column element's content across column boxes
(see [[CSS3COL]]).
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 <span>named flow</span> content
whose dynamic generation is not in the scope
of this specification.</p>
<p>Each CSS Region in turn
consumes content from its associated <span>named flow</span>.
The <span>named flow</span> content is positioned
in the current region
until a natural or forced region break occurs,
at which point the next region
in the <span title="region-chain">region chain</span>
becomes the <span title="current-region">current region</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 'region-fragment' property
on the last <span>region</span> in the chain.</p>
<p>The CSS regions module follows
the fragmentation rules defined
in the CSS Fragmentation Module Level 3
(see [[!CSS3-BREAK]]).</p>
<h2 id="properties-and-rules">Properties and rules</h2>
<h3 id="the-flow-into-property">The 'flow-into' property</h3>
<div class="issue-marker wrapper">
<div class="issue-marker" data-bug_id="16527" data-bug_status="ASSIGNED">
<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 <span>named flow</span>.
Content that belongs to the same flow
is laid out in the region chain
associated with that flow.</p>
<table class="propdef" summary="flow property definition">
<tr>
<th>Name:</th>
<td><dfn id="flow-into">flow-into</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>none | <ident> [element|content]?</td>
</tr>
<tr>
<th>Initial:</th>
<td>none</td>
</tr>
<tr>
<th>Applies to:</th>
<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>.</p></td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>as specified</td>
</tr>
</table>
<dl>
<dt>none</dt>
<dd>The element is not moved
to a <span>named flow</span>
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 'element' 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 'content' is present,
then only the element's contents
are placed into the named flow.
The element or content is said to have
a <dfn id="specified-flow">specified flow</dfn>.
The values 'none', 'inherit', 'default', 'auto' and 'initial'
are invalid flow names.</dd>
</dl>
<p>The 'flow-into' property does not affect
the CSS cascade and inheritance
for the elements on which it is specified.
The 'flow-into' property does not affect the
<a href="http://www.w3.org/TR/2012/WD-dom-20120405/#introduction-to-the-dom">DOM</a>
[[!DOM]] position of an element or its contents.
The 'flow-into' property affects
the visual formatting of elements or contents
placed into a <span>named flow</span>
and of the region chain laying out content
from a <span>named flow</span>.</p>
<p>A <span>named flow</span> needs to be associated
with a region chain
(one or more CSS regions)
for its content to be visually formatted.
If no region chain is associated
with a given <span>named flow</span>,
the content in the <span>named flow</span>
is not rendered:
it does not generate boxes
and is not displayed.</p>
<p>The children of an element or content
with a specified flow
may themselves have a specified flow.
If an element or content has
the same specified flow
as one of its ancestors,
it becomes the next sibling
of its closest ancestor
with the same specified flow.</p>
<p>Content in a <span>named flow</span>
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>
<p>The edges of the first CSS region in a region chain
associated with a <span>named flow</span>
establish the rectangle that is the
<a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing block</a>
used for absolutely positioned elements
in the <span>named flow</span>
which do not have an ancestor
with a 'position' of 'absolute', 'relative' or 'fixed'
(see [[!CSS21]]).
That first CSS region rectangle is used
as the containing block
instead of the initial containing block.
This does not affect
fixed position elements
in the <span>named flow</span> -
they are still positioned relative
to the viewport or page area even if
they have been redirected
to a named flow.</p>
<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.</p>
<div class="note"><span class="note-prefix">Note </span>
<p>The 'flow-into' 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 'table-content'
<span>named flow</span>.
However, the</p>
<pre>table > * {flow-into: table-content} ...</pre>
<p>selector will move all immediate children
of all table elements
into the ‘table-content’ <span>named flow</span>
(which may be useful as it will usually result,
if the immediate children are rows,
in merging rows of multiple tables),
but the</p>
<pre>table * {flow-into: table-content}</pre>
<p>selector will move all descendants
of table elements into the ‘table-content’ <span>named flow</span>,
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 <span>named flow</span>.
Having the descendants become siblings
in the <span>named flow</span>
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 'flow-into' property
to avoid unintended results.</p>
</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>
Then the 'span-content' named flow contents
will contain this:
<pre><span>one</span><span>two</span>
</pre>
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 id="the-flow-from-property">The 'flow-from' property</h3>
<p>The 'flow-from' property makes
a block container a region
and associates it with
a <span>named flow</span>.</p>
<table class="propdef" summary="flow-from property definition">
<tr>
<th>Name:</th>
<td><dfn id="flow-from">flow-from</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td><ident> | none | inherit</td>
</tr>
<tr>
<th>Initial:</th>
<td>none</td>
</tr>
<tr>
<th>Applies to:</th>
<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.</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>as specified</td>
</tr>
</table>
<dl>
<dt><strong>none</strong></dt>
<dd>The block container is not a <span title="region">region</span>.</dd>
<dt><strong><a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a></strong></dt>
<dd>
If the 'content' property computes
to something else than 'normal'
(or 'none' for a pseudo-element),
the block container does not become a <span>CSS Region</span>.
If the 'content' property computes to 'normal'
(or 'none' for a pseudo-element),
then the block container becomes a <span>CSS 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 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 <span>region chain</span>.
<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>A <span>CSS Region</span>’s document children
are not visually formatted
unless they are directed
to a <span>named flow</span>
with an associated <span>region chain</span>.</p>
<p>Block container pseudo-elements where
the value of 'flow-from' 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 'content' computes to 'none'
are generated as CSS Regions,
which is an update to the behavior
described in [[!CSS21]].</p>
<div class="note"><span class="note-prefix">Note </span>
<p>A block container becomes a <span>CSS Region</span>
when its 'flow-from' 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:</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 block container matching
the <code>.region</code> selector
is still associated with
that empty <span>named flow</span>
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>
<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 'flow-from' combined with those display values
does not result in a CSS Region.</p>
</div>
<p><span title="region">CSS Regions</span>
create a new
<a href="http://www.w3.org/TR/CSS2/visuren.html#z-index">stacking context</a>.
<span title="region">CSS Regions</span>
establish a new
<a href="http://www.w3.org/TR/CSS2/visuren.html#block-formatting">block formatting Context</a>.
Exclusions (see [[CSS3-EXCLUSIONS]])
potentially impact the content
laid out in region chains,
just as for non-regions.</p>
<div class="note"><span class="note-prefix">Note </span>
<p>With <span>region chains</span>,
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 <span>CSS Region</span> 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>
<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 <span>CSS Region</span>,
so each fragment of these elements
is rendered separately.</p>
</div>
<p>See the
<a href="#regions-visual-formatting-details">regions visual formatting details</a>
section for a description of how
'width' and 'height' values are resolved
for <span>CSS Region</span> boxes.</p>
<h4 id="circular-dependencies">Cycle Detection</h4>
<p><span>Named flows</span> containing elements
where the value of 'flow-from' 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 <span>named flow</span> containing <span>CSS Regions</span>
in its own <span>region chain</span>.
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>
<p>The dependency graph consists of edges such that:</p>
<ul>
<li>Every <span>named flow</span> depends on its elements
where the value of 'flow-from' 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 <span>named flow</span>
where the value of 'flow-from' computes to an
<a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#value-def-identifier"><ident></a>
depends on the <span>named flow</span> 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 'flow-from'
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 <span>CSS Regions</span>.</p>
<div class="note"><span class="note-prefix">Note </span>
<p>For example, styling like this:</p>
<pre>
#id {
flow-into: foolish;
flow-from: foolish;
}
</pre>
<p>would move the <code>#id</code> element to a 'foolish' <span>named flow</span>, and try to make the <code>#id</code> element a <span>CSS Region</span> for the 'foolish' <span>named flow</span>. The 'foolish' <span>named flow</span> would then contain its own region, creating a cycle. So the <code>#id</code> element does not become a <span>CSS Region</span>.
</div>
<h4 id="fragmenting-regions">Nested fragmentation contexts</h4>
<p>A <span>CSS Region</span> that contains
a fragment of a <span>named flow</span>
can itself be fragmented if it is nested
within a fragmentation context [[!CSS3-BREAK]],
such as when a layout
using a region chain is printed.
In these cases break opportunities
in the named flow fragment
contained by the <span>CSS Region</span>
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 <span>CSS Region</span>,
if that is desired.</p>
<p>A <span>CSS Region</span> 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>nested region context</dfn>,
which has an effect
on the <a href="#regions-visual-formatting-steps">Visual Formatting Steps</a>
described below.</p>
<h3 id="region-flow-break">Region flow break properties: 'break-before', 'break-after', 'break-inside'</h3>
<div class="note"><span class="note-prefix">Note </span>
<p>This section is also defined in [[!CSS3-BREAK]].
If that specification moves to last call
with the region values,
the section here can be replaced by a reference.</p>
</div>
<p>User agents laying out content in multiple regions must
determine where content breaks occur. The problem of breaking content into
fragments fitting in regions is similar to breaking content into pages or
columns.</p>
<p>Each break ends layout in the current region and causes remaining pieces
of content from the <span>named flow</span> to be visually formatted in the following
region in the region chain, if there is one.</p>
<p>The following extends the 'break-before', 'break-after' and
'break-inside' properties from the [[!CSS3COL]] specification to account
for regions. The additional values are described below.</p>
<table class="propdef" summary="break-before property definition">
<tr>
<td><em>Name:</em></td>
<td><dfn>break-before</dfn></td>
</tr>
<tr>
<td><em>Value:</em></td>
<td>auto | always | avoid | left | right | page | column | region |
avoid-page | avoid-column | avoid-region</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>auto</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>block-level elements</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>no</td>
</tr>
<tr>
<td><em>Percentages:</em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>