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

Michel Fortin michel.fortin at michelf.com
Wed Feb 27 05:06:24 PST 2008

Le 2008-02-25 à 17:42, Ian Hickson a écrit :

> On Mon, 16 Jul 2007, Michel Fortin wrote:
>> Since I'm not convinced that the current content model for <figure>  
>> is
>> adequate [1], I decided to dig more examples where figures in HTML  
>> pages
>> would be hard to fit with the current model. Here are the results.
> Thank you hugely for this research! This is very useful. I have  
> updated
> the spec to handle these cases, and given examples of some of the key
> ones. Let me know if you think anything else deserves an example.

I'm glad it was helpful. I quite like the new definition for figure  
and I think it covers the vast majority of illustration use cases I  
could come with. I don't think it needs more examples either.

I'm wondering however about the definition leaving something out. It  
says: "The figure element represents some prose content, optionally  
with a caption, which can be moved away from the main flow of the  
document without affecting the document's meaning."

Now, suppose you have this:

     <p>A header looks like this in your browser:</p>
     <h1>Some text!</h1>

... unfortunately, the <h1> here isn't a real header in the document:  
it's an illustration of a header (ah-ha: figure!) which can't be  
removed from te flow of the document (oops, can't use figure). There's  
no rational way to markup this with the current wording of the spec;  
abusing <figure> is the most reasonable option I can find:

     <p>A header looks like this in your browser:</p>
     <figure><h1>Some text!</h1></figure>

The problem being that <figure> needs the ability to be moved around  
without changing the meaning of the document, so the markup above  
would be non-conforming because the sentence just makes no sense if  
you put the figure elsewhere. Perhaps figure could have an optional  
"anchored" attribute to indicate it belongs to a specific point in the  

Note that there was a couple of such markup rendering examples like  
these at the end of the email you're referring to. Now, perhaps that  
case isn't important or frequent enough to justify adding it to the  
spec -- I won't be the juge of that -- but I have myself such a page  
on my website for which I'd like to use better markup than <div  
class="html"> at each example (page included in the list in the old  
email) and I still don't see what I should use (was hoping for  

>> It could also be useful to allow labeling of subfigures, perhaps like
>> this:
>>    <figure>
>>      <figure><legend>(a)</legend> <img ...></figure>
>>      <figure><legend>(b)</legend> <img ...></figure>
>>      <legend>My house seen (a) from the front; (b) from the back</ 
>> legend>
>>    </figure>
> This is allowed, but I haven't included an example.

I don't think it's necessary.

Michel Fortin
michel.fortin at michelf.com

More information about the whatwg mailing list