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

Ian Hickson ian at hixie.ch
Wed Feb 27 11:40:15 PST 2008


On Wed, 27 Feb 2008, Michel Fortin wrote:
> 
> 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 document.

Using <figure> here doesn't help. What you are illustrating in this case 
isn't what a header looks like, it's a section that happens to have a 
header. In fact the only difference between this case and the first 
example above is that the first example above breaks the outline, but you 
could work around that by doing this:

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

...and it would have roughly the same meaning as in the <figure> case.

The problem is that there's no way to mark up content as being 
"metacontent", that is, there's no way to mark up an element as having no 
semantics but its default presentation.

This is a rare edge case which basically only affects tutorials and test 
cases. We could come up with a feature to annotate markup as being 
"literal" or "meta" rather than working as defined, but I don't see the 
point. Test cases aren't going to use it because they are trying to fake 
out the browser into thinking that some particular convoluted case is 
occuring, and frankly tutorials are better off not using it because 
otherwise people would copy and paste that without realising it is 
specific to tutorials.

I recommend simply not worrying about it. In cases where you're 
self-referrentially discussing markup, the document's semantics don't 
really make sense. But that's ok, I don't think anyone but semantic nerds 
like us are going to really notice or care.

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