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

> On 9/1/10 3:19 PM, Lea Verou wrote:
>> Oh, right. As things currently stand, I guess it should be a parse error
>> then (in the 2nd case), unless a type is explicitly specified.
>
> Ah... are we using "type" to mean two different things here, perhaps?  I had assumed you were talking about types of attributes as defined in the markup language spec (e.g. HTML does this for various attributes).  Are you talking about some other type?
>
> -Boris
I'm talking about both. From my understanding, you can override the type of the attribute as defined in the markup language spec by providing a second parameter to attr():
> 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)

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).

Am I making sense now?

-- 
Lea Verou
Blog: leaverou.me <http://leaverou.me>
Twitter: http://twitter.com/LeaVerou
LinkedIn: http://gr.linkedin.com/in/leaverou

Received on Wednesday, 1 September 2010 19:27:37 UTC