-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.html
More file actions
1118 lines (913 loc) · 68.9 KB
/
Overview.html
File metadata and controls
1118 lines (913 loc) · 68.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><html lang=en><head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Exclusions Module Level 1</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<script defer src=//test.csswg.org/harness/annotate.js#css-exclusions-1_dev/css-exclusions-1 type=text/javascript></script>
<style type=text/css>
.singleImgExample {
display: block;
margin: auto;
}
.example-table {
table-layout: fixed;
width: 100%;
}
.example-table tr td img {
width: 90%;
}
</style>
</head>
<body class=h-entry>
<div class=head>
<p data-fill-with=logo><a class=logo href=http://www.w3.org/>
<img alt=W3C height=48 src=https://www.w3.org/Icons/w3c_home width=72>
</a>
</p>
<h1 class="p-name no-ref" id=title>CSS Exclusions Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20141030>30 October 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-exclusions/>http://dev.w3.org/csswg/css-exclusions/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css3-exclusions/>http://www.w3.org/TR/css3-exclusions/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-css3-exclusions-20130528/ rel=previous>http://www.w3.org/TR/2013/WD-css3-exclusions-20130528/</a><dt>Feedback:<dd><span><a href="mailto:www-style@w3.org?subject=[css-exclusions] feedback">www-style@w3.org</a> with subject line “<kbd>[css-exclusions] <var>… message topic …</var></kbd>” (<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)</span><dt>Test Suite:<dd><a href=http://test.csswg.org/suites/css-exclusions-1_dev/nightly-unstable/>http://test.csswg.org/suites/css-exclusions-1_dev/nightly-unstable/</a><dd><span><a href=http://test.csswg.org/suites/css3-exclusions/nightly-unstable/>http://test.csswg.org/suites/css3-exclusions/nightly-unstable/</a></span><dt class=editor>Editors:<dd class=editor><div class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:ratan@microsoft.com>Rossen Atanassov</a> (<span class="p-org org">Microsoft</span>)</div><dd class=editor><div class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:vhardy@adobe.com>Vincent Hardy</a> (<span class="p-org org">Adobe</span>)</div><dd class=editor><div class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:astearns@adobe.com>Alan Stearns</a> (<span class="p-org org">Adobe</span>)</div><dt>Issues list:<dd><span><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Exclusions&resolution=---&cmdtype=doit">in Bugzilla</a></span></dl></div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id=abstract><span class=content>Abstract</span></h2>
<div class=p-summary data-fill-with=abstract><p>CSS Exclusions define arbitrary areas around which inline content (<a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a>) can flow. CSS Exclusions can be defined on any CSS block-level elements. CSS Exclusions extend the notion of content wrapping previously limited to floats.</p>
<a href=http://www.w3.org/TR/CSS/>CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</div>
<h2 class="no-num no-toc no-ref heading settled" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<p>
The (<a href=http://lists.w3.org/Archives/Public/www-style/>archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-exclusions%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href=http://www.w3.org/Mail/Request>instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-exclusions” in the subject,
preferably like this:
“[css-exclusions] <em>…summary of comment…</em>”
<p>
This document was produced by the <a href=http://www.w3.org/Style/CSS/members>CSS Working Group</a>
(part of the <a href=http://www.w3.org/Style/>Style Activity</a>).
<p>
This document was produced by a group operating under
the <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href=http://www.w3.org/2004/01/pp-impl/32061/status rel=disclosure>public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>
must disclose the information in accordance with <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.
<p>
This document is governed by the <a href=http://www.w3.org/2014/Process-20140801/>1 August 2014 W3C Process Document</a>.
</div>
<div data-fill-with=at-risk></div>
<h2 class="no-num no-toc no-ref heading settled" id=contents><span class=content>Table of Contents</span></h2>
<div data-fill-with=table-of-contents><ul class=toc><li><a href=#intro><span class=secno>1</span> <span class=content>
Introduction</span></a><li><a href=#terms><span class=secno>2</span> <span class=content>
Terminology</span></a><li><a href=#exclusions><span class=secno>3</span> <span class=content>
Exclusions</span></a><ul class=toc><li><a href=#declaring-exclusions><span class=secno>3.1</span> <span class=content>
Declaring exclusions</span></a><ul class=toc><li><a href=#wrap-flow-property><span class=secno>3.1.1</span> <span class=content>
The <span class=property data-link-type=propdesc title=wrap-flow>wrap-flow</span> property</span></a></ul><li><a href=#scope-and-effect-of-exclusions><span class=secno>3.2</span> <span class=content>
Scope and effect of exclusions</span></a><li><a href=#propagation-of-exclusions><span class=secno>3.3</span> <span class=content>
Propagation of Exclusions</span></a><ul class=toc><li><a href=#wrap-through-property><span class=secno>3.3.1</span> <span class=content>
The <span class=property data-link-type=propdesc title=wrap-through>wrap-through</span> Property</span></a></ul><li><a href=#exclusions-order><span class=secno>3.4</span> <span class=content>
Exclusions order</span></a><li><a href=#exclusions-processing-model><span class=secno>3.5</span> <span class=content>
Processing model</span></a><ul class=toc><li><a href=#exclusions-processing-model-description><span class=secno>3.5.1</span> <span class=content>
Description</span></a><li><a href=#step-1><span class=secno>3.5.2</span> <span class=content>
Step 1: resolve exclusion boxes belonging to each <span data-link-type=dfn title="wrapping context">wrapping context</span></span></a><li><a href=#step-2><span class=secno>3.5.3</span> <span class=content>
Step 2: resolve wrapping contexts and lay out containing blocks</span></a><li><a href=#step-2-A><span class=secno>3.5.4</span> <span class=content>
Step 2-A: resolve the position and size of exclusion boxes</span></a><li><a href=#step-2-B><span class=secno>3.5.5</span> <span class=content>
Step 2-B: lay out containing block applying wrapping</span></a><li><a href=#processing-model-example><span class=secno>3.5.6</span> <span class=content>
Processing Model Example</span></a><ul class=toc><li><a href=#example-step-1><span class=secno>3.5.6.1</span> <span class=content>
Step 1: resolve exclusion boxes belonging to each <span data-link-type=dfn title="wrapping context">wrapping context</span></span></a><li><a href=#example-step-2><span class=secno>3.5.6.2</span> <span class=content>
Step 2: resolve wrapping contexts and lay out containing blocks</span></a><ul class=toc><li><a href=#example-resolving-rwc-1><span class=secno>3.5.6.2.1</span> <span class=content>
Resolving RWC-1</span></a><li><a href=#example-resolving-rwc-2><span class=secno>3.5.6.2.2</span> <span class=content>
Resolving RWC-2</span></a></ul></ul></ul><li><a href=#floats-and-exclusions><span class=secno>3.6</span> <span class=content>
Floats and exclusions</span></a><ul class=toc><li><a href=#floats-and-exclusions-similarities><span class=secno>3.6.1</span> <span class=content>
Similarities</span></a><li><a href=#floats-and-exclusions-differences><span class=secno>3.6.2</span> <span class=content>
Differences</span></a><li><a href=#floats-interop><span class=secno>3.6.3</span> <span class=content>
Interoperability</span></a><ul class=toc><li><a href=#effect-of-floats-on-exclusions><span class=secno>3.6.3.1</span> <span class=content>
Effect of floats on exclusions</span></a><li><a href=#effect-of-exclusions-on-floats><span class=secno>3.6.3.2</span> <span class=content>
Effect of exclusions on floats</span></a></ul></ul></ul><li><a href=#acks><span class=secno></span> <span class=content>
Acknowledgments</span></a><li><a href=#conformance><span class=secno></span> <span class=content>
Conformance</span></a><ul class=toc><li><a href=#conventions><span class=secno></span> <span class=content>
Document conventions</span></a><li><a href=#conformance-classes><span class=secno></span> <span class=content>
Conformance classes</span></a><li><a href=#partial><span class=secno></span> <span class=content>
Partial implementations</span></a><li><a href=#experimental><span class=secno></span> <span class=content>
Experimental implementations</span></a><li><a href=#testing><span class=secno></span> <span class=content>
Non-experimental implementations</span></a></ul><li><a href=#references><span class=secno></span> <span class=content>References</span></a><ul class=toc><li><a href=#normative><span class=secno></span> <span class=content>Normative References</span></a><li><a href=#informative><span class=secno></span> <span class=content>Informative References</span></a></ul><li><a href=#index><span class=secno></span> <span class=content>Index</span></a><li><a href=#property-index><span class=secno></span> <span class=content>Property Index</span></a><li><a href=#issues-index><span class=secno></span> <span class=content>Issues Index</span></a></ul></div>
<h2 class="heading settled" data-level=1 id=intro><span class=secno>1. </span><span class=content>
Introduction</span><a class=self-link href=#intro></a></h2>
<p><em>This section is not normative.</em></p>
<p>This specification defines features that allow inline flow
content to wrap around outside the <span>exclusion area</span> of elements.</p>
<h2 class="heading settled" data-level=2 id=terms><span class=secno>2. </span><span class=content>
Terminology</span><a class=self-link href=#terms></a></h2>
<dl data-export="">
<dt><dfn data-dfn-type=dfn data-export="" id=exclusion-box title="exclusion box">Exclusion box<a class=self-link href=#exclusion-box></a></dfn>
<dd>
A <a href=http://www.w3.org/TR/css3-box/>box</a> (<a data-biblio-type=normative data-link-type=biblio href=#biblio-css3box title=CSS3BOX>[CSS3BOX]</a>) that defines
an <span>exclusion area</span> for other boxes. The <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> property is
used to make an element’s generated box an exclusion box. An exclusion box
contributes its <span>exclusion area</span> to its <a href=http://www.w3.org/TR/CSS2/visudet.html#containing-block-details>containing block’s</a>
<span>wrapping context</span>. An element with a <span class=css>float</span> computed value other
than <span class=css>none</span> does not become an exclusion.
<dt><dfn data-dfn-type=dfn data-export="" id=exclusion-area title="exclusion area">Exclusion area<a class=self-link href=#exclusion-area></a></dfn>
<dd>
The area used for excluding inline flow content around an exclusion box. The
<span>exclusion area</span> is equivalent to the
<a href=http://www.w3.org/TR/CSS2/box.html#box-dimensions>border box</a>
for an exclusion box.
<p class=note>
If a user agent implements both CSS Exclusions and CSS Shapes, the
shape-outside property defines the exclusion area instead of the border box.
<dt><dfn data-dfn-type=dfn data-export="" id=exclusion-element title="exclusion element">Exclusion element<a class=self-link href=#exclusion-element></a></dfn>
<dd>
An <span>exclusion element</span> is a block-level element which is not a float
and generates an <span>exclusion box</span>. An element generates an exclusion
box when its <span class=css>wrap-flow</span> property’s computed value is not <span class=css>auto</span>.
<dt><dfn data-dfn-type=dfn data-export="" id=wrapping-context title="wrapping context">Wrapping context<a class=self-link href=#wrapping-context></a></dfn>
<dd>
The <span>wrapping context</span> of a box is a collection of <span>exclusion
areas</span> contributed by its associated <span>exclusion boxes</span>.
During layout, a box wraps its inline flow content in the <code>wrapping area</code>
that corresponds to the subtraction of its <span>wrapping context</span> from
its own <span>content area</span>.
<p>A box inherits its <a href=http://www.w3.org/TR/CSS2/visudet.html#containing-block-details>containing block’s</a> <span>wrapping context</span> unless it specifically
resets it using the <a class=property data-link-type=propdesc href=#propdef-wrap-through title=wrap-through>wrap-through</a> property.</p>
<dt><dfn data-dfn-type=dfn data-export="" id=content-area title="content area">Content area<a class=self-link href=#content-area></a></dfn>
<dd>
The <a href=http://www.w3.org/TR/CSS2/box.html#box-dimensions>content area</a>
is normally used for layout of the inline flow content of a box.
<dt><dfn data-dfn-type=dfn data-export="" id=wrapping-area title="wrapping area">Wrapping area<a class=self-link href=#wrapping-area></a></dfn>
<dd>
The area used for layout of inline flow content of a box affected by a
<span>wrapping context</span>, defined by subtracting the <span>wrapping
context</span> from its <span>content area</span>.
<dt><dfn data-dfn-type=dfn data-export="" id=outside-inside title=outside-inside>Outside and inside<a class=self-link href=#outside-inside></a></dfn>
<dd>
In this specification, <span class=css>outside</span> refers to DOM content that is not a descendant
of an element while <span class=css>inside</span> refers to the element’s descendants.
</dl>
<h2 class="heading settled" data-level=3 id=exclusions><span class=secno>3. </span><span class=content>
Exclusions</span><a class=self-link href=#exclusions></a></h2>
<p>Exclusion elements define <span>exclusion areas</span> that contribute to their
containing block’s <span>wrapping context</span>. As a consequence, exclusions
impact the layout of their containing block’s descendants.</p>
<p>Elements lay out their inline content in their <span>content area</span> and wrap
around the <span>exclusion areas</span> in their associated <span>wrapping
context</span>. If the element is itself an exclusion, it does not wrap around
its own exclusion area and the impact of other exclusions on other exclusions
is controlled by the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#propdef-z-index title=z-index>z-index</a> property as explained in the
'exclusions order' section.</p>
<h3 class="heading settled" data-level=3.1 id=declaring-exclusions><span class=secno>3.1. </span><span class=content>
Declaring exclusions</span><a class=self-link href=#declaring-exclusions></a></h3>
<p>An element becomes an exclusion when its <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> property has a computed
value other than <span class=css>auto</span>.</p>
<h4 class="heading settled" data-level=3.1.1 id=wrap-flow-property><span class=secno>3.1.1. </span><span class=content>
The <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> property</span><a class=self-link href=#wrap-flow-property></a></h4>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-wrap-flow>wrap-flow<a class=self-link href=#propdef-wrap-flow></a></dfn><tr><th>Value:<td class=prod>auto <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> both <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> start <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> end <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> minimum <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> maximum <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> clear<tr><th>Initial:<td>auto<tr><th>Applies to:<td>block-level elements.<tr><th>Inherited:<td>no<tr><th>Percentages:<td>N/A<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified except for element’s whose <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visuren.html#propdef-float title=float>float</a> computed value is not <span class=css>none</span>, in which case the computed value is <span class=css>auto</span>.<tr><th>Animatable:<td>no</table>
<p>The values of this property have the following meanings:</p>
<dl data-dfn-for=wrap-flow data-dfn-type=value>
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowauto title="'wrap-flow'!!'auto'">auto<a class=self-link href=#valdef-wrap-flow-wrap-flowauto></a></dfn>
<dd>
No exclusion is created. Inline flow content interacts with the element
as usual. In particular, if the element is a
<a href=http://www.w3.org/TR/CSS2/visuren.html#floats>float</a>
(see <a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a>), the behavior is unchanged.
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowboth title="'wrap-flow'!!'both'">both<a class=self-link href=#valdef-wrap-flow-wrap-flowboth></a></dfn>
<dd>
Inline flow content can flow on all sides of the exclusion.
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowstart title="'wrap-flow'!!'start'">start<a class=self-link href=#valdef-wrap-flow-wrap-flowstart></a></dfn>
<dd>
Inline flow content can flow around the start edge of the <span>exclusion
area</span> but must leave the area next to the end edge of the exclusion
empty.
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowend title="'wrap-flow'!!'end'">end<a class=self-link href=#valdef-wrap-flow-wrap-flowend></a></dfn>
<dd>
Inline flow content can flow around the end edge of the
<span>exclusion area</span> but must leave the area next to the start edge
of the exclusion empty.
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowminimum title="'wrap-flow'!!'minimum'">minimum<a class=self-link href=#valdef-wrap-flow-wrap-flowminimum></a></dfn>
<dd>
Inline flow content can flow around the edge of the exclusion with the
smallest available space within the flow content’s containing block, and
must leave the other edge of the exclusion empty.
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowmaximum title="'wrap-flow'!!'maximum'">maximum<a class=self-link href=#valdef-wrap-flow-wrap-flowmaximum></a></dfn>
<dd>
Inline flow content can flow around the edge of the exclusion with the
largest available space within the flow content’s containing block, and
must leave the other edge of the exclusion empty.
<dt><dfn class=css data-dfn-for=wrap-flow data-dfn-type=value data-export="" id=valdef-wrap-flow-wrap-flowclear title="'wrap-flow'!!'clear'">clear<a class=self-link href=#valdef-wrap-flow-wrap-flowclear></a></dfn>
<dd>
Inline flow content can only flow before and after the exclusion in the
flow content’s block direction and must leave the areas next to the start
and end edges of the exclusion empty.
</dl>
<p>If the property’s computed value is <span class=css>auto</span>, the element does not become an
<span>exclusion</span>.</p>
<p>Otherwise, a computed <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> property value of <span class=css>both</span>, <span class=css>start</span>, <span class=css>end</span>,
<span class=css>minimum</span>, <span class=css>maximum</span> or <span class=css>clear</span> on an element makes that element an
<a data-link-type=dfn href=#exclusion-element title="exclusion element">exclusion element</a>. It’s <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion area</a> is contributed
to its containing block’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>, causing the containing
block’s descendants to wrap around its <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion area</a>.</p>
<div class=figure>
<img alt="LTR text wrapping on left edge, RTL text wrapping on right edge, and vertical text wrapping on top edge." src=images/exclusion-writing-modes.png width=70%>
<p class=caption>Exclusion with <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a>: <span class=css>start</span> interacting with various
writing modes.</p>
</div>
<p>Determining the relevant edges of the exclusion depends on the
<a href=http://www.w3.org/TR/css3-writing-modes/#text-flow>writing mode</a> <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3-writing-modes title=CSS3-WRITING-MODES>[CSS3-WRITING-MODES]</a> of the content wrapping around the 'exclusion area'.</p>
<p>An <a data-link-type=dfn href=#exclusion-element title="exclusion element">exclusion element</a> establishes a new <a href="">block formatting
context</a> (see <a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a>) for its content.</p>
<div class=figure>
<img alt="General illustration showing how exclusions combine" src=images/exclusions-illustration.png width=70%>
<p class=caption>Combining exclusions</p>
</div>
<p>The above figure illustrates how exclusions are combined. The outermost box
represents an element’s content box. The A, B, C and D darker gray boxes
represent exclusions in the element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>.
A, B, C and D have their respective <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> computed to <span class=css>both</span>, <span class=css>start</span>,
<span class=css>end</span> and <span class=css>clear</span> respectively. The lighter gray areas show the additional areas
that are excluded for inline layout as a result of the 'wrap-flow’value.
For example, the area to the right of B cannot be used for inline layout
of left-to-right writing mode content because the <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> for B is <span class=css>start</span>.</p>
<p>The background blue area shows what areas are available for a left-to-right
writing mode element’s inline content layout.
All areas represented with a light or dark shade of gray are not available for
(left-to-right writing mode) inline content layout.</p>
<div class=example>
The <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> property values applied to exclusions as grid items.
<pre><div id="grid">
<div id="top-right" class="exclusion"></div>
<div id="bottom-left" class="exclusion"></div>
<div id="content">Lorem ipsum…</div>
</div>
<style type="text/css">
#grid {
width: 30em;
height: 30em;
display: grid;
grid-columns: 25% 25% 25% 25%;
grid-rows: 25% 25% 25% 25%;
#top-right {
grid-column: 3;
grid-row: 2;
}
#bottom-left {
grid-column: 2;
grid-row: 3;
}
.exclusion {
wrap-flow: <see below>
}
#content {
grid-row: 1;
grid-row-span: 4;
grid-column: 1;
grid-column-span: 4;
}
</style>
</pre>
<p>The following figures illustrate the visual rendering for different values
of the <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> property. The gray grid lines are marking the grid cells
and the blue area is the exclusion box (positioned by the grid).</p>
<table class=example-table>
<tr>
<td><code class=html>.exclusion{ wrap-flow: auto; }</code></td>
<td><code class=html>.exclusion{ wrap-flow: both; }</code></td>
</tr>
<tr>
<td><img alt="Example rendering for wrap-side: auto" src=images/exclusion_wrap_side_auto.png></td>
<td><img alt="Example rendering for wrap-side: both" src=images/exclusion_wrap_side_both.png></td>
</tr>
<tr>
<td><code class=html>.exclusion{ wrap-flow: start; }</code></td>
<td><code class=html>.exclusion{ wrap-flow: end; }</code></td>
</tr>
<tr>
<td><img alt="Example rendering for wrap-side: start" src=images/exclusion_wrap_side_left.png></td>
<td><img alt="Example rendering for wrap-side: end" src=images/exclusion_wrap_side_right.png></td>
</tr>
<tr>
<td><code class=html>.exclusion{ wrap-flow: minimum; }</code></td>
<td><code class=html>.exclusion{ wrap-flow: maximum; }</code></td>
</tr>
<tr>
<td><img alt="Example rendering for wrap-side: minimum" src=images/exclusion_wrap_side_minimum.png></td>
<td><img alt="Example rendering for wrap-side: maximum" src=images/exclusion_wrap_side_maximum.png></td>
</tr>
<tr>
<td><code class=html>.exclusion{ wrap-flow: clear; }</code></td>
<td></td>
</tr>
<tr>
<td><img alt="Example rendering for wrap-side: clear" src=images/exclusion_wrap_side_clear.png></td>
<td></td>
</tr>
</table>
</div>
<h3 class="heading settled" data-level=3.2 id=scope-and-effect-of-exclusions><span class=secno>3.2. </span><span class=content>
Scope and effect of exclusions</span><a class=self-link href=#scope-and-effect-of-exclusions></a></h3>
<p>An <span>exclusion</span> affects the inline flow content descended from the
exclusion’s containing block (defined in <a href=http://www.w3.org/TR/CSS2/visudet.html#containing-block-details>CSS 2.1 10.1</a>) and that of all descendant
elements of the same containing block. All inline flow content inside the
containing block of the exclusions is affected. To stop the effect of exclusions
defined outside an element, the <a class=property data-link-type=propdesc href=#propdef-wrap-through title=wrap-through>wrap-through</a> property can be used
(see the <a href=#propagation-of-exclusions>propagation of exclusions</a>
section below).</p>
<p>As a reminder, for exclusions with <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#propdef-position title=position>position</a>:<span class=css>fixed</span>, the containing block
is established by the root element.</p>
<h3 class="heading settled" data-level=3.3 id=propagation-of-exclusions><span class=secno>3.3. </span><span class=content>
Propagation of Exclusions</span><a class=self-link href=#propagation-of-exclusions></a></h3>
<p>By default, an element inherits its parent <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. In other
words it is subject to the exclusions defined <span title=outside-inside>outside</span>
the element.</p>
<p>Setting the <a class=property data-link-type=propdesc href=#propdef-wrap-through title=wrap-through>wrap-through</a> property to <span class=css>none</span> prevents an element from
inheriting its parent <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. In other words, exclusions
defined <span class=css>outside</span> the element, have not effect on the element’s children layout.</p>
<p class=note>
Exclusions defined by an element’s descendants still contribute to their
containing block’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. If that containing block is a
child of an element with <a class=property data-link-type=propdesc href=#propdef-wrap-through title=wrap-through>wrap-through</a> computes to <span class=css>none</span>, or the element
itself, then exclusion still have an effect on the children of that
containing block element.
</p>
<h4 class="heading settled" data-level=3.3.1 id=wrap-through-property><span class=secno>3.3.1. </span><span class=content>
The <a class=property data-link-type=propdesc href=#propdef-wrap-through title=wrap-through>wrap-through</a> Property</span><a class=self-link href=#wrap-through-property></a></h4>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-wrap-through>wrap-through<a class=self-link href=#propdef-wrap-through></a></dfn><tr><th>Value:<td class=prod>wrap <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> none<tr><th>Initial:<td>wrap<tr><th>Applies to:<td>block-level elements<tr><th>Inherited:<td>no<tr><th>Percentages:<td>N/A<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>no</table>
<p>The values of this property have the following meanings:</p>
<dl data-dfn-for=wrap-through data-dfn-type=value>
<dt><dfn class=css data-dfn-for=wrap-through data-dfn-type=value data-export="" id=valdef-wrap-through-wrap-throughwrap title="'wrap-through'!!'wrap'">wrap<a class=self-link href=#valdef-wrap-through-wrap-throughwrap></a></dfn></dt>
<dd>
The element inherits its parent node’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. Its descendant
inline content wraps around exclusions defined <a data-link-type=dfn href=#outside-inside title=outside-inside>outside</a>
the element.
<dt><dfn class=css data-dfn-for=wrap-through data-dfn-type=value data-export="" id=valdef-wrap-through-wrap-throughnone title="'wrap-through'!!'none'">none<a class=self-link href=#valdef-wrap-through-wrap-throughnone></a></dfn></dt>
<dd>
The element does not inherit its parent node’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. Its
descendants are only subject to exclusion areas defined <a data-link-type=dfn href=#outside-inside title=outside-inside>inside</a>
the element.
</dl>
<div class=example>
Using the <a class=property data-link-type=propdesc href=#propdef-wrap-through title=wrap-through>wrap-through</a> property to control the effect of exclusions.
<pre><code class=html>
<style type="text/css">
#grid {
display: grid;
grid-columns: 25% 50% 25%;
grid-rows: 25% 25% 25% 25%;
}
#exclusion {
grid-row: 2;
grid-row-span: 2;
grid-column: 2;
wrap-flow: <see below>
}
#rowA, #rowB {
grid-row-span: 2;
grid-column: 1;
grid-column-span: 3;
}
#rowA {
grid-row: 1;
}
#rowB {
grid-row: 3;
}
</style>
<style type="text/css">
.exclusion {
wrap-flow: both;
position: absolute;
left: 20%;
top: 20%;
width: 50%;
height: 50%;
background-color: rgba(220, 230, 242, 0.5);
}
</style>
<div id="grid">
<div class=”exclusion”></div>
<div id="rowA" style=”wrap-through: wrap;”> Lorem ipsum dolor sit amet...</div>
<div id="rowB" style=”wrap-through: none;”> Lorem ipsum dolor sit amet...</div>
</div>
</code></pre>
<p><img alt="Example rendering of wrap-through: wrap | none" class=singleImgExample src=images/exclusion_wrap_through.png style=max-width:40%></p>
</div>
<h3 class="heading settled" data-level=3.4 id=exclusions-order><span class=secno>3.4. </span><span class=content>
Exclusions order</span><a class=self-link href=#exclusions-order></a></h3>
<p>Exclusions follow the painting order (See <a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a> Appendix E). Exclusions are
applied in reverse to the document order in which they are defined. The last exclusion
appears on top of all other exclusion, thus it affects the inline flow content of
all other preceding exclusions or elements descendant of the same containing block.
The <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#propdef-z-index title=z-index>z-index</a> property can be used to change the ordering of
<a href=http://www.w3.org/TR/CSS2/visuren.html#choose-position>positioned</a> exclusion
boxes (see <a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a>). Statically positioned exclusions are not affected by the
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#propdef-z-index title=z-index>z-index</a> property and thus follow the painting order.</p>
<div class=example>
<p>Ordering of exclusions.</p>
<pre><code class=html>
<style type="text/css">
.exclusion {
wrap-flow: both;
position: absolute;
width: 200px;
}
.topleft {
top: 10px;
left: 10px;
background-color: lightblue;
}
.middle {
top: 90px;
left: 90px;
background-color: lightgreen;
}
.bottomright {
top: 170px;
left: 170px;
background-color: pink;
}
</style>
<div class="exclusion topleft">
The top left div...
</div>
<div class="exclusion middle">
The middle div...
</div>
<div class="exclusion bottomright">
The bottom right div...
</div>
</code></pre>
<table class=example-table>
<tr>
<td style=width:50%><code class=html>.middle { z-index: auto; }</code></td>
<td style=width:50%><code class=html>.middle { z-index: 1; }</code></td>
</tr>
<tr>
<td><img alt="Example rendering of default exclusion ordering." class=singleImgExample src=images/exclusion_ordering.png></td>
<td><img alt="Example rendering of default exclusion ordering." class=singleImgExample src=images/exclusion_ordering_z_order.png></td>
</tr>
</table>
</div>
<div class="issue-marker wrapper">
<div class=issue-marker>
<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15183">Issue-15183</a>
<div class=issue-details>
<p class=short-desc>Is the CSS exclusions processing model incorrect?</p>
</div>
</div>
</div>
<div class=issue id=issue-53942a83><a class=self-link href=#issue-53942a83></a>
<p>The current draft provides a model for exclusions
without a collision-avoidance model.
The existing exclusion model in CSS uses floats,
which have both exclusion and collision-avoidance behavior.
Concerns have been raised that allowing exclusions
without collision avoidance could be harmful,
particularly with absolutely-positioned elements.
Three options should be considered:</p>
<ol>
<li>Allow exclusions in positioning schemes
with no collision avoidance.</li>
<li>Disallow exclusions in positioning schemes
with no collision avoidance.</li>
<li>Define collision-avoidance behavior
for positioning schemes without it,
and use this behavior by default with exclusions.</li>
</ol>
</div>
<h3 class="heading settled" data-level=3.5 id=exclusions-processing-model><span class=secno>3.5. </span><span class=content>
Processing model</span><a class=self-link href=#exclusions-processing-model></a></h3>
<h4 class="heading settled" data-level=3.5.1 id=exclusions-processing-model-description><span class=secno>3.5.1. </span><span class=content>
Description</span><a class=self-link href=#exclusions-processing-model-description></a></h4>
<p>Applying exclusions is a two-step process:</p>
<ul>
<li><strong>Step 1</strong>: resolve exclusion boxes belonging to each
<a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>
<li><strong>Step 2</strong>: resolve each <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> and lay out
each containing block in turn:
<ul>
<li><strong>Step 2-A</strong>: resolve the position and size of exclusion
boxes
<li><strong>Step 2-B</strong>: lay out containing block, wrapping around
each <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion area</a>
</ul>
</ul>
<h4 class="heading settled" data-level=3.5.2 id=step-1><span class=secno>3.5.2. </span><span class=content>
Step 1: resolve exclusion boxes belonging to each <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a></span><a class=self-link href=#step-1></a></h4>
<p>In this step, the user agent determines which <a href=http://www.w3.org/TR/CSS2/visudet.html#containing-block-details>containing block</a> each <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion area</a>
belongs to. This is a simple step, based on the definition of containing
blocks and elements with a computed value for <a class=property data-link-type=propdesc href=#propdef-wrap-flow title=wrap-flow>wrap-flow</a> that is not
<code class=css>auto</code>.</p>
<h4 class="heading settled" data-level=3.5.3 id=step-2><span class=secno>3.5.3. </span><span class=content>
Step 2: resolve wrapping contexts and lay out containing blocks</span><a class=self-link href=#step-2></a></h4>
<p>In this step, starting from the top of the <a href=http://www.w3.org/TR/CSS2/visuren.html#z-index>rendering tree</a> (see <a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a>), the the agent processes each
containing block in two sub-steps.</p>
<h4 class="heading settled" data-level=3.5.4 id=step-2-A><span class=secno>3.5.4. </span><span class=content>
Step 2-A: resolve the position and size of exclusion boxes</span><a class=self-link href=#step-2-A></a></h4>
<p>Resolving the position and size of <a data-link-type=dfn href=#exclusion-box title="exclusion boxes">exclusion boxes</a> in the <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping
context</a> may or may not require a layout. For example, if an <a data-link-type=dfn href=#exclusion-box title="exclusion box">exclusion
box</a> is absolutely positioned and sized, a layout may not be needed to
resolve its position and size. In other situations, laying out the containing
block’s content is required.</p>
<p>When a layout is required, it is carried out without applying any <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion
area</a>. In other words, the containing block is laid out without a
<a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>.</p>
<p>Step 2-A yields a position and size for all <a data-link-type=dfn href=#exclusion-box title="exclusion boxes">exclusion boxes</a> in the
<a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. Each exclusion box is processed in turn, starting from
the top-most, and each <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion area</a> is computed and contributed to the
<a href=http://www.w3.org/TR/CSS2/visudet.html#containing-block-details>containing
block’s</a> <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>.</p>
<p>Scrolling is ignored in this step when resolving the position and size of
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#propdef-position title=position>position</a>: <span class=css>fixed</span> <a data-link-type=dfn href=#exclusion-box title="exclusion boxes">exclusion boxes</a>.</p>
<p>Once the <a href=http://www.w3.org/TR/CSS2/visudet.html#containing-block-details>containing block’s</a> <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> is computed, all <a data-link-type=dfn href=#exclusion-box title="exclusion boxes">exclusion boxes</a> in
that <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> are removed from the normal flow.</p>
<h4 class="heading settled" data-level=3.5.5 id=step-2-B><span class=secno>3.5.5. </span><span class=content>
Step 2-B: lay out containing block applying wrapping</span><a class=self-link href=#step-2-B></a></h4>
<p>Finally, the content of the containing block is laid out, with the inline content
wrapping around the <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>’s <a data-link-type=dfn href=#exclusion-area title="exclusion area">exclusion area</a>.</p>
<p>When the containing block itself is an <a data-link-type=dfn href=#exclusion-box title="exclusion box">exclusion box</a>, then rules on
<a href=#exclusions-order>exclusions order</a> define which exclusions affect
the inline and descendant content of the box.</p>
<h4 class="heading settled" data-level=3.5.6 id=processing-model-example><span class=secno>3.5.6. </span><span class=content>
Processing Model Example</span><a class=self-link href=#processing-model-example></a></h4>
<p>This section illustrates the exclusions processing model with an example.
It is meant to be simple. Yet, it contains enough complexity to address the
issues of layout dependencies and re-layout.</p>
<p>The code snippet in the following example has two exclusions affecting the
document’s inline content.</p>
<div class=example>
<pre class=html><html>
<style>
#d1 {
position:relative;
height: auto;
color: #46A4E9;
border: 1px solid gray;
}
#e1 {
wrap-flow: both;
position: absolute;
left: 50%;
top: 50%;
width: 40%;
height: 40%;
border: 1px solid red;
margin-left: -20%;
margin-top: -20%;
}
#d2 {
position: static;
width: 100%;
height: auto;
color: #808080;
}
#e2 {
wrap-flow: both;
position: absolute;
right: 5ex;
top: 1em;
width: 12ex;
height: 10em;
border: 1px solid lime;
}
</style>
<body>
<div id="d1">
Lorem ipsusm ...
<p id="e1"></p>
</div>
<div id="d2">
Lorem ipsusm ...
<p id="e2" ></p>
</div>
</body>
</html></pre>
</div>
<p>The following figures illustrate:</p>
<ul>
<li>the document’s DOM tree
<li>the layout tree of generated block boxes
</ul>
<div class=figure>
<img alt="DOM tree nodes" src=images/processing-model-example-dom.svg width=200>
<p class=caption>DOM tree
</div>
<div class=figure>
<img alt="Layout tree boxes" src=images/processing-model-example-layout-tree.svg width=350>
<p class=caption>Layout tree of generated block boxes
</div>
<h5 class="heading settled" data-level=3.5.6.1 id=example-step-1><span class=secno>3.5.6.1. </span><span class=content>
Step 1: resolve exclusion boxes belonging to each <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a></span><a class=self-link href=#example-step-1></a></h5>
<p>The figures illustrate how the boxes corresponding to the element sometimes
have a different containment hierarchy in the layout tree than in the DOM tree.
For example, the box generated by <code class=idl>e1</code> is positioned in
its containing block’s box, which is the <code class=idl>d1-box</code>, because
<code class=idl>e1</code> is absolutely positioned and <code class=idl>d1</code>
is relatively positioned. However, while <code class=idl>e2</code> is also absolutely
positioned, its containing block is the initial containing block (ICB). See the
section 10.1 of the CSS 2.1 specification (<a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=CSS21>[CSS21]</a>) for details.</p>
<p>As a result of the computation of containing blocks for the tree, the boxes
belonging to the <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>s of all the elements can be determined:</p>
<ul>
<li>The <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> for the html element contains the
<code class=idl>e2</code> box: WC-1 (Wrapping Context 1)
<li>The <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> for the body element inherits the html
element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>: WC-1
<li>The <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> for <code class=idl>d1</code> inherits the
body element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> and adds the <code class=idl>e1-box</code>
to it. So the wrapping context is made of both the
<code class=idl>e1-box</code> and the <code class=idl>e2-box</code>:
WC-2</li>
<li>The <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> for <code class=idl>d2</code> inherits the
body element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>: WC-1
</ul>
<h5 class="heading settled" data-level=3.5.6.2 id=example-step-2><span class=secno>3.5.6.2. </span><span class=content>
Step 2: resolve wrapping contexts and lay out containing blocks</span><a class=self-link href=#example-step-2></a></h5>
<p>In this step, each containing block is processed in turn. For each containing
block, we (conceptually) go through two phases:</p>
<ol>
<li>resolve the <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>: resolve the position and size of its
exclusions
<li>lay out the containing block
</ol>
<p>In our example, this breaks down to:</p>
<ol>
<li>resolve the position and size of the exclusions belonging to WC-1:
RWC-1 (Resolved Wrapping Context 1).
<li>lay out the initial containing block (i.e., lay out its content):
<ol>
<li>resolve the html element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>: RWC-1
<li>lay out the html element:
<ol>
<li>resolve the body element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>: RWC-1
<li>lay out the body element:
<ol>
<li>resolve the <code class=idl>d1</code> element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping
context</a>: RWC-2
<li>lay out the <code class=idl>d1</code> element
<li>resolve the <code class=idl>d2</code> element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping
context</a>: RWC-1
<li>lay out the <code class=idl>d2</code> element
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
<h6 class="heading settled" data-level=3.5.6.2.1 id=example-resolving-rwc-1><span class=secno>3.5.6.2.1. </span><span class=content>
Resolving RWC-1</span><a class=self-link href=#example-resolving-rwc-1></a></h6>
<p>The top-most <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> in the layout tree contains the
<code class=idl>e2</code> exclusion. Its position and size needs to be
resolved. In general, computing an exclusion’s position and size may or may
not require laying out other content. In this example, no content needs to be
laid out to resolve the <code class=idl>e2</code> exclusion’s position
because it is absolutely positioned and its size can be resolved without
layout either. At this point, RWC-1 is resolved and can be used when laying
inline content out.<p></p>
<h6 class="heading settled" data-level=3.5.6.2.2 id=example-resolving-rwc-2><span class=secno>3.5.6.2.2. </span><span class=content>
Resolving RWC-2</span><a class=self-link href=#example-resolving-rwc-2></a></h6>
<p>The process is similar: the position of the <code class=idl>e1</code>
exclusion needs to be resolved. Again, resolving the exclusion’s position and
size may require processing the containing block (d1 here). It is the case here
because the size and position of <code class=idl>e1</code> depend on
resolving the percentage lengths. The percentages are relative to the size of
<code class=idl>d1</code>’s box. As a result, in order to resolve a size for
<code class=idl>d1</code>’s box, a first layout of <code class=idl>d1</code>
is done without any <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> (i.e., no exclusions applied).
The layout yields a position and size for <code class=idl>e1</code>’s box.</p>
<p>At this point, RWC-2 is resolved because the position and size of both e1 and
e2 are resolved.</p>
<p class=note>The important aspect of the above processing example is that
once an element’s <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> is resolved (by resolving its
exclusions' position and size), the position and size of the exclusions are
not re-processed if the element’s size changes between the layout that may be
done without considering any <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a> (as for RWC-2) and the
layout done with the resolved <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>. This is what breaks the
possible circular dependency between the resolution of <a data-link-type=dfn href=#wrapping-context title="wrapping context">wrapping context</a>s
and the layout of containing blocks.</p>
<h3 class="heading settled" data-level=3.6 id=floats-and-exclusions><span class=secno>3.6. </span><span class=content>
Floats and exclusions</span><a class=self-link href=#floats-and-exclusions></a></h3>
<h4 class="heading settled" data-level=3.6.1 id=floats-and-exclusions-similarities><span class=secno>3.6.1. </span><span class=content>
Similarities</span><a class=self-link href=#floats-and-exclusions-similarities></a></h4>
<p>There are similarities between floats and exclusions in that inline content
wraps around floats and also wraps around <span>exclusion areas</span>. However,
there are very significant differences.</p>
<h4 class="heading settled" data-level=3.6.2 id=floats-and-exclusions-differences><span class=secno>3.6.2. </span><span class=content>
Differences</span><a class=self-link href=#floats-and-exclusions-differences></a></h4>
<ul>
<li><strong>scope</strong>. While floats apply to content that follows in the
document, exclusions apply to content in their containing block.
<li><strong>positioning</strong>. Floats are part of the inline flow and
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visuren.html#propdef-float title=float>float</a> on the line box. Authors can control how the floats move on the line
box, to the right or to the left. By contrast, exclusions can be positioned
using any positioning scheme such as grid layout (<a data-biblio-type=informative data-link-type=biblio href=#biblio-css3-grid-layout title=CSS3-GRID-LAYOUT>[CSS3-GRID-LAYOUT]</a>),
flexible box (<a data-biblio-type=informative data-link-type=biblio href=#biblio-css3-flexbox title=CSS3-FLEXBOX>[CSS3-FLEXBOX]</a>) or any other CSS positioning scheme.
<li><strong>separation of concerns</strong>. Making an element a float
determines both its positioning scheme and its effect on inline content.
Making an element an exclusion only determines its impact on inline content
and does not impose constraints on its positioning method.
</ul>
<h4 class="heading settled" data-level=3.6.3 id=floats-interop><span class=secno>3.6.3. </span><span class=content>
Interoperability</span><a class=self-link href=#floats-interop></a></h4>
<h5 class="heading settled" data-level=3.6.3.1 id=effect-of-floats-on-exclusions><span class=secno>3.6.3.1. </span><span class=content>
Effect of floats on exclusions</span><a class=self-link href=#effect-of-floats-on-exclusions></a></h5>
<p>Floats have an effect on the positioning of exclusions and the layout of their
inline content. For example, if an exclusion is an inline-box which happens to
be on the same line as a float, its position, as computed in
<a href=#step-2-A>Step 2-A</a> will be impacted by the float, as is any other
inline content.</p>
<h5 class="heading settled" data-level=3.6.3.2 id=effect-of-exclusions-on-floats><span class=secno>3.6.3.2. </span><span class=content>
Effect of exclusions on floats</span><a class=self-link href=#effect-of-exclusions-on-floats></a></h5>
<p>Exclusions have an effect on the positioning of floats as they have an effect
on inline content. Therefore, in <a href=#step-2-B>Step 2-B</a>, floats will
avoid <a data-link-type=dfn href=#exclusion-area title="exclusion areas">exclusion areas</a>.</p>
<h2 class="no-num heading settled" id=acks><span class=content>
Acknowledgments</span><a class=self-link href=#acks></a></h2>
<p>This specification is made possible by input from
Andrei Bucur,
Alexandru Chiculita,
Arron Eicholz,
Daniel Glazman,
Arno Gourdol,
Chris Jones,
Bem Jones-Bey,
Marcus Mielke,
Alex Mogilevsky,
Hans Muller,
Mihnea Ovidenie,
Virgil Palanciuc,
Florian Rivoal,
Peter Sorotokin,
Bear Travis,
Eugene Veselov,
Stephen Zilles
and the CSS Working Group members.</p>
<h2 class="no-ref no-num heading settled" id=conformance><span class=content>
Conformance</span><a class=self-link href=#conformance></a></h2>
<h3 class="no-ref heading settled" id=conventions><span class=content>
Document conventions</span><a class=self-link href=#conventions></a></h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words "MUST",
"MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc2119 title=RFC2119>[RFC2119]</a></p>
<p>Examples in this specification are introduced with the words "for example"
or are set apart from the normative text with <code>class="example"</code>,
like this:
<div class=example>
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word "Note" and are set apart from the
normative text with <code>class="note"</code>, like this:
<p class=note>Note, this is an informative note.</p>
<p>Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with <code><strong class="advisement"></code>, like
this: