This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6543 - Mint a new element for figure captions
Summary: Mint a new element for figure captions
Status: VERIFIED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: CR
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: NoReply
Depends on:
Blocks:
 
Reported: 2009-02-09 07:17 UTC by Henri Sivonen
Modified: 2010-10-04 14:49 UTC (History)
5 users (show)

See Also:


Attachments

Description Henri Sivonen 2009-02-09 07:17:29 UTC
Currently, HTML 5 specifies that the caption for <figure> is represented by the <legend> element. Unfortunately, the <legend> element implies a <fieldset> in the HTML parser in already shipped and installed instances of Gecko. If <legend> is used, this is a rather notable barrier for author adoption of <figure> even if the generation of implied fieldset were removed in a future release.

Furthermore, the <legend> element comes with form-related DOM baggage: the HTMLLegendElement interface from DOM Level 2 HTML.

Since <caption> is also legacy-encumbered, I suggest minting a new element to remove the adoption barriers for <figure> and its caption.

Since the English thesaurus has been exhausted, I suggest minting a new element name that has some qualifying prefix for the word "caption": e.g. <figcaption>. (I'm assuming here that <rubric> wouldn't be appropriate.)
Comment 1 Ian 'Hixie' Hickson 2009-02-09 07:33:17 UTC
IMHO the long-term author confusion from having yet another element (or likely two, since <figcaption> wouldn't work for <details>) for this kind of semantic far outweighs the short-term migration problem. In practice, <legend> will soon not be any more of a problem than <section>.

(The DOM baggage is pretty minimal on HTMLLegendElement; I don't really see that as a problem. It doesn't have any special behaviour like, say, <label>.)
Comment 2 Rob Burns 2009-02-09 08:10:55 UTC
Since it seems "caption" is really the word we're looking for, but legacy parsing wants caption to be properly placed in a table, why not simply make a legacy synonym element to the figure element as has been suggested in the past[1].

With this approach, the parsing algorithm could be updated to permit 'caption' elements in "figure" elements in addition to the "table" element. In the meantime, authors can use:

<table f >
     <caption>some caption text</caption>
     <tr><td><img src='uri' alt='alt text' >
</table>

in the same way they will eventually use 

<figure>
     <caption>some caption text</caption>
    <img src='uri' alt='alt text' >
</figure>

in all XML parsed HTML and HTML5 parsed text/html in the future. Note the use of the "f" boolean minimized attribute to indicate this is a figure element and almost the same character count in the legacy compatible approach as the figure example.

With this approach authors get immediate CSS support for figures that I expect behaves much the way we would want the figure caption to behave.

figure, table[f] {caption-side: bottom; }

 or

figure, table[f] {caption-side: top; }

Sure it's a little contrived in the interim, but there's a lot in HTML5 that's a little contrived. And it works today!
Comment 3 Rob Burns 2009-02-09 08:17:54 UTC
(In reply to comment #1)
I'll not here also that this suggestion in comment #2 doesn't need to prevent the use of 'legend' for 'details' elements. Either way we have 'legend' and we have 'caption'. Its only a matter of where precisely each one gets used.
Comment 4 Ian 'Hixie' Hickson 2009-05-26 02:22:08 UTC
I propose to wait and see how this plays out, since it's not a particularly critical feature.
Comment 5 Ian 'Hixie' Hickson 2009-09-16 08:04:13 UTC
ended up using leif's suggestion from http://lists.w3.org/Archives/Public/public-html/2009Feb/0207
Comment 6 Maciej Stachowiak 2010-03-14 13:16:49 UTC
This bug predates the HTML Working Group Decision Policy.

If you are satisfied with the resolution of this bug, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

This bug is now being moved to VERIFIED. Please respond within two weeks. If this bug is not closed, reopened or escalated within two weeks, it may be marked as NoReply and will no longer be considered a pending comment.