NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 124 - Change the meaning of <ol> and <ul> subtly; include some examples.
Change the meaning of <ol> and <ul> subtly; include some examples.
Status: RESOLVED DUPLICATE of bug 86
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Henri Sivonen
http://svn.whatwg.org/webapps/source?...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-03 17:39 CET by Nobody
Modified: 2008-03-03 18:40 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody 2008-03-03 17:39:54 CET
Index: source
===================================================================
--- source	(revision 1241)
+++ source	(revision 1242)
@@ -7844,8 +7844,12 @@
    </dd>
   </dl>
 
-  <p>The <code>ol</code> element represents an ordered list of items
-  (which are represented by <code>li</code> elements).</p>
+  <p>The <code>ol</code> element represents a list of items, where the
+  items have been intentionally ordered, such that changing the order
+  would change the meaning of the document.</p>
+
+  <p>The items of the list are the <code>li</code> element child nodes
+  of the <code>ol</code> element, in <span>tree order</span>.</p>
 
   <p>The <dfn title="attr-ol-start"><code>start</code></dfn>
   attribute, if present, must be a <span>valid integer</span> giving
@@ -7858,9 +7862,6 @@
   missing or if the value cannot be converted to a number according to
   the referenced algorithm, is 1.</p>
 
-  <p>The items of the list are the <code>li</code> element child nodes
-  of the <code>ol</code> element, in <span>tree order</span>.</p>
-
   <p>The first item in the list has the ordinal value given by the
   <code>ol</code> element's <code title="attr-ol-start">start</code>
   attribute, unless that <code>li</code> element has a <code
@@ -7881,6 +7882,39 @@
   <!-- XXX counting up and down? -->
   <!-- XXX reverse-counted lists? -->
 
+  <div class="example">
+
+   <p>The following markup shows a list where the order matters, and
+   where the <code>ol</code> element is therefore appropriate. Compare
+   this list to the equivalent list in the <code>ul</code> section to
+   see an example of the same items using the <code>ul</code>
+   element.</p>
+
+   <pre>&lt;p>I have lived in the following countries (given in the order of when
+I first lived there):&lt;/p>
+&lt;ol>
+ &lt;li>Switzerland
+ &lt;li>United Kingdom
+ &lt;li>United States
+ &lt;li>Norway
+&lt;/ol></pre>
+
+   <p>Note how changing the order of the list changes the meaning of
+   the document. In the following example, changing the relative order
+   of the first two items has changed the birthplace of the
+   author:</p>
+
+   <pre>&lt;p>I have lived in the following countries (given in the order of when
+I first lived there):&lt;/p>
+&lt;ol>
+ &lt;li>United Kingdom
+ &lt;li>Switzerland
+ &lt;li>United States
+ &lt;li>Norway
+&lt;/ol></pre>
+
+  </div>
+
 
   <h4>The <dfn><code>ul</code></dfn> element</h4>
 
@@ -7900,12 +7934,46 @@
    <dd>No difference from <code>HTMLElement</code>.</dd>
   </dl>
 
-  <p>The <code>ul</code> element represents an unordered list of items
-  (which are represented by <code>li</code> elements).</p>
+  <p>The <code>ul</code> element represents a list of items, where the
+  order of the items is not important &mdash; that is, where changing
+  the order would not materially change the meaning of the
+  document.</p>
 
   <p>The items of the list are the <code>li</code> element child nodes
   of the <code>ul</code> element.</p>
 
+  <div class="example">
+
+   <p>The following markup shows a list where the order does not
+   matter, and where the <code>ul</code> element is therefore
+   appropriate. Compare this list to the equivalent list in the
+   <code>ol</code> section to see an example of the same items using
+   the <code>ol</code> element.</p>
+
+   <pre>&lt;p>I have lived in the following countries:&lt;/p>
+&lt;ol>
+ &lt;li>Norway
+ &lt;li>Switzerland
+ &lt;li>United Kingdom
+ &lt;li>United States
+&lt;/ol></pre>
+
+   <p>Note that changing the order of the list does not change the
+   meaning of the document. The items in the snippet above are given
+   in alphabetical order, but in the snippet below they are given in
+   order of the size of their current account balance in 2007, without
+   changing the meaning of the document whatsoever:</p>
+
+   <pre>&lt;p>I have lived in the following countries:&lt;/p>
+&lt;ol>
+ &lt;li>Switzerland
+ &lt;li>Norway
+ &lt;li>United Kingdom
+ &lt;li>United States
+&lt;/ol></pre>
+
+  </div>
+
 
   <h4>The <dfn><code>li</code></dfn> element</h4>
Comment 1 Henri Sivonen 2008-03-03 18:40:32 CET

*** This bug has been marked as a duplicate of bug 86 ***