Re: [css3-images] Rounding issues in degenerate repeating gradients

On May 25, 2011, at 2:16 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> Repeating gradients repeat their color-stop list infinitely, shifting
> each set forward and backward by multiples of the "width" of the list
> (the distance between the first and last color-stop).
> 
> This has an obvious degenerate case when the width is 0.  I have a
> definition for what to do in this case (just render a solid-color
> image with the color of the last color-stop), but there's still a
> problem here - the definition of "when the width is 0" is ambiguous
> due to rounding issues.  As a general spec design goal, we try to
> avoid sharp behavior switches that are sensitive to rounding like
> this.  In other words, we try to make the behavior continuous, in a
> mathematical sense, such that the behavior at any point is equivalent
> to the behavior you converge on as you approach that point.
> 
> Implementors, is this worth fixing?  If so, I'm leaning towards
> enforcing a minimum width of 1px, so that if the width would be less
> than that, the last color-stop is moved so that it's 1px farther than
> the first color-stop.  This still resolves the singularity (by
> avoiding it entirely), and preserves behavior-continuity across all
> values.
> 
> (Non-repeating gradients don't suffer from the same problem, despite
> having a similar rule about what to do when multiple stops are at the
> "same location", because the specified behavior is the same as the
> limit behavior as the distance approaches 0; it's behavior-continuous
> already.)

Shouldn't it be identical to what happens to a non-repeating horizontal or vertical gradient in a repeating background when background-size approaches zero? My expectation there that once it rounds to zero, it disappears. An author should not make things that are nearly zero width if he wants people to see them. If he is animating a gradient width, he can animate it down to one or two px instead of zero, if he is concerned about what decimal of one will cause it to suddenly disappear. 

Received on Thursday, 26 May 2011 15:45:59 UTC