[css-counter-styles] range of a counter style

The spec is currently a bit woolly (or indeed contradictory) as to whether 
the range of a counter style is exactly the union of the ranges given in the
'range' descriptor, or whether it's influenced by the 'system' of the counter
style.  Similarly for the related concepts of what values a counter style is
defined over, or what values cause fallback.


In the list of steps in section 2, the first step is:

  # If the counter value is outside the _range_ of the counter style
  # [then use fallback; otherwise don't use fallback].

where "range" is a link to a rather non-normative-looking definition:

  # Counter styles are composed of:
  #    ...
  #    - a <dfn id="range">range</dfn>, which limits the
  #      values that a counter style handles

This doesn't actually help in deciding how to perform that first step.  I think
that this list of steps should be clearly marked as to whether it is normative
or not.  If it is normative, then I believe that range should link to a
normative definition of what the range of a counter style is, or rather should
link to some text that allows deciding whether a given counter value is outside
the range of a given counter style, and thus whether or not to use the fallback.


If we look to section 3.5 for the definition of the 'range' descriptor,
then it says:

  # The ‘range’ descriptor defines the ranges over which the counter style is
  # defined.  If a counter style is used to represent a counter value outside of
  # its ranges, the counter style instead drops down to its fallback counter
  # style.
  # ...
  # The range of the counter style is the union of all the ranges defined in
  # the list.

Also relevant to these concepts are that some systems aren't defined for all
counter values (e.g. their algorithm doesn't say what to produce for all
counter values, even if we take the negation rule as applying); and that the
non-normative-looking description of fallback in section 2 describes it as what
to use "when the counter value is outside the counter style's range or the
counter style otherwise can't render the counter value".

I suggest that each system description include a sentence saying what values
it's defined over, and being clear as to whether this means what absolute
values it's defined over or what original counter values it's defined over.

Then the fallback clause (or the definition of "range of a counter") can refer
to that concept.

A couple minor issues in nomenclature: (i) sometimes "range" is used in the
spec to mean a contiguous range, and sometimes to a union of contiguous ranges
(though see following post); (ii) mathematically speaking, one might say that
it's the domain rather than range of the function.  ("Range" does make sense
mathematically if one considers the function to be an identity function, but
that seems a bit questionable for some counter styles.)  I've no real
objections to either of these, they're just things you might wish to
address at the same time as the other things mentioned here.

pjrm.

Received on Wednesday, 20 February 2013 12:18:11 UTC