[html5] r5743 - [giowt] (0) teach the fragment serialisation algorithm about namespaces Fixing h [...]

whatwg at whatwg.org whatwg at whatwg.org
Thu Jan 6 14:58:37 PST 2011


Author: ianh
Date: 2011-01-06 14:58:36 -0800 (Thu, 06 Jan 2011)
New Revision: 5743

Modified:
   complete.html
   index
   source
Log:
[giowt] (0) teach the fragment serialisation algorithm about namespaces
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11099

Modified: complete.html
===================================================================
--- complete.html	2011-01-06 22:26:50 UTC (rev 5742)
+++ complete.html	2011-01-06 22:58:36 UTC (rev 5743)
@@ -83818,20 +83818,73 @@
 
        <dd>
 
-        <p>Append a U+003C LESS-THAN SIGN character (<),
-        followed by the element's tag name. (For nodes created by the
-        <a href=#html-parser>HTML parser</a> or <code title="">Document.createElement()</code>, the tag name will be
-        lowercase.)</p>
+        <p>If <var title="">current node</var> is an element in the
+        <a href=#html-namespace-0>HTML namespace</a>, the <a href=#mathml-namespace>MathML
+        namespace</a>, or the <a href=#svg-namespace>SVG namespace</a>, then let
+        <var title="">tagname</var> be <var title="">current
+        node</var>'s local name. Otherwise, let <var title="">tagname</var> be <var title="">current node</var>'s
+        qualified name.</p>
 
+        <p>Append a U+003C LESS-THAN SIGN character (<), followed
+        by <var title="">tagname</var>.</p>
+
+        <p class=note>For <a href=#html-elements>HTML elements</a> created by the
+        <a href=#html-parser>HTML parser</a> or <code title="">Document.createElement()</code>, <var title="">tagname</var> will be lowercase.</p>
+
         <p>For each attribute that the element has, append a U+0020
-        SPACE character, the attribute's name (which, for attributes
-        set by the <a href=#html-parser>HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, will be lowercase), a
+        SPACE character, the <a href="#attribute's-serialized-name" title="attribute's serialized
+        name">attribute's serialized name as described below</a>, a
         U+003D EQUALS SIGN character (=), a U+0022 QUOTATION MARK
         character ("), the attribute's value, <a href=#escapingString title="escaping a string">escaped as described below</a> in
         <i>attribute mode</i>, and a second U+0022 QUOTATION MARK
         character (").</p>
 
-        <p>While the exact order of attributes is UA-defined, and may
+        <p>An <dfn id="attribute's-serialized-name">attribute's serialized name</dfn> for the purposes
+        of the previous paragraph must be determined as follows:</p>
+
+        <dl class=switch><dt>If the attribute has no namespace</dt>
+
+         <dd>
+
+          <p>The attribute's serialized name is the attribute's local
+          name.</p>
+
+          <p class=note>For attributes on <a href=#html-elements>HTML elements</a>
+          set by the <a href=#html-parser>HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, the local name will
+          be lowercase.</p>
+
+         </dd>
+
+
+         <dt>If the attribute is in the <a href=#xml-namespace>XML namespace</a></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xml:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in the <a href=#xmlns-namespace>XMLNS namespace</a> and the attribute's local name is <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xmlns</code>".</dd>
+
+
+         <dt>If the attribute is in the <a href=#xmlns-namespace>XMLNS namespace</a> and the attribute's local name is not <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xmlns:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in the <a href=#xlink-namespace>XLink namespace</a></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xlink:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in some other namespace</dt>
+
+         <dd><p>The attribute's serialized name is the attribute's
+         qualified name.</dd>
+
+        </dl><p>While the exact order of attributes is UA-defined, and may
         depend on factors such as the order that the attributes were
         given in the original markup, the sort order must be stable,
         such that consecutive invocations of this algorithm serialize an
@@ -83860,9 +83913,8 @@
         serialization algorithm</a> on the <var title="">current
         node</var> element (thus recursing into this algorithm for
         that element), followed by a U+003C LESS-THAN SIGN character
-        (<), a U+002F SOLIDUS character (/), the element's tag name
-        again, and finally a U+003E GREATER-THAN SIGN character
-        (>).</p>
+        (<), a U+002F SOLIDUS character (/), <var title="">tagname</var> again, and finally a U+003E
+        GREATER-THAN SIGN character (>).</p>
 
        </dd>
 

Modified: index
===================================================================
--- index	2011-01-06 22:26:50 UTC (rev 5742)
+++ index	2011-01-06 22:58:36 UTC (rev 5743)
@@ -79792,20 +79792,73 @@
 
        <dd>
 
-        <p>Append a U+003C LESS-THAN SIGN character (<),
-        followed by the element's tag name. (For nodes created by the
-        <a href=#html-parser>HTML parser</a> or <code title="">Document.createElement()</code>, the tag name will be
-        lowercase.)</p>
+        <p>If <var title="">current node</var> is an element in the
+        <a href=#html-namespace-0>HTML namespace</a>, the <a href=#mathml-namespace>MathML
+        namespace</a>, or the <a href=#svg-namespace>SVG namespace</a>, then let
+        <var title="">tagname</var> be <var title="">current
+        node</var>'s local name. Otherwise, let <var title="">tagname</var> be <var title="">current node</var>'s
+        qualified name.</p>
 
+        <p>Append a U+003C LESS-THAN SIGN character (<), followed
+        by <var title="">tagname</var>.</p>
+
+        <p class=note>For <a href=#html-elements>HTML elements</a> created by the
+        <a href=#html-parser>HTML parser</a> or <code title="">Document.createElement()</code>, <var title="">tagname</var> will be lowercase.</p>
+
         <p>For each attribute that the element has, append a U+0020
-        SPACE character, the attribute's name (which, for attributes
-        set by the <a href=#html-parser>HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, will be lowercase), a
+        SPACE character, the <a href="#attribute's-serialized-name" title="attribute's serialized
+        name">attribute's serialized name as described below</a>, a
         U+003D EQUALS SIGN character (=), a U+0022 QUOTATION MARK
         character ("), the attribute's value, <a href=#escapingString title="escaping a string">escaped as described below</a> in
         <i>attribute mode</i>, and a second U+0022 QUOTATION MARK
         character (").</p>
 
-        <p>While the exact order of attributes is UA-defined, and may
+        <p>An <dfn id="attribute's-serialized-name">attribute's serialized name</dfn> for the purposes
+        of the previous paragraph must be determined as follows:</p>
+
+        <dl class=switch><dt>If the attribute has no namespace</dt>
+
+         <dd>
+
+          <p>The attribute's serialized name is the attribute's local
+          name.</p>
+
+          <p class=note>For attributes on <a href=#html-elements>HTML elements</a>
+          set by the <a href=#html-parser>HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, the local name will
+          be lowercase.</p>
+
+         </dd>
+
+
+         <dt>If the attribute is in the <a href=#xml-namespace>XML namespace</a></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xml:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in the <a href=#xmlns-namespace>XMLNS namespace</a> and the attribute's local name is <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xmlns</code>".</dd>
+
+
+         <dt>If the attribute is in the <a href=#xmlns-namespace>XMLNS namespace</a> and the attribute's local name is not <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xmlns:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in the <a href=#xlink-namespace>XLink namespace</a></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code title="">xlink:</code>" followed by the attribute's local
+         name.</dd>
+
+
+         <dt>If the attribute is in some other namespace</dt>
+
+         <dd><p>The attribute's serialized name is the attribute's
+         qualified name.</dd>
+
+        </dl><p>While the exact order of attributes is UA-defined, and may
         depend on factors such as the order that the attributes were
         given in the original markup, the sort order must be stable,
         such that consecutive invocations of this algorithm serialize an
@@ -79834,9 +79887,8 @@
         serialization algorithm</a> on the <var title="">current
         node</var> element (thus recursing into this algorithm for
         that element), followed by a U+003C LESS-THAN SIGN character
-        (<), a U+002F SOLIDUS character (/), the element's tag name
-        again, and finally a U+003E GREATER-THAN SIGN character
-        (>).</p>
+        (<), a U+002F SOLIDUS character (/), <var title="">tagname</var> again, and finally a U+003E
+        GREATER-THAN SIGN character (>).</p>
 
        </dd>
 

Modified: source
===================================================================
--- source	2011-01-06 22:26:50 UTC (rev 5742)
+++ source	2011-01-06 22:58:36 UTC (rev 5743)
@@ -94897,23 +94897,86 @@
 
        <dd>
 
-        <p>Append a U+003C LESS-THAN SIGN character (<),
-        followed by the element's tag name. (For nodes created by the
+        <p>If <var title="">current node</var> is an element in the
+        <span>HTML namespace</span>, the <span>MathML
+        namespace</span>, or the <span>SVG namespace</span>, then let
+        <var title="">tagname</var> be <var title="">current
+        node</var>'s local name. Otherwise, let <var
+        title="">tagname</var> be <var title="">current node</var>'s
+        qualified name.</p>
+
+        <p>Append a U+003C LESS-THAN SIGN character (<), followed
+        by <var title="">tagname</var>.</p>
+
+        <p class="note">For <span>HTML elements</span> created by the
         <span>HTML parser</span> or <code
-        title="">Document.createElement()</code>, the tag name will be
-        lowercase.)</p>
+        title="">Document.createElement()</code>, <var
+        title="">tagname</var> will be lowercase.</p>
 
         <p>For each attribute that the element has, append a U+0020
-        SPACE character, the attribute's name (which, for attributes
-        set by the <span>HTML parser</span> or by <code
-        title="">Element.setAttributeNode()</code> or <code
-        title="">Element.setAttribute()</code>, will be lowercase), a
+        SPACE character, the <span title="attribute's serialized
+        name">attribute's serialized name as described below</span>, a
         U+003D EQUALS SIGN character (=), a U+0022 QUOTATION MARK
         character ("), the attribute's value, <span
         title="escaping a string">escaped as described below</span> in
         <i>attribute mode</i>, and a second U+0022 QUOTATION MARK
         character (").</p>
 
+        <p>An <dfn>attribute's serialized name</dfn> for the purposes
+        of the previous paragraph must be determined as follows:</p>
+
+        <dl class="switch">
+
+         <dt>If the attribute has no namespace</dt>
+
+         <dd>
+
+          <p>The attribute's serialized name is the attribute's local
+          name.</p>
+
+          <p class="note">For attributes on <span>HTML elements</span>
+          set by the <span>HTML parser</span> or by <code
+          title="">Element.setAttributeNode()</code> or <code
+          title="">Element.setAttribute()</code>, the local name will
+          be lowercase.</p>
+
+         </dd>
+
+
+         <dt>If the attribute is in the <span>XML namespace</span></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code
+         title="">xml:</code>" followed by the attribute's local
+         name.</p></dd>
+
+
+         <dt>If the attribute is in the <span>XMLNS namespace</span> and the attribute's local name is <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code
+         title="">xmlns</code>".</p></dd>
+
+
+         <dt>If the attribute is in the <span>XMLNS namespace</span> and the attribute's local name is not <code title="">xmlns</code></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code
+         title="">xmlns:</code>" followed by the attribute's local
+         name.</p></dd>
+
+
+         <dt>If the attribute is in the <span>XLink namespace</span></dt>
+
+         <dd><p>The attribute's serialized name is the string "<code
+         title="">xlink:</code>" followed by the attribute's local
+         name.</p></dd>
+
+
+         <dt>If the attribute is in some other namespace</dt>
+
+         <dd><p>The attribute's serialized name is the attribute's
+         qualified name.</p></dd>
+
+        </dl>
+
         <p>While the exact order of attributes is UA-defined, and may
         depend on factors such as the order that the attributes were
         given in the original markup, the sort order must be stable,
@@ -94943,9 +95006,9 @@
         serialization algorithm</span> on the <var title="">current
         node</var> element (thus recursing into this algorithm for
         that element), followed by a U+003C LESS-THAN SIGN character
-        (<), a U+002F SOLIDUS character (/), the element's tag name
-        again, and finally a U+003E GREATER-THAN SIGN character
-        (>).</p>
+        (<), a U+002F SOLIDUS character (/), <var
+        title="">tagname</var> again, and finally a U+003E
+        GREATER-THAN SIGN character (>).</p>
 
        </dd>
 




More information about the Commit-Watchers mailing list