[Bug 13128] Allow wrapping list items in DIV elements

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13128

--- Comment #4 from Aryeh Gregor <Simetrical+w3cbug@gmail.com> 2011-07-06 21:34:30 UTC ---
(In reply to comment #3)
> For <ul> and <ol>, there is no need for this.  Anything you can do by wrapping
> <li> in <div>, you can instead accomplish by moving the <div> inside the <li>
> and adjusting your styles appropriately.

You could, but only by adding more markup.  Consider something like

----
<p>To-do list, in descending order of priority:

<ol>
  <div class=urgent>
    <li>Put out fire in my apartment.
    <li>Foil plot to murder the president.
  </div>
  <div class=important>
    <li>Destroy invading aliens before they reach the Earth.
    <li>Devise cure for cancer.
  </div>
  <div class=unimportant>
    <li>Rescue kitten from tree.
    <li>Go to work.
  </div>
</ol>
----

Yes, of course you *could* just put the classes directly on the <li>s, but why
should you have to?  This is exactly what divs are for.  The only reasons I can
think of to disallow this are

1) If you mix li's that are children of divs with ones that aren't, you have to
be careful to explicitly close any <li> that precedes a <div>, or else it will
be parsed wrong.  (This applies to bug 12609 too.)

2) It makes programmatic list handling more complicated, because li's might
legitimately not be children of their containing list anymore.

But neither of these problems seems very strong.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 6 July 2011 21:34:36 UTC