NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 682 - <figure> Example in Spec Fails Validation
<figure> Example in Spec Fails Validation
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-22 14:39 CET by theb83
Modified: 2010-02-02 16:53 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description theb83 2009-11-22 14:39:42 CET
The following example is given at http://www.whatwg.org/specs/web-apps/current-work/#the-figure-element :

<!DOCTYPE html>
<meta charset=utf-8>
<title>Test</title>
<p>In <a href="#l4">listing 4</a> we see the primary core interface
API declaration.</p>
<figure id="l4">
 <dt>Listing 4. The primary core interface API declaration.</dt>
 <dd>
  <pre><code>interface PrimaryCore {
  boolean verifyDataLine();
  void sendData(in sequence&lt;byte> data);
  void initSelfDestruct();
}</code></pre>
 </dd>
</figure>
<p>The API is designed to use UTF-8.</p>

When this code is entered into the textfield at http://html5.validator.nu/, the validator complains:

Error: Element dt not allowed as child of element figure in this context. (Suppressing further errors from this subtree.)
From line 7, column 2; to line 7, column 5
id="l4">↩ <dt>Listin
Contexts in which element dt may be used:
Before dd or dt elements inside dl elements.
In a figure element containing no other dt element children.
As the first child of a details element.
Content model for element figure:
In any order, one dd element, and optionally one dt element.

Error: Element dd not allowed as child of element figure in this context. (Suppressing further errors from this subtree.)
From line 8, column 2; to line 8, column 5
on.</dt>↩ <dd>↩  <pr
Contexts in which element dd may be used:
After dt or dd elements inside dl elements.
In a figure element containing no other dd element children.
As the last child of a details element.
Content model for element figure:
In any order, one dd element, and optionally one dt element.

I'm confused. :-)
Comment 1 Michael[tm] Smith 2009-11-22 17:06:09 CET
(In reply to comment #0)
> The following example is given at
> http://www.whatwg.org/specs/web-apps/current-work/#the-figure-element 
> When this code is entered into the textfield at http://html5.validator.nu/, the
> validator complains:
> Error: Element dt not allowed as child of element figure in this context.
> I'm confused. :-)

The content model for the figure element was changed relatively recently, and the validator.nu backend has not yet been updated to reflect the change. So this is on the TODO list at this point.
Comment 2 theb83 2009-11-22 17:30:12 CET
Thanks for the clarification. :-)
Comment 3 Michael[tm] Smith 2010-02-02 16:53:03 CET
The spec has changed recently. The dt and dd elements are no longer part of its content model; instead, there's a new <figcaption> element. The validator.nu sources have been updated to match the current spec.