[whatwg] The IMG element, proposing a CAPTION attribute

Ian Hickson ian at hixie.ch
Fri Nov 10 16:16:16 PST 2006


On Fri, 10 Nov 2006, Michel Fortin wrote:
> 
> And today's browsers also have problems with <caption> outside a table, 
> which implies that my previously proposed markup for this:
> 
>     <figure>
>       <caption>caption text</caption>
>       ... figure content here ...
>     </figure>
> 
> would not work correctly in today's browsers. But if you look at things 
> in another way, today's Firefox can't handle <section>, <aside>, 
> <header>, and <footer> correctly either (stopping the section at the 
> first block-level element!).

The difference is that <caption> will never work, because of things like 
this:

   <table>
     <caption>
        <figure>
           <img ...>
           <caption> ...A... </caption>
        </figure>
     </caption>
     ...
   </table>

...which, for legacy compatibility reasons, must result in a DOM where the 
text with "A" ends up in a second <caption> element that is a child of the 
<table> element.


The idea of having markup of this form:

   <-container->
     <-embedded-content-/>
     <-caption-> ... </-caption->
   </-container->

...is a fine idea, however, which has been proposed multiple times, and 
I'm sure we'll use some variant on that. We just can't use <caption>. Or 
<label>, because that's for form controls.

I imagine we'll use <legend>. Parsers are a bit erratic with it right now, 
but we're requiring them to shape up for the parser part of the spec 
already, and the <details> element uses it already.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list