Re: Wrapping delimited lists, fluid rows

Andrew Fedoniouk wrote:
> From: "Daniel Beardsmore" <public@telcontar.net>
> | to display horizontally:
> |
> |   ul.menu li { display: inline }
> |   ul.menu li:after { content: " |  " }
> |   ul.menu li:last-child:after { content: none }
> |
> | A given list might look like:
> |
> |   Foo | Bar | Baz
> |
> | But if this list wraps onto a new line, you'll see a problem:
> |
> |   Foo | Bar | Baz | Iddly | Diddly | We've | Run | Out |
> |            of | Names | For | This | List
> |

> Rules like
> 
> ul.menu li:after { content: " |  " }
> ul.menu li:last-on-line:after { content: none }
> 
> effectively create oscillation condition in the layout algorithm.

And exactly how this is different from :hover, for example? Here's an
highly probably oscillating style for any document styled with CSS:

 :hover { position: absolute; top: 1000cm; }
 /* hover the pointer above the content to test */

If we already have stuff like this in the CSS, it possibly cannot be
used as the *only* reason not to allow new similar constructs. If
oscillation is considered a serious problem, the we just have to define
one state as the correct one. Perhaps define maximum width over time
during style resolution of :last-on-line() as the width that is used to
determine *if* the element still fits on the current line?

I'd suggest :nth-on-line() that would be defined along the lines of
:nth-child(). Obviously, nth-on-line() would be a lousy name for a
selecter when writing system uses columns instead of lines, but I hope
you get the point.

However, I must admit that even though I'm not opposed to a feature like
this per se, there's a very high possibility that this wouldn't be
implemented by real world UAs. And a nice style system without a real
world implementation is useless - at least to me.

Also, where does one end? If :nth-on-line() is added, perhaps we need
:nth-word(), :nth-character(), :nth-pixel()?

-- 
Mikko

Received on Monday, 26 February 2007 13:18:03 UTC