Skip to content

Commit 509d9bd

Browse files
committed
Minor bugfixes in the gradient serialization algorithm, fixing color-stops and the two-keyword linear-gradient case.
Also added manual ids to serialization and interpolation.
1 parent 0461a4a commit 509d9bd

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

css3-images/Overview.src.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,14 @@ <h3 id=color-stop-syntax><code>color-stop</code> Syntax</h3>
421421
</div>
422422

423423
<div>
424-
<h3>Serializing Gradients</h3>
424+
<h3 id="serializing-gradients">Serializing Gradients</h3>
425425
<p>To serialize a linear gradient, let s initially be the empty string, run these steps, and then return s:</p>
426426
<ol>
427427
<li>Append "linear-gradient(" to s.</li>
428428
<li>
429429
<ul>
430-
<li>If the first argument to the gradient function was a keyword, serialize the keyword and append it to s.</li>
430+
<li>If the first argument to the gradient function was a single keyword, serialize the keyword and append it to s.</li>
431+
<li>Otherwise, if the first argument to the gradient function was two keywords, serialize both keywords. Append them, separated by a space " ", to s.</li>
431432
<li>Otherwise, if the first argument to the gradient function was an &lt;angle>, serialize the &lt;angle> and append it to s.</li>
432433
<li>Otherwise, append "top" to s.</li>
433434
</ul>
@@ -437,7 +438,7 @@ <h3>Serializing Gradients</h3>
437438
<ol>
438439
<li>Serialize the &lt;color>, and append it to s.</li>
439440
<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>
440-
<li>Append a comma and a space ", " to s.</li>
441+
<li>If this is not the final color-stop, append a comma and a space ", " to s.</li>
441442
</ol>
442443
</li>
443444
<li>Append a close parenthesis ")" to s.</li>
@@ -471,15 +472,15 @@ <h3>Serializing Gradients</h3>
471472
<ol>
472473
<li>Serialize the &lt;color>, and append it to s.</li>
473474
<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>
474-
<li>Append a comma and a space ", " to s.</li>
475+
<li>If this is not the final color-stop, append a comma and a space ", " to s.</li>
475476
</ol>
476477
</li>
477478
<li>Append a close parenthesis ")" to s.</li>
478479
</ol>
479480
</div>
480481

481482
<div>
482-
<h3>Interpolating Gradients</h3>
483+
<h3 id="interpolating-gradients">Interpolating Gradients</h3>
483484
<p>Gradient images can be interpolated directly in CSS transitions and animations, smoothly animating from one gradient to another. There are only a few restrictions on what gradients are allowed to be interpolated:</p>
484485
<ol>
485486
<li>Both the starting and ending gradient must be of the same type; either both linear gradients or both radial gradients.</li>

0 commit comments

Comments
 (0)