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: Wed, 22 Aug 2012 18:32:54 -0700
Cc: Brian Kardell <bkardell@gmail.com>, public-webapps <public-webapps@w3.org>, Ojan Vafai <ojan@chromium.org>
Message-id: <5DEBD7ED-60BD-4540-B428-E58EE93785A4@apple.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Aug 21, 2012, at 1:59 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Tue, Aug 21, 2012 at 1:37 PM, Brian Kardell <bkardell@gmail.com> wrote:
>> On Tue, Aug 21, 2012 at 4:32 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>> Correct.  If we applied CAS on attribute changes, we'd have... problems.
>> Because you could do something like:
>> .foo[x=123]{ x:  234; }
>> .foo[x=234]{ x:  123; }
>> ?
> Precisely.  Any way around this problem pulls in a lot more complexity
> that I don't think is worthwhile.

I suspect it's actually pretty simple to fix. Ban attribute selectors, and forbid setting the class or id attributes using this language.

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 {

In other words, make attribute setting look like attribute syntax.

I also think the proposed semi-dynamic behavior of applying only at DOM insertion time but otherwise being static is super confusing.

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.

Received on Thursday, 23 August 2012 01:33:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:38 UTC