Skip to content

Commit 1acb6b0

Browse files
committed
[css-exclusions] shape interpolation and box-sizing
1 parent 9e87880 commit 1acb6b0

2 files changed

Lines changed: 142 additions & 41 deletions

File tree

css3-exclusions/Exclusions.src.html

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,24 +1147,25 @@ <h3 id="relation-to-box-model-and-float-behavior">Relation to the box model and
11471147
<h3 id="basic-shapes-from-svg-syntax">Basic Shapes</h3>
11481148
<p>
11491149
Shapes can be specified using
1150-
syntax similar to <a href="http://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a>.
1150+
syntax similar to SVG's <a href="http://www.w3.org/TR/SVG/shapes.html">basic shapes</a>.
11511151
The definitions use
11521152
<code><a href="http://www.w3.org/TR/css3-values/#lengths">&lt;length&gt;</a></code> type
11531153
and the <code><a href="">&lt;percentage&gt;</a></code> types (see [[!CSS3VAL]]).
11541154
Percentages are resolved
1155-
from the border box
1156-
of the element to which the property applies.
1155+
from the computed value of the
1156+
<a href="http://www.w3.org/TR/css3-ui/#box-sizing">'box-sizing'</a>
1157+
property [[!CSS3UI]]
1158+
on the element to which the property applies.
11571159
For the radius <code>r</code> of the <code>circle</code> shape,
11581160
a percentage value is resolved as
11591161
<a href="http://www.w3.org/TR/SVG/coords.html#Units">specified</a>
11601162
in the SVG recommendation (see [[!SVG11]]).
1161-
SVG strokes are not considered part of the shape,
1162-
thus only the following geometries are valid.
1163+
Path styling like stroking is not considered part of the specified shape.
11631164
</p>
11641165

11651166

11661167
<h4 id="supported-basic-shapes">Supported Shapes</h4>
1167-
The following SVG shapes are supported by the CSS shapes module.
1168+
The following basic shapes are supported.
11681169
<dl>
11691170
<dt><dfn id="rectangle">rectangle</dfn>([&lt;length&gt;|&lt;percentage&gt;]{4} [ curve [&lt;length&gt;|&lt;percentage&gt;]{1,2} ]? )</dt>
11701171
<dd>
@@ -1223,17 +1224,17 @@ <h4 id="supported-basic-shapes">Supported Shapes</h4>
12231224
<dt><dfn id="polygon">polygon</dfn>([&lt;fill-rule&gt;,]? [&lt;length&gt;|&lt;percentage&gt;]{2}#)</dt>
12241225
<dd>
12251226
<ul>
1226-
<li><strong>fillRule</strong> - The filling rule used to determine the interior of the
1227+
<li><strong>fill-rule</strong> - The filling rule used to determine the interior of the
12271228
polygon. See <a href="http://www.w3.org/TR/SVG/painting.html#FillRuleProperty">fill-rule</a> property in SVG for details. Possible values are nonzero
12281229
or evenodd. Default value when omitted is nonzero.</li>
12291230
<li>
12301231
The two length values represent <strong>xi</strong> and <strong>yi</strong> -
12311232
the <strong>x</strong> and <strong>y</strong> axis coordinates of the i-th vertex of the polygon.
12321233
</li>
12331234
</ul>
1234-
<p>
1235-
If the polygon is not closed the user-agent will automatically add a new vertex
1236-
at the end.</p>
1235+
<p>The UA will close a polygon
1236+
by connecting the last vertex
1237+
with the first vertex of the list.</p>
12371238
<br/>
12381239
</dd>
12391240
</dl>
@@ -1274,15 +1275,52 @@ <h4 id='referencing-svg-shapes'>Referencing SVG shapes</h4>
12741275
</pre></code>
12751276
</div>
12761277
<p>
1277-
When using the SVG syntax or referencing SVG elements to define shapes, all the
1278-
lengths expressed in percentages are resolved from the border box of the element.
1279-
The coordinate system for the shape has its origin on the top-left corner of the
1280-
border box with the x-axis running to the right and the y-axis running downwards.
1281-
If the SVG element uses unitless coordinate values, they are equivalent to using
1282-
'px' units. If the border box of the element is dependent on auto sizing (i.e.,
1283-
the element's 'width' or 'height' property is 'auto'), then the percentage values
1278+
When using the SVG syntax
1279+
or referencing SVG elements
1280+
to define shapes,
1281+
the relevant box is determined
1282+
by the computed value of the
1283+
<a href="http://www.w3.org/TR/css3-ui/#box-sizing">'box-sizing'</a>
1284+
property.
1285+
All the lengths expressed in percentages
1286+
are resolved from the relevant box.
1287+
The coordinate system for the shape
1288+
has its origin on the top-left corner of the
1289+
relevant box with the x-axis
1290+
running to the right
1291+
and the y-axis running downwards.
1292+
If the SVG element uses unitless coordinate values,
1293+
they are equivalent to using
1294+
'px' units.
1295+
If the relevant box of the element
1296+
is dependent on auto sizing
1297+
(i.e., the element's 'width' or 'height' property is 'auto'),
1298+
then the percentage values
12841299
resolve to 0.
12851300
</p>
1301+
1302+
<h4 id='basic-shape-interpolation'>Interpolation of Basic Shapes</h4>
1303+
1304+
<p>For interpolating between
1305+
one basic shape and a second,
1306+
the rules described below are applied.
1307+
</p>
1308+
<ul>
1309+
<li>If both basic shapes are of the same type and not of type polygon:
1310+
<ul><li>Interpolate between each value.</li></ul>
1311+
</li>
1312+
<li>If one basic shape is of type rectangle and the second of type circle or ellipse:
1313+
<ul><li>Replace the circle/ellipse with a temporary rectangle of equal dimension.</li>
1314+
<li>Set the values for rx and ry on the temporary rectangle to ‘50%’.</li>
1315+
<li>Interpolate between the two rectangles as above.</li></ul>
1316+
</li>
1317+
<li>If both basic shapes are of type polygon and if both polygons have the same number of vertices:
1318+
<ul><li>Interpolate between each value.</li></ul>
1319+
</li>
1320+
<li>In all other cases:
1321+
<ul><li>No interpolation is specified.</li></ul></li>
1322+
</ul>
1323+
12861324
<!-- End section "Shapes from SVG Syntax -->
12871325

12881326
<h3 id="shapes-from-image">Shapes from Image</h3>
@@ -1446,7 +1484,9 @@ <h4 id="shape-outside-property">The 'shape-outside' Property</h4>
14461484
<p>The values of this property have the following meanings:</p>
14471485
<dl>
14481486
<dt><dfn title="'shape-outside'!!'auto'">auto</dfn></dt>
1449-
<dd>The shape is computed based on the border box of the element.</dd>
1487+
<dd>The shape is computed
1488+
based on the border box of the element for exclusions,
1489+
or computed based on the margin box for floats.</dd>
14501490
</dl>
14511491
<dl>
14521492
<dt><dfn title="'shape-outside'!!'&lt;shape&gt;'">&lt;shape&gt;</dfn></dt>
@@ -2055,6 +2095,8 @@ <h2 class="no-num" id="change-log">Change Log</h2>
20552095

20562096
<h3>Since <a href="http://www.w3.org/TR/2012/WD-css3-exclusions-20120503/">May 3rd 2012</a></h3>
20572097
<ul>
2098+
<li>Added interpolation for basic shapes</li>
2099+
<li>Changed basic shapes to depend on box specified with box-sizing</li>
20582100
<li>Added overflow behavior for shape-inside.</li>
20592101
<li>Added wrap-flow:minimum.</li>
20602102
<li>Clarified processing model.</li>

css3-exclusions/Overview.html

Lines changed: 82 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<meta content="CSS Exclusions and Shapes Module Level 3"
1414
name=dcterms.title>
1515
<meta content=text name=dcterms.type>
16-
<meta content=2012-11-29 name=dcterms.issued>
16+
<meta content=2012-12-01 name=dcterms.issued>
1717
<meta content="http://dev.w3.org/csswg/css3-exclusions/"
1818
name=dcterms.creator>
1919
<meta content=W3C name=dcterms.publisher>
20-
<meta content="http://www.w3.org/TR/2012/ED-css3-exclusions-20121129/"
20+
<meta content="http://www.w3.org/TR/2012/ED-css3-exclusions-20121201/"
2121
name=dcterms.identifier>
2222
<link href="../shared/style/default.css" rel=stylesheet type="text/css">
2323
<script defer=defer
@@ -55,15 +55,15 @@
5555

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

58-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 29 November
58+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 1 December
5959
2012</h2>
6060

6161
<dl>
6262
<dt>This version:
6363

6464
<dd><a
6565
href="http://dev.w3.org/csswg/css3-exclusions/">http://dev.w3.org/csswg/css3-exclusions/</a></dd>
66-
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-exclusions-20121129/">http://www.w3.org/TR/2012/WD-css3-exclusions-20121129/</a></dd>-->
66+
<!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-exclusions-20121201/">http://www.w3.org/TR/2012/WD-css3-exclusions-20121201/</a></dd>-->
6767

6868
<dt>Latest version:
6969

@@ -286,6 +286,9 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
286286

287287
<li><a href="#referencing-svg-shapes"><span class=secno>4.2.2.
288288
</span>Referencing SVG shapes</a>
289+
290+
<li><a href="#basic-shape-interpolation"><span class=secno>4.2.3.
291+
</span>Interpolation of Basic Shapes</a>
289292
</ul>
290293

291294
<li><a href="#shapes-from-image"><span class=secno>4.3. </span>Shapes
@@ -1575,26 +1578,28 @@ <h3 id=relation-to-box-model-and-float-behavior><span class=secno>4.1.
15751578
<h3 id=basic-shapes-from-svg-syntax><span class=secno>4.2. </span>Basic
15761579
Shapes</h3>
15771580

1578-
<p> Shapes can be specified using syntax similar to <a
1579-
href="http://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a>. The
1581+
<p> Shapes can be specified using syntax similar to SVG's <a
1582+
href="http://www.w3.org/TR/SVG/shapes.html">basic shapes</a>. The
15801583
definitions use <code><a
15811584
href="http://www.w3.org/TR/css3-values/#lengths">&lt;length&gt;</a></code>
15821585
type and the <code><a href="">&lt;percentage&gt;</a></code> types (see <a
15831586
href="#CSS3VAL" rel=biblioentry>[CSS3VAL]<!--{{!CSS3VAL}}--></a>).
1584-
Percentages are resolved from the border box of the element to which the
1587+
Percentages are resolved from the computed value of the <a
1588+
href="http://www.w3.org/TR/css3-ui/#box-sizing"><code
1589+
class=property>box-sizing</code></a> property <a href="#CSS3UI"
1590+
rel=biblioentry>[CSS3UI]<!--{{!CSS3UI}}--></a> on the element to which the
15851591
property applies. For the radius <code>r</code> of the <a
15861592
href="#circle"><code>circle</code></a> shape, a percentage value is
15871593
resolved as <a
15881594
href="http://www.w3.org/TR/SVG/coords.html#Units">specified</a> in the SVG
15891595
recommendation (see <a href="#SVG11"
1590-
rel=biblioentry>[SVG11]<!--{{!SVG11}}--></a>). SVG strokes are not
1591-
considered part of the shape, thus only the following geometries are
1592-
valid.
1596+
rel=biblioentry>[SVG11]<!--{{!SVG11}}--></a>). Path styling like stroking
1597+
is not considered part of the specified shape.
15931598

15941599
<h4 id=supported-basic-shapes><span class=secno>4.2.1. </span>Supported
15951600
Shapes</h4>
15961601

1597-
<p> The following SVG shapes are supported by the CSS shapes module.
1602+
<p> The following basic shapes are supported.
15981603

15991604
<dl>
16001605
<dt><dfn
@@ -1640,7 +1645,7 @@ <h4 id=supported-basic-shapes><span class=secno>4.2.1. </span>Supported
16401645

16411646
<dd>
16421647
<ul>
1643-
<li><strong>fillRule</strong> - The filling rule used to determine the
1648+
<li><strong>fill-rule</strong> - The filling rule used to determine the
16441649
interior of the polygon. See <a
16451650
href="http://www.w3.org/TR/SVG/painting.html#FillRuleProperty">fill-rule</a>
16461651
property in SVG for details. Possible values are nonzero or evenodd.
@@ -1651,8 +1656,8 @@ <h4 id=supported-basic-shapes><span class=secno>4.2.1. </span>Supported
16511656
axis coordinates of the i-th vertex of the polygon.
16521657
</ul>
16531658

1654-
<p> If the polygon is not closed the user-agent will automatically add a
1655-
new vertex at the end.</p>
1659+
<p>The UA will close a polygon by connecting the last vertex with the
1660+
first vertex of the list.</p>
16561661
<br>
16571662
</dl>
16581663

@@ -1695,15 +1700,54 @@ <h4 id=referencing-svg-shapes><span class=secno>4.2.2. </span>Referencing
16951700
</div>
16961701

16971702
<p> When using the SVG syntax or referencing SVG elements to define shapes,
1698-
all the lengths expressed in percentages are resolved from the border box
1699-
of the element. The coordinate system for the shape has its origin on the
1700-
top-left corner of the border box with the x-axis running to the right and
1701-
the y-axis running downwards. If the SVG element uses unitless coordinate
1702-
values, they are equivalent to using ‘<code class=property>px</code>
1703-
units. If the border box of the element is dependent on auto sizing (i.e.,
1704-
the element's ‘<code class=property>width</code>’ or ‘<code
1703+
the relevant box is determined by the computed value of the <a
1704+
href="http://www.w3.org/TR/css3-ui/#box-sizing"><code
1705+
class=property>box-sizing</code></a> property. All the lengths
1706+
expressed in percentages are resolved from the relevant box. The
1707+
coordinate system for the shape has its origin on the top-left corner of
1708+
the relevant box with the x-axis running to the right and the y-axis
1709+
running downwards. If the SVG element uses unitless coordinate values,
1710+
they are equivalent to using ‘<code class=property>px</code>’ units.
1711+
If the relevant box of the element is dependent on auto sizing (i.e., the
1712+
element's ‘<code class=property>width</code>’ or ‘<code
17051713
class=property>height</code>’ property is ‘<code
1706-
class=property>auto</code>’), then the percentage values resolve to 0.</p>
1714+
class=property>auto</code>’), then the percentage values resolve to 0.
1715+
1716+
<h4 id=basic-shape-interpolation><span class=secno>4.2.3.
1717+
</span>Interpolation of Basic Shapes</h4>
1718+
1719+
<p>For interpolating between one basic shape and a second, the rules
1720+
described below are applied.
1721+
1722+
<ul>
1723+
<li>If both basic shapes are of the same type and not of type polygon:
1724+
<ul>
1725+
<li>Interpolate between each value.
1726+
</ul>
1727+
1728+
<li>If one basic shape is of type rectangle and the second of type circle
1729+
or ellipse:
1730+
<ul>
1731+
<li>Replace the circle/ellipse with a temporary rectangle of equal
1732+
dimension.
1733+
1734+
<li>Set the values for rx and ry on the temporary rectangle to
1735+
‘50%’.
1736+
1737+
<li>Interpolate between the two rectangles as above.
1738+
</ul>
1739+
1740+
<li>If both basic shapes are of type polygon and if both polygons have the
1741+
same number of vertices:
1742+
<ul>
1743+
<li>Interpolate between each value.
1744+
</ul>
1745+
1746+
<li>In all other cases:
1747+
<ul>
1748+
<li>No interpolation is specified.
1749+
</ul>
1750+
</ul>
17071751
<!-- End section "Shapes from SVG Syntax -->
17081752

17091753
<h3 id=shapes-from-image><span class=secno>4.3. </span>Shapes from Image</h3>
@@ -1912,7 +1956,8 @@ <h4 id=shape-outside-property><span class=secno>4.4.1. </span>The ‘<a
19121956
<dl>
19131957
<dt><dfn id=auto0 title="'shape-outside'!!'auto'">auto</dfn>
19141958

1915-
<dd>The shape is computed based on the border box of the element.
1959+
<dd>The shape is computed based on the border box of the element for
1960+
exclusions, or computed based on the margin box for floats.
19161961
</dl>
19171962

19181963
<dl>
@@ -2586,6 +2631,16 @@ <h3 class=no-num id=normative-references>Normative references</h3>
25862631
</dd>
25872632
<!---->
25882633

2634+
<dt id=CSS3UI>[CSS3UI]
2635+
2636+
<dd>Tantek Çelik. <a
2637+
href="http://www.w3.org/TR/2012/WD-css3-ui-20120117/"><cite>CSS Basic
2638+
User Interface Module Level 3 (CSS3 UI).</cite></a> 17 January 2012. W3C
2639+
Working Draft. (Work in progress.) URL: <a
2640+
href="http://www.w3.org/TR/2012/WD-css3-ui-20120117/">http://www.w3.org/TR/2012/WD-css3-ui-20120117/</a>
2641+
</dd>
2642+
<!---->
2643+
25892644
<dt id=CSS3VAL>[CSS3VAL]
25902645

25912646
<dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
@@ -2940,6 +2995,10 @@ <h3 id=since-may-3rd-2012><span class=secno>5.7. </span>Since <a
29402995
2012</a></h3>
29412996

29422997
<ul>
2998+
<li>Added interpolation for basic shapes
2999+
3000+
<li>Changed basic shapes to depend on box specified with box-sizing
3001+
29433002
<li>Added overflow behavior for shape-inside.
29443003

29453004
<li>Added wrap-flow:minimum.

0 commit comments

Comments
 (0)