Skip to content

Commit 53f1261

Browse files
committed
Moved the <color-stop> serialization out into a separate section.
Made the color-stop production a proper definition, so references to it elsewhere will properly link to it.
1 parent 4c27cfe commit 53f1261

2 files changed

Lines changed: 39 additions & 47 deletions

File tree

css3-images/Overview.html

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ <h3>Repeating Gradients</h3>
802802
<h3 id=color-stop-syntax><span class=secno>5.3.
803803
</span><code>color-stop</code> Syntax</h3>
804804

805-
<p>The <dfn id=ltcolor-stopgt><code>&lt;color-stop&gt;</code></dfn>
806-
stands for:</p>
805+
<p>The <dfn id=ltcolor-stopgt><code>&lt;color-stop&gt;</code></dfn> is
806+
defined as:</p>
807807

808808
<pre
809-
class=prod><code>&lt;color&gt; [ &lt;percentage&gt; | &lt;length&gt; ]?</code></pre>
809+
class=prod><code><dfn id=ltcolor-stop>&lt;color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;length> ]?</code></pre>
810810

811811
<p>Color-stops are points placed along the line defined by the
812812
gradient-line at the beginning of the rule. Color-stops must be
@@ -1475,12 +1475,16 @@ <h2 id=serialization><span class=secno>7. </span>Serialization</h2>
14751475
<p>This section describes the serialization of all new properties and
14761476
value types introduced in this specification.</p>
14771477

1478+
<p>All of these algorithms refer to a variable "s". For each, let s
1479+
initially be the empty string, run the steps described, and then return
1480+
s.</p>
1481+
14781482
<div>
14791483
<h3 id=serializing-gradients><span class=secno>7.1. </span>Serializing
14801484
Gradients</h3>
14811485

1482-
<p>To serialize a linear gradient, let s initially be the empty string,
1483-
run these steps, and then return s:</p>
1486+
<p>To serialize a &lsquo;<a href="#ltlinear-gradient"><code
1487+
class=css>&lt;linear-gradient></code></a>&rsquo;:</p>
14841488

14851489
<ol>
14861490
<li>Append "linear-gradient(" to s.
@@ -1503,23 +1507,15 @@ <h3 id=serializing-gradients><span class=secno>7.1. </span>Serializing
15031507
<li>If the first argument to the gradient function was not a
15041508
color-stop, append a comma and a space ", " to s.
15051509

1506-
<li>For each color-stop in the gradient, do the following:
1507-
<ol>
1508-
<li>Serialize the &lt;color>, and append it to s.
1509-
1510-
<li>If a &lt;length> or &lt;percentage> was specified, append a space
1511-
" " to s, then serialize the &lt;length> or &lt;percentage> and
1512-
append it to s.
1513-
1514-
<li>If this is not the final color-stop, append a comma and a space
1515-
", " to s.
1516-
</ol>
1510+
<li>For each color-stop in the gradient, serialize the color-stop, and
1511+
append it to s. Then, if it is not the final color-stop, append a
1512+
comma and a space ", " to s.
15171513

15181514
<li>Append a close parenthesis ")" to s.
15191515
</ol>
15201516

1521-
<p>To serialize a radial gradient, let s initially be the empty string,
1522-
run these steps, and then return s:</p>
1517+
<p>To serialize a &lsquo;<a href="#ltradial-gradient"><code
1518+
class=css>&lt;radial-gradient></code></a>&rsquo;:</p>
15231519

15241520
<ol>
15251521
<li>Append "radial-gradient(" to s.
@@ -1561,19 +1557,22 @@ <h3 id=serializing-gradients><span class=secno>7.1. </span>Serializing
15611557

15621558
<li>Append a comma and a space ", " to s.
15631559

1564-
<li>For each color-stop in the gradient, do the following:
1565-
<ol>
1566-
<li>Serialize the &lt;color>, and append it to s.
1560+
<li>For each color-stop in the gradient, serialize the color-stop, and
1561+
append it to s. Then, if it is not the final color-stop, append a
1562+
comma and a space ", " to s.
1563+
1564+
<li>Append a close parenthesis ")" to s.
1565+
</ol>
15671566

1568-
<li>If a &lt;length> or &lt;percentage> was specified, append a space
1569-
" " to s, then serialize the &lt;length> or &lt;percentage> and
1570-
append it to s.
1567+
<p>To serialize a &lsquo;<a href="#ltcolor-stop"><code
1568+
class=css>&lt;color-stop></code></a>&rsquo;:</p>
15711569

1572-
<li>If this is not the final color-stop, append a comma and a space
1573-
", " to s.
1574-
</ol>
1570+
<ol>
1571+
<li>Serialize the &lt;color>, and append it to s.
15751572

1576-
<li>Append a close parenthesis ")" to s.
1573+
<li>If a &lt;length> or &lt;percentage> was specified, append a space "
1574+
" to s, then serialize the &lt;length> or &lt;percentage> and append
1575+
it to s.
15771576
</ol>
15781577
</div>
15791578
</div>

css3-images/Overview.src.html

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ <h3>Repeating Gradients</h3>
406406

407407
<div>
408408
<h3 id=color-stop-syntax><code>color-stop</code> Syntax</h3>
409-
<p>The <dfn><code>&lt;color-stop&gt;</code></dfn> stands for:</p>
410-
<pre class=prod><code>&lt;color&gt; [ &lt;percentage&gt; | &lt;length&gt; ]?</code></pre>
409+
<p>The <dfn><code>&lt;color-stop&gt;</code></dfn> is defined as:</p>
410+
<pre class=prod><code><dfn>&lt;color-stop></dfn> = &lt;color> [ &lt;percentage> | &lt;length> ]?</code></pre>
411411
<p>Color-stops are points placed along the line defined by the gradient-line at the beginning of the rule. Color-stops must be specified in order. Percentages refer to the length of the gradient-line, with 0% being at the starting point and 100% being at the ending point. Lengths are measured from the starting-point in the direction of the ending-point. Color-stops are usually placed between the starting-point and ending-point, but that's not required; the gradient-line extends infinitely in both directions, and a color-stop can be placed at any position on the line.</p>
412412
<p>At each color-stop, the line is the color of the color-stop. Between two color-stops, the line's color is linearly interpolated between the colors of the two color-stops, with the interpolation taking place in premultiplied RGBA space. Before the first color-stop, the line is the color of the first color-stop. After the last color-stop, the line is the color of the last color-stop.</p>
413413
<p>The following steps must be applied <em>in order</em> to process the list of color-stops. After applying these rules, all color-stops will have a definite position and they will be in ascending order:</p>
@@ -779,10 +779,10 @@ <h3 id="object-position">The 'object-position' Property</h3>
779779
<div>
780780
<h2>Serialization</h2>
781781
<p>This section describes the serialization of all new properties and value types introduced in this specification.</p>
782-
782+
<p>All of these algorithms refer to a variable "s". For each, let s initially be the empty string, run the steps described, and then return s.</p>
783783
<div>
784784
<h3 id="serializing-gradients">Serializing Gradients</h3>
785-
<p>To serialize a linear gradient, let s initially be the empty string, run these steps, and then return s:</p>
785+
<p>To serialize a ''&lt;linear-gradient>'':</p>
786786
<ol>
787787
<li>Append "linear-gradient(" to s.</li>
788788
<li>
@@ -794,16 +794,10 @@ <h3 id="serializing-gradients">Serializing Gradients</h3>
794794
</ul>
795795
</li>
796796
<li>If the first argument to the gradient function was not a color-stop, append a comma and a space ", " to s.</li>
797-
<li>For each color-stop in the gradient, do the following:
798-
<ol>
799-
<li>Serialize the &lt;color>, and append it to s.</li>
800-
<li>If a &lt;length> or &lt;percentage> was specified, append a space " " to s, then serialize the &lt;length> or &lt;percentage> and append it to s.</li>
801-
<li>If this is not the final color-stop, append a comma and a space ", " to s.</li>
802-
</ol>
803-
</li>
797+
<li>For each color-stop in the gradient, serialize the color-stop, and append it to s. Then, if it is not the final color-stop, append a comma and a space ", " to s.</li>
804798
<li>Append a close parenthesis ")" to s.</li>
805799
</ol>
806-
<p>To serialize a radial gradient, let s initially be the empty string, run these steps, and then return s:</p>
800+
<p>To serialize a ''&lt;radial-gradient>'':</p>
807801
<ol>
808802
<li>Append "radial-gradient(" to s.</li>
809803
<li>If a &lt;bg-position> was specified in the first argument to the gradient function, serialize it and append it to s. Otherwise, append "center" to s.</li>
@@ -828,15 +822,14 @@ <h3 id="serializing-gradients">Serializing Gradients</h3>
828822
</ul>
829823
</li>
830824
<li>Append a comma and a space ", " to s.</li>
831-
<li>For each color-stop in the gradient, do the following:
832-
<ol>
833-
<li>Serialize the &lt;color>, and append it to s.</li>
834-
<li>If a &lt;length> or &lt;percentage> was specified, append a space " " to s, then serialize the &lt;length> or &lt;percentage> and append it to s.</li>
835-
<li>If this is not the final color-stop, append a comma and a space ", " to s.</li>
836-
</ol>
837-
</li>
825+
<li>For each color-stop in the gradient, serialize the color-stop, and append it to s. Then, if it is not the final color-stop, append a comma and a space ", " to s.</li>
838826
<li>Append a close parenthesis ")" to s.</li>
839827
</ol>
828+
<p>To serialize a ''&lt;color-stop>'':</p>
829+
<ol>
830+
<li>Serialize the &lt;color>, and append it to s.</li>
831+
<li>If a &lt;length> or &lt;percentage> was specified, append a space " " to s, then serialize the &lt;length> or &lt;percentage> and append it to s.</li>
832+
</ol>
840833
</div>
841834
</div>
842835

0 commit comments

Comments
 (0)