Re: what is dt?

Tab Atkins Jr. On 09-09-18 16.58:

> On Fri, Sep 18, 2009 at 9:33 AM, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
>> Tab Atkins Jr. wrote:
>>> On Thu, Sep 17, 2009 at 7:51 PM, Leif Halvard Silli
>>> <xn--mlform-iua@xn--mlform-iua.no>  wrote:
>>>> To illustrate my point, we could end up with this:
>>>>
>>>> <figure>
>>>> <h1>Exhibit A</h1>
>>>> <div><h1>Madonna and child</h1>
>>>> <img src="foo" alt="bar">
>>>> </div>
>>>> </figure>
>>> It's easy to avoid that situation - the caption for the<figure>  would
>>> just be the *first* child heading element.  So it wouldn't be
>>> necessary to wrap a<div>  around the content there - the second<h1>
>>> is implicitly part of the content, not the caption.
>> Let's try to avoid introducing solutions that require such workarounds to
>> avoid unintended side affects.  Also, requiring the caption to be the first
>> element is counter intuitive for the very common practice of putting
>> captions below images or other figure content.
> 
> This is true.  In that case, though, we're definitely stuck with
> explicitly marking the caption and the content in such a way that the
> caption *cannot* be confused as part of the content.
> 
> As noted before, <dt>/<dd> works, in that they can't show up as
> arbitrary children.  A new element would work, if it was defined as
> the caption of a <figure>.


We should perhaps have had a systematic evaluation of the 
advantages of new vs old element?

For IE, the advantages of a _new_ element is that, via JavaScript, 
it becomes an XML-like element, that closes with the end tag.

Whereas when resusing <dt> and <dd> is used inside <figure>, then 
in IE version 6 and 7, they will swallow the the subsequent 
element - disregarding the closing </dd> of </dt> or </figure>.

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/235

So, for IE 6 and 7 compatibility, there is an advantage to using 
new elements - instead of reusing <dt> and <dd> in a new element.

> A third solution (that was actually suggested by you, Lachlan,
> yesterday in IRC) is to use an attribute to disambiguate the caption
> from the content.  So you'd have markup like:
> 
> <figure>
>   <p caption>Exhibit A</p>
>   <h1>Madonna and child</h1>
>   <img src="foo" alt="bar">
> </figure>

As Lachlan said, one disadvantage to this would be that it would 
be impossible to place the caption /last/. Unless you also add a 
special rule for last child ...

Also, if you can accept <figure caption >, then why not <dl figure 
 > instead?
-- 
leif halvard silli

Received on Friday, 18 September 2009 18:15:42 UTC