Re: [css-images] Syntax for image() incorrect?

On 3 March 2016 at 20:57, Tab Atkins Jr. <> wrote:
> On Thu, Mar 3, 2016 at 5:37 AM, Sebastian Zartner
> <> wrote:
>> The description for the image() function says that it allows to use a
>> solid color as an image.
>> Though its syntax is defined as
>>     image( [ [ <image> | <string> ]? , <color>? ]! )
>> meaning that colors are only allowed as fallback values.
> How are you getting this?  The syntax marks both parts as optional,
> and just requires that you specify one of them.  So image(blue) is
> valid per that grammar.
>> Furthermore, the syntax for the image() function suggests that the
>> comma stands for its own and is not influenced by the question mark
>> multiplier after <color>.
> Correct, but clarifies
> how commas work in CSS grammars - they're automatically required to be
> omitted unless they're actually separating things.

Ah, I didn't know that. So then it's obviously valid.

Regarding my second point about extending <image> to accept <color>
values, I saw that you had the same idea some years ago.[1]
It looks like fantasai was reluctant to this idea but the thread
didn't come to a conclusion and as far as I can see this is also not
mentioned in any WG minutes. So, maybe this topic should be revived?



Received on Thursday, 3 March 2016 22:05:22 UTC