Bugzilla – Bug 87
Change the meaning of <dl> subtly; include some examples.
Last modified: 2008-03-06 11:49:31 CET
Index: source =================================================================== --- source (revision 1242) +++ source (revision 1243) @@ -8046,8 +8046,8 @@ <dd>No difference from <code>HTMLElement</code>.</dd> </dl> - <p>The <code>dl</code> element introduces an unordered association - list consisting of zero or more name-value groups (a description + <p>The <code>dl</code> element introduces an association list + consisting of zero or more name-value groups (a description list). Each group must consist of one or more names (<code>dt</code> elements) followed by one or more values (<code>dd</code> elements).</p> @@ -8055,8 +8055,27 @@ <p>Name-value groups may be terms and definitions, metadata topics and values, or any other groups of name-value data.</p> + <p>The order of the list of groups, and of the names and values + within each group, may be significant.</p> + + <p>If a <code>dl</code> element is empty, it contains no groups.</p> + + <p>If a <code>dl</code> element contains non-<span + title="inter-element whitespace">whitespace</span> <span title="text + node">text nodes</span>, or elements other than <code>dt</code> and + <code>dd</code>, then those elements or <span title="text node">text + nodes</span> do not form part of any groups in that <code>dl</code>, + and the document is non-conforming.</p> + + <p>If a <code>dl</code> element contains only <code>dt</code> + elements, then it consists of one group with names but no values, + and the document is non-conforming.</p> + + <p>If a <code>dl</code> element contains only <code>dd</code> + elements, then it consists of one group with values but no names, + and the document is non-conforming.</p> + <div class="example"> - <p>The following are all conforming HTML fragments.</p> <p>In the following example, one entry ("Authors") is linked to two values ("John" and "Luke").</p> <pre><dl> @@ -8066,6 +8085,9 @@ <dt> Editor <dd> Frank </dl></pre> + </div> + + <div class="example"> <p>In the following example, one definition is linked to two terms.</p> <pre><dl> @@ -8075,6 +8097,9 @@ the fine structure of the eye to distinguish three differently filtered analyses of a view. </dd> </dl></pre> + </div> + + <div class="example"> <p>The following example illustrates the use of the <code>dl</code> element to mark up metadata of sorts. At the end of the example, one group has two metadata labels ("Authors" and "Editors") and two @@ -8091,22 +8116,26 @@ </dl></pre> </div> - <p>If a <code>dl</code> element is empty, it contains no groups.</p> - - <p>If a <code>dl</code> element contains non-<span - title="inter-element whitespace">whitespace</span> <span title="text - node">text nodes</span>, or elements other than <code>dt</code> and - <code>dd</code>, then those elements or <span title="text node">text - nodes</span> do not form part of any groups in that <code>dl</code>, - and the document is non-conforming.</p> - - <p>If a <code>dl</code> element contains only <code>dt</code> - elements, then it consists of one group with names but no values, - and the document is non-conforming.</p> + <div class="example"> - <p>If a <code>dl</code> element contains only <code>dd</code> - elements, then it consists of one group with values but no names, - and the document is non-conforming.</p> + <p>The following example shows the <code>dl</code> element used to + give a set of instructions. The order of the instructions here is + important (in the other examples, the order of the blocks was not + important).</p> + + <pre><p>Determine the victory points as follows (use the +first matching case):</p> +<dl> + <dt> If you have exactly five gold coins </dt> + <dd> You get five victory points </dd> + <dt> If you have one or more gold coins, and you have one or more silver coins </dt> + <dd> You get two victory points </dd> + <dt> If you have one or more silver coins </dt> + <dd> You get one victory point </dd> + <dt> Otherwise </dt> + <dd> You get no victory points </dd> +</dl></pre> + </div> <p class="note">The <code>dl</code> element is inappropriate for marking up dialogue, since dialogue is ordered (each speaker/line
*** Bug 72 has been marked as a duplicate of this bug. ***
*** Bug 125 has been marked as a duplicate of this bug. ***
Nothing new.