[html5] r1242 - /

whatwg at whatwg.org whatwg at whatwg.org
Mon Feb 25 18:19:03 PST 2008


Author: ianh
Date: 2008-02-25 18:18:59 -0800 (Mon, 25 Feb 2008)
New Revision: 1242

Modified:
   index
   source
Log:
[ac] (0) Change the meaning of <ol> and <ul> subtly; include some examples.

Modified: index
===================================================================
--- index	2008-02-25 23:16:13 UTC (rev 1241)
+++ index	2008-02-26 02:18:59 UTC (rev 1242)
@@ -24,7 +24,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=working>Working Draft — 25 February
+   <h2 class="no-num no-toc" id=working>Working Draft — 26 February
     2008</h2>
 
    <p>You can take part in this work. <a
@@ -9643,10 +9643,14 @@
 };</pre>
   </dl>
 
-  <p>The <code><a href="#ol">ol</a></code> element represents an ordered list
-   of items (which are represented by <code><a href="#li">li</a></code>
-   elements).
+  <p>The <code><a href="#ol">ol</a></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>The items of the list are the <code><a href="#li">li</a></code> element
+   child nodes of the <code><a href="#ol">ol</a></code> element, in <a
+   href="#tree-order">tree order</a>.
+
   <p>The <dfn id=start0 title=attr-ol-start><code>start</code></dfn>
    attribute, if present, must be a <a href="#valid0">valid integer</a>
    giving the ordinal value of the first list item.
@@ -9658,10 +9662,6 @@
    if the value cannot be converted to a number according to the referenced
    algorithm, is 1.
 
-  <p>The items of the list are the <code><a href="#li">li</a></code> element
-   child nodes of the <code><a href="#ol">ol</a></code> element, in <a
-   href="#tree-order">tree order</a>.
-
   <p>The first item in the list has the ordinal value given by the <code><a
    href="#ol">ol</a></code> element's <code title=attr-ol-start><a
    href="#start0">start</a></code> attribute, unless that <code><a
@@ -9682,6 +9682,36 @@
   <!-- 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><a href="#ol">ol</a></code> element is therefore appropriate.
+    Compare this list to the equivalent list in the <code><a
+    href="#ul">ul</a></code> section to see an example of the same items
+    using the <code><a href="#ul">ul</a></code> element.</p>
+
+   <pre><p>I have lived in the following countries (given in the order of when
+I first lived there):</p>
+<ol>
+ <li>Switzerland
+ <li>United Kingdom
+ <li>United States
+ <li>Norway
+</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><p>I have lived in the following countries (given in the order of when
+I first lived there):</p>
+<ol>
+ <li>United Kingdom
+ <li>Switzerland
+ <li>United States
+ <li>Norway
+</ol></pre>
+  </div>
+
   <h4 id=the-ul><span class=secno>3.11.2 </span>The <dfn
    id=ul><code>ul</code></dfn> element</h4>
 
@@ -9711,13 +9741,44 @@
     href="#htmlelement">HTMLElement</a></code>.
   </dl>
 
-  <p>The <code><a href="#ul">ul</a></code> element represents an unordered
-   list of items (which are represented by <code><a href="#li">li</a></code>
-   elements).
+  <p>The <code><a href="#ul">ul</a></code> element represents a list of
+   items, where the order of the items is not important — that is,
+   where changing the order would not materially change the meaning of the
+   document.
 
   <p>The items of the list are the <code><a href="#li">li</a></code> element
    child nodes of the <code><a href="#ul">ul</a></code> element.
 
+  <div class=example>
+   <p>The following markup shows a list where the order does not matter, and
+    where the <code><a href="#ul">ul</a></code> element is therefore
+    appropriate. Compare this list to the equivalent list in the <code><a
+    href="#ol">ol</a></code> section to see an example of the same items
+    using the <code><a href="#ol">ol</a></code> element.</p>
+
+   <pre><p>I have lived in the following countries:</p>
+<ol>
+ <li>Norway
+ <li>Switzerland
+ <li>United Kingdom
+ <li>United States
+</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><p>I have lived in the following countries:</p>
+<ol>
+ <li>Switzerland
+ <li>Norway
+ <li>United Kingdom
+ <li>United States
+</ol></pre>
+  </div>
+
   <h4 id=the-li><span class=secno>3.11.3 </span>The <dfn
    id=li><code>li</code></dfn> element</h4>
 

Modified: source
===================================================================
--- source	2008-02-25 23:16:13 UTC (rev 1241)
+++ source	2008-02-26 02:18:59 UTC (rev 1242)
@@ -7844,9 +7844,13 @@
    </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
   the ordinal value of the first list item.</p>
@@ -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,7 +7882,40 @@
   <!-- 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><p>I have lived in the following countries (given in the order of when
+I first lived there):</p>
+<ol>
+ <li>Switzerland
+ <li>United Kingdom
+ <li>United States
+ <li>Norway
+</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><p>I have lived in the following countries (given in the order of when
+I first lived there):</p>
+<ol>
+ <li>United Kingdom
+ <li>Switzerland
+ <li>United States
+ <li>Norway
+</ol></pre>
+
+  </div>
+
+
   <h4>The <dfn><code>ul</code></dfn> element</h4>
 
   <dl class="element">
@@ -7900,13 +7934,47 @@
    <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 — 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><p>I have lived in the following countries:</p>
+<ol>
+ <li>Norway
+ <li>Switzerland
+ <li>United Kingdom
+ <li>United States
+</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><p>I have lived in the following countries:</p>
+<ol>
+ <li>Switzerland
+ <li>Norway
+ <li>United Kingdom
+ <li>United States
+</ol></pre>
+
+  </div>
+
+
   <h4>The <dfn><code>li</code></dfn> element</h4>
 
   <dl class="element">




More information about the Commit-Watchers mailing list