forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.html
More file actions
1730 lines (1346 loc) · 61.9 KB
/
Overview.html
File metadata and controls
1730 lines (1346 loc) · 61.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 PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head
profile="http://dublincore.org/documents/2008/08/04/dc-html/ http://www.w3.org/2006/03/hcard">
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Exclusions Module Level 1</title>
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=dcterms.rights>
<meta content="CSS Exclusions Module Level 1" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2013-10-01 name=dcterms.date>
<meta content="Vincent Hardy" name=dcterms.creator>
<meta content="Rossen Atanassov" name=dcterms.creator>
<meta content="Alan Stearns" name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://dev.w3.org/csswg/css-exclusions/"
name=dcterms.identifier>
<link href="../shared/style/default.css" rel=stylesheet type="text/css">
<script defer=defer
src="http://test.csswg.org/harness/annotate.js#css-exclusions-1_dev"
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>
<link href="../shared/style/issues.css" rel=stylesheet type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<link href="../shared/style/alternate-spec-style.css" id=st rel=stylesheet
title="alternate spec style" type="text/css">
<body>
<div class=head id=div-head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1 id=css-exclusions-module>CSS Exclusions Module Level 1</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 1 October 2013</h2>
<dl>
<dt>This version:
<dd><a
href="http://dev.w3.org/csswg/css-exclusions/">http://dev.w3.org/csswg/css-exclusions/</a></dd>
<!--<dd><a href="http://dev.w3.org/csswg/css-exclusions/">http://www.w3.org/TR/2013/WD-css-exclusions-20131001/</a></dd>-->
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-exclusions/">http://www.w3.org/TR/css3-exclusions/</a>
<dt>Editor's Draft:
<dd><a
href="http://dev.w3.org/csswg/css-exclusions/">http://dev.w3.org/csswg/css-exclusions/</a>
<dt>Previous version:
<dd><a
href="http://www.w3.org/TR/2013/WD-css3-exclusions-20130528/">http://www.w3.org/TR/2013/WD-css3-exclusions-20130528/</a>
<dt>Editors:
<dd class=vcard><span class=fn>Vincent Hardy</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>vhardy@adobe.com</span>
<dd class=vcard><span class=fn>Rossen Atanassov</span>, <span
class=org>Microsoft Corporation</span>, <span
class=email>ratan@microsoft.com</span>
<dd class=vcard><span class=fn>Alan Stearns</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>stearns@adobe.com</span>
<dt>Issues List:
<dd><a
href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Exclusions&resolution=---&cmdtype=doit">in
Bugzilla</a>
<dt>Feedback:
<dd><a
href="mailto:www-style@w3.org?subject=%5B[css-exclusions]%5D%20feedback">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>)
<dt>Test Suite:
<dd><a
href="http://test.csswg.org/suites/css3-exclusions/nightly-unstable/">http://test.csswg.org/suites/css3-exclusions/nightly-unstable/</a>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2013 <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>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>CSS Exclusions define arbitrary areas around which <a
href="http://www.w3.org/TR/CSS2/visuren.html#inline-boxes">inline
content</a> (<a href="#CSS21"
rel=biblioentry>[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.
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%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>
<!--end-status-->
<p>This specification was previously called “CSS Exclusions and
Shapes.” The definitions for shapes are now in a separate specification,
see <a href="#CSS-SHAPES"
rel=biblioentry>[CSS-SHAPES]<!--{{CSS-SHAPES}}--></a>.
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#intro"><span class=secno>1. </span>Introduction</a>
<li><a href="#definitions"><span class=secno>2. </span>Terminology</a>
<li><a href="#exclusions"><span class=secno>3. </span>Exclusions</a>
<ul class=toc>
<li><a href="#declaring-exclusions"><span class=secno>3.1.
</span>Declaring exclusions</a>
<ul class=toc>
<li><a href="#wrap-flow-property"><span class=secno>3.1.1. </span>The
‘<code class=property>wrap-flow</code>’ property</a>
</ul>
<li><a href="#scope-and-effect-of-exclusions"><span class=secno>3.2.
</span>Scope and effect of exclusions</a>
<li><a href="#propagation-of-exclusions"><span class=secno>3.3.
</span>Propagation of Exclusions</a>
<ul class=toc>
<li><a href="#wrap-through-property"><span class=secno>3.3.1.
</span>The ‘<code class=property>wrap-through</code>’
Property</a>
</ul>
<li><a href="#exclusions-order"><span class=secno>3.4. </span>Exclusions
order</a>
<li><a href="#exclusions-processing-model"><span class=secno>3.5.
</span>Processing model</a>
<ul class=toc>
<li><a href="#exclusions-processing-model-description"><span
class=secno>3.5.1. </span>Description</a>
<li><a
href="#step-1-resolve-exclusion-boxes-belonging-to-each-wrapping-context"><span
class=secno>3.5.2. </span>Step 1: resolve exclusion boxes belonging
to each <span>wrapping context</span></a>
<li><a
href="#step-2-resolve-wrapping-contexts-layout-containing-blocks"><span
class=secno>3.5.3. </span>Step 2: resolve wrapping contexts and lay
out containing blocks</a>
<li><a href="#step-2-A-resolve-exclusions-position-and-size"><span
class=secno>3.5.4. </span>Step 2-A: resolve the position and size of
exclusion boxes</a>
<li><a
href="#step-2-B-layout-containing-block-applying-wrapping"><span
class=secno>3.5.5. </span>Step 2-B: lay out containing block applying
wrapping</a>
<li><a href="#exclusions-processing-model-example"><span
class=secno>3.5.6. </span>Example</a>
<ul class=toc>
<li><a href="#step-1-resolve-exclusion-boxes-belonging"><span
class=secno>3.5.6.1. </span>Step 1: resolve exclusion boxes
belonging to each <span>wrapping context</span></a>
<li><a href="#step-2-resolve-wrapping-contexts-and-lay"><span
class=secno>3.5.6.2. </span>Step 2: resolve wrapping contexts and
lay out containing blocks</a>
<ul class=toc>
<li><a href="#resolving-rwc-1"><span class=secno>3.5.6.2.1.
</span>Resolving RWC-1</a>
<li><a href="#resolving-rwc-2"><span class=secno>3.5.6.2.2.
</span>Resolving RWC-2</a>
</ul>
</ul>
</ul>
<li><a href="#floats-and-exclusions"><span class=secno>3.6.
</span>Floats and exclusions</a>
<ul class=toc>
<li><a href="#floats-and-exclusions-similarities"><span
class=secno>3.6.1. </span>Similarities</a>
<li><a href="#floats-and-exclusions-differences"><span
class=secno>3.6.2. </span>Differences</a>
<li><a href="#floats-and-exclusions-interoperability"><span
class=secno>3.6.3. </span>Interoperability</a>
<ul class=toc>
<li><a href="#effect-of-floats-on-exclusions"><span
class=secno>3.6.3.1. </span>Effect of floats on exclusions</a>
<li><a href="#effect-of-exclusions-on-floats"><span
class=secno>3.6.3.2. </span>Effect of exclusions on floats</a>
</ul>
</ul>
</ul>
<li><a href="#conformance"><span class=secno>4. </span>Conformance</a>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
<li class=no-num><a href="#change-log">Change Log</a>
<ul class=toc>
<li class=no-num><a href="#since-may-3rd-2012">Since May 3rd 2012</a>
<li class=no-num><a href="#since-december-13th-2011">Since December 13th
2011</a>
</ul>
</ul>
<!--end-toc-->
<h2 id=intro><span class=secno>1. </span>Introduction</h2>
<p><em>This section is not normative.</em>
<p> This specification defines features that allow inline flow content to
wrap around outside the <a href="#exclusion-area">exclusion area</a> of
elements.
<h2 id=definitions><span class=secno>2. </span>Terminology</h2>
<p><dfn id=exclusion-box>Exclusion box</dfn>
<p> A <a href="http://www.w3.org/TR/css3-box/">box</a> (<a href="#CSS3BOX"
rel=biblioentry>[CSS3BOX]<!--{{!CSS3BOX}}--></a>) that defines an <a
href="#exclusion-area">exclusion area</a> for other boxes. The ‘<a
href="#wrap-flow"><code class=property>wrap-flow</code></a>’ property is
used to make an element's generated box an exclusion box. An exclusion box
contributes its <a href="#exclusion-area">exclusion area</a> to its <a
href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">
containing block's</a> <a href="#wrapping-context">wrapping context</a>.
An element with a ‘<code class=property>float</code>’ computed value
other than ‘<code class=property>none</code>’ does not become an
exclusion.
<p><dfn id=exclusion-area>Exclusion area</dfn>
<p> The area used for excluding inline flow content around an exclusion
box. The <a href="#exclusion-area">exclusion area</a> 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.
<p><dfn id=exclusion-element>Exclusion element</dfn>
<p> An <a href="#exclusion-element">exclusion element</a> is a block-level
element which is not a float and generates an <a
href="#exclusion-box">exclusion box</a>. An element generates an exclusion
box when its ‘<a href="#wrap-flow"><code
class=property>wrap-flow</code></a>’ property's computed value is not
‘<code class=property>auto</code>’.
<p><dfn id=wrapping-context>Wrapping context</dfn>
<p> The <a href="#wrapping-context">wrapping context</a> of a box is a
collection of <a href="#exclusion-area">exclusion areas</a> contributed by
its associated <a href="#exclusion-box">exclusion boxes</a>. During
layout, a box wraps its inline flow content in the <a
href="#wrapping-area"><code>wrapping area</code></a> that corresponds to
the subtraction of its <a href="#wrapping-context">wrapping context</a>
from its own <a href="#content-area">content area</a>.
<p> A box inherits its <a
href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing
block's</a> <a href="#wrapping-context">wrapping context</a> unless it
specifically resets it using the ‘<a href="#wrap-through"><code
class=property>wrap-through</code></a>’ property.
<p><dfn id=content-area>Content area</dfn>
<p> 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.
<p><dfn id=wrapping-area>Wrapping area</dfn>
<p> The area used for layout of inline flow content of a box affected by a
<a href="#wrapping-context">wrapping context</a>, defined by subtracting
the <a href="#wrapping-context">wrapping context</a> from its <a
href="#content-area">content area</a>
<p><dfn id=outside-and-inside title=outside-inside>Outside and inside</dfn>
<p> In this specification, ‘<code class=property>outside</code>’ refers
to DOM content that is not a descendant of an element while ‘<code
class=property>inside</code>’ refers to the element's descendants.
<h2 id=exclusions><span class=secno>3. </span>Exclusions</h2>
<p> Exclusion elements define <a href="#exclusion-area">exclusion areas</a>
that contribute to their containing block's <a
href="#wrapping-context">wrapping context</a>. As a consequence,
exclusions impact the layout of their containing block's descendants.
<p>
<p> Elements layout their inline content in their <a
href="#content-area">content area</a> and wrap around the <a
href="#exclusion-area">exclusion areas</a> in their associated <a
href="#wrapping-context">wrapping context</a>. 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 ‘<code
class=property>z-index</code>’ property as explained in the <a
href="#exclusions-order">exclusions order</a> section.
<h3 id=declaring-exclusions><span class=secno>3.1. </span>Declaring
exclusions</h3>
<p> An element becomes an exclusion when its ‘<a href="#wrap-flow"><code
class=property>wrap-flow</code></a>’ property has a computed value other
than ‘<code class=property>auto</code>’.
<h4 id=wrap-flow-property><span class=secno>3.1.1. </span>The ‘<a
href="#wrap-flow"><code class=property>wrap-flow</code></a>’ property</h4>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-flow title="'wrap-flow'">wrap-flow</dfn>
<tr>
<th>Value:
<td><var>auto</var> | <var>both</var> | <var>start</var> |
<var>end</var> | <var>minimum</var> | <var>maximum</var> |
<var>clear</var>
<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 ‘<code
class=property>float</code>’ computed value is not <code
class=css>none</code>, in which case the computed value is ‘<code
class=property>auto</code>’.
</table>
<p>The values of this property have the following meanings:
<dl>
<dt><dfn id=auto title="'wrap-flow'!!'auto'">auto</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
href="#CSS21" rel=biblioentry>[CSS21]<!--{{CSS21}}--></a>), the behavior
is unchanged.
<dt><dfn id=both title="'wrap-flow'!!'both'">both</dfn>
<dd> Inline flow content can flow on all sides of the exclusion.
<dt><dfn id=start title="'wrap-flow'!!'start'">start</dfn>
<dd> Inline flow content can flow around the start edge of the <a
href="#exclusion-area">exclusion area</a> but must leave the area next to
the end edge of the exclusion empty.
<dt><dfn id=end title="'wrap-flow'!!'end'">end</dfn>
<dd> Inline flow content can flow around the end edge of the <a
href="#exclusion-area">exclusion area</a> but must leave the area next to
the start edge of the exclusion empty.
<dt><dfn id=minimum title="'wrap-flow'!!'minimum'">minimum</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 id=maximum title="'wrap-flow'!!'maximum'">maximum</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 id=clear title="'wrap-flow'!!'clear'">clear</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 ‘<code
class=property>auto</code>’, the element does not become an
<span>exclusion</span>.
<p> Otherwise, a computed ‘<a href="#wrap-flow"><code
class=property>wrap-flow</code></a>’ property value of ‘<code
class=property>both</code>’, ‘<code class=property>start</code>’,
‘<code class=property>end</code>’, ‘<code
class=property>minimum</code>’, ‘<code
class=property>maximum</code>’ or ‘<code
class=property>clear</code>’ on an element makes that element an <a
href="#exclusion-element">exclusion element</a>. It's <a
href="#exclusion-area">exclusion area</a> is contributed to its containing
block's <a href="#wrapping-context">wrapping context</a>, causing the
containing block's descendants to wrap around its <a
href="#exclusion-area">exclusion area</a>.
<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 ‘<code class=css>wrap-flow:
start</code>’ interacting with various writing modes.
</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 href="#CSS3-WRITING-MODES"
rel=biblioentry>[CSS3-WRITING-MODES]<!--{{!CSS3-WRITING-MODES}}--></a> of
the content wrapping around the <a href="#exclusion-area">exclusion
area</a>.
<p>An <a href="#exclusion-element">exclusion element</a> establishes a new
<a href="">block formatting context</a> (see <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>) for its content.
<div class=figure> <img
alt="General illustration showing how exclusions combine"
src="images/exclusions-illustration.png" width="70%">
<p class=caption>Combining exclusions
</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
href="#wrapping-context">wrapping context</a>. A, B, C and D have their
respective ‘<a href="#wrap-flow"><code
class=property>wrap-flow</code></a>’ computed to ‘<code
class=property>both</code>’, ‘<code class=property>start</code>’,
‘<code class=property>end</code>’ and ‘<code
class=property>clear</code>’ respectively. The lighter gray areas show
the additional areas that are excluded for inline layout as a result of
the ‘<a href="#wrap-flow"><code
class=property>wrap-flow</code></a>’value. For example, the area to the
right of ‘<code class=property>B</code>’ cannot be used for inline
layout of left-to-right writing mode content because the ‘<a
href="#wrap-flow"><code class=property>wrap-flow</code></a>’ for
‘<code class=property>B</code>’ is ‘<code
class=property>start</code>’.
<p> The background ‘<code class=property>blue</code>’ 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.
<div class=example>
<p> The ‘<a href="#wrap-flow"><code
class=property>wrap-flow</code></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 href="#wrap-flow"><code
class=property>wrap-flow</code></a>’ property. The gray grid lines are
marking the grid cells. and the blue area is the exclusion box
(positioned by the grid).
<table class=example-table>
<tbody>
<tr>
<td><code class=html>.exclusion{ wrap-flow: auto; }</code>
<td><code class=html>.exclusion{ wrap-flow: both; }</code>
<tr>
<td><img alt="Example rendering for wrap-side: auto"
src="images/exclusion_wrap_side_auto.png">
<td><img alt="Example rendering for wrap-side: both"
src="images/exclusion_wrap_side_both.png">
<tr>
<td><code class=html>.exclusion{ wrap-flow: start; }</code>
<td><code class=html>.exclusion{ wrap-flow: end; }</code>
<tr>
<td><img alt="Example rendering for wrap-side: start"
src="images/exclusion_wrap_side_left.png">
<td><img alt="Example rendering for wrap-side: end"
src="images/exclusion_wrap_side_right.png">
<tr>
<td><code class=html>.exclusion{ wrap-flow: minimum; }</code>
<td><code class=html>.exclusion{ wrap-flow: maximum; }</code>
<tr>
<td><img alt="Example rendering for wrap-side: minimum"
src="images/exclusion_wrap_side_minimum.png">
<td><img alt="Example rendering for wrap-side: maximum"
src="images/exclusion_wrap_side_maximum.png">
<tr>
<td><code class=html>.exclusion{ wrap-flow: clear; }</code>
<td>
<tr>
<td><img alt="Example rendering for wrap-side: clear"
src="images/exclusion_wrap_side_clear.png">
<td>
</table>
</div>
<!-- End section "wrap-flow Property" -->
<!-- End section "Declaring Exclusions" -->
<h3 id=scope-and-effect-of-exclusions><span class=secno>3.2. </span>Scope
and effect of exclusions</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 href="#wrap-through"><code
class=property>wrap-through</code></a>’ property can be used (see the <a
href="#propagation-of-exclusions">propagation of exclusions</a> section
below).
<p> As a reminder, for exclusions with ‘<code
class=css>position:fixed</code>’, the containing block is that of the
root element.</p>
<!-- End section "Scope and Effect of Exclusions" -->
<h3 id=propagation-of-exclusions><span class=secno>3.3. </span>Propagation
of Exclusions</h3>
<p> By default, an element inherits its parent <a
href="#wrapping-context">wrapping context</a>. In other words it is
subject to the exclusions defined <a href="#outside-and-inside"
title=outside-inside>outside</a> the element.
<p>Setting the ‘<a href="#wrap-through"><code
class=property>wrap-through</code></a>’ property to ‘<code
class=property>none</code>’ prevents an element from inheriting its
parent <a href="#wrapping-context">wrapping context</a>. In other words,
exclusions defined ‘<code class=property>outside</code>’ the element,
have not effect on the element's children layout.
<div class=note> Exclusions defined by an element's descendants still
contribute to their containing block's <a
href="#wrapping-context">wrapping context</a>. If that containing block is
a child of an element with ‘<a href="#wrap-through"><code
class=property>wrap-through</code></a>’ computes to none, or the element
itself, then exclusion still have an effect on the children of that
containing block element.</div>
<h4 id=wrap-through-property><span class=secno>3.3.1. </span>The ‘<a
href="#wrap-through"><code class=property>wrap-through</code></a>’
Property</h4>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-through title="'wrap-through'">wrap-through</dfn>
<tr>
<th>Value:
<td><var>wrap</var> | <var>none</var>
<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
</table>
<p>The values of this property have the following meanings:
<dl>
<dt><dfn id=wrap title="'wrap-through'!!'wrap'">wrap</dfn>
<dd> The element inherits its parent node's <a
href="#wrapping-context">wrapping context</a>. Its descendant inline
content wraps around exclusions defined <a href="#outside-and-inside"
title=outside-inside>outside</a> the element.
</dl>
<dl>
<dt><dfn id=none title="'wrap-through'!!'none'">none</dfn>
<dd> The element does not inherit its parent node's <a
href="#wrapping-context">wrapping context</a>. Its descendants are only
subject to exclusion areas defined <a href="#outside-and-inside"
title=outside-inside>inside</a> the element.
</dl>
<div class=example>
<p> Using the ‘<a href="#wrap-through"><code
class=property>wrap-through</code></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>
<img alt="Example rendering of wrap-through: wrap | none"
class=singleImgExample src="images/exclusion_wrap_through.png"
style="max-width:40%"></div>
<!-- End section "wrap-through property" -->
<!-- End section "Propagation of Exclusions" -->
<h3 id=exclusions-order><span class=secno>3.4. </span>Exclusions order</h3>
<p> Exclusions follow the painting order (See <a href="#CSS21"
rel=biblioentry>[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 ‘<code
class=property>z-index</code>’ 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 href="#CSS21"
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>). Statically positioned
exclusions are not affected by the ‘<code
class=property>z-index</code>’ property and thus follow the painting
order.
<div class=example>
<p>Ordering of exclusions.
<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>
<tbody>
<tr>
<td style="width:50%"><code class=html>.middle { z-index: auto;
}</code>
<td style="width:50%"><code class=html>.middle { z-index: 1; }</code>
<tr>
<td><img alt="Example rendering of default exclusion ordering."
class=singleImgExample src="images/exclusion_ordering.png">
<td><img alt="Example rendering of default exclusion ordering."
class=singleImgExample src="images/exclusion_ordering_z_order.png">
</table>
</div>
<!-- End section "Order of Exclusions" -->
<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?
</div>
</div>
</div>
<div class=issue>
<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>Disallow exclusions in positioning schemes with no collision
avoidance.
<li>Define collision-avoidance behavior for positioning schemes without
it, and use this behavior by default with exclusions.
</ol>
</div>
<h3 id=exclusions-processing-model><span class=secno>3.5. </span>Processing
model</h3>
<h4 id=exclusions-processing-model-description><span class=secno>3.5.1.
</span>Description</h4>
<p>Applying exclusions is a two-step process:
<ul>
<li><strong>Step 1</strong>: resolve exclusion boxes belonging to each <a
href="#wrapping-context">wrapping context</a>
<li><strong>Step 2</strong>: resolve <a href="#wrapping-context">wrapping
context</a>s 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
<a href="#exclusion-area">exclusion areas</a>
</ul>
</ul>
<h4
id=step-1-resolve-exclusion-boxes-belonging-to-each-wrapping-context><span
class=secno>3.5.2. </span>Step 1: resolve exclusion boxes belonging to
each <a href="#wrapping-context">wrapping context</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 href="#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 href="#wrap-flow"><code
class=property>wrap-flow</code></a>’ that is not <code
class=css>auto</code>.
<h4 id=step-2-resolve-wrapping-contexts-layout-containing-blocks><span
class=secno>3.5.3. </span>Step 2: resolve wrapping contexts and lay out
containing blocks</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 href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>), the
the agent processes each containing block in two sub-steps.
<h4 id=step-2-A-resolve-exclusions-position-and-size><span
class=secno>3.5.4. </span>Step 2-A: resolve the position and size of
exclusion boxes</h4>
<p>Resolving the position and size of <a href="#exclusion-box">exclusion
boxes</a> in the <a href="#wrapping-context">wrapping context</a> may or
may not require a layout. For example, if an <a
href="#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.