W3C home > Mailing lists > Public > www-style@w3.org > May 2006

Re: [CSS2 counters] Is it possible to evaluate a value inside CSS?

From: Daniel MD <danielmendes@im-thinking.com>
Date: Tue, 16 May 2006 15:18:48 +0100
Message-Id: <7.0.1.0.2.20060516150848.02242f48@im-thinking.com>
To: www-style@w3.org

At 13:33 16-05-2006, you wrote:
>On Tue, 16 May 2006 14:22:02 +0200, Daniel MD
><danielmendes@im-thinking.com> wrote:
>>>According to the prose in section 4.3.4 of CSS 2.1 and section 3.7.2 of
>>>the CSS3 Values WD, this isn’t allowed. If it were though, the syntax
>
>>>would have to be like <content-list> in the ‘content’ property:
>rty:
>>>
>>>   url(counter(list,decimal) ".gif")
>>>
>>>Strings need to be quoted, and things are concatenated by separating
>>>them with a space.
>>
>>I also tried that syntax in fact it was the first one i tried, it also
>>does not work, how does the counter get evaluated... is there any way to
>>do something like url(toString(counter(list, decimal)) ".gif"); ?
>
>That's not the problem. The problem is that something like that is not
>allowed as Laurens pointed out.

Well OK but i need to understand why is it not 
allowed? And if there is a way to exploit the 
code in some way that make it possible


>>I think i need to get into the inner workings of the counter and URL
>>parameters see how they are implemented and try to see if there is a way
>>to get the return from the counter propriety, and concatenate it with
>>the file extension... any pointers on how to do this?
>
>It won't work. The property values that look like functions don't actually
>work like they would in programming languages. So for now there's no way
>to do what you want.

Then how do they work? If you could explain it to me i would appreciate it :)
Concatenation is built, and if you can output a 
url with image and also if i can have a counter 
that outputs: (Image1.gif) and this is pretty 
easy there must be a way to turn that into a 
valid image url directly or indirectly i just 
need to figure out how, all the functionality is 
already built now i just need to glue this in some weird fashion way.

What i don't get is why did the counter propriety 
got created and then limit it's scope so much, 
wend there are so many cool things that you can do with a counter...

-Dan 
Received on Tuesday, 16 May 2006 14:45:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:45 GMT