[html5] r5253 - [t] (0) Make <title> and <subtitle> in the Atom conversion contain markup

whatwg at whatwg.org whatwg at whatwg.org
Mon Aug 9 12:11:07 PDT 2010


Author: ianh
Date: 2010-08-09 12:11:05 -0700 (Mon, 09 Aug 2010)
New Revision: 5253

Modified:
   complete.html
   index
   source
Log:
[t] (0) Make <title> and <subtitle> in the Atom conversion contain markup

Modified: complete.html
===================================================================
--- complete.html	2010-08-09 18:35:45 UTC (rev 5252)
+++ complete.html	2010-08-09 19:11:05 UTC (rev 5253)
@@ -56931,8 +56931,8 @@
 
    </li>
 
-   <li><p>Let <var title="">subheading text</var> be the empty
-   string.</li>
+   <li><p>Let <var title="">subheading content</var> be an empty
+   list.</li>
 
    <li><p>Let <var title="">heading</var> be the first element of
    <a href=#heading-content>heading content</a> whose nearest ancestor of
@@ -56949,10 +56949,9 @@
 
      <dd>
 
-      <p>Let <var title="">heading text</var> be the
-      <code><a href=#textcontent>textContent</a></code> of <a href=#the-title-element>the <code>title</code>
-      element</a>, if there is one, or the empty string
-      otherwise.</p>
+      <p>Let <var title="">heading content</var> be the descendants
+      <a href=#the-title-element>the <code>title</code> element</a>, if there is one, or
+      an empty list otherwise.</p>
 
      </dd>
 
@@ -56961,18 +56960,18 @@
      <dd>
 
       <p>If <var title="">heading</var> contains no child
-      <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading text</var> be the empty string.</p>
+      <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading content</var> be an empty list.</p>
 
       <p>Otherwise, let <var title="">headings list</var> be a list of
       all the <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element children
       of <var title="">heading</var>, sorted first by descending
       <a href=#rank>rank</a> and then in <a href=#tree-order>tree order</a> (so
       <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>s first, then <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h2</a></code>s, etc, with each
-      group in the order they appear in the document). Then, let <var title="">heading text</var> be the <code><a href=#textcontent>textContent</a></code> of
-      the first entry in <var title="">headings list</var>, and if
-      there are multiple entries, let <var title="">subheading
-      text</var> be the <code><a href=#textcontent>textContent</a></code> of the second entry
-      in <var title="">headings list</var>.</p>
+      group in the order they appear in the document). Then, let <var title="">heading content</var> be the descendants of the first
+      entry in <var title="">headings list</var>, and if there are
+      multiple entries, let <var title="">subheading content</var> be
+      the descendants of the second entry in <var title="">headings
+      list</var>.</p>
 
      </dd>
 
@@ -56980,8 +56979,8 @@
 
      <dd>
 
-      <p>Let <var title="">heading text</var> be the
-      <code><a href=#textcontent>textContent</a></code> of <var title="">heading</var>.</p>
+      <p>Let <var title="">heading content</var> be the descendants of
+      <var title="">heading</var>.</p>
 
      </dd>
 
@@ -56989,21 +56988,75 @@
 
    <li>
 
-    <p>Append a <code title="">title</code> element in the <a href=#atom-namespace>Atom
-    namespace</a> to the root element of <var title="">R</var>
-    whose contents is a text node with its data set to <var title="">heading text</var>.</p>
+    <p>Clone the nodes in <var title="">heading content</var> and
+    their descendants into an environment that has <a href=#concept-bc-noscript title=concept-bc-noscript>scripting disabled</a>, has no
+    <a href=#plugin title=plugin>plugins</a>, and fails any attempt to
+    <a href=#fetch title=fetch>fetch</a> any resources. Let <var title="">cloned heading content</var> be a new
+    <code><a href=#documentfragment>DocumentFragment</a></code> containing the resulting cloned
+    nodes, preserving their relative order.</p>
 
    </li>
 
    <li>
 
-    <p>If <var title="">subheading text</var> is not the empty string,
-    append a <code title="">subtitle</code> element in the <a href=#atom-namespace>Atom
-    namespace</a> to the root element of <var title="">R</var>
-    whose contents is a text node with its data set to <var title="">subheading text</var>.</p>
+    <p>If the document being converted is an <a href=#html-documents title="HTML
+    documents">HTML document</a>, then: Let <var title="">x</var>
+    be a <code title="">title</code> element in the <a href=#atom-namespace>Atom
+    namespace</a>. Add a <code title="">type</code> attribute whose
+    value is the string "<code title="">html</code>" to <var title="">x</var>. Append a text node with its data set to the
+    result of running the <a href=#html-fragment-serialization-algorithm>HTML fragment serialization
+    algorithm</a> on <var title="">cloned heading content</var> to
+    <var title="">x</var>. Append <var title="">x</var> to the root
+    element of <var title="">R</var>.</p>
 
+    <p>Otherwise, the document being converted is an <a href=#xml-documents title="XML
+    documents">XML document</a>: Let <var title="">x</var> be a
+    <code title="">title</code> element in the <a href=#atom-namespace>Atom
+    namespace</a>. Add a <code title="">type</code> attribute whose
+    value is the string "<code title="">xhtml</code>" to <var title="">x</var>. Append a <code><a href=#the-div-element>div</a></code> element to <var title="">x</var>. Move all the child nodes of the <var title="">cloned heading content</var> node to that
+    <code><a href=#the-div-element>div</a></code> element, preserving their relative order. Append
+    <var title="">x</var> to the root element of <var title="">R</var>.</p>
+
    </li>
 
+   <li>
+
+    <p>If <var title="">subheading content</var> is not an empty list,
+    run these substeps:</p>
+
+    <ol><li>
+
+      <p>Clone the nodes in <var title="">subheading content</var>
+      and their descendants into an environment that has <a href=#concept-bc-noscript title=concept-bc-noscript>scripting disabled</a>, has no
+      <a href=#plugin title=plugin>plugins</a>, and fails any attempt to
+      <a href=#fetch title=fetch>fetch</a> any resources. Let <var title="">cloned subheading content</var> be a new
+      <code><a href=#documentfragment>DocumentFragment</a></code> containing the resulting cloned
+      nodes, preserving their relative order.</p>
+
+     </li>
+
+     <li>
+
+      <p>If the document being converted is an <a href=#html-documents title="HTML
+      documents">HTML document</a>, then: Let <var title="">x</var>
+      be a <code title="">subtitle</code> element in the <a href=#atom-namespace>Atom
+      namespace</a>. Add a <code title="">type</code> attribute
+      whose value is the string "<code title="">html</code>" to <var title="">x</var>. Append a text node with its data set to the
+      result of running the <a href=#html-fragment-serialization-algorithm>HTML fragment serialization
+      algorithm</a> on <var title="">cloned subheading
+      content</var> to <var title="">x</var>. Append <var title="">x</var> to the root element of <var title="">R</var>.</p>
+
+      <p>Otherwise, the document being converted is an <a href=#xml-documents title="XML documents">XML document</a>: Let <var title="">x</var> be a <code title="">subtitle</code> element in
+      the <a href=#atom-namespace>Atom namespace</a>. Add a <code title="">type</code> attribute whose value is the string "<code title="">xhtml</code>" to <var title="">x</var>. Append a
+      <code><a href=#the-div-element>div</a></code> element to <var title="">x</var>. Move all the
+      child nodes of the <var title="">cloned subheading content</var>
+      node to that <code><a href=#the-div-element>div</a></code> element, preserving their relative
+      order. Append <var title="">x</var> to the root element of <var title="">R</var>.</p>
+
+     </li>
+
+    </ol></li>
+
    <li><p>Let <var title="">global update date</var> have no
    value.</li>
 
@@ -57045,8 +57098,8 @@
 
        <dd>
 
-        <p>Let <var title="">heading text</var> be the empty
-        string.</p>
+        <p>Let <var title="">heading content</var> be an empty
+        list.</p>
 
        </dd>
 
@@ -57055,7 +57108,7 @@
        <dd>
 
         <p>If <var title="">heading</var> contains no child
-        <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading text</var> be the empty string.</p>
+        <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading content</var> be an empty list.</p>
 
         <p>Otherwise, let <var title="">headings list</var> be a list
         of all the <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element
@@ -57064,8 +57117,7 @@
         order</a> (so <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>s first, then
         <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h2</a></code>s, etc, with each group in the order they
         appear in the document). Then, let <var title="">heading
-        text</var> be the <code><a href=#textcontent>textContent</a></code> of the first entry
-        in <var title="">headings list</var>.</p>
+        content</var> be the descendants of the first entry in <var title="">headings list</var>.</p>
 
        </dd>
 
@@ -57073,8 +57125,8 @@
 
        <dd>
 
-        <p>Let <var title="">heading text</var> be the
-        <code><a href=#textcontent>textContent</a></code> of <var title="">heading</var>.</p>
+        <p>Let <var title="">heading content</var> be the descendants
+        of <var title="">heading</var>.</p>
 
        </dd>
 
@@ -57082,14 +57134,38 @@
 
      <li>
 
-      <p>Append a <code title="">title</code> element in the
-      <a href=#atom-namespace>Atom namespace</a> to <var title="">E</var> whose
-      contents is a text node with its data set to <var title="">heading text</var>.</p>
+      <p>Clone the nodes in <var title="">heading content</var> and
+      their descendants into an environment that has <a href=#concept-bc-noscript title=concept-bc-noscript>scripting disabled</a>, has no
+      <a href=#plugin title=plugin>plugins</a>, and fails any attempt to
+      <a href=#fetch title=fetch>fetch</a> any resources. Let <var title="">cloned heading content</var> be a new
+      <code><a href=#documentfragment>DocumentFragment</a></code> containing the resulting cloned
+      nodes, preserving their relative order.</p>
 
      </li>
 
+     <li>
+
+      <p>If the document being converted is an <a href=#html-documents title="HTML
+      documents">HTML document</a>, then: Let <var title="">x</var>
+      be a <code title="">title</code> element in the <a href=#atom-namespace>Atom
+      namespace</a>. Add a <code title="">type</code> attribute
+      whose value is the string "<code title="">html</code>" to <var title="">x</var>. Append a text node with its data set to the
+      result of running the <a href=#html-fragment-serialization-algorithm>HTML fragment serialization
+      algorithm</a> on <var title="">cloned heading content</var>
+      to <var title="">x</var>. Append <var title="">x</var> to <var title="">E</var>.</p>
+
+      <p>Otherwise, the document being converted is an <a href=#xml-documents title="XML documents">XML document</a>: Let <var title="">x</var> be a <code title="">title</code> element in the
+      <a href=#atom-namespace>Atom namespace</a>. Add a <code title="">type</code>
+      attribute whose value is the string "<code title="">xhtml</code>" to <var title="">x</var>. Append a
+      <code><a href=#the-div-element>div</a></code> element to <var title="">x</var>. Move all the
+      child nodes of the <var title="">cloned heading content</var>
+      node to that <code><a href=#the-div-element>div</a></code> element, preserving their relative
+      order. Append <var title="">x</var> to <var title="">E</var>.</p>
+
+     </li>
+
      <!-- <atom:author> is required either at the feed level (above)
-     or the entry level (here) but we don't provide it -->
+     or the entry level (here) but we don't provide it here -->
 
      <li>
 
@@ -85483,8 +85559,9 @@
 
   <p>The following steps form the <dfn id=html-fragment-serialization-algorithm>HTML fragment serialization
   algorithm</dfn>. The algorithm takes as input a DOM
-  <code><a href=#element>Element</a></code> or <code><a href=#document>Document</a></code>, referred to as <var title="">the node</var>, and either returns a string or raises an
-  exception.</p>
+  <code><a href=#element>Element</a></code>, <code><a href=#document>Document</a></code>, or
+  <code><a href=#documentfragment>DocumentFragment</a></code> referred to as <var title="">the
+  node</var>, and either returns a string or raises an exception.</p>
 
   <p class=note>This algorithm serializes the <em>children</em> of
   the node being serialized, not the node itself.</p>

Modified: index
===================================================================
--- index	2010-08-09 18:35:45 UTC (rev 5252)
+++ index	2010-08-09 19:11:05 UTC (rev 5253)
@@ -56858,8 +56858,8 @@
 
    </li>
 
-   <li><p>Let <var title="">subheading text</var> be the empty
-   string.</li>
+   <li><p>Let <var title="">subheading content</var> be an empty
+   list.</li>
 
    <li><p>Let <var title="">heading</var> be the first element of
    <a href=#heading-content>heading content</a> whose nearest ancestor of
@@ -56876,10 +56876,9 @@
 
      <dd>
 
-      <p>Let <var title="">heading text</var> be the
-      <code><a href=#textcontent>textContent</a></code> of <a href=#the-title-element>the <code>title</code>
-      element</a>, if there is one, or the empty string
-      otherwise.</p>
+      <p>Let <var title="">heading content</var> be the descendants
+      <a href=#the-title-element>the <code>title</code> element</a>, if there is one, or
+      an empty list otherwise.</p>
 
      </dd>
 
@@ -56888,18 +56887,18 @@
      <dd>
 
       <p>If <var title="">heading</var> contains no child
-      <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading text</var> be the empty string.</p>
+      <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading content</var> be an empty list.</p>
 
       <p>Otherwise, let <var title="">headings list</var> be a list of
       all the <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element children
       of <var title="">heading</var>, sorted first by descending
       <a href=#rank>rank</a> and then in <a href=#tree-order>tree order</a> (so
       <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>s first, then <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h2</a></code>s, etc, with each
-      group in the order they appear in the document). Then, let <var title="">heading text</var> be the <code><a href=#textcontent>textContent</a></code> of
-      the first entry in <var title="">headings list</var>, and if
-      there are multiple entries, let <var title="">subheading
-      text</var> be the <code><a href=#textcontent>textContent</a></code> of the second entry
-      in <var title="">headings list</var>.</p>
+      group in the order they appear in the document). Then, let <var title="">heading content</var> be the descendants of the first
+      entry in <var title="">headings list</var>, and if there are
+      multiple entries, let <var title="">subheading content</var> be
+      the descendants of the second entry in <var title="">headings
+      list</var>.</p>
 
      </dd>
 
@@ -56907,8 +56906,8 @@
 
      <dd>
 
-      <p>Let <var title="">heading text</var> be the
-      <code><a href=#textcontent>textContent</a></code> of <var title="">heading</var>.</p>
+      <p>Let <var title="">heading content</var> be the descendants of
+      <var title="">heading</var>.</p>
 
      </dd>
 
@@ -56916,21 +56915,75 @@
 
    <li>
 
-    <p>Append a <code title="">title</code> element in the <a href=#atom-namespace>Atom
-    namespace</a> to the root element of <var title="">R</var>
-    whose contents is a text node with its data set to <var title="">heading text</var>.</p>
+    <p>Clone the nodes in <var title="">heading content</var> and
+    their descendants into an environment that has <a href=#concept-bc-noscript title=concept-bc-noscript>scripting disabled</a>, has no
+    <a href=#plugin title=plugin>plugins</a>, and fails any attempt to
+    <a href=#fetch title=fetch>fetch</a> any resources. Let <var title="">cloned heading content</var> be a new
+    <code><a href=#documentfragment>DocumentFragment</a></code> containing the resulting cloned
+    nodes, preserving their relative order.</p>
 
    </li>
 
    <li>
 
-    <p>If <var title="">subheading text</var> is not the empty string,
-    append a <code title="">subtitle</code> element in the <a href=#atom-namespace>Atom
-    namespace</a> to the root element of <var title="">R</var>
-    whose contents is a text node with its data set to <var title="">subheading text</var>.</p>
+    <p>If the document being converted is an <a href=#html-documents title="HTML
+    documents">HTML document</a>, then: Let <var title="">x</var>
+    be a <code title="">title</code> element in the <a href=#atom-namespace>Atom
+    namespace</a>. Add a <code title="">type</code> attribute whose
+    value is the string "<code title="">html</code>" to <var title="">x</var>. Append a text node with its data set to the
+    result of running the <a href=#html-fragment-serialization-algorithm>HTML fragment serialization
+    algorithm</a> on <var title="">cloned heading content</var> to
+    <var title="">x</var>. Append <var title="">x</var> to the root
+    element of <var title="">R</var>.</p>
 
+    <p>Otherwise, the document being converted is an <a href=#xml-documents title="XML
+    documents">XML document</a>: Let <var title="">x</var> be a
+    <code title="">title</code> element in the <a href=#atom-namespace>Atom
+    namespace</a>. Add a <code title="">type</code> attribute whose
+    value is the string "<code title="">xhtml</code>" to <var title="">x</var>. Append a <code><a href=#the-div-element>div</a></code> element to <var title="">x</var>. Move all the child nodes of the <var title="">cloned heading content</var> node to that
+    <code><a href=#the-div-element>div</a></code> element, preserving their relative order. Append
+    <var title="">x</var> to the root element of <var title="">R</var>.</p>
+
    </li>
 
+   <li>
+
+    <p>If <var title="">subheading content</var> is not an empty list,
+    run these substeps:</p>
+
+    <ol><li>
+
+      <p>Clone the nodes in <var title="">subheading content</var>
+      and their descendants into an environment that has <a href=#concept-bc-noscript title=concept-bc-noscript>scripting disabled</a>, has no
+      <a href=#plugin title=plugin>plugins</a>, and fails any attempt to
+      <a href=#fetch title=fetch>fetch</a> any resources. Let <var title="">cloned subheading content</var> be a new
+      <code><a href=#documentfragment>DocumentFragment</a></code> containing the resulting cloned
+      nodes, preserving their relative order.</p>
+
+     </li>
+
+     <li>
+
+      <p>If the document being converted is an <a href=#html-documents title="HTML
+      documents">HTML document</a>, then: Let <var title="">x</var>
+      be a <code title="">subtitle</code> element in the <a href=#atom-namespace>Atom
+      namespace</a>. Add a <code title="">type</code> attribute
+      whose value is the string "<code title="">html</code>" to <var title="">x</var>. Append a text node with its data set to the
+      result of running the <a href=#html-fragment-serialization-algorithm>HTML fragment serialization
+      algorithm</a> on <var title="">cloned subheading
+      content</var> to <var title="">x</var>. Append <var title="">x</var> to the root element of <var title="">R</var>.</p>
+
+      <p>Otherwise, the document being converted is an <a href=#xml-documents title="XML documents">XML document</a>: Let <var title="">x</var> be a <code title="">subtitle</code> element in
+      the <a href=#atom-namespace>Atom namespace</a>. Add a <code title="">type</code> attribute whose value is the string "<code title="">xhtml</code>" to <var title="">x</var>. Append a
+      <code><a href=#the-div-element>div</a></code> element to <var title="">x</var>. Move all the
+      child nodes of the <var title="">cloned subheading content</var>
+      node to that <code><a href=#the-div-element>div</a></code> element, preserving their relative
+      order. Append <var title="">x</var> to the root element of <var title="">R</var>.</p>
+
+     </li>
+
+    </ol></li>
+
    <li><p>Let <var title="">global update date</var> have no
    value.</li>
 
@@ -56972,8 +57025,8 @@
 
        <dd>
 
-        <p>Let <var title="">heading text</var> be the empty
-        string.</p>
+        <p>Let <var title="">heading content</var> be an empty
+        list.</p>
 
        </dd>
 
@@ -56982,7 +57035,7 @@
        <dd>
 
         <p>If <var title="">heading</var> contains no child
-        <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading text</var> be the empty string.</p>
+        <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> elements, let <var title="">heading content</var> be an empty list.</p>
 
         <p>Otherwise, let <var title="">headings list</var> be a list
         of all the <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>–<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element
@@ -56991,8 +57044,7 @@
         order</a> (so <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>s first, then
         <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h2</a></code>s, etc, with each group in the order they
         appear in the document). Then, let <var title="">heading
-        text</var> be the <code><a href=#textcontent>textContent</a></code> of the first entry
-        in <var title="">headings list</var>.</p>
+        content</var> be the descendants of the first entry in <var title="">headings list</var>.</p>
 
        </dd>
 
@@ -57000,8 +57052,8 @@
 
        <dd>
 
-        <p>Let <var title="">heading text</var> be the
-        <code><a href=#textcontent>textContent</a></code> of <var title="">heading</var>.</p>
+        <p>Let <var title="">heading content</var> be the descendants
+        of <var title="">heading</var>.</p>
 
        </dd>
 
@@ -57009,14 +57061,38 @@
 
      <li>
 
-      <p>Append a <code title="">title</code> element in the
-      <a href=#atom-namespace>Atom namespace</a> to <var title="">E</var> whose
-      contents is a text node with its data set to <var title="">heading text</var>.</p>
+      <p>Clone the nodes in <var title="">heading content</var> and
+      their descendants into an environment that has <a href=#concept-bc-noscript title=concept-bc-noscript>scripting disabled</a>, has no
+      <a href=#plugin title=plugin>plugins</a>, and fails any attempt to
+      <a href=#fetch title=fetch>fetch</a> any resources. Let <var title="">cloned heading content</var> be a new
+      <code><a href=#documentfragment>DocumentFragment</a></code> containing the resulting cloned
+      nodes, preserving their relative order.</p>
 
      </li>
 
+     <li>
+
+      <p>If the document being converted is an <a href=#html-documents title="HTML
+      documents">HTML document</a>, then: Let <var title="">x</var>
+      be a <code title="">title</code> element in the <a href=#atom-namespace>Atom
+      namespace</a>. Add a <code title="">type</code> attribute
+      whose value is the string "<code title="">html</code>" to <var title="">x</var>. Append a text node with its data set to the
+      result of running the <a href=#html-fragment-serialization-algorithm>HTML fragment serialization
+      algorithm</a> on <var title="">cloned heading content</var>
+      to <var title="">x</var>. Append <var title="">x</var> to <var title="">E</var>.</p>
+
+      <p>Otherwise, the document being converted is an <a href=#xml-documents title="XML documents">XML document</a>: Let <var title="">x</var> be a <code title="">title</code> element in the
+      <a href=#atom-namespace>Atom namespace</a>. Add a <code title="">type</code>
+      attribute whose value is the string "<code title="">xhtml</code>" to <var title="">x</var>. Append a
+      <code><a href=#the-div-element>div</a></code> element to <var title="">x</var>. Move all the
+      child nodes of the <var title="">cloned heading content</var>
+      node to that <code><a href=#the-div-element>div</a></code> element, preserving their relative
+      order. Append <var title="">x</var> to <var title="">E</var>.</p>
+
+     </li>
+
      <!-- <atom:author> is required either at the feed level (above)
-     or the entry level (here) but we don't provide it -->
+     or the entry level (here) but we don't provide it here -->
 
      <li>
 
@@ -78594,8 +78670,9 @@
 
   <p>The following steps form the <dfn id=html-fragment-serialization-algorithm>HTML fragment serialization
   algorithm</dfn>. The algorithm takes as input a DOM
-  <code><a href=#element>Element</a></code> or <code><a href=#document>Document</a></code>, referred to as <var title="">the node</var>, and either returns a string or raises an
-  exception.</p>
+  <code><a href=#element>Element</a></code>, <code><a href=#document>Document</a></code>, or
+  <code><a href=#documentfragment>DocumentFragment</a></code> referred to as <var title="">the
+  node</var>, and either returns a string or raises an exception.</p>
 
   <p class=note>This algorithm serializes the <em>children</em> of
   the node being serialized, not the node itself.</p>

Modified: source
===================================================================
--- source	2010-08-09 18:35:45 UTC (rev 5252)
+++ source	2010-08-09 19:11:05 UTC (rev 5253)
@@ -64217,8 +64217,8 @@
 
    </li>
 
-   <li><p>Let <var title="">subheading text</var> be the empty
-   string.</p></li>
+   <li><p>Let <var title="">subheading content</var> be an empty
+   list.</p></li>
 
    <li><p>Let <var title="">heading</var> be the first element of
    <span>heading content</span> whose nearest ancestor of
@@ -64237,10 +64237,9 @@
 
      <dd>
 
-      <p>Let <var title="">heading text</var> be the
-      <code>textContent</code> of <span>the <code>title</code>
-      element</span>, if there is one, or the empty string
-      otherwise.</p>
+      <p>Let <var title="">heading content</var> be the descendants
+      <span>the <code>title</code> element</span>, if there is one, or
+      an empty list otherwise.</p>
 
      </dd>
 
@@ -64250,7 +64249,7 @@
 
       <p>If <var title="">heading</var> contains no child
       <code>h1</code>–<code>h6</code> elements, let <var
-      title="">heading text</var> be the empty string.</p>
+      title="">heading content</var> be an empty list.</p>
 
       <p>Otherwise, let <var title="">headings list</var> be a list of
       all the <code>h1</code>–<code>h6</code> element children
@@ -64258,11 +64257,11 @@
       <span>rank</span> and then in <span>tree order</span> (so
       <code>h1</code>s first, then <code>h2</code>s, etc, with each
       group in the order they appear in the document). Then, let <var
-      title="">heading text</var> be the <code>textContent</code> of
-      the first entry in <var title="">headings list</var>, and if
-      there are multiple entries, let <var title="">subheading
-      text</var> be the <code>textContent</code> of the second entry
-      in <var title="">headings list</var>.</p>
+      title="">heading content</var> be the descendants of the first
+      entry in <var title="">headings list</var>, and if there are
+      multiple entries, let <var title="">subheading content</var> be
+      the descendants of the second entry in <var title="">headings
+      list</var>.</p>
 
      </dd>
 
@@ -64270,8 +64269,8 @@
 
      <dd>
 
-      <p>Let <var title="">heading text</var> be the
-      <code>textContent</code> of <var title="">heading</var>.</p>
+      <p>Let <var title="">heading content</var> be the descendants of
+      <var title="">heading</var>.</p>
 
      </dd>
 
@@ -64281,23 +64280,96 @@
 
    <li>
 
-    <p>Append a <code title="">title</code> element in the <span>Atom
-    namespace</span> to the root element of <var title="">R</var>
-    whose contents is a text node with its data set to <var
-    title="">heading text</var>.</p>
+    <p>Clone the nodes in <var title="">heading content</var> and
+    their descendants into an environment that has <span
+    title="concept-bc-noscript">scripting disabled</span>, has no
+    <span title="plugin">plugins</span>, and fails any attempt to
+    <span title="fetch">fetch</span> any resources. Let <var
+    title="">cloned heading content</var> be a new
+    <code>DocumentFragment</code> containing the resulting cloned
+    nodes, preserving their relative order.</p>
 
    </li>
 
    <li>
 
-    <p>If <var title="">subheading text</var> is not the empty string,
-    append a <code title="">subtitle</code> element in the <span>Atom
-    namespace</span> to the root element of <var title="">R</var>
-    whose contents is a text node with its data set to <var
-    title="">subheading text</var>.</p>
+    <p>If the document being converted is an <span title="HTML
+    documents">HTML document</span>, then: Let <var title="">x</var>
+    be a <code title="">title</code> element in the <span>Atom
+    namespace</span>. Add a <code title="">type</code> attribute whose
+    value is the string "<code title="">html</code>" to <var
+    title="">x</var>. Append a text node with its data set to the
+    result of running the <span>HTML fragment serialization
+    algorithm</span> on <var title="">cloned heading content</var> to
+    <var title="">x</var>. Append <var title="">x</var> to the root
+    element of <var title="">R</var>.</p>
 
+    <p>Otherwise, the document being converted is an <span title="XML
+    documents">XML document</span>: Let <var title="">x</var> be a
+    <code title="">title</code> element in the <span>Atom
+    namespace</span>. Add a <code title="">type</code> attribute whose
+    value is the string "<code title="">xhtml</code>" to <var
+    title="">x</var>. Append a <code>div</code> element to <var
+    title="">x</var>. Move all the child nodes of the <var
+    title="">cloned heading content</var> node to that
+    <code>div</code> element, preserving their relative order. Append
+    <var title="">x</var> to the root element of <var
+    title="">R</var>.</p>
+
    </li>
 
+   <li>
+
+    <p>If <var title="">subheading content</var> is not an empty list,
+    run these substeps:</p>
+
+    <ol>
+
+     <li>
+
+      <p>Clone the nodes in <var title="">subheading content</var>
+      and their descendants into an environment that has <span
+      title="concept-bc-noscript">scripting disabled</span>, has no
+      <span title="plugin">plugins</span>, and fails any attempt to
+      <span title="fetch">fetch</span> any resources. Let <var
+      title="">cloned subheading content</var> be a new
+      <code>DocumentFragment</code> containing the resulting cloned
+      nodes, preserving their relative order.</p>
+
+     </li>
+
+     <li>
+
+      <p>If the document being converted is an <span title="HTML
+      documents">HTML document</span>, then: Let <var title="">x</var>
+      be a <code title="">subtitle</code> element in the <span>Atom
+      namespace</span>. Add a <code title="">type</code> attribute
+      whose value is the string "<code title="">html</code>" to <var
+      title="">x</var>. Append a text node with its data set to the
+      result of running the <span>HTML fragment serialization
+      algorithm</span> on <var title="">cloned subheading
+      content</var> to <var title="">x</var>. Append <var
+      title="">x</var> to the root element of <var
+      title="">R</var>.</p>
+
+      <p>Otherwise, the document being converted is an <span
+      title="XML documents">XML document</span>: Let <var
+      title="">x</var> be a <code title="">subtitle</code> element in
+      the <span>Atom namespace</span>. Add a <code
+      title="">type</code> attribute whose value is the string "<code
+      title="">xhtml</code>" to <var title="">x</var>. Append a
+      <code>div</code> element to <var title="">x</var>. Move all the
+      child nodes of the <var title="">cloned subheading content</var>
+      node to that <code>div</code> element, preserving their relative
+      order. Append <var title="">x</var> to the root element of <var
+      title="">R</var>.</p>
+
+     </li>
+
+    </ol>
+
+   </li>
+
    <li><p>Let <var title="">global update date</var> have no
    value.</p></li>
 
@@ -64347,8 +64419,8 @@
 
        <dd>
 
-        <p>Let <var title="">heading text</var> be the empty
-        string.</p>
+        <p>Let <var title="">heading content</var> be an empty
+        list.</p>
 
        </dd>
 
@@ -64358,7 +64430,7 @@
 
         <p>If <var title="">heading</var> contains no child
         <code>h1</code>–<code>h6</code> elements, let <var
-        title="">heading text</var> be the empty string.</p>
+        title="">heading content</var> be an empty list.</p>
 
         <p>Otherwise, let <var title="">headings list</var> be a list
         of all the <code>h1</code>–<code>h6</code> element
@@ -64367,8 +64439,8 @@
         order</span> (so <code>h1</code>s first, then
         <code>h2</code>s, etc, with each group in the order they
         appear in the document). Then, let <var title="">heading
-        text</var> be the <code>textContent</code> of the first entry
-        in <var title="">headings list</var>.</p>
+        content</var> be the descendants of the first entry in <var
+        title="">headings list</var>.</p>
 
        </dd>
 
@@ -64376,8 +64448,8 @@
 
        <dd>
 
-        <p>Let <var title="">heading text</var> be the
-        <code>textContent</code> of <var title="">heading</var>.</p>
+        <p>Let <var title="">heading content</var> be the descendants
+        of <var title="">heading</var>.</p>
 
        </dd>
 
@@ -64387,15 +64459,46 @@
 
      <li>
 
-      <p>Append a <code title="">title</code> element in the
-      <span>Atom namespace</span> to <var title="">E</var> whose
-      contents is a text node with its data set to <var
-      title="">heading text</var>.</p>
+      <p>Clone the nodes in <var title="">heading content</var> and
+      their descendants into an environment that has <span
+      title="concept-bc-noscript">scripting disabled</span>, has no
+      <span title="plugin">plugins</span>, and fails any attempt to
+      <span title="fetch">fetch</span> any resources. Let <var
+      title="">cloned heading content</var> be a new
+      <code>DocumentFragment</code> containing the resulting cloned
+      nodes, preserving their relative order.</p>
 
      </li>
 
+     <li>
+
+      <p>If the document being converted is an <span title="HTML
+      documents">HTML document</span>, then: Let <var title="">x</var>
+      be a <code title="">title</code> element in the <span>Atom
+      namespace</span>. Add a <code title="">type</code> attribute
+      whose value is the string "<code title="">html</code>" to <var
+      title="">x</var>. Append a text node with its data set to the
+      result of running the <span>HTML fragment serialization
+      algorithm</span> on <var title="">cloned heading content</var>
+      to <var title="">x</var>. Append <var title="">x</var> to <var
+      title="">E</var>.</p>
+
+      <p>Otherwise, the document being converted is an <span
+      title="XML documents">XML document</span>: Let <var
+      title="">x</var> be a <code title="">title</code> element in the
+      <span>Atom namespace</span>. Add a <code title="">type</code>
+      attribute whose value is the string "<code
+      title="">xhtml</code>" to <var title="">x</var>. Append a
+      <code>div</code> element to <var title="">x</var>. Move all the
+      child nodes of the <var title="">cloned heading content</var>
+      node to that <code>div</code> element, preserving their relative
+      order. Append <var title="">x</var> to <var
+      title="">E</var>.</p>
+
+     </li>
+
      <!-- <atom:author> is required either at the feed level (above)
-     or the entry level (here) but we don't provide it -->
+     or the entry level (here) but we don't provide it here -->
 
      <li>
 
@@ -97474,9 +97577,9 @@
 
   <p>The following steps form the <dfn>HTML fragment serialization
   algorithm</dfn>. The algorithm takes as input a DOM
-  <code>Element</code> or <code>Document</code>, referred to as <var
-  title="">the node</var>, and either returns a string or raises an
-  exception.</p>
+  <code>Element</code>, <code>Document</code>, or
+  <code>DocumentFragment</code> referred to as <var title="">the
+  node</var>, and either returns a string or raises an exception.</p>
 
   <p class="note">This algorithm serializes the <em>children</em> of
   the node being serialized, not the node itself.</p>




More information about the Commit-Watchers mailing list