W3C home > Mailing lists > Public > www-style@w3.org > April 2009

[CSS3-values and units] attr() function questions

From: Kai Brüning <kai@granus.net>
Date: Fri, 3 Apr 2009 14:28:29 +0200
Message-Id: <8E7D87D0-9794-4677-B401-3414C0FCD22E@granus.net>
To: www-style@w3.org
Seems like this never reached the list, so I give it a second try.

Hi,

while (partially) implementing the CSS3 attr() function in WebKit, I  
hit a few points in which the current draft of the spec (Editor's  
Draft 5 March 2009), section 6.10, left questions open - at least for  
me:

- The spec says: "The third argument (which is optional) is a CSS  
value which must be valid where the attr() expression is placed."
I assume "where the expression is placed" means "must be valid at the  
time of parsing"?

- Spec: "Note that the default value need not be of the type given.  
For instance, if the type required of the attribute by the author is  
‘px’, the default could still be ‘5em’."
Should this be allowed for string versus uri values for e.g. the  
content property, too? That is, should e.g. attr(href,url,"No Image")  
be valid? (in my current implementation I did not allow this).

- I assume that the default is NOT used if an URI given by an  
attribute is valid but can not be resolved?

- Is an empty URI valid? That is, is a default with an empty URI  
valid? Or would this make the whole declaration invalid?

Please note that I am anything but an CSS-expert. So if any of the  
answers is obvious from other parts of the spec, please bear with me.

Best
Kai Brüning
Received on Monday, 6 April 2009 09:23:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT