W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

Re: Proposal for "Cascading Attribute Sheets" - like CSS, but for attributes!

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 28 Aug 2012 12:54:51 -0700
Cc: Brian Kardell <bkardell@gmail.com>, public-webapps <public-webapps@w3.org>, Ojan Vafai <ojan@chromium.org>
Message-id: <D075CD6A-E35C-4D5A-816B-42B1DF90D6D6@apple.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Aug 27, 2012, at 2:07 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> 
> 
> 
>> I have mixed feelings about this proposal overall, but I think it's a little weird to use CSS property syntax instead of markup-like attribute syntax to set attributes. I think this makes the syntax confusingly similar to CSS even though proposed behavior is quite different. Something like this might make more sense:
>> 
>> img.placeholder {
>>    src="/images/1x1.gif"
>>    alt=""
>> }
>> 
>> In other words, make attribute setting look like attribute syntax.
> 
> This is similar to the discussions about monocle-mustache in JS.  I
> prefer being able to simple re-use the existing CSS parser, but I'm
> not completely wedded to it.  I'd need some strong opinions from more
> relevant parties to switch over, though.

I doubt we would be able to actually reuse the CSS parser, at least at the code level, at least for WebKit. To give some examples of issues that arise:

- The CSS parser has specific knowledge of all the CSS properties we recognize and their value syntax. 
- It has no provision for catchall recognition of all other property names with a quoted string value.
- There are some CSS properties that have the same name as meaningful HTML attributes.

> 
>> And finally, I'm skeptical whether the convenience here is worth adding a whole new language to the Web Platform technology stack. It is literally just convenience / syntactic sugar. I'm not sure that rises to the high bar needed to add an additional language to the Web Platform.
> 
> Yeah, this is the major hurdle for this.  My hope is that, by reusing
> the CSS parser and restricting all the expensive parts of CSS
> (dynamicness, remembering where a value came from, etc.), I can pull
> the bar down low enough for this to make it.

I think your assumption is that it's possible to reuse the CSS parser is incorrect, at least for strong values of "reuse".

Regards,
Maciej
Received on Tuesday, 28 August 2012 19:56:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:54 GMT