[html5] r1400 - /

whatwg at whatwg.org whatwg at whatwg.org
Sat Apr 5 03:35:49 PDT 2008


Author: ianh
Date: 2008-04-05 03:35:47 -0700 (Sat, 05 Apr 2008)
New Revision: 1400

Modified:
   index
   source
Log:
[a] (0) Define the syntax for the upcoming SVG+MathML-in-text/html revolution.

Modified: index
===================================================================
--- index	2008-04-05 00:07:36 UTC (rev 1399)
+++ index	2008-04-05 10:35:47 UTC (rev 1400)
@@ -1592,7 +1592,9 @@
        <li><a href="#character"><span class=secno>8.1.4 </span>Character
         entity references</a>
 
-       <li><a href="#comments"><span class=secno>8.1.5 </span>Comments</a>
+       <li><a href="#cdata"><span class=secno>8.1.5 </span>CDATA blocks</a>
+
+       <li><a href="#comments"><span class=secno>8.1.6 </span>Comments</a>
       </ul>
 
      <li><a href="#parsing"><span class=secno>8.2 </span>Parsing HTML
@@ -38120,9 +38122,9 @@
 
   <h4 id=elements0><span class=secno>8.1.2 </span>Elements</h4>
 
-  <p>There are four different kinds of <dfn id=elements2
+  <p>There are five different kinds of <dfn id=elements2
    title=syntax-elements>elements</dfn>: void elements, CDATA elements,
-   RCDATA elements, and normal elements.
+   RCDATA elements, foreign elements, and normal elements.
 
   <dl>
    <dt><dfn id=void-elements>Void elements</dfn>
@@ -38147,6 +38149,11 @@
 
    <dd><code><a href="#title1">title</a></code>, <code>textarea</code>
 
+   <dt>Foreign elements
+
+   <dd>Elements from the <a href="#mathml">MathML namespace</a> and the <a
+    href="#svg-namespace">SVG namespace</a>.
+
    <dt>Normal elements
 
    <dd>All other allowed <a href="#html-elements">HTML elements</a> are
@@ -38161,7 +38168,9 @@
    normal elements can be <a href="#omitted"
    title=syntax-tag-omission>omitted</a>, as described later. Those that
    cannot be omitted must not be omitted. Void elements only have a start
-   tag; end tags must not be specified for void elements.
+   tag; end tags must not be specified for void elements. Foreign elements
+   must either have a start tag and an end tag, or a start tag that is marked
+   as self-closing, in which case they must not have an end tag.
 
   <p>The contents of the element must be placed between just after the start
    tag (which <a href="#omitted" title=syntax-tag-omission>might be implied,
@@ -38171,11 +38180,11 @@
    on the content model of that element, as described earlier in this
    specification. Elements must not contain content that their content model
    disallows. In addition to the restrictions placed on the contents by those
-   content models, however, the four types of elements have additional
+   content models, however, the five types of elements have additional
    <em>syntactic</em> requirements.
 
   <p>Void elements can't have any contents (since there's no end tag, no
-   content can be put between the start tag and the end tag.)
+   content can be put between the start tag and the end tag).
 
   <p>CDATA elements can have <a href="#text1" title=syntax-text>text</a>,
    though it has <a href="#cdata-rcdata-restrictions">restrictions</a>
@@ -38188,6 +38197,19 @@
    <a href="#cdata-rcdata-restrictions">further restrictions</a> described
    below.
 
+  <p>Foreign elements whose start tag is marked as self-closing can't have
+   any contents (since, again, as there's no end tag, no content can be put
+   between the start tag and the end tag). Foreign elements whose start tag
+   is <em>not</em> marked as self-closing can have <a href="#text1"
+   title=syntax-text>text</a>, <a href="#character2"
+   title=syntax-entities>character entity references</a>, <a href="#cdata0"
+   title=syntax-cdata>CDATA blocks</a>, other <a href="#elements2"
+   title=syntax-elements>elements</a>, and <a href="#comments0"
+   title=syntax-comments>comments</a>, but the text must not contain the
+   character U+003C LESS-THAN SIGN (<code><</code>) or an <a
+   href="#ambiguous" title=syntax-ambiguous-ampersand>ambiguous
+   ampersand</a>.
+
   <p>Normal elements can have <a href="#text1" title=syntax-text>text</a>, <a
    href="#character2" title=syntax-entities>character entity references</a>,
    other <a href="#elements2" title=syntax-elements>elements</a>, and <a
@@ -38235,10 +38257,10 @@
     required to be followed by a space. See the <a href="#attributes2"
     title=syntax-attributes>attributes section</a> below.)
 
-   <li>Then, if the element is one of the void elements, then there may be a
-    single U+002F SOLIDUS (<code>/</code>) character. This character has no
-    effect except to appease the markup gods. As this character is therefore
-    just a symbol of faith, atheists should omit it.
+   <li>Then, if the element is one of the void elements, or if the element is
+    a foreign element, then there may be a single U+002F SOLIDUS
+    (<code>/</code>) character. This character has no effect on void
+    elements, but on foreign elements it marks the start tag as self-closing.
 
    <li>Finally, start tags must be closed by a U+003E GREATER-THAN SIGN
     (<code>></code>) character.
@@ -38713,8 +38735,24 @@
    a <a href="#space">space character</a>, a U+003C LESS-THAN SIGN character
    ('<'), or another U+0026 AMPERSAND (<code>&</code>) character.
 
-  <h4 id=comments><span class=secno>8.1.5 </span>Comments</h4>
+  <h4 id=cdata><span class=secno>8.1.5 </span>CDATA blocks</h4>
 
+  <p><dfn id=cdata0 title=syntax-cdata>CDATA blocks</dfn> must start with the
+   character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+005B
+   LEFT SQUARE BRACKET, U+0043 LATIN CAPITAL LETTER C, U+0044 LATIN CAPITAL
+   LETTER D, U+0041 LATIN CAPITAL LETTER A, U+0054 LATIN CAPITAL LETTER T,
+   U+0041 LATIN CAPITAL LETTER A, U+005B LEFT SQUARE BRACKET (<code
+   title=""><![CDATA[</code>). Following this sequence, the block may have
+   <a href="#text1" title=syntax-text>text</a>, with the additional
+   restriction that the text must not contain the three character sequence
+   U+005D RIGHT SQUARE BRACKET, U+005D RIGHT SQUARE BRACKET, U+003E
+   GREATER-THAN SIGN (<code title="">]]></code>). Finally, the comment must
+   be ended by the three character sequence U+005D RIGHT SQUARE BRACKET,
+   U+005D RIGHT SQUARE BRACKET, U+003E GREATER-THAN SIGN (<code
+   title="">]]></code>).
+
+  <h4 id=comments><span class=secno>8.1.6 </span>Comments</h4>
+
   <p><dfn id=comments0 title=syntax-comments>Comments</dfn> must start with
    the four character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION
    MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS (<code
@@ -44894,6 +44932,15 @@
   <p>The <dfn id=html-namespace0>HTML namespace</dfn> is:
    <code>http://www.w3.org/1999/xhtml</code>
 
+  <p>The <dfn id=mathml>MathML namespace</dfn> is:
+   <code>http://www.w3.org/1998/Math/MathML</code>
+
+  <p>The <dfn id=svg-namespace>SVG namespace</dfn> is:
+   <code>http://www.w3.org/2000/svg</code>
+
+  <p>The <dfn id=xlink>XLink namespace</dfn> is:
+   <code>http://www.w3.org/1999/xlink</code>
+
   <h3 id=serialising><span class=secno>8.4 </span>Serialising HTML fragments</h3>
 
   <p>The following steps form the <dfn id=html-fragment>HTML fragment

Modified: source
===================================================================
--- source	2008-04-05 00:07:36 UTC (rev 1399)
+++ source	2008-04-05 10:35:47 UTC (rev 1400)
@@ -35598,9 +35598,10 @@
 
   <h4>Elements</h4>
 
-  <p>There are four different kinds of <dfn
+  <p>There are five different kinds of <dfn
   title="syntax-elements">elements</dfn>: void elements, CDATA
-  elements, RCDATA elements, and normal elements.</p>
+  elements, RCDATA elements, foreign elements, and normal
+  elements.</p>
 
   <dl>
 
@@ -35621,6 +35622,11 @@
 
    <dd><code>title</code>, <code>textarea</code></dd>
 
+   <dt>Foreign elements</dt>
+
+   <dd>Elements from the <span>MathML namespace</span> and the
+   <span>SVG namespace</span>.</dd>
+
    <dt>Normal elements</dt>
 
    <dd>All other allowed <span>HTML elements</span> are normal
@@ -35637,7 +35643,9 @@
   title="syntax-tag-omission">omitted</span>, as described
   later. Those that cannot be omitted must not be omitted. Void
   elements only have a start tag; end tags must not be specified for
-  void elements.</p>
+  void elements. Foreign elements must either have a start tag and an
+  end tag, or a start tag that is marked as self-closing, in which
+  case they must not have an end tag.</p>
 
   <p>The contents of the element must be placed between just after the
   start tag (which <span title="syntax-tag-omission">might be implied,
@@ -35647,12 +35655,12 @@
   depends on the content model of that element, as described earlier
   in this specification. Elements must not contain content that their
   content model disallows. In addition to the restrictions placed on
-  the contents by those content models, however, the four types of
+  the contents by those content models, however, the five types of
   elements have additional <em>syntactic</em> requirements.</p>
 
   <p>Void elements can't have any contents (since there's no end
   tag, no content can be put between the start tag and the end
-  tag.)</p>
+  tag).</p>
 
   <p>CDATA elements can have <span title="syntax-text">text</span>,
   though it has <a href="#cdata-rcdata-restrictions">restrictions</a>
@@ -35665,6 +35673,19 @@
   There are also <a href="#cdata-rcdata-restrictions">further
   restrictions</a> described below.</p>
 
+  <p>Foreign elements whose start tag is marked as self-closing can't
+  have any contents (since, again, as there's no end tag, no content
+  can be put between the start tag and the end tag). Foreign elements
+  whose start tag is <em>not</em> marked as self-closing can have
+  <span title="syntax-text">text</span>, <span
+  title="syntax-entities">character entity references</span>, <span
+  title="syntax-cdata">CDATA blocks</span>, other <span
+  title="syntax-elements">elements</span>, and <span
+  title="syntax-comments">comments</span>, but the text must not
+  contain the character U+003C LESS-THAN SIGN (<code><</code>) or
+  an <span title="syntax-ambiguous-ampersand">ambiguous
+  ampersand</span>.</p>
+
   <p>Normal elements can have <span title="syntax-text">text</span>,
   <span title="syntax-entities">character entity references</span>,
   other <span title="syntax-elements">elements</span>, and <span
@@ -35715,11 +35736,11 @@
    are required to be followed by a space. See the <span
    title="syntax-attributes">attributes section</span> below.)</li>
 
-   <li>Then, if the element is one of the void elements, then there
-   may be a single U+002F SOLIDUS (<code>/</code>) character. This
-   character has no effect except to appease the markup gods. As this
-   character is therefore just a symbol of faith, atheists should omit
-   it.</li>
+   <li>Then, if the element is one of the void elements, or if the
+   element is a foreign element, then there may be a single U+002F
+   SOLIDUS (<code>/</code>) character. This character has no effect on
+   void elements, but on foreign elements it marks the start tag as
+   self-closing.</li>
 
    <li>Finally, start tags must be closed by a U+003E GREATER-THAN
    SIGN (<code>></code>) character.</li>
@@ -36215,6 +36236,24 @@
   character.</p>
 
 
+  <h4>CDATA blocks</h4>
+
+  <p><dfn title="syntax-cdata">CDATA blocks</dfn> must start with the
+  character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK,
+  U+005B LEFT SQUARE BRACKET, U+0043 LATIN CAPITAL LETTER C, U+0044
+  LATIN CAPITAL LETTER D, U+0041 LATIN CAPITAL LETTER A, U+0054 LATIN
+  CAPITAL LETTER T, U+0041 LATIN CAPITAL LETTER A, U+005B LEFT SQUARE
+  BRACKET (<code title=""><![CDATA[</code>). Following this
+  sequence, the block may have <span title="syntax-text">text</span>,
+  with the additional restriction that the text must not contain the
+  three character sequence U+005D RIGHT SQUARE BRACKET, U+005D RIGHT
+  SQUARE BRACKET, U+003E GREATER-THAN SIGN (<code
+  title="">]]></code>). Finally, the comment must be ended by the
+  three character sequence U+005D RIGHT SQUARE BRACKET, U+005D RIGHT
+  SQUARE BRACKET, U+003E GREATER-THAN SIGN (<code
+  title="">]]></code>).</p>
+
+
   <h4>Comments</h4>
 
   <p><dfn title="syntax-comments">Comments</dfn> must start with the
@@ -42218,8 +42257,14 @@
 
   <p>The <dfn>HTML namespace</dfn> is: <code>http://www.w3.org/1999/xhtml</code></p>
 
+  <p>The <dfn>MathML namespace</dfn> is: <code>http://www.w3.org/1998/Math/MathML</code></p>
 
+  <p>The <dfn>SVG namespace</dfn> is: <code>http://www.w3.org/2000/svg</code></p>
 
+  <p>The <dfn>XLink namespace</dfn> is: <code>http://www.w3.org/1999/xlink</code></p>
+
+
+
   <h3>Serialising HTML fragments</h3>
 
   <p>The following steps form the <dfn>HTML fragment serialisation




More information about the Commit-Watchers mailing list