W3C home > Mailing lists > Public > www-style@w3.org > September 2003

Re: One more list-item thought

From: <staffan.mahlen@comhem.se>
Date: Sun, 14 Sep 2003 10:18:17 +0200
To: Ian Hickson <ian@hixie.ch>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <3F644069.15334.66A529@localhost>

On 13 Sep 2003 at 19:21, Ian Hickson wrote:
> You wouldn't use ::marker for inline lists, unless we are talking
> inline-block lists, in which case you would use inline-list-item or some
> such.
Yes, but could it not be useful to change the way of handling it? 
(please note that i am really not sure myself).

What i am thinking is that possibly the display: list-item way of 
defining it makes for to big a separation from the ::before way of 
doing lists, but they are basically the same concept. The display: 
list-item currently implies lots of things that could possibly be 
better defined elsewhere, and that seem to not really be "display" 
type of implications. I do agree that my suggestion may not be the 
best solution though and i am not really up to speed on counters and 
before/after.

I believe that since CSS does take "ownership" of list item values 
from the content language, it should do so in a way which does not 
require a specific rendering of the list, or a separate way of 
creating the list. For instance, if ::before and ::after along with 
counters are required to create an inline list, they should possibly 
be used in the default style sheet to create the regular rendered 
list? However, since ::marker only exists for display: list-item 
elements, i suppose you could not modify such default style easily to 
make it inline? (Hmm, a style-sheet-property-value selector anyone?!? 
:)

The above may all be nitpicking and is not a big issue in actual 
usage, but it think it would be neat if things were defined so that
li {display: inline}
would "just work" and render as an inline list with the appropriate 
"indicator" before each item.

> That's already possible, just say
>    h1 { display: list-item; }
...
> > As a side note, would it be useful to add body to the below suggested
> > default to capture list-item featured elements that are rendered as
> > list items but are not in content an actual list-item in a list ( eg,
> > h1 {display: list-item})?
> >
> >  ol, ul { counter-reset: list-item; }
> 
> It's implied by the root element.
> 
I suppose that depends on what you mean by the rule. To make myself 
more clear test the following in your browsers of choise:

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>Display: list-item test</title>
    <style type="text/css">
      h2 {display: list-item}
    </style>
  </head>
  <body>
    <h2>First</h2>
    <h2>Second</h2>
    <ol>
      <li>Text
        <h2>Third</h2>
        <h2>Fourth</h2>
      </li>
    </ol>
  </body>
</html>

Perhaps a stronger implication could be useful. I think this example 
also possibly shows that there may be issues in what different 
browsers see as "list-container" (some seem to do implicit counter-
resets, perhaps when inside li?) when using display: list-item. 

As yet another side note i noticed that CSS2.1 states:
(http://www.w3.org/TR/CSS21/visuren.html#propdef-display)
"list-item 
This value causes an element (e.g., LI in HTML) to generate a 
principal block box and a list-item inline box. "

I am not sure that "list-item inline box" is a good way of wording 
it.

 /Staffan
Received on Sunday, 14 September 2003 04:18:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:23 GMT