Re: [css3-lists] Where can the counter() function be used?

On Monday 2012-07-09 07:32 -0700, Tab Atkins Jr. wrote:
> On Mon, Jul 9, 2012 at 7:24 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> > On 7/9/12 3:16 AM, Tab Atkins Jr. wrote:
> >> One way this could be solved would be to allow math on counter values
> >> (which are just integers), such as allowing the counter() function
> >> inside of calc().  Then you could write your use-case as:
> >>
> >> animation-delay: calc(counter(delay-timer) * 1s);
> >
> > I must be missing something.
> >
> > Counter values depend on whether boxes are present or not, no?
> >
> > It seems pretty odd to me to require that values of some properties depend
> > on whether some completely unrelated boxes far away in the DOM are present.
> > It might also be somewhat difficult to implement correctly in the face of
> > dynamic changes.
> >
> > -Boris
> >
> > P.S.  Note that "boxes are present" does not actually map directly to
> > computed display values, by the way.  It probably does map to used display
> > values...
> 
> You must be missing something, since what you just described is how
> counters always work.  It's just that in the past they've been limited
> to being used in 'content' only.

Counters aren't computed to anything in the computed value of
'content'.

Introducing a feature like this is equally broken as the entire
reason we had to introduce the used value concept into CSS:
preventing computed values of properties from depending on layout
data.

You claim it *could* be computed from style, but it can't be
computed from *local* style -- i.e., the element and its parent.
That's nearly as bad as depending on layout.  There are operations
on layout that are non-local, but finding computed values isn't.

And as computers become more parallel, we should care *more* about
this sort of thing, not less.  CPU cores aren't getting faster,
we're just getting more of them.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Monday, 9 July 2012 15:39:32 UTC