mike: define what a misnested tag is

mike: define what a misnested tag is

http://dev.w3.org/cvsweb/html5/markup/spec.html?r1=1.52&r2=1.53&f=h

===================================================================
RCS file: /sources/public/html5/markup/syntax.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- syntax.html 20 Jul 2009 15:18:32 -0000 1.16
+++ syntax.html 20 Jul 2009 18:26:46 -0000 1.17
@@ -87,10 +87,8 @@
     <pre>&lt;!DOCTYPE HTML system "about:legacy-compat"&gt;</pre>
     </div>
     <p>The following are examples of some DOCTYPEs that match the 
-    definition of a
-    <code class="defined-elsewhere">doctypedecl</code>
-    (<b class="defined-elsewhere">document type declaration</b>)
-    given in the XML specification
+    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-doctypedecl"><code class="defined-elsewhere">doctypedecl</code></a>
+    production defined in the XML specification
     <a href="references.html#refsXML">[XML]</a>.</p>
     <div class="example">
     <pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -216,27 +214,27 @@
       are defined in the XML specification
       <a href="references.html#refsXML">[XML]</a>.</p>
     <ul>
-    <li><dfn id="tags" title="syntax-tags">Tags</dfn> are used to
-    delimit the start and end of elements in the markup. Elements
-    have a
-    <a href="syntax.html#syntax-start-tags">start tag</a>
-    to indicate where they begin. Non-<a href="syntax.html#void-element">void</a> elements have an
-    <a href="syntax.html#syntax-end-tags">end tag</a>
-    to
-    indicate where they end.</li>
-    <li><dfn id="tag-name" title="syntax-tag-name">Tag names</dfn>
-    are used within element start tags and end tags to 
-    give the element&#8217;s name. HTML elements all have names that
-    only use characters in the range
-    <code title="U+0030 DIGIT ZERO&#8211;U+0039 DIGIT NINE">0&#8211;9</code>,
-    <code title="U+0061 LATIN SMALL LETTER A&#8211;U+007A LATIN SMALL LETTER Z">a&#8211;z</code>,
-    <code title="U+0041 LATIN CAPITAL LETTER A&#8211;U+005A LATIN CAPITAL LETTER Z">A&#8211;Z</code>,
-    and the character
-    "<code title="U+002D HYPHEN-MINUS">-</code>".
-    Tag names may be written with any mix of
-    lowercase and uppercase letters that, when converted to
-    all-lowercase, matches the element&#8217;s tag name; tag names are
-    case-insensitive.</li>
+      <li><dfn id="tags" title="syntax-tags">Tags</dfn> are used to
+      delimit the start and end of elements in the markup. Elements
+      have a
+      <a href="syntax.html#syntax-start-tags">start tag</a>
+      to indicate where they begin. Non-<a href="syntax.html#void-element">void</a> elements have an
+      <a href="syntax.html#syntax-end-tags">end tag</a>
+      to
+      indicate where they end.</li>
+      <li><dfn id="tag-name" title="syntax-tag-name">Tag names</dfn>
+      are used within element start tags and end tags to 
+      give the element&#8217;s name. HTML elements all have names that
+      only use characters in the range
+      <code title="U+0030 DIGIT ZERO&#8211;U+0039 DIGIT NINE">0&#8211;9</code>,
+      <code title="U+0061 LATIN SMALL LETTER A&#8211;U+007A LATIN SMALL LETTER Z">a&#8211;z</code>,
+      <code title="U+0041 LATIN CAPITAL LETTER A&#8211;U+005A LATIN CAPITAL LETTER Z">A&#8211;Z</code>,
+      and the character
+      "<code title="U+002D HYPHEN-MINUS">-</code>".
+      Tag names may be written with any mix of
+      lowercase and uppercase letters that, when converted to
+      all-lowercase, matches the element&#8217;s tag name; tag names are
+      case-insensitive.</li>
       <li>
       <dfn id="syntax-start-tags">Start tags</dfn>
       must have the following format:
@@ -270,7 +268,7 @@
         "<code title="U+002F SOLIDUS">/</code>"
         character before the closing
         "<code title="U+003E GREATER-THAN SIGN">&gt;</code>"
-         character.</li>
+        character.</li>
       </ol>
       </li>
       <li>
@@ -290,27 +288,59 @@
         <a href="terminology.html#space" title="space character">space characters</a>.</li>
         <li>An end tag must be closed by a
         "<code title="U+003E GREATER-THAN SIGN">&gt;</code>"
-          character.</li>
+        character.</li>
       </ol>
       </li>
-    <li><a href="syntax.html#void-element">Void elements</a> only have a
-    start tag; end tags must not be specified for void
-    elements.</li>
-    <li>The start and end tags of certain elements can be <dfn id="omitted" title="syntax-tag-omission">omitted</dfn>. 
-    The subsection for each element in the <a href="elements.html#elements">HTML elements</a> section of this
-    specification provides information about which tags (if any)
-    can be omitted for that particular element.</li>
-    <li>A non-<a href="syntax.html#void-element">void</a> element must have
+      <li><a href="syntax.html#void-element">Void elements</a> only have a
+      start tag; end tags must not be specified for void
+      elements.</li>
+      <li>The start and end tags of certain elements can be <dfn id="omitted" title="syntax-tag-omission">omitted</dfn>. 
+      The subsection for each element in the <a href="elements.html#elements">HTML elements</a> section of this
+      specification provides information about which tags (if any)
+      can be omitted for that particular element.</li>
+      <li>A non-<a href="syntax.html#void-element">void</a> element must have
       an end tag, unless the subsection for that element in the <a href="elements.html#elements">HTML elements</a> section of this
-    specification indicates that its end tag can be <a href="syntax.html#omitted">omitted</a>.</li>
-    <li>The <a href="syntax.html#contents">contents</a> of an element must be
-    placed between just after the start tag (which
-    <a href="syntax.html#omitted" title="syntax-tag-omission">might be
-      implied, in certain cases</a>) and just before the end tag
-    (which again,
-    <a href="syntax.html#omitted" title="syntax-tag-omission">might be
-      implied in certain cases</a>).</li>
+      specification indicates that its end tag can be <a href="syntax.html#omitted">omitted</a>.</li>
+      <li>The <a href="syntax.html#contents">contents</a> of an element must be
+      placed between just after its start tag (which
+      <a href="syntax.html#omitted" title="syntax-tag-omission">might be
+        implied, in certain cases</a>) and just before its end tag
+      (which <a href="syntax.html#omitted" title="syntax-tag-omission">might be
+        implied in certain cases</a>).</li>
     </ul>
+    <p>If an
+    <a href="syntax.html#syntax-elements">element</a>
+    has both a
+    <a href="syntax.html#syntax-start-tags">start tag</a>
+    and an
+    <a href="syntax.html#syntax-end-tags">end tag</a>,
+    its end tag must be contained within the
+    <a href="syntax.html#contents">contents</a>
+    of the same element in which its start tag is contained.
+    An
+    <a href="syntax.html#syntax-end-tags">end tag</a>
+    that is not contained within the same 
+    <a href="syntax.html#contents">contents</a>
+    as its
+    <a href="syntax.html#syntax-start-tags">start tag</a>
+    is said to be a
+    <dfn id="misnested-tag" title="misnested-tag">misnested tag</dfn>.</p>
+    <div class="example">
+      <p>In the following example, the
+      "<code>&lt;/i&gt;</code>"
+      <a href="syntax.html#syntax-end-tags">end tag</a>
+      is a
+      <a href="syntax.html#misnested-tag">misnested tag</a>,
+      because it is not contained
+      within the 
+      <a href="syntax.html#contents">contents</a>
+      of the
+      <span class="element">b</span>
+      element that contains its corresponding
+      "<code>&lt;i&gt;</code>"
+      start tag.</p>
+      <pre>&lt;b&gt;foo &lt;i&gt;bar&lt;/b&gt; baz&lt;/i&gt;</pre>
+    </div>
   </div>
     <div id="syntax-attributes" class="section">
       <h2>6.4. Attributes <a class="hash" href="#syntax-attributes">#</a> <a class="toc-bak" href="Overview.html#syntax-attributes-toc">T</a></h2>

Index: spec.html
===================================================================
RCS file: /sources/public/html5/markup/spec.html,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- spec.html 20 Jul 2009 15:18:32 -0000 1.52
+++ spec.html 20 Jul 2009 18:26:46 -0000 1.53
@@ -1017,10 +1017,8 @@
     <pre>&lt;!DOCTYPE HTML system "about:legacy-compat"&gt;</pre>
     </div>
     <p>The following are examples of some DOCTYPEs that match the 
-    definition of a
-    <code class="defined-elsewhere">doctypedecl</code>
-    (<b class="defined-elsewhere">document type declaration</b>)
-    given in the XML specification
+    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-doctypedecl"><code class="defined-elsewhere">doctypedecl</code></a>
+    production defined in the XML specification
     <a href="#refsXML">[XML]</a>.</p>
     <div class="example">
     <pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -1151,27 +1149,27 @@
     <ul>
 <li>
 <dfn id="tags" title="syntax-tags">Tags</dfn> are used to
-    delimit the start and end of elements in the markup. Elements
-    have a
-    <a href="#syntax-start-tags">start tag</a>
-    to indicate where they begin. Non-<a href="#void-element">void</a> elements have an
-    <a href="#syntax-end-tags">end tag</a>
-    to
-    indicate where they end.</li>
-    <li>
+      delimit the start and end of elements in the markup. Elements
+      have a
+      <a href="#syntax-start-tags">start tag</a>
+      to indicate where they begin. Non-<a href="#void-element">void</a> elements have an
+      <a href="#syntax-end-tags">end tag</a>
+      to
+      indicate where they end.</li>
+      <li>
 <dfn id="tag-name" title="syntax-tag-name">Tag names</dfn>
-    are used within element start tags and end tags to 
-    give the element&#8217;s name. HTML elements all have names that
-    only use characters in the range
-    <code title="U+0030 DIGIT ZERO&#8211;U+0039 DIGIT NINE">0&#8211;9</code>,
-    <code title="U+0061 LATIN SMALL LETTER A&#8211;U+007A LATIN SMALL LETTER Z">a&#8211;z</code>,
-    <code title="U+0041 LATIN CAPITAL LETTER A&#8211;U+005A LATIN CAPITAL LETTER Z">A&#8211;Z</code>,
-    and the character
-    "<code title="U+002D HYPHEN-MINUS">-</code>".
-    Tag names may be written with any mix of
-    lowercase and uppercase letters that, when converted to
-    all-lowercase, matches the element&#8217;s tag name; tag names are
-    case-insensitive.</li>
+      are used within element start tags and end tags to 
+      give the element&#8217;s name. HTML elements all have names that
+      only use characters in the range
+      <code title="U+0030 DIGIT ZERO&#8211;U+0039 DIGIT NINE">0&#8211;9</code>,
+      <code title="U+0061 LATIN SMALL LETTER A&#8211;U+007A LATIN SMALL LETTER Z">a&#8211;z</code>,
+      <code title="U+0041 LATIN CAPITAL LETTER A&#8211;U+005A LATIN CAPITAL LETTER Z">A&#8211;Z</code>,
+      and the character
+      "<code title="U+002D HYPHEN-MINUS">-</code>".
+      Tag names may be written with any mix of
+      lowercase and uppercase letters that, when converted to
+      all-lowercase, matches the element&#8217;s tag name; tag names are
+      case-insensitive.</li>
       <li>
       <dfn id="syntax-start-tags">Start tags</dfn>
       must have the following format:
@@ -1205,7 +1203,7 @@
         "<code title="U+002F SOLIDUS">/</code>"
         character before the closing
         "<code title="U+003E GREATER-THAN SIGN">&gt;</code>"
-         character.</li>
+        character.</li>
       </ol>
 </li>
       <li>
@@ -1225,29 +1223,61 @@
         <a href="#space" title="space character">space characters</a>.</li>
         <li>An end tag must be closed by a
         "<code title="U+003E GREATER-THAN SIGN">&gt;</code>"
-          character.</li>
+        character.</li>
       </ol>
 </li>
-    <li>
+      <li>
 <a href="#void-element">Void elements</a> only have a
-    start tag; end tags must not be specified for void
-    elements.</li>
-    <li>The start and end tags of certain elements can be <dfn id="omitted" title="syntax-tag-omission">omitted</dfn>. 
-    The subsection for each element in the <a href="#elements">HTML elements</a> section of this
-    specification provides information about which tags (if any)
-    can be omitted for that particular element.</li>
-    <li>A non-<a href="#void-element">void</a> element must have
+      start tag; end tags must not be specified for void
+      elements.</li>
+      <li>The start and end tags of certain elements can be <dfn id="omitted" title="syntax-tag-omission">omitted</dfn>. 
+      The subsection for each element in the <a href="#elements">HTML elements</a> section of this
+      specification provides information about which tags (if any)
+      can be omitted for that particular element.</li>
+      <li>A non-<a href="#void-element">void</a> element must have
       an end tag, unless the subsection for that element in the <a href="#elements">HTML elements</a> section of this
-    specification indicates that its end tag can be <a href="#omitted">omitted</a>.</li>
-    <li>The <a href="#contents">contents</a> of an element must be
-    placed between just after the start tag (which
-    <a href="#omitted" title="syntax-tag-omission">might be
-      implied, in certain cases</a>) and just before the end tag
-    (which again,
-    <a href="#omitted" title="syntax-tag-omission">might be
-      implied in certain cases</a>).</li>
+      specification indicates that its end tag can be <a href="#omitted">omitted</a>.</li>
+      <li>The <a href="#contents">contents</a> of an element must be
+      placed between just after its start tag (which
+      <a href="#omitted" title="syntax-tag-omission">might be
+        implied, in certain cases</a>) and just before its end tag
+      (which <a href="#omitted" title="syntax-tag-omission">might be
+        implied in certain cases</a>).</li>
     </ul>
-</div>
+<p>If an
+    <a href="#syntax-elements">element</a>
+    has both a
+    <a href="#syntax-start-tags">start tag</a>
+    and an
+    <a href="#syntax-end-tags">end tag</a>,
+    its end tag must be contained within the
+    <a href="#contents">contents</a>
+    of the same element in which its start tag is contained.
+    An
+    <a href="#syntax-end-tags">end tag</a>
+    that is not contained within the same 
+    <a href="#contents">contents</a>
+    as its
+    <a href="#syntax-start-tags">start tag</a>
+    is said to be a
+    <dfn id="misnested-tag" title="misnested-tag">misnested tag</dfn>.</p>
+    <div class="example">
+      <p>In the following example, the
+      "<code>&lt;/i&gt;</code>"
+      <a href="#syntax-end-tags">end tag</a>
+      is a
+      <a href="#misnested-tag">misnested tag</a>,
+      because it is not contained
+      within the 
+      <a href="#contents">contents</a>
+      of the
+      <span class="element">b</span>
+      element that contains its corresponding
+      "<code>&lt;i&gt;</code>"
+      start tag.</p>
+      <pre>&lt;b&gt;foo &lt;i&gt;bar&lt;/b&gt; baz&lt;/i&gt;</pre>
+    </div>
+  </div>
     <div id="syntax-attributes" class="section">
       <h2>6.4. Attributes <a class="hash" href="#syntax-attributes">#</a> <a class="toc-bak" href="#syntax-attributes-toc">T</a>
 </h2>

--- NEW FILE: logo-ED.png ---
(This appears to be a binary file; contents omitted.)

Received on Monday, 20 July 2009 18:29:54 UTC