Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ac] (0) Change the meaning of <ol> and <ul> subtly; include some exa…
…mples.

git-svn-id: http://svn.whatwg.org/webapps@1242 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 26, 2008
1 parent a2dbcf7 commit a33e649
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 18 deletions.
83 changes: 72 additions & 11 deletions index
Expand Up @@ -24,7 +24,7 @@

<h1 id=html-5>HTML 5</h1>

<h2 class="no-num no-toc" id=working>Working Draft &mdash; 25 February
<h2 class="no-num no-toc" id=working>Working Draft &mdash; 26 February
2008</h2>

<p>You can take part in this work. <a
Expand Down Expand Up @@ -9643,9 +9643,13 @@ a friend lost to the
};</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>
Expand All @@ -9658,10 +9662,6 @@ a friend lost to the
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
Expand All @@ -9682,6 +9682,36 @@ a friend lost to the
<!-- 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>&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 id=the-ul><span class=secno>3.11.2 </span>The <dfn
id=ul><code>ul</code></dfn> element</h4>

Expand Down Expand Up @@ -9711,13 +9741,44 @@ a friend lost to the
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 &mdash; 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>&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 id=the-li><span class=secno>3.11.3 </span>The <dfn
id=li><code>li</code></dfn> element</h4>

Expand Down
82 changes: 75 additions & 7 deletions source
Expand Up @@ -7844,8 +7844,12 @@ a friend lost to the
</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
Expand All @@ -7858,9 +7862,6 @@ a friend lost to the
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
Expand All @@ -7881,6 +7882,39 @@ a friend lost to the
<!-- 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>

Expand All @@ -7900,12 +7934,46 @@ a friend lost to the
<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>

Expand Down

0 comments on commit a33e649

Please sign in to comment.