Skip to content

Commit

Permalink
[t] (0) Make <title> and <subtitle> in the Atom conversion contain ma…
Browse files Browse the repository at this point in the history
…rkup

git-svn-id: http://svn.whatwg.org/webapps@5253 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 9, 2010
1 parent a417973 commit 46d8e55
Show file tree
Hide file tree
Showing 3 changed files with 363 additions and 106 deletions.
145 changes: 111 additions & 34 deletions complete.html
Expand Up @@ -56931,8 +56931,8 @@ <h4 id=atom><span class=secno>5.5.3 </span>Atom</h4>

</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
Expand All @@ -56949,10 +56949,9 @@ <h4 id=atom><span class=secno>5.5.3 </span>Atom</h4>

<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>

Expand All @@ -56961,49 +56960,103 @@ <h4 id=atom><span class=secno>5.5.3 </span>Atom</h4>
<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>&ndash;<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>&ndash;<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>&ndash;<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>

<dt>If <var title="">heading</var> is an <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>&ndash;<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element</dt>

<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>

</dl></li>

<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>

Expand Down Expand Up @@ -57045,8 +57098,8 @@ <h4 id=atom><span class=secno>5.5.3 </span>Atom</h4>

<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>

Expand All @@ -57055,7 +57108,7 @@ <h4 id=atom><span class=secno>5.5.3 </span>Atom</h4>
<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>&ndash;<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>&ndash;<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>&ndash;<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element
Expand All @@ -57064,32 +57117,55 @@ <h4 id=atom><span class=secno>5.5.3 </span>Atom</h4>
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>

<dt>If <var title="">heading</var> is an <code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h1</a></code>&ndash;<code><a href=#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements>h6</a></code> element</dt>

<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>

</dl></li>

<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>

Expand Down Expand Up @@ -85483,8 +85559,9 @@ <h3 id=serializing-html-fragments><span class=secno>12.3 </span>Serializing HTML

<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>
Expand Down

0 comments on commit 46d8e55

Please sign in to comment.