[whatwg] several messages about <figure> and related subjects

Ian Hickson ian at hixie.ch
Sat Nov 29 19:58:29 PST 2008


On Mon, 25 Feb 2008, Maciej Stachowiak wrote:
> On Feb 25, 2008, at 2:42 PM, Ian Hickson wrote:
> > 
> >   <label>
> >      This would preclude any sane way of putting form controls in
> >      legends, which would be bad.
> >      This can't be fixed in the spec.
> 
> Is the ability to put form controls in figure captions (let alone more 
> than one form control) really more important than ability to style them 
> sanely? Putting a form control in a figure caption seems unlikely to me. 
> Even more so for <details>, where form controls inside the label would 
> be confusingly inside another interactive element. Indeed, <details> is 
> arguably a kind of form control.

It's easy to imagine UIs, e.g. of templates, that have text boxes in 
captions and are waiting for user input there. The default "open file" 
dialog on Mac OS X has a kind of <details>-like UI with a control in the 
"caption", too. And finally, <label> already has so many semantics and 
special rules and so forth that reusing it here just seems like a 
particularly bad idea.


> >   <legend>
> >      Parsing issues in Firefox and IE:
> >         http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%3Cscript%3Edocument.createElement(%27figure%27)%3C%2Fscript%3E%3Ctitle%3ETitle%3C%2Ftitle%3E%3Cp%3E...%3C%2Fp%3E%0A%3Cfieldset%3E%0A%20...%0A%20%3Cfigure%3E%0A%20%20%3Clegend%3Efigure%3C%2Flegend%3E%0A%20%20content%0A%20%3C%2Ffigure%3E%0A%20...%0A%3C%2Ffieldset%3E
> >      ...and the element doesn't appear in the DOM when there's no
> >      <fieldset> in at least Safari and Firefox.
> 
> It seems to me that the problems with adding a new element are purely 
> aesthetic, while the problems with reusing 'legend' are practical and 
> harm deployment of the new element.

I don't think we should discount the problems with introducing a new 
element quite that quickly.


> > I think our only option is to use <legend>, and, while in the 
> > migration period, have people use markup like:
> > 
> >   <figure>
> >     <legend><span class="legend"> ... </span></legend>
> >     ...
> >   </figure>
> > 
> > ...with styles like:
> > 
> >   figure > legend, figure > .legend { ... }
> 
> Yuck. Surely writing <legend><span class="legend"> ... </span></legend> 
> is uglier than writing something like <figcaption> ... </figcaption>.

Yes, but the former would only last a decade or two, while the latter 
would last for the lifetime of HTML.


> > > 4) Another alternative would be using a new unknown element. 
> > > Whipping out my thesaurus, I see <rubric>, <inscription>. Another 
> > > possibility is something like <figcaption> (to avoid the problems 
> > > <caption> would cause for figures inside tables), but that wouldn't 
> > > be a good fit for <details>.
> > 
> > <figcaption> and <detailscaption> and so on just seems like it would 
> > make the language really complicated.
> 
> But <rubric> is pretty reusable and about as semantically correct as 
> <legend> for general use as a caption:
> 
> http://dictionary.reference.com/browse/rubric
> http://dictionary.reference.com/browse/legend

Except people don't know what a rubric is. They know what a legend is. 
"Legend" is what people call this (or "caption", but the parsing issues 
there are even more intractable).


> > We've waited years for <figure>, can't we wait a few more while 
> > browsers get their act together in their parsers?
> 
> <figure> could be used right now with CSS styling as backup and without 
> polluting up the markup if it didn't rely on an aspect of the HTML5 
> parsing algorithm that no browser implements yet. Otherwise we will 
> indeed have to wait years, needlessly.

I think the cost of a few years here is worth it. It's not like this is 
<input type=date> where introducing this feature today is ten years too 
late; the <figure> element is helpful, and worth adding, but not a 
panacea. Thus I don't see the problems as a big deal.

-- 
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