Re: [css3-images] exactly 2 adjacent colors stops

On Mon, May 16, 2011 at 10:21 AM, Brian Manthos <brianman@microsoft.com> wrote:
> http://dev.w3.org/csswg/css3-images/#repeating-gradients
> # If the difference in the positions of the first and last color-stops is 0
> # (for example, in the value ‘linear-gradient(red 10px, blue 10px)’),
> # the gradient defines a solid-color image with the color of the last
> # color-stop in the rule (in this case, then, it would simply define a
> # blue image).
>
> http://dev.w3.org/csswg/css3-images/#color-stop-syntax
> # If multiple color-stops have the same position, they produce an
> # infinitesimal transition from the one specified first in the rule to
> # the one specified last.
>
>
> I believe both of these quotes are intended to be normative, but they are in
> conflict.
>
> The first quote indicates you should see solid blue.  The second quote says
> you should see both red and blue (as well as an infinitesimal transition
> from red to blue).
>
>
> I believe the second quote is the preferred to be applied in this case, and
> that we should consider just removing the first quote.  If we decide to keep
> the first quote, I think it really belongs in section 5.4 (gradient
> color-stops) rather than buried in 5.3 (repeating gradients).

You seem to have slightly misunderstood the scope of the first quote.
It applies only to repeating linear gradients, not normal gradients.
It's absolutely necessary, since otherwise there are infinite
color-stops sitting on that one point.  In other words, having a
repeating gradients with 0 distance between the first and last
color-stops is an error condition, and the quote in question is
necessary to define the behavior for this case.

For normal gradients, having 0 distance between the first and last
color-stops is completely fine, and is handled as defined by the
second quote.

I just tested FF and Webkit, and they do indeed implement this correctly.

~TJ

Received on Monday, 16 May 2011 18:00:48 UTC