Skip to content

Commit 9cd0e57

Browse files
committed
[css-shapes] Updated computed value and serialization of basic shapes
1 parent 3b4621e commit 9cd0e57

2 files changed

Lines changed: 55 additions & 7 deletions

File tree

css-shapes/Overview.html

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
120120
Terminology</a></ul><li><a href=#relation-to-box-model-and-float-behavior><span class=secno>2</span>
121121
Relation to the box model and float behavior</a><li><a href=#basic-shape-functions><span class=secno>3</span>
122122
Basic Shapes</a><ul class=toc><li><a href=#supported-basic-shapes><span class=secno>3.1</span>
123-
Supported Shapes</a><li><a href=#basic-shape-interpolation><span class=secno>3.2</span>
123+
Supported Shapes</a><li><a href=#basic-shape-computed-values><span class=secno>3.2</span>
124+
Computed Values of Basic Shapes</a><li><a href=#basic-shape-serialization><span class=secno>3.3</span>
125+
Serialization of Basic Shapes</a><li><a href=#basic-shape-interpolation><span class=secno>3.4</span>
124126
Interpolation of Basic Shapes</a></ul><li><a href=#shapes-from-image><span class=secno>4</span>
125127
Shapes from Image</a><li><a href=#shapes-from-box-values><span class=secno>5</span>
126128
Shapes from Box Values</a><li><a href=#declaring-shapes><span class=secno>6</span>
@@ -579,7 +581,29 @@ <h3 class="heading settled heading" data-level=3.1 id=supported-basic-shapes><sp
579581
</dd>
580582
</dl>
581583

582-
<h3 class="heading settled heading" data-level=3.2 id=basic-shape-interpolation><span class=secno>3.2 </span><span class=content>
584+
<h3 class="heading settled heading" data-level=3.2 id=basic-shape-computed-values><span class=secno>3.2 </span><span class=content>
585+
Computed Values of Basic Shapes</span><a class=self-link href=#basic-shape-computed-values></a></h3>
586+
587+
<p> The values in a <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> function are computed as specified, with these exceptions:
588+
589+
<p> <ul>
590+
<li>
591+
Omitted values are included and compute to their defaults
592+
</li>
593+
<li>
594+
A <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> value in <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a> or <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a> is computed as a pair of offsets (horizontal and vertical) from the top left origin each given as a combination of an absolute length and a percentage
595+
</li>
596+
<li>
597+
A &lt;<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#border-radius title=border-radius>border-radius</a>&gt; value in <a class=css data-link-type=maybe href=#funcdef-inset title=inset()>inset()</a> is computed as an expanded list of all eight <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a> or percentage values.
598+
</li>
599+
</ul>
600+
601+
<h3 class="heading settled heading" data-level=3.3 id=basic-shape-serialization><span class=secno>3.3 </span><span class=content>
602+
Serialization of Basic Shapes</span><a class=self-link href=#basic-shape-serialization></a></h3>
603+
604+
<p> To serialize the <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> functions, serialize as per their individual grammars, in the order the grammars are written in, omitting components when possible without changing the meaning, joining space-separated tokens with a single space, and following each serialized comma with a single space.
605+
606+
<h3 class="heading settled heading" data-level=3.4 id=basic-shape-interpolation><span class=secno>3.4 </span><span class=content>
583607
Interpolation of Basic Shapes</span><a class=self-link href=#basic-shape-interpolation></a></h3>
584608

585609
<p> For interpolating between
@@ -592,7 +616,7 @@ <h3 class="heading settled heading" data-level=3.2 id=basic-shape-interpolation>
592616
percentage, or calc</a> where possible.
593617
If list values are not one of those types
594618
but are identical
595-
(such as finding <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-position-3/#left title=left>left</a>
619+
(such as finding <span class=css data-link-type=maybe title=nonzero>nonzero</span>
596620
in the same list position
597621
in both lists)
598622
those values do interpolate.
@@ -814,7 +838,7 @@ <h2 class="heading settled heading" data-level=6 id=declaring-shapes><span class
814838
<h3 class="heading settled heading" data-level=6.1 id=shape-outside-property><span class=secno>6.1 </span><span class=content>
815839
The <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> Property</span><a class=self-link href=#shape-outside-property></a></h3>
816840

817-
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-shape-outside>shape-outside<a class=self-link href=#propdef-shape-outside></a></dfn><tr><th>Value:<td>none | [ <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> || <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> ] | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><tr><th>Initial:<td>none<tr><th>Applies to:<td>floats<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>computed lengths for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a> with its URI made absolute, otherwise as specified<tr><th>Animatable:<td>as <a href=#basic-shape-interpolation>specified</a> for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, otherwise no</table>
841+
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-shape-outside>shape-outside<a class=self-link href=#propdef-shape-outside></a></dfn><tr><th>Value:<td>none | [ <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> || <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> ] | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><tr><th>Initial:<td>none<tr><th>Applies to:<td>floats<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as <a href=#basic-shape-computed-values>defined</a> for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a> with its URI made absolute, otherwise as specified<tr><th>Animatable:<td>as <a href=#basic-shape-interpolation>specified</a> for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, otherwise no</table>
818842
<p> The values of this property have the following meanings:
819843

820844
<dl data-dfn-for=shape-outside data-dfn-type=value>
@@ -1006,6 +1030,7 @@ <h2 class="no-num heading settled heading" id=change-log><span class=content>
10061030
<h3 class="no-num heading settled heading" id=20131203><span class=content>
10071031
Since <a href=http://www.w3.org/TR/2013/WD-css-shapes-1-20131203/>December 3rd 2013</a></span><a class=self-link href=#20131203></a></h3>
10081032
<ul>
1033+
<li>Updated computed value and serialization of basic shapes</li>
10091034
<li>Added a margin-box example</li>
10101035
<li>Change auto to none for shape-outside</li>
10111036
<li>Defined shape-box instead of redefining box</li>
@@ -1228,7 +1253,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
12281253
<h2 class="no-num no-ref heading settled heading" id=property-index><span class=content>
12291254
Property index</span><a class=self-link href=#property-index></a></h2>
12301255
<div data-fill-with=property-index><table class="proptable data"><thead><tr><th scope=col>Name<th scope=col>Value<th scope=col>Initial<th scope=col>Applies to<th scope=col>Inh.<th scope=col>%ages<th scope=col>Media<th scope=col>Animatable<th scope=col>Computed value<tbody>
1231-
<tr><th scope=row><a data-property="">shape-outside</a><td>none | [ &lt;basic-shape&gt; || &lt;shape-box&gt; ] | &lt;image&gt;<td>none<td>floats<td>no<td><td>visual<td>as specified for &lt;basic-shape&gt;, otherwise no<td>computed lengths for &lt;basic-shape&gt;, the &lt;image&gt; with its URI made absolute, otherwise as specified
1256+
<tr><th scope=row><a data-property="">shape-outside</a><td>none | [ &lt;basic-shape&gt; || &lt;shape-box&gt; ] | &lt;image&gt;<td>none<td>floats<td>no<td><td>visual<td>as specified for &lt;basic-shape&gt;, otherwise no<td>as defined for &lt;basic-shape&gt;, the &lt;image&gt; with its URI made absolute, otherwise as specified
12321257
<tr><th scope=row><a data-property="">shape-image-threshold</a><td>&lt;number&gt;<td>0.0<td>floats<td>no<td><td>visual<td>as number<td>The same as the specified value after clipping the &lt;number&gt; to the range [0.0,1.0]
12331258
<tr><th scope=row><a data-property="">shape-margin</a><td>&lt;length&gt; | &lt;percentage&gt;<td>0<td>floats<td>no<td><td>visual<td>as length, percentage, or calc.<td>the absolute length</table></div>
12341259

css-shapes/Overview.src.html

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,28 @@ <h3 id="supported-basic-shapes">
460460
</dd>
461461
</dl>
462462

463+
<h3 id='basic-shape-computed-values'>
464+
Computed Values of Basic Shapes</h3>
465+
466+
The values in a <<basic-shape>> function are computed as specified, with these exceptions:
467+
468+
<ul>
469+
<li>
470+
Omitted values are included and compute to their defaults
471+
</li>
472+
<li>
473+
A <<position>> value in ''circle()'' or ''ellipse()'' is computed as a pair of offsets (horizontal and vertical) from the top left origin each given as a combination of an absolute length and a percentage
474+
</li>
475+
<li>
476+
A <'border-radius'> value in ''inset()'' is computed as an expanded list of all eight <<length>> or percentage values.
477+
</li>
478+
</ul>
479+
480+
<h3 id='basic-shape-serialization'>
481+
Serialization of Basic Shapes</h3>
482+
483+
To serialize the <<basic-shape>> functions, serialize as per their individual grammars, in the order the grammars are written in, omitting components when possible without changing the meaning, joining space-separated tokens with a single space, and following each serialized comma with a single space.
484+
463485
<h3 id='basic-shape-interpolation'>
464486
Interpolation of Basic Shapes</h3>
465487

@@ -473,7 +495,7 @@ <h3 id='basic-shape-interpolation'>
473495
percentage, or calc</a> where possible.
474496
If list values are not one of those types
475497
but are identical
476-
(such as finding 'left'
498+
(such as finding ''nonzero''
477499
in the same list position
478500
in both lists)
479501
those values do interpolate.
@@ -709,7 +731,7 @@ <h3 id="shape-outside-property">
709731
Initial: none
710732
Applies To: floats
711733
Inherited: no
712-
Computed Value: computed lengths for <<basic-shape>>, the <<image>> with its URI made absolute, otherwise as specified
734+
Computed Value: as <a href="#basic-shape-computed-values">defined</a> for <<basic-shape>>, the <<image>> with its URI made absolute, otherwise as specified
713735
Media: visual
714736
Animatable: as <a href="#basic-shape-interpolation">specified</a> for <<basic-shape>>, otherwise no
715737
</pre>
@@ -930,6 +952,7 @@ <h2 class="no-num" id="change-log">
930952
<h3 class="no-num" id="20131203">
931953
Since <a href="http://www.w3.org/TR/2013/WD-css-shapes-1-20131203/">December 3rd 2013</a></h3>
932954
<ul>
955+
<li>Updated computed value and serialization of basic shapes</li>
933956
<li>Added a margin-box example</li>
934957
<li>Change auto to none for shape-outside</li>
935958
<li>Defined shape-box instead of redefining box</li>

0 commit comments

Comments
 (0)