Skip to content

Commit b567196

Browse files
committed
Added/fixed/improved examples and reference images
1 parent 4a79d4d commit b567196

12 files changed

Lines changed: 506 additions & 46 deletions

css3-exclusions/Exclusions.src.html

Lines changed: 101 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ <h4 id="wrap-flow-property">The 'wrap-flow' property</h4>
351351

352352
&lt;style type="text/css"&gt;
353353
#grid {
354-
width: 100em;
355-
height: 100em;
354+
width: 30em;
355+
height: 30em;
356356
display: grid;
357-
grid-columns: 50% 20% 20%;
357+
grid-columns: 50% 25% 25%;
358358
grid-rows: 40% 20% 40%;
359359
}
360360

@@ -372,6 +372,9 @@ <h4 id="wrap-flow-property">The 'wrap-flow' property</h4>
372372
}
373373
&lt;/style&gt;
374374
</pre></code>
375+
<p>The following figures illustrate the visual rendering for different values
376+
of the 'wrap-flow' property. The gray grid lines are marking the grid cells. and the
377+
blue area is the exclusion box (positioned by the grid).</p>
375378
<table class="example-table">
376379
<tr>
377380
<td><code class="html">#exclusion{ wrap-flow: auto; }</code></td>
@@ -391,11 +394,11 @@ <h4 id="wrap-flow-property">The 'wrap-flow' property</h4>
391394
</tr>
392395
<tr>
393396
<td><code class="html">#exclusion{ wrap-flow: maximum; }</code></td>
394-
<td><code class="html">#exclusion{ wrap-flow: maximum; }</code></td>
397+
<td><code class="html">#exclusion{ wrap-flow: minimum; }</code></td>
395398
</tr>
396399
<tr>
397-
<td><img src="images/exclusion_wrap_side_maximum_L.png" alt="Example rendering for wrap-side: maximum" /></td>
398-
<td><img src="images/exclusion_wrap_side_maximum_R.png" alt="Example rendering for wrap-side: maximum" /></td>
400+
<td><img src="images/exclusion_wrap_side_maximum.png" alt="Example rendering for wrap-side: maximum" /></td>
401+
<td><img src="images/exclusion_wrap_side_minimum.png" alt="Example rendering for wrap-side: maximum" /></td>
399402
</tr>
400403
<tr>
401404
<td><code class="html">#exclusion{ wrap-flow: clear; }</code></td>
@@ -407,6 +410,7 @@ <h4 id="wrap-flow-property">The 'wrap-flow' property</h4>
407410
</tr>
408411
</table>
409412
</div>
413+
410414
<!-- End section "wrap-flow Property" -->
411415
<!-- End section "Declaring Exclusions" -->
412416

@@ -705,7 +709,7 @@ <h3 id="exclusions-order">Exclusions order</h3>
705709
appears on top of all other exclusion, thus it affects the inline flow content of
706710
all other preceding exclusions or elements descendant of the same containing block.
707711
The 'z-index' property can be used to change the ordering of
708-
<a href="http://www.w3.org/TR/CSS2/visuren.html#choose-position"positioned</a> exclusion
712+
<a href="http://www.w3.org/TR/CSS2/visuren.html#choose-position">positioned</a> exclusion
709713
boxes (see [[!CSS21]]). Statically positioned exclusions are not affected by the
710714
'z-index' property and thus follow the painting order.
711715
</p>
@@ -845,19 +849,53 @@ <h4 id="exclusions-processing-model-example">Example</h4>
845849

846850
<div class="example">
847851
<pre class="html">&lt;html&gt;
848-
&lt;body&gt;
849-
&lt;div id="d1" style="position:relative"&gt;
850-
Lorem ipsusm ...
851-
&lt;p id="e1" style="wrap-flow: both;position:absolute; left:50%; top:50%;
852-
width:40%;height:40%;
853-
margin-left:-20%;margin-right:-20%" &gt;&lt/p&gt;
854-
&lt;/div&gt;
855-
&lt;div id="d2" style="width:100%;height:auto;position:static"&gt;
856-
Lorem ipsusm ...
857-
&lt;p id="e2" style="wrap-flow: both;position:absolute; right:5ex; top:1em;
858-
width:12ex;height:10em;" &gt;&lt/p&gt;
859-
&lt;/div&gt;
860-
&lt;/body&gt;
852+
&lt;style&gt;
853+
#d1 {
854+
position:relative;
855+
height: auto;
856+
color: #46A4E9;
857+
border: 1px solid gray;
858+
}
859+
860+
#e1 {
861+
-webkit-wrap-flow: both;
862+
position: absolute;
863+
left: 50%;
864+
top: 50%;
865+
width: 40%;
866+
height: 40%;
867+
border: 1px solid red;
868+
margin-left: -20%;
869+
margin-top: -20%;
870+
}
871+
872+
#d2 {
873+
position: static;
874+
width: 100%;
875+
height: auto;
876+
color: #808080;
877+
}
878+
879+
#e2 {
880+
-webkit-wrap-flow: both;
881+
position: absolute;
882+
right: 5ex;
883+
top: 1em;
884+
width: 12ex;
885+
height: 10em;
886+
border: 1px solid lime;
887+
}
888+
&lt;/style&gt;
889+
&lt;body&gt;
890+
&lt;div id="d1"&gt;
891+
Lorem ipsusm ...
892+
&lt;p id="e1"&gt;&lt/p&gt;
893+
&lt;/div&gt;
894+
&lt;div id="d2"&gt;
895+
Lorem ipsusm ...
896+
&lt;p id="e2" &gt;&lt/p&gt;
897+
&lt;/div&gt;
898+
&lt;/body&gt;
861899
&lt;/html&gt;</pre>
862900
</div>
863901
<p>The following figures illustrate:</p>
@@ -1045,12 +1083,17 @@ <h3 id="relation-to-box-model-and-float-behavior">Relation to the box model and
10451083
</p>
10461084

10471085
<div class="example">
1048-
<p>CSS 'shape' and CSS box model relation.</p>
1086+
<p>CSS 'shape-outside' and CSS box model relation: the red box illustrates the exclusion element's
1087+
content box, which is unmodified and subject to normal CSS positioning (here absolute positioning).</p>
10491088
<pre><code class="html">
10501089
&lt;style type="text/css"&gt;
10511090
.exclusion {
10521091
wrap-flow: both;
10531092
position: absolute;
1093+
top: 25%;
1094+
left: 25%;
1095+
width: 50%;
1096+
height: 50%;
10541097
shape-outside: circle(50%, 50%, 50%);
10551098
border: 1px solid red;
10561099
}
@@ -1063,7 +1106,44 @@ <h3 id="relation-to-box-model-and-float-behavior">Relation to the box model and
10631106
</code></pre>
10641107
<img class="singleImgExample" src="images/shapes_CSS2.1_MBP.png" alt="Example rendering of circle shape and box model." style="max-width:40%"/>
10651108
</div>
1109+
1110+
<div class="example">
1111+
<p>In the following example the left and right floating <code class="html">div</code> elements
1112+
specify a triangular shape using the 'shape-outside' property.</p>
1113+
1114+
<pre><code class="html">
1115+
&lt;div style="text-align:center;"&gt;
1116+
&lt;div id="float-left"&gt;&lt;/div&gt;
1117+
&lt;div id="float-right"&gt;&lt;/div&gt;
1118+
&lt;div&gt;
1119+
Sometimes a web page's text content appears to be
1120+
funneling your attention towards a spot on the page
1121+
to drive you to follow a particular link. Sometimes
1122+
you don't notice.
1123+
&lt;/div&gt;
1124+
&lt;/div&gt;
1125+
1126+
&lt;style type="text/css"&gt;
1127+
#float-left {
1128+
wrap-flow: right
1129+
shape-outside: polygon(0,0 100%,100% 0,100%);
1130+
float: left;
1131+
width: 40%;
1132+
height: 12ex;
1133+
}
1134+
1135+
#float-right {
1136+
wrap-flow: left;
1137+
shape-outside: polygon(100%,0 100%,100% 0,100%);
1138+
float: right;
1139+
width: 40%;
1140+
height: 12ex;
1141+
}
1142+
&lt;/style&gt;
1143+
&lt;/div&gt;</code></pre>
10661144

1145+
<img class="singleImgExample" src="images/float-shape-outside.png" alt="Using the shape-outside property with a float"/>
1146+
</div>
10671147
<h3 id="shapes-from-svg-syntax">Shapes from SVG Syntax</h3>
10681148
<p>
10691149
Shapes can be specified using <a href="http://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a>.

css3-exclusions/Overview.html

Lines changed: 111 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040

4141
<h1 id=css-exclusions-module>CSS Exclusions and Shapes Module Level 3</h1>
4242

43-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 21 April 2012</h2>
43+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 25 April 2012</h2>
4444

4545
<dl>
4646
<dt>This version:
4747

4848
<dd><a
4949
href="http://dev.w3.org/csswg/css3-exclusions/">http://dev.w3.org/csswg/css3-exclusions/</a></dd>
50-
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-exclusions-20120421/">http://www.w3.org/TR/2012/WD-css3-exclusions-20120421/</a></dd>-->
50+
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-exclusions-20120425/">http://www.w3.org/TR/2012/WD-css3-exclusions-20120425/</a></dd>-->
5151

5252
<dt>Latest version:
5353

@@ -655,10 +655,10 @@ <h4 id=wrap-flow-property><span class=secno>3.1.1. </span>The &lsquo;<a
655655

656656
&lt;style type="text/css"&gt;
657657
#grid {
658-
width: 100em;
659-
height: 100em;
658+
width: 30em;
659+
height: 30em;
660660
display: grid;
661-
grid-columns: 50% 20% 20%;
661+
grid-columns: 50% 25% 25%;
662662
grid-rows: 40% 20% 40%;
663663
}
664664

@@ -677,6 +677,12 @@ <h4 id=wrap-flow-property><span class=secno>3.1.1. </span>The &lsquo;<a
677677
&lt;/style&gt;
678678
</pre>
679679

680+
<p>The following figures illustrate the visual rendering for different
681+
values of the &lsquo;<a href="#wrap-flow"><code
682+
class=property>wrap-flow</code></a>&rsquo; property. The gray grid lines
683+
are marking the grid cells. and the blue area is the exclusion box
684+
(positioned by the grid).</p>
685+
680686
<table class=example-table>
681687
<tbody>
682688
<tr>
@@ -706,14 +712,14 @@ <h4 id=wrap-flow-property><span class=secno>3.1.1. </span>The &lsquo;<a
706712
<tr>
707713
<td><code class=html>#exclusion{ wrap-flow: maximum; }</code>
708714

709-
<td><code class=html>#exclusion{ wrap-flow: maximum; }</code>
715+
<td><code class=html>#exclusion{ wrap-flow: minimum; }</code>
710716

711717
<tr>
712718
<td><img alt="Example rendering for wrap-side: maximum"
713-
src="images/exclusion_wrap_side_maximum_L.png">
719+
src="images/exclusion_wrap_side_maximum.png">
714720

715721
<td><img alt="Example rendering for wrap-side: maximum"
716-
src="images/exclusion_wrap_side_maximum_R.png">
722+
src="images/exclusion_wrap_side_minimum.png">
717723

718724
<tr>
719725
<td><code class=html>#exclusion{ wrap-flow: clear; }</code>
@@ -1086,8 +1092,8 @@ <h3 id=exclusions-order><span class=secno>3.4. </span>Exclusions order</h3>
10861092
descendant of the same containing block. The &lsquo;<code
10871093
class=property>z-index</code>&rsquo; property can be used to change the
10881094
ordering of <a
1089-
href="http://www.w3.org/TR/CSS2/visuren.html#choose-position"
1090-
positioned></a> exclusion boxes (see <a href="#CSS21"
1095+
href="http://www.w3.org/TR/CSS2/visuren.html#choose-position">positioned</a>
1096+
exclusion boxes (see <a href="#CSS21"
10911097
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>). Statically positioned
10921098
exclusions are not affected by the &lsquo;<code
10931099
class=property>z-index</code>&rsquo; property and thus follow the painting
@@ -1259,19 +1265,53 @@ <h4 id=exclusions-processing-model-example><span class=secno>3.5.6.
12591265

12601266
<div class=example>
12611267
<pre class=html>&lt;html&gt;
1262-
&lt;body&gt;
1263-
&lt;div id="d1" style="position:relative"&gt;
1264-
Lorem ipsusm ...
1265-
&lt;p id="e1" style="wrap-flow: both;position:absolute; left:50%; top:50%;
1266-
width:40%;height:40%;
1267-
margin-left:-20%;margin-right:-20%" &gt;&lt/p&gt;
1268-
&lt;/div&gt;
1269-
&lt;div id="d2" style="width:100%;height:auto;position:static"&gt;
1270-
Lorem ipsusm ...
1271-
&lt;p id="e2" style="wrap-flow: both;position:absolute; right:5ex; top:1em;
1272-
width:12ex;height:10em;" &gt;&lt/p&gt;
1273-
&lt;/div&gt;
1274-
&lt;/body&gt;
1268+
&lt;style&gt;
1269+
#d1 {
1270+
position:relative;
1271+
height: auto;
1272+
color: #46A4E9;
1273+
border: 1px solid gray;
1274+
}
1275+
1276+
#e1 {
1277+
-webkit-wrap-flow: both;
1278+
position: absolute;
1279+
left: 50%;
1280+
top: 50%;
1281+
width: 40%;
1282+
height: 40%;
1283+
border: 1px solid red;
1284+
margin-left: -20%;
1285+
margin-top: -20%;
1286+
}
1287+
1288+
#d2 {
1289+
position: static;
1290+
width: 100%;
1291+
height: auto;
1292+
color: #808080;
1293+
}
1294+
1295+
#e2 {
1296+
-webkit-wrap-flow: both;
1297+
position: absolute;
1298+
right: 5ex;
1299+
top: 1em;
1300+
width: 12ex;
1301+
height: 10em;
1302+
border: 1px solid lime;
1303+
}
1304+
&lt;/style&gt;
1305+
&lt;body&gt;
1306+
&lt;div id="d1"&gt;
1307+
Lorem ipsusm ...
1308+
&lt;p id="e1"&gt;&lt/p&gt;
1309+
&lt;/div&gt;
1310+
&lt;div id="d2"&gt;
1311+
Lorem ipsusm ...
1312+
&lt;p id="e2" &gt;&lt/p&gt;
1313+
&lt;/div&gt;
1314+
&lt;/body&gt;
12751315
&lt;/html&gt;</pre>
12761316
</div>
12771317

@@ -1513,14 +1553,21 @@ <h3 id=relation-to-box-model-and-float-behavior><span class=secno>4.1.
15131553
box.
15141554

15151555
<div class=example>
1516-
<p>CSS &lsquo;<code class=property>shape</code>&rsquo; and CSS box model
1517-
relation.</p>
1556+
<p>CSS &lsquo;<a href="#shape-outside"><code
1557+
class=property>shape-outside</code></a>&rsquo; and CSS box model
1558+
relation: the red box illustrates the exclusion element's content box,
1559+
which is unmodified and subject to normal CSS positioning (here absolute
1560+
positioning).</p>
15181561

15191562
<pre><code class=html>
15201563
&lt;style type="text/css"&gt;
15211564
.exclusion {
15221565
wrap-flow: both;
15231566
position: absolute;
1567+
top: 25%;
1568+
left: 25%;
1569+
width: 50%;
1570+
height: 50%;
15241571
shape-outside: circle(50%, 50%, 50%);
15251572
border: 1px solid red;
15261573
}
@@ -1535,6 +1582,45 @@ <h3 id=relation-to-box-model-and-float-behavior><span class=secno>4.1.
15351582
class=singleImgExample src="images/shapes_CSS2.1_MBP.png"
15361583
style="max-width:40%"></div>
15371584

1585+
<div class=example>
1586+
<p>In the following example the left and right floating <code
1587+
class=html>div</code> elements specify a triangular shape using the
1588+
&lsquo;<a href="#shape-outside"><code
1589+
class=property>shape-outside</code></a>&rsquo; property.</p>
1590+
1591+
<pre><code class=html>
1592+
&lt;div style="text-align:center;"&gt;
1593+
&lt;div id="float-left"&gt;&lt;/div&gt;
1594+
&lt;div id="float-right"&gt;&lt;/div&gt;
1595+
&lt;div&gt;
1596+
Sometimes a web page's text content appears to be
1597+
funneling your attention towards a spot on the page
1598+
to drive you to follow a particular link. Sometimes
1599+
you don't notice.
1600+
&lt;/div&gt;
1601+
&lt;/div&gt;
1602+
1603+
&lt;style type="text/css"&gt;
1604+
#float-left {
1605+
wrap-flow: right
1606+
shape-outside: polygon(0,0 100%,100% 0,100%);
1607+
float: left;
1608+
width: 40%;
1609+
height: 12ex;
1610+
}
1611+
1612+
#float-right {
1613+
wrap-flow: left;
1614+
shape-outside: polygon(100%,0 100%,100% 0,100%);
1615+
float: right;
1616+
width: 40%;
1617+
height: 12ex;
1618+
}
1619+
&lt;/style&gt;
1620+
&lt;/div&gt;</code></pre>
1621+
<img alt="Using the shape-outside property with a float"
1622+
class=singleImgExample src="images/float-shape-outside.png"></div>
1623+
15381624
<h3 id=shapes-from-svg-syntax><span class=secno>4.2. </span>Shapes from SVG
15391625
Syntax</h3>
15401626

0 commit comments

Comments
 (0)