W3C home > Mailing lists > Public > public-html@w3.org > September 2009

Re: what is dt?

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Fri, 18 Sep 2009 21:55:38 +0200
Message-ID: <4AB3E5BA.2070101@xn--mlform-iua.no>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Lachlan Hunt <lachlan.hunt@lachy.id.au>, public-html@w3.org, Shelley Powers <shelleyp@burningbird.net>
Tab Atkins Jr. On 09-09-18 20.51:

> On Fri, Sep 18, 2009 at 1:15 PM, Leif Halvard Silli
> <xn--mlform-iua@xn--mlform-iua.no> wrote:
>> Tab Atkins Jr. On 09-09-18 16.58:
>>> 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>


>>> </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 ...
> 
> Huh?  I'm not sure how this applies. [...]


I (wrongly) interpreted what you said to mean that the placement 
of the caption should not be governed by CSS, but instead be 
governed by where the caption is placed. As Lachlan put it [1]:

"So whatever markup we decide for caption needs to be able to be 
freely placed either before or  after the content in the markup, 
and not simply controlled with  'caption-side' in CSS."

It follows from this that if the caption is placed in the middle, 
as you say below should be OK, then the caption should by default 
appear in the middle.

And at least, caption in the middle, was not something Lachlan 
mentioned.

> The <p> could even go in the middle I guess, though that would be very
> odd and I wouldn't recommend it.

I suppose that for CSS, it doesn't matter where the the caption is 
placed in the code. But such a thing as a caption in the middle 
should not be conforming - it would water down the distinction 
between caption and content.

> Also, just in case it wasn't clear, the intention is that @caption can
> be put on *any* child of <figure>.  It's not just for <p>.  You can
> put it on <ul>, <div>, or whatever.


Right here I suppose you meant "any element", and and not "any child".

>  The intended rendering (stolen
> from another suggestion from Lachy) can be expressed as:
> 
> figure { display: table; }
> figure>[caption] { display: table-caption; caption-side: bottom;
> margin: 0; text-align: center; }
> figure>[caption]:first-child { caption-side: top; }
> 
>> Also, if you can accept <figure caption >, then why not <dl figure >
>> instead?
> 
> I don't understand the connection.  <figure> doesn't get @caption.
> Some child of it does.  The intent is basically identical to that of
> <time pubdate> - rather than minting a new element just to indicate
> that something has a particular semantic relation to its
> parent/ancestor, you just pop an attribute on it.

The idea of <dl figure > is the same - we do not need to mint a 
new element - AKA figure. Much less do we need to invent a new 
caption element (or attribute) or content element.

(We must, however decide how to handle the placement of the <dt>.)

> This approach isn't infinitely scaleable, of course - it's been stated
> before that basing actual behavior/parsing/etc on attributes is a big
> antipattern that is to be avoided at nearly all costs.  But as long as
> the relation conveys nothing more than a bit of semantics,


Nothing more than a bit of semantics. Sounds like <dl figure >.

> it should
> be okay, just like <time pubdate> does.  (This would mean that
> <details> should probably keep using actual elements, so <dt>/<dd>
> seems fine there.)

<details> still has the rendering problems I just detected.

I must say that <dl figure > is a smaller jump than <p caption >.

Firstly, @figure would only be allowed on <dl>, so authors would 
not need to learn a lot of exception elements - such as <caption> 
  - that could not have the @caption attribute.

Secondly, adding @caption means that the element is taken out of 
the normal flow. Both via CSS [according to your description 
above]. But also semantically, as an element that becomes a 
caption is literally demoted from "real content" to only a 
label/caption on the real content.

> <dl figure> is something different entirely - it's changing the
> semantics of the element entirely, rather than adding additional
> semantics like <* caption>.  It also just feels weird; to me, it's
> probably *weirder* than <figure><dt/><dd/></figure>.


Well, @figure represents "additional semantics", whereas <* 
caption> represents a big change in semantics.

[1] http://www.w3.org/mid/4AB39A25.5000203@lachy.id.au
-- 
leif halvard silli
Received on Friday, 18 September 2009 19:56:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:48 GMT