RE: [css3-images] linear-gradient keywords and angles are opposite

> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> 
> On Wed, Jun 8, 2011 at 4:27 AM, Brad Kemper <brad.kemper@gmail.com>
> wrote:
> > On Jun 7, 2011, at 11:34 AM, Brian Manthos <brianman@microsoft.com>
> wrote:
> >> Paraphrasing [1]:
> >> When specified via angle, the angle can be understood as both the
> direction
> >> ("toward the <angle>") and the ending point ("ends at <angle>").
> >>
> >> Paraphrasing [2] and [3]:
> >> When specified via keyword, the keyword can be understood as both
> opposite
> >> direction ("away from the <keyword(s)>") and the starting point
> ("starts at
> >>  <keyword>").
> >>
> >> Is it intentional that these two ways of specifying gradient-line
> are
> >> opposite?
> >
> > I don't think they are. In [1], the angle determines the starting AND
> ending
> > points. In [2] and [3], the ending point (and thus the direction) is
> > determined by the starting point. I see no inconsistency.
> 
> This was brought up during the ftf, and I think it's a valid point.
> 
> In my head (and I expect in others'), when I think of what angle to
> use for a gradient I do so by imagining a compass rose, with 0deg at
> the top, 90deg to the right, etc.  I then set the gradient angle by
> choosing which angle I want the gradient to point toward.
> 
> Similarly, if I imagine keywords, I do so with 'top' at the top,
> 'right' at the right, etc.  Now, though, I have to reverse how I deal
> with my mental image - if I want the gradient to point up, I don't
> choose 'top', I choose 'bottom'.
> 
> I'm not sure if this is an important enough disconnect to justify
> changing the keywords, but we brainstormed it a bit at the ftf.  I
> don't think we came up with any set of directional keywords that was
> sufficiently decent to work as replacements, though.  If anyone has
> any suggestions, please speak up!  The current front-runner is
> 'upward'/'rightward'/etc, which isn't very good.
> 
> ~TJ

Indeed, Tab.

Here's another indication of the currently opposite nature of the keywords.

Again, I'll use the working draft text:
http://www.w3.org/TR/2011/WD-css3-images-20110217/

angle-specified:
# the standard algebraic notation for angles where 0deg points to the right, 90deg points up

keyword-specified:
# If a ‘left’, ‘bottom’, ‘right’, or ‘top’ is given, the used value
# value of the gradient is 0deg, 90deg, 180deg, or 270 deg, respectively"

The first quote puts right at 0deg.  The second quote puts right at 180deg.

The second (keyword) is the opposite the way I naturally think about things. Mapping "bottom @ 90deg" and "top @ 270deg" is completely alien to any coordinate system I've ever used in any discipline.


[Sidenote: Spec used value typo - "270 deg" should be "270deg".]

Received on Wednesday, 8 June 2011 08:56:00 UTC