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

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

From: Brian Manthos <brianman@microsoft.com>
Date: Thu, 26 May 2011 16:32:38 +0000
To: Brad Kemper <brad.kemper@gmail.com>, Tab Atkins Jr. <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>
Message-ID: <FA122FEC823D524CB516E4E0374D9DCF1FB03043@TK5EX14MBXC136.redmond.corp.microsoft.com>
The question, I think, is about when the "color stop range" has a width of zero for repeating-*-gradient rather than about when the "color stop range" final stop location is at zero.


> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
> Behalf Of Brad Kemper
> Sent: Thursday, May 26, 2011 8:45 AM
> To: Tab Atkins Jr.
> Cc: www-style list
> Subject: 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 16:33:07 UTC

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