W3C home > Mailing lists > Public > www-style@w3.org > May 2011

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 16 May 2011 10:59:59 -0700
Message-ID: <BANLkTikicuiGWW5xYLroaBNumbE4b_7C1w@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: www-style list <www-style@w3.org>
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.

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:46 UTC