[whatwg] Reverse ordered lists

Sam Arthur Allen dev at atshop3d.com
Wed Jan 23 07:32:50 PST 2008


On Wed, 23 Jan 2008 09:07:02 -0600
Siemova <siemova at gmail.com> wrote:

> But then what would someone do in order to begin a list but not end
> it? For instance, if they wanted to say:
> 
> "10. Blah
> 9. Blah
> 8. Blah
> 
> And so forth..."

Then in this situation, a start value would be necessary.

> 
> I guess I'm asking, why recommend artificial and unnecessarily
> narrow constraints? We don't want UAs to force unexpected behaviors
> which would frustrate the end user and make them search (vainly)
> for a workaround if that's not what they wanted, do we?

What I'm looking for, is a _logical_ reverse order list that would
be displayed by default when the site designer or whoever uses it
can't be bothere setting specific list values, which AFAIK is from
X to 1. Also, nobody has to be constrained to anything as defaults
should alwalys be overridden when needed.

> Personally, I don't see any problem with allowing list items to be
> numbered 0 or negatively, so I think the "1, 0, -1, -2" default
> approach would work fine.

I can only disagree with using negative numbers in a reverse order
list, since I communicate to many people in non-english countries
that use brackets to display negative numbers in their locale. So a
list would appear as:

    1 : Red
    0 : Green
   (1): Blue
   (2): Violet
   (3): ...etc...

and if a long list is printed out on paper, all anybody would see is:

  (120): Insert a really long paragraph of text here.
         ...
  (121): And one here too
         ...

which, to someone outside of their locale, would appear confusing.

> With both "reverse" and "step" we could
> still accomplish what you're talking about, but the spec would
> remain both simpler for UAs to implement and more flexible for
> content creators' use.
> 
> - Jason
> 

> > 
> > On Jan 23, 2008 8:23 AM, Sam Arthur Allen <dev at atshop3d.com> wrote:
> > 
> > > On Wed, 23 Jan 2008 15:03:42 +0100
> > > Lachlan Hunt <lachlan.hunt at lachy.id.au> wrote:
> > >
> > > Actually, the best route I can see is to not have a start
> > > attribute at all but to rely on the browser to automatically
> > > detect the amount of <li> tags within an
> > > <ol reverse> container and decrement from there. ie:
> > >
> > >   <ol reverse>   <-- Start count from here.
> > >      <li>Red</li>
> > >      <li>Orange</li>
> > >      <li>Yellow</li>
> > >      <li>Green</li>
> > >      <li>Blue</li>
> > >   </ol>   <-- Close tag detected, 5 <li> tags counted.
> > >
> > > is rendered as starting from 5:
> > >
> > >    5. Red
> > >    4. Orange
> > >    ...etc...
> > >
> > > and using a "step" value, for example, all the browser would need
> > > to do is multiply the total at the </ol> tag, and decrement that
> > > multiplied total by the "step" amount, making:
> > >
> > >   <ol reverse step="5">
> > >
> > > render the list as:
> > >
> > >  25. Red
> > >  20. Orange
> > >  15. Yellow
> > >  ...etc...
> > >
> > > It might mean more work for the browsers, but by experience
> > > something like this isn't too hard to implement.
> > >



More information about the whatwg mailing list