-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathOverview.html
More file actions
1461 lines (1077 loc) · 45.2 KB
/
Overview.html
File metadata and controls
1461 lines (1077 loc) · 45.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html dir=ltr lang=en>
<head profile="http://www.w3.org/2006/03/hcard"><meta content="HTML Tidy for
Mac OS X (vers 31 October 2006 - Apple Inc. build 15.3.6), see www.w3.org"
name=generator>
<meta content="IE=edge" http-equiv=X-UA-Compatible>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Exclusions Module</title>
<link href="http://dev.w3.org/csswg/default.css" rel=stylesheet
type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=Stylesheet
type="text/css">
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo--></p>
<h1>CSS Exclusions Module</h1>
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 4 May 2011</h2>
<dl>
<dt>This version:
<dd><a
href="http://www.w3.org/TR/2011/ED-css3-exclusions-20110504">http://www.w3.org/csswg/css3-exclusions</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-exclusions">http://www.w3.org/csswg/css3-exclusions</a>
<dt>Previous version:
<dd>none
<dt>Editors:
<dd class=vcard><span class=fn>Vincent Hardy</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>vhardy@adobe.com</span>
<dt>Authors and Former Editors:
<dd class=vcard><span class=fn>Stephen Zilles</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>szilles@adobe.com</span>
<dd class=vcard><span class=fn>Alexandru Chiculita</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>achicu@adobe.com</span>
<dd class=vcard><span class=fn>Andrei Bucur</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>abucur@adobe.com</span>
<dd class=vcard><span class=fn>Mihnea Ovidenie</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>mihnea@adobe.com</span>
<dd class=vcard><span class=fn>Peter Sorotokin</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>psorotok@adobe.com</span>
<dd class=vcard><span class=fn>Virgil Palanciuc</span>, <span
class=org>Adobe Systems, Inc.</span>, <span
class=email>virgilp@adobe.com</span>
<dd class=vcard><span class=fn>Arno Gourdol</span>, <span class=org>Adobe
Systems, Inc.</span>, <span class=email>agourdol@adobe.com</span>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2011 <a
href="http://www.w3.org/"><acronym title="World Wide Web
Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym
title="European Research Consortium for Informatics and
Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>CSS Exclusions extend the concept of CSS floats (see <a href="#CSS21"
rel=biblioentry>[CSS21]<!--{{CSS21}}--></a>): they provide the ability to
exclude arbitrary areas around which content can flow. CSS Exclusions also
allow content to flow in these exclusions areas. CSS Exclusions enable
sophisticated layouts, for example having content flow into and/or around
circles or other, arbitrarily complex shapes.
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss3-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
“css3-exclusions” in the subject, preferably like this:
“[<!---->css3-exclusions<!---->] <em>…summary of
comment…</em>”
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<!--end-status-->
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#exclusions-abstract"><span class=secno>1.
</span>Introduction</a>
<li><a href="#background"><span class=secno>2. </span>Background</a>
<ul class=toc>
<li><a href="#exclusion-properties"><span class=secno>2.1.
</span>Properties</a>
<ul class=toc>
<li><a href="#the-wrap-shape-mode-property"><span class=secno>2.1.1.
</span>The ‘<code class=property>wrap-shape-mode</code>’
property</a>
<ul class=toc>
<li><a href="#combining-exclusions"><span class=secno>2.1.1.1.
</span>Combining exclusions</a>
</ul>
<li><a href="#the-wrap-shape-order-property"><span class=secno>2.1.2.
</span>The ‘<code class=property>wrap-shape-order</code>’
property</a>
<li><a href="#the-wrap-shape-property"><span class=secno>2.1.3.
</span>The ‘<code class=property>wrap-shape</code>’
property</a>
<ul class=toc>
<li><a href="#computing-shapes"><span class=secno>2.1.3.1.
</span>Computing the shapes</a>
</ul>
<li><a href="#define-exclusion-using-an-image-alpha-ch"><span
class=secno>2.1.4. </span>Define exclusion using an image alpha
channel: ‘<code class=property>wrap-shape-image</code>’
property</a>
<li><a href="#wrap-shape-image-threshold-property"><span
class=secno>2.1.5. </span>‘<code
class=property>wrap-shape-image-threshold</code>’ property</a>
<li><a href="#other-wrap-shape-image-properties"><span
class=secno>2.1.6. </span>Other wrap-shape-image properties</a>
<li><a href="#wrap-shape-margin-wrap-shape-padding-pro"><span
class=secno>2.1.7. </span>‘<code
class=property>wrap-shape-margin</code>’, ‘<code
class=property>wrap-shape-padding</code>’ properties</a>
<li><a href="#affecting-the-exclusion-shape"><span class=secno>2.1.8.
</span>Affecting the exclusion shape</a>
<li><a href="#affecting-the-content-shape"><span class=secno>2.1.9.
</span>Affecting the content shape</a>
</ul>
</ul>
<li><a href="#q-and-a"><span class=secno>3. </span>Q&A</a>
<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>
</ul>
<!--end-toc-->
<h2 id=exclusions-abstract><span class=secno>1. </span>Introduction</h2>
<p>The sections below define features that allow text to wrap around and
inside non-rectangular shapes. The term <strong>"exclusion shape"</strong>
refers to the exterior of the shape and the term <strong>"content
shape"</strong> refers to the interior of the shape. The text will wrap
around the <strong>"exclusion shape"</strong> and will wrap inside the
<strong>"content shape"</strong>.
<h2 id=background><span class=secno>2. </span>Background</h2>
<p><em>This section is not normative.</em>
<p>Exclusions are arbitrary shapes that will be avoided by the user agent
when laying out content. The exclusion shape of an element is generated
from the element's ‘<a href="#wrap-shape"><code
class=property>wrap-shape</code></a>’ property. The exclusion area
is computed relative to the content box of the element on which the
exclusion is specified.
<p>Elements that specify ‘<a href="#wrap-shape-mode"><code
class=property>wrap-shape-mode</code></a>’ different than
‘<code class=property>none</code>’ setup a wrapping context
for all the child elements.
<p><strong>Note:</strong> Elements that have no wrapping context are not
affected by any exclusion.
<p>Exclusion shapes affect only the content outside the element on which
the exclusion was defined. In other words, exclusion shapes do not affect
the element's children.
<p>The ‘<a href="#wrap-shape-mode"><code
class=property>wrap-shape-mode</code></a>’ property is used to
enable the definition of exclusion shape. Setting ‘<a
href="#wrap-shape-mode"><code
class=property>wrap-shape-mode</code></a>’ to something other than
‘<code class=property>none</code>’ will affect both exterior
and interior element's content. It will make all the elements outside wrap
around the shape defined by ‘<a href="#wrap-shape"><code
class=property>wrap-shape</code></a>’. Moreover, the children
elements will wrap inside the specified shape.
<p><br>
<p>There are two other properties that can be used in conjunction with the
‘<a href="#wrap-shape"><code
class=property>wrap-shape</code></a>’:
<dl>
<dt>‘<a href="#wrap-shape-padding"><code
class=property>wrap-shape-padding</code></a>’
<dd>contracts the boundary of the wrap shape to obtain a content shape
<dt>‘<a href="#wrap-shape-margin"><code
class=property>wrap-shape-margin</code></a>’
<dd>expands the boundary of the wrap shape to obtain an exclusion shape
</dl>
<p>By default, the shape is defined by the content box of the element. The
content shape will be intersected with the exclusion shape at the
content-block coordinate space using exclusion shape projections. If
multiple parent elements define content shapes, only the nearest one in
the DOM tree is used to calculate the wrapping area inside which the
element is laid out.
<p>Another property, ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’, describes the layer at
which the exclusion works. An exclusion can affect all the elements in the
same exclusion context with the ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ smaller or equal than
its ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’.
<p>The ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ property was necessary
to describe a sort of grouping between the elements affected by exclusion
shapes. We wanted to avoid overloading the meaning of ‘<code
class=property>z-index</code>’ property (which is available only for
elements with ‘<code class=css>position</code>’ property set)
and also we wanted something more than just the DOM order.
<p><span>The ‘wrap-shape-order’ property does not influence the
positioning of DOM elements.</span><br>
<p>When laying out content, the user agent will compute a dependency graph
for DOM elements that will take wrap shapes into account. The dependency
graph will be computed based on the values of ‘<a
href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ property. For elements
with equal ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ values, dependency is
computed based on the order of the elements in DOM.
<h3 id=exclusion-properties><span class=secno>2.1. </span>Properties</h3>
<h4 id=the-wrap-shape-mode-property><span class=secno>2.1.1. </span>The
‘<a href="#wrap-shape-mode"><code
class=property>wrap-shape-mode</code></a>’ property</h4>
<p>By default, the property has the value ‘<code
class=property>none</code>’ and the engine will not use the element
as an text-wrapping exclusions for other elements. Setting the property to
‘<code class=property>around</code>’, ‘<code
class=property>left</code>’, ‘<code
class=property>right</code>’, ‘<code
class=property>maximum</code>’ or ‘<code
class=property>top-bottom</code>’ will enable the exclusion
text-wrapping features and the wrapping mode for the outside content. The
element's inside content will always fill the content shape.
<p>The element will be considered an exclusion shape for anything outside
the element and a content shape for everything inside that element. By
‘<code class=property>outside</code>’ we mean the elements in
DOM that are not children of the element on which the wrap shape was
defined and have a wrapping context. By ‘<code
class=property>inside</code>’ we mean the children of the element on
which the wrap shape was defined. The default shape is the content box as
defined by the CSS box model.
<p>When the property is set to ‘<code
class=property>content</code>’ only the elements inside the element
will wrap inside the content shape. The ‘<code
class=property>content</code>’ value is used to disable the
exclusion shape while still keeping the content shape enabled.
<p>The content shape does not affect the element's children with
‘<code class=property>position</code>’ = fixed or absolute
(and the children of those elements).
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-shape-mode>wrap-shape-mode</dfn>
<tr>
<th>Value:
<td>none | around | left | right | maximum | top-bottom | content
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>any block element
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
</table>
<ul>
<li><strong>none</strong>: Disables the text wrapping feature. Setting the
‘<a href="#wrap-shape-mode"><code
class=property>wrap-shape-mode</code></a>’ to ‘<code
class=property>none</code>’ will disable both the exclusion shape
and the content shape.
<li><strong>around</strong>: Wrap the outside content on all sides of the
exclusion (see the example 1).
<li><strong>left</strong>: Wrap the outside content on the left side of
the exclusion.
<li><strong>right</strong>: Wrap the outside content on the right side of
the exclusion.
<li><strong>maximum</strong>: Wrap the outside content only in the segment
(left/right) with the maximum size.
<li><strong>top-bottom</strong>: Wrap the outside content on top and
bottom of the exclusion.
<li><strong>content</strong>: Do not wrap the outside content. Wrap only
the inside content.
</ul>
<table>
<tbody>
<tr>
<td><img alt="Example rendering for wrap-shape-mode: around"
src="images/wrap-shape-mode-around.jpg">
<td><img alt="Example rendering for wrap-shape-mode: content"
src="images/wrap-shape-mode-content.jpg">
<tr>
<td><img alt="Example rendering for wrap-shape-mode: left"
src="images/wrap-shape-mode-left.jpg">
<td><img alt="Example rendering for wrap-shape-mode: right"
src="images/wrap-shape-mode-right.jpg">
<tr>
<td><img alt="Example rendering for wrap-shape-mode: maximum"
src="images/wrap-shape-mode-max.jpg">
<td><img alt="Example rendering for wrap-shape-mode: top-bottom"
src="images/wrap-shape-mode-top-bottom.jpg">
</table>
<div class=example>
<p>Define a circle as an exclusion shape. The center of the circle shape
is computed as follows: cx = 50% from the div width, cy = 50% from the
div height. The div has the id = "circle" and the center of the circle is
calculated percent from the div box dimensions. The radius cannot be
specified as percent, therefore is specified in units.</p>
<pre>
<style>
#circle {
wrap-shape: circle(50%, 50%, 30px);
wrap-shape-margin: 10px;
}
</style>
<div id="circle">
<img src="mycircle.png"/>
</div>
<div>Lorem ipsum</div>
</pre>
<p>It might be easier to just use the original image alpha channel to
define the exclusion shape.</p>
<pre>
<style>
#circle {
background: url(mycircle.png);
wrap-shape-image: url(mycircle.png);
wrap-shape-margin: 10px;
}
</style>
<div id="circle"></div>
<div>Lorem ipsum</div>
</pre>
<div class=figure>
<p><img alt="Text wrapping around a circle" src="images/example1.jpg"></p>
<p class=caption>The #circle DIV's shape is used as an exclusion for the
region with content. Note: mycircle.png has a solid fill</p>
</div>
</div>
<h5 id=combining-exclusions><span class=secno>2.1.1.1. </span>Combining
exclusions</h5>
<p>There are cases when multiple exclusions with different ‘<code
class=property>left</code>’ or ‘<code
class=property>right</code>’ modes will overlap the same text lines.
In that case the rules will still apply, meaning that overlapping lines
will be skipped (see the image below for more details).
<p><img alt="Combining exclusions with left and right wrap modes"
src="images/wrap-shape-mode-combine.jpg">
<p>We thought about defining a value ‘<code
class=property>exclusion</code>’ (‘<code
class=property>no-content</code>’) for the ‘<a
href="#wrap-shape-mode"><code
class=property>wrap-shape-mode</code></a>’ property. Such value
would make the wrap shape as exclusion only, as opposed to content.
However, we were unable to find a compelling reason/use case for such a
value.
<p class=issue>This section on grouping exclusions or describing their
interactions needs to be further detailed.
<h4 id=the-wrap-shape-order-property><span class=secno>2.1.2. </span>The
‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ property</h4>
<p>Exclusions will only affect the block elements with equal or smaller
‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ value in the same
wrapping context. The values can be both positive and negative. A
‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ value other than auto,
will establish a new wrapping context, in the same way ‘<code
class=property>z-index</code>’ non auto values establish a new
stacking context.
<p>The user agent will sort all the elements using the ‘<a
href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ property. The elements
with a smaller order will wrap around the elements with bigger ‘<a
href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’. Elements with equal
‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ values will be sorted
using the order in the source DOM.
<p>When the ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ is set to auto, the
‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ is set to 0.
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-shape-order>wrap-shape-order</dfn>
<tr>
<th>Value:
<td><var><integer></var> | auto
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>any block element, exclusions
<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>Values have the following meaning:
<ul>
<li><strong><integer></strong>: The order of the wrapping shape. The
element also establishes a new wrapping context.
<li><strong>auto</strong>: The ‘<a href="#wrap-shape-order"><code
class=property>wrap-shape-order</code></a>’ is set to 0. The
element does not establish a new wrapping context, unless it is a root
element.
</ul>
<h4 id=the-wrap-shape-property><span class=secno>2.1.3. </span>The
‘<a href="#wrap-shape"><code
class=property>wrap-shape</code></a>’ property</h4>
<p>Exclusion shape can get out of the content box of the element on which
it is defined. In this case, the exclusion shape is not clipped to the
margins of the
<p>As opposed to the exclusion shape, the content shape will be clipped by
the content-box rectangle.
<div class=example>
<p>Exclusion shape (and content shape) defined using a polygon</p>
<pre>
wrap-shape: polygon(x1, y1, …, xn, yn);
</pre>
</div>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-shape>wrap-shape</dfn>
<tr>
<th>Value:
<td><var><shape> | auto</var>
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>any block element
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to the element width or height
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>the specified value
</table>
<p>Shapes are used to describe the value of the ‘<a
href="#wrap-shape"><code class=property>wrap-shape</code></a>’
property. The ‘<a href="#wrap-shape"><code
class=property>wrap-shape</code></a>’ property is used to define the
boundary in which to flow content and also used to define the area to be
avoided when laying out content.
<p>The shape can be defined using SVG style basic shapes as defined by the
SVG Shapes.
<dl>
<dt>auto
<dd>The wrap-shape will computed based on the content box of the element.
<dt><shape>
<dd>A shape defined in the <a href="#computing-shapes">Computing the
shapes</a> section.
</dl>
<h5 id=computing-shapes><span class=secno>2.1.3.1. </span>Computing the
shapes</h5>
<p>All the lengths can be expressed in percentages and are defined in the
coordinate space of the element. Percentages will take into account the
element width/height excluding any padding or margins. The (x,y)
coordinates are relative to the block's content box.
<p>When defining a polygon area using percentages, the content box of the
element must always be fully known in advance.
<dl>
<dt>rect(x, y, width, height, [[rx], ry])
<dd>
<ul>
<li><strong>x, y, width and height</strong> - define the bounding box of
the rectangle
<li><strong>rx</strong> - For rounded rectangles, the x-axis radius of
the ellipse used to round off the corners of the rectangle
<li><strong>ry</strong> - For rounded rectangles, the y-axis radius of
the ellipse used to round off the corners of the rectangle
</ul>
<dt>circle(cx, cy, r)
<dd>
<ul>
<li><strong>cx</strong> - The x-axis coordinate of the center of the
circle
<li><strong>cy</strong> - The y-axis coordinate of the center of the
circle
<li><strong>r</strong> - The radius of the circle. Note: Cannot be
expressed as a percentage.
</ul>
<dt>ellipse(cx, cy, rx, ry)
<dd>
<ul>
<li><strong>cx</strong> - The x-axis coordinate of the center of the
ellipse
<li><strong>cy</strong> - The y-axis coordinate of the center of the
ellipse
<li><strong>rx</strong> - The x-axis radius of the ellipse
<li><strong>ry</strong> - The y-axis radius of the ellipse
</ul>
<dt>polygon([fillRule], x1, y1 x2, y2 x3, y3 … xn, yn)
<dd>
<ul>
<li><strong>fillRule</strong> - The filling rule used to determine the
interior of the polygon. See fill-rule property in SVG for details.
Possible values are nonzero or evenodd. Default value when omitted is
nonzero.
<li><strong>xi</strong> - The x-axis coordinate of the i-th vertex of
the polygon
<li><strong>yi</strong> - The y-axis coordinate of the i-th vertex of
the polygon
</ul>
<p>If the polygon is not closed the user-agent will automatically add a
new vertex at the end.</p>
<br>
<dt>path([fillRule], ...)
<dd>
<ul>
<li><strong>fillRule</strong> - The filling rule used to determine the
interior of the polygon. See fill-rule property in SVG for details.
Possible values are nonzero or evenodd. Default value when omitted is
nonzero.
</ul>
<p>The content of the path() function will be parsed using SVG PathData
notation.</p>
</dl>
<div class=example>
<pre>
<div id="circle" style="wrap-shape: circle(50%, 50%, 40px); width: 100px;
height: 100px;"></div>
</pre>
<p>In this example, the actual position of the exclusion shape polygon is
determined based on the position of the "circle" div element.</p>
</div>
<h4 id=define-exclusion-using-an-image-alpha-ch><span class=secno>2.1.4.
</span>Define exclusion using an image alpha channel: ‘<a
href="#wrap-shape-image"><code
class=property>wrap-shape-image</code></a>’ property</h4>
<p>One can define an exclusion by specifying a source image whose alpha
channel is used to compute the exclusion shape. As image, one can specify
the same values as the ones used when defining the values for the
‘<code class=property>background-image</code>’ property.
<p>The exclusion shape is computed to be the path that encloses the area
where the opacity of the specified image is greater than the ‘<a
href="#wrap-shape-image-threshold"><code
class=property>wrap-shape-image-threshold</code></a>’ value. If the
‘<a href="#wrap-shape-image-threshold"><code
class=property>wrap-shape-image-threshold</code></a>’ is not
specified, the default value to be considered is 50%.
<p>Note: Images can also define cavities and text should wrap inside them.
In order to avoid that, another exclusion element can be overlaid.
<div class=example>
<p>Exclusion shape defined using the alpha channel of the specified image,
opacity threshold 50%.</p>
<pre>
<style>
#id {
wrap-shape-image: url(myimage.png);
}
</style>
</pre>
</div>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-shape-image>wrap-shape-image</dfn>
<tr>
<th>Value:
<td>none | <var><url></var>
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>any block element
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>the specified value
</table>
<h4 id=wrap-shape-image-threshold-property><span class=secno>2.1.5.
</span>‘<a href="#wrap-shape-image-threshold"><code
class=property>wrap-shape-image-threshold</code></a>’ property</h4>
<p>Defines the alpha channel threshold used to define the shape using an
image. The default is 50%, meaning that all the pixels that are more than
50% transparent define the path of the exclusion shape.
<div class=example>
<p>Exclusion shape defined using the alpha channel of the specified image,
opacity filter 75%.</p>
<pre>
<style>
#id {
wrap-shape-image: url(myimage.png);
wrap-shape-image-threshold: 75%;
}
</style>
</pre>
</div>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-shape-image-threshold>wrap-shape-image-threshold</dfn>
<tr>
<th>Value:
<td><var><percent></var>
<tr>
<th>Initial:
<td>50%
<tr>
<th>Applies to:
<td>any block element
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>the specified value
</table>
<h4 id=other-wrap-shape-image-properties><span class=secno>2.1.6.
</span>Other wrap-shape-image properties</h4>
<p>‘<code class=property>wrap-shape-image-repeat</code>’,
‘<code class=property>wrap-shape-image-attachment</code>’,
‘<code class=property>wrap-shape-image-position</code>’,
‘<code class=property>wrap-shape-image-size</code>’
<p>These properties are equivalent to the ones available for the
‘<code class=css>background</code>’ property as defined in CSS
Background module . The properties apply only to the ‘<a
href="#wrap-shape-image"><code
class=property>wrap-shape-image</code></a>’.
<h4 id=wrap-shape-margin-wrap-shape-padding-pro><span class=secno>2.1.7.
</span>‘<a href="#wrap-shape-margin"><code
class=property>wrap-shape-margin</code></a>’, ‘<a
href="#wrap-shape-padding"><code
class=property>wrap-shape-padding</code></a>’ properties</h4>
<p>Because the ‘<a href="#wrap-shape"><code
class=property>wrap-shape</code></a>’ and ‘<a
href="#wrap-shape-image"><code
class=property>wrap-shape-image</code></a>’ properties define a
single shape for both the exclusion shape and the content shape, two new
properties allow to distinguish between them even more using specified
offsets: ‘<a href="#wrap-shape-margin"><code
class=property>wrap-shape-margin</code></a>’ property can be used to
offset the exclusion shape from the one specified with ‘<a
href="#wrap-shape"><code class=property>wrap-shape</code></a>’ or
‘<a href="#wrap-shape-image"><code
class=property>wrap-shape-image</code></a>’ properties. ‘<a
href="#wrap-shape-padding"><code
class=property>wrap-shape-padding</code></a>’ property can be used
to offset the content shape from the one specified with ‘<a
href="#wrap-shape"><code class=property>wrap-shape</code></a>’ or
‘<a href="#wrap-shape-image"><code
class=property>wrap-shape-image</code></a>’ properties.
<p>The exclusion shape is used to wrap elements that are not content of the
specified block. The content shape is used to wrap the content elements.
<p>Both margin and padding can take negative values. However, the content
shape will be clipped by the content-box rectangle, so that interior
elements will not be rendered outside the content-box of the block
element.
<div class=example>
<p>Text wrapping around an irregular shape.</p>
<pre>
<style>
#div2 {
wrap-shape: poly(50px, 50px, 10px);
wrap-shape-margin: 10px;
wrap-shape-padding: 10px;
}
</style>
</pre>
</div>
<h4 id=affecting-the-exclusion-shape><span class=secno>2.1.8.
</span>Affecting the exclusion shape</h4>
<table class=propdef>
<tbody>
<tr>
<th>Name:
<td><dfn id=wrap-shape-margin>wrap-shape-margin</dfn>
<tr>
<th>Value:
<td>length
<tr>
<th>Initial: