Re: [css-color] Exposing browser color parsing to JS

On Wed, Jul 9, 2014 at 10:47 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> On 09/07/14 17:58, Tab Atkins Jr. wrote:
>> It would suck if we had a function called parseColor that couldn't
>> parse all colors.  I don't understand why the restriction would be
>> useful.  It's true that "inherit" isn't a color, but it can be the
>> value of the 'color' property, and I'd like to maintain the invariant
>> that you can *always* feed the value of 'color' into it and get a
>> useful result out.
>
> I still think this adds more complexity than the benefit is worth, but I
> won’t oppose it any more than this. (Since the parameter is optional.)

On further thought, I can't actually support the global keywords.  I
can do "inherit" with nothing more than an element as context, but I
can't support "initial" without a property as context.  So let's just
strike the global keywords and stick with colors.

That does mean that the second argument is only used for
"currentcolor" in CSS, but SVG is, I think, adding some additional
keywords that work similarly to make <use> work better, so it might
have some friends soon.

~TJ

Received on Thursday, 10 July 2014 02:21:08 UTC