Re: [css3-background] color transition line

On 10/31/2011 09:15 PM, Brian Manthos wrote:
> Also, I thought the spec was pretty clear on this topic in section 5.4:

It is, and it's wrong. See previous message.

> http://www.w3.org/TR/css3-background/#corner-transitions
> # The center of color and style transitions between adjoining borders
> # is at the point on the curve that is at an angle that is proportional
> # to the ratio of the border widths. For example, if the top and right
> # border widths are equal, that point is at a 45° angle from the
> # horizontal, and if the top is twice the width of the right the point
> # is at a 30° angle from the horizontal. The line demarcating this
> # transition is drawn between the point at that angle on the outer arc
> # and the point at that angle on the inner arc.
>
> IE9's implementation matches this conformance requirement.

No, it doesn't. It matches the first rendering in this set:
   http://lists.w3.org/Archives/Public/www-archive/2011Jul/0005.html
But the spec is the third one.

> In your sample (0005.html), it appears that you are using consistent width
> across all 4 sides of the border.

Yes.

> As such, the correct rendering would have a color split along 45 deg angle
> in the upper right corner.  Your first rendering looks like it might be
> matching that, but I didn't pixel verify.

No, you're missing the last sentence in the spec. It's not drawn at a 45deg
angle. The 45deg ray is used to find the intersection point on the inner
and outer curves, and the line segment drawn between them is the transition
line.

> While interesting to look at, the border-radius has no impact on the angle
> at which the color transitions.  That's been my understanding since the
> very beginning of working on CSS3 backgrounds in IE.  In fact we have
> internal test cases to verify that this doesn't break accidentally.
>
> Has something changed since the spec went CR in February 2011 that necessitates
> revisiting this?

The thing that's changed is that I've spent more time on this with an implementer,
and thereby
   a) noticed that the definition in the spec (the third one) can give results
      that are totally wonky
   b) found the answer that people seem to agree is the right one

~fantasai

Received on Tuesday, 1 November 2011 07:56:04 UTC