Re: [css3-values] attr() function

> >Doesn't this constitute a lost opportunity?
> 
> An opportunity to do what? To make the design extensible so we can
> extend it later once we have clear use cases to address? To extend
> the feature now even if we don't have clear use cases? Do we know
> whether CSS is the right solution here? Couldn't it be done with
> scripting? I really wouldn't mind replacing attr() by xpath() which
> would address pretty much all use cases you could think of, but
> XPath is not that popular here...

We do have clear use cases or at least a proper statement of what CSS is about:

"Cascading Style Sheets (CSS) is a simple mechanism for adding style
(e.g. fonts, colors, spacing) to Web documents."

Notice it doesn't say HTML document or (X)HTML document or even
SGML-based documents. It says Web documents which I take to mean any
document whose primary delivery method is the web. I say primary and
not only since we seem to care about HTML and CSS delivered on CD.

CSS does have a fairly simple grammar and this grammar could be easily
extended so that any language could easily be handled.

<selector> {
    <property>: <value>;
}

I'm ignoring the @rules because they don't really matter for this
argument. What does matter is that <selector>, <property> and <value>
have all been heavily tied to HTML. They didn't have to be and if they
weren't other languages could benefit.

<selector> could have been anything, it could have been supplied by
the UA as a plugin. Likewise the set of <property>'s and <value>'s
could have been defined by canvas/layout/datatype and not just how
well they cover the needs of HTML.

Functions could have also been made extensible so that we wouldn't
have to worry about limiting syntax to whatever HTML uses or whatever
CSS uses natively.

I'm not saying CSS should go the extensible route, but I am saying we
should stop pretending it's designed for any language that comes
along. It's SGML/HTML only.

-- 

Orion Adrian

Received on Tuesday, 2 August 2005 17:31:07 UTC