Bugzilla – Bug 682
<figure> Example in Spec Fails Validation
Last modified: 2010-02-02 16:53:03 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<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. :-)
(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.
Thanks for the clarification. :-)
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.