[whatwg] Nested list

Ryosuke Niwa rniwa at google.com
Thu Jul 16 00:59:30 PDT 2009


On Mon, Jul 13, 2009 at 12:12 PM, Erik Vorhes<erik at textivism.com> wrote:
> While I think I understand your description, I'm a little concerned
> for a few reasons.
>
> 1. Depending on context, lists within lists don't render differently
> than lists within list items do.

Right, but you're talking about a graphical representation with
default styles.  You can always modify them using CSS.  e.g. there is
no difference between a text wrapped with a span and the same text
without the wrapping span.  Should we then disallow span since it
doesn't render differently and doesn't have any semantic meaning?

I personally like the idea of getting rid of span, div, and all other
semantically useless elements but I don't think that's the goal of
HTML5.

> 2. How does the User Agent determine if a list within a list is part
> of the preceding <li> if that <li> isn't closed? Is it part of the
> <li> or something on its own?

If li isn't closed then we should assume that ol/ul is inside the li.
I think SGML exhibits this behavior automatically.  So why don't we
follow that?

> 3. Why should <ol> and <ul> provide different semantic meaning
> depending on context? Won't that lead to confusion?

I don't think I gave any different semantic meaning to it.  If you
take one level of a tree structure while ignoring all descendants, it
should be a list.

> 4. If two lists aren't actually supposed to be items in the same list,
> why would you group them as a list? Shouldn't they be separate
> entities entirely?

I do agree that ul / ol inside an ul / ol must be a list item as well.
 But I'm opposing the idea that there should always be li since major
UAs don't generate them and they are probably not going to change it
anytime soon for backward compatibility.  We should standardize this
de-facto standard so that everyone else can follow it with confidence.
 The last thing we want is incompatible behavior across UAs.

If you'd like, you can always rewrite DOM such that ol / ul is always
inside a li.  But if some UA puts li and some don't, then you have to
start branching cases and deal with each.  And that will be an extra
burden to authors.

Ryosuke



More information about the whatwg mailing list