Re: [css3-values] Suggestion: Allowing attr() in calc()

> On 9/1/10 3:26 PM, Lea Verou wrote:
> >> The second argument (which is optional but must be present if the
> >> third argument is present) is a <type> and tells the UA how to
> >> interpret the attribute value. It may be one of the values from the
> >> list below.
> > (from http://dev.w3.org/csswg/css3-values/#ltattrgt)
>
> Ah.  That sounds unfortunately slow, but ok.
>
> > So what I'm saying is that if the type of the attribute as defined  
> in
> > the markup spec (or if it's not defined at all) is "string", and  
> attr()
> > is called on it without a 2nd parameter, then it could either be
> > considered a parse error (which would be more consistent with how  
> attr()
> > is currently proposed) or interpreted as a number, if possible  
> (which is
> > more useful).
>
> With some sort of fallback for values that can't be interpreted as  
> numbers?
>
> > Am I making sense now?
>
> Yes, but I'm not sure what the use cases are, honestly...

I can imagine that this could be very useful in co-operation with  
HTML5 Custom Data Attributes [1]. It could also be useful with the  
various attributes from Web Forms 2 (max, min, step, etc.).

[1] http://dev.w3.org/html5/spec/elements.html#custom-data-attribute
>
>
>
> -Boris

David Storey

Chief Web Opener / Product Manager, Opera Dragonfly
W3C WG:  Mobile Web Best Practices / SVG Interest Group

Opera Software ASA, Oslo, Norway
Mobile: +47 94 22 02 32 / E-Mail/XMPP: dstorey@opera.com / Twitter:  
dstorey

Received on Thursday, 2 September 2010 18:23:32 UTC