[css-images] Gradients with only one color stop

Hi,

The syntax allows gradients with only one color stop. It pretty obvious 
that they should render as a solid color, but the spec does not say that 
explicitly.

Still, the non-repeating case is well-defined thanks to this sentence in 
§4.4:

> 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.


For repeating gradients, however, the spec might need some 
clarification. In particular, in this paragraph of §4.3:

> If the distance between the first and last color-stops is zero (or
> rounds to zero due to implementation limitations), the implementation
> must find the average color of a gradient with the same number and
> color of color-stops, but with the first and last color-stops an
> arbitrary non-zero distance apart, and the remaining color-stops
> equally spaced between them. Then it must render the gradient as a
> solid-color image equal to that average color.

"the first and last color-stops an arbitrary non-zero distance apart" 
does not make sense when the first and last are the same point.

I suggest adding "Otherwise," at the beginning of the quoted paragraph, 
and adding just before it:

> If the gradient has only one color-stop, then it must render as a
> solid-color image equal to the color of the only color-stop.

-- 
Simon Sapin

Received on Friday, 5 April 2013 12:46:56 UTC