W3C home > Mailing lists > Public > www-style@w3.org > December 2012

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

From: François REMY <francois.remy.dev@outlook.com>
Date: Sat, 1 Dec 2012 23:35:43 +0100
Message-ID: <DUB120-DS675FC0BDA841D15D4BF90A5420@phx.gbl>
To: "Lea Verou" <lea@w3.org>
Cc: "Simon Sapin" <simon.sapin@kozea.fr>, <www-style@w3.org>
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 

-----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 
However, the issue that Simon mentioned seems quite serious :( 
Received on Saturday, 1 December 2012 22:36:10 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:06 UTC