[whatwg] INS and DEL in lists

On Fri, Mar 28, 2008 at 6:02 AM, Keryx Web <webmaster at keryx.se> wrote:

> Henri Sivonen skrev:
>
> > For various legacy parsing reasons and in the table case for CSS table
> > model reasons, this kind of thing is seriously more trouble for
> > implementors than it is worth. From an implementation cost/benefit point
> > of view, I am against allowing ins/del in more places.
> >
>
> But from what I've understood it actually works as expected today (in
> lists). Not that I've yet tested this exhaustively.
>
> Allowing list markup in tables seems to be a nightmare to spec and
> implement - and teach! Ins and del in tables is no priority of mine
> either.
>
>
> Lars Gunther
>
Yes, if you have any insight as to why it is difficult, please share.  As it
is, browsers (specifically, FF2, IE7, and Opera9) seem to handle it just
fine.
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3Ctitle%3EIns%2FDel%20within%20lists%3C%2Ftitle%3E%0D%0A%3C!--%0D%0A%3Cstyle%20type%3D%22text%2Fcss%22%3E%0D%0Adel%20%7B%0D%0Adisplay%3A%20none%3B%0D%0A%7D%0D%0A%0D%0Ains%20%7B%0D%0Atext-decoration%3A%20none%3B%0D%0A%7D%0D%0A%3C%2Fstyle%3E%0D%0A--%3E%0D%0A%3Col%3E%0D%0A%09%3Cli%3EOne%3C%2Fli%3E%0D%0A%09%3Cdel%3E%3Cli%3ETwo%3C%2Fli%3E%3C%2Fdel%3E%0D%0A%09%3Cli%3EThree%3C%2Fli%3E%0D%0A%09%3Cins%3E%3Cli%3EThree.5%3C%2Fli%3E%3C%2Fins%3E%0D%0A%09%3Cli%3EFour%3C%2Fli%3E%0D%0A%3C%2Fol%3E
Note - this is obviously triggering quirks mode.  FF2, in fact, refuses to
style the <ins> and <del> elements if you give the page a proper DOCTYPE.
The other two browsers seem to accept it just fine, though.

In DOM terms, both FF and Opera create a well-formed, identical tree.  IE
does something... weird.  I don't really understand what's going on there in
the DOM, mainly because I've never seen a red tagname before.  However, it
obviously styles things correctly.  Note, though, that IE drops the tags
when it displays the InnerHTML.  Odd.

>I like the idea of a list header, maybe <lh>
No need to add a new element.  Some simple experimentation shows that all
major browsers will accept a simple <h1>.  That still communicates the
semantics you want, without any backwards-compatibility issues.


>> I doubt this is something we'd ever want in HTML.  CSS3 can do this
>> just fine with generated content and counters, though.
>
>And the original problem can be solved using CSS2;
>I only wanted to bring a similar example:
>HTML poorly supports interleaving unrelated markup streams.
Please, elaborate.  The reason this is a problem is because it *can't* be
well-solved with CSS.  If the <ins>/<del> is used *within* an <li> then it
breaks the numbering of <ol> when you hide the <del>'d elements.  The
semantics are wrong as well - it indicates that you have a list item with
deleted text, not a deleted list item.  The ability to wrap <ins>/<del>
around <li> solves a specific semantic issue and a display issue as well.

On the other hand, mixing together lists and tables doesn't seem to have any
good semantic interpretation.  The reason I objected to that example was
because you'd pretty much just be jacking the *display* of <ol> for your own
purposes, without regard to the semantics.  If you just want something
numbered without giving it proper list semantics, hand-number it or use
generated content.

Now, an objection I can think of is that, if <ins>/<del> around <li> is
allowed, there's no good reason not to allow it around <tr> or <td> either,
or even <tbody> for that matter.  It would have clear, useful semantics, but
would likely be a lot more complex.  The following link shows that every
browser parses it differently, and none of them actually pay attention to
it:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3Ctitle%3EIns%2FDel%20within%20tables%3C%2Ftitle%3E%0D%0A%3C!--%0D%0A%3Cstyle%20type%3D%22text%2Fcss%22%3E%0D%0Adel%20%7B%0D%0Adisplay%3A%20none%3B%0D%0A%7D%0D%0A%0D%0Ains%20%7B%0D%0Atext-decoration%3A%20none%3B%0D%0A%7D%0D%0A%3C%2Fstyle%3E%0D%0A--%3E%0D%0A%3Ctable%3E%0D%0A%3Ctr%3E%3Cdel%3E%3Ctd%3EOne%3C%2Ftd%3E%3C%2Fdel%3E%3Cins%3E%3Ctd%3EOne.5%3C%2Ftd%3E%3C%2Fins%3E%3C%2Ftr%3E%0D%0A%3Ctr%3E%3Ctd%3ETwo%3C%2Ftd%3E%3C%2Ftr%3E%0D%0A%3Cdel%3E%3Ctr%3E%3Ctd%3EThree%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Fdel%3E%0D%0A%3Cins%3E%3Ctr%3E%3Ctd%3EThree.5%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Fins%3E%0D%0A%3Ctr%3E%3Ctd%3EFour%3C%2Ftd%3E%3C%2Ftr%3E%0D%0A%3C%2Ftable%3E

~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080328/831ce1d7/attachment.htm>

Received on Friday, 28 March 2008 07:12:13 UTC