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: Wed, 1 Apr 2009 08:35:15 +0200
Message-Id: <AA38E71D-0627-4824-9A57-F3379E5D067F@granus.net>
To: www-style@w3.org

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  

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

Kai Brüning
Received on Monday, 6 April 2009 09:21:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:35 UTC