Re: [css3-value] calc and child selectors (was: Proposal for Touch-Based Animation Scrubbing)

The good thing is that you can compute the value of a counter quite early. 
You only need to have the computed value of the 'display' and 'counter' 
propeties of PREVIOUS elements (those should already have been computed so 
when you compute the current element).

I'm pretty sure it's possible to substitute the reference by a value at 
computation time (which is required if we want it to be a reference). The 
only thing which is maybe more tricky is to take in account the status of 
the current element (but we could just resolve that the COUNTER reference 
refers to the value the counter has just before the element, and we're 
done).




-----Message d'origine----- 
From: Lea Verou
Sent: Saturday, December 01, 2012 10:54 PM
To: François REMY
Cc: Simon Sapin ; www-style@w3.org
Subject: Re: [css3-value] calc and child selectors (was: Proposal for 
Touch-Based Animation Scrubbing)

On Nov 30, 2012, at 21:20, François REMY wrote:

> The computed value of a calculation may already be complex, even if this 
> would make it even more. I guess that if browsers want to support 
> "nth-child" they would get exactly the same issue anyway.

:nth-child() only depends on the sibling index. Counters depend on other 
things as well, e.g. display:none elements are not counted. So no, nth-child 
wouldn’t have that issue, I think.

That said, I really hope there's a way to make counters work in calc(). I 
don’t see the issue with overloading the function to return a <number> 
inside calc(), CSS’ strongly typed-ness is almost transparent to authors 
anyway.
However, the issue that Simon mentioned seems quite serious :( 

Received on Saturday, 1 December 2012 22:36:10 UTC