CVS html5/html-polyglot

Update of /sources/public/html5/html-polyglot
In directory roscoe:/tmp/cvs-serv30564

Modified Files:
	html-polyglot.html 
Log Message:
Fixes per bug 24451, comment 7

--- /sources/public/html5/html-polyglot/html-polyglot.html	2014/02/19 00:57:08	1.30
+++ /sources/public/html5/html-polyglot/html-polyglot.html	2014/03/19 23:56:13	1.31
@@ -8,7 +8,7 @@
         var respecConfig = {
             specStatus:   "ED",
             shortName:    "html-polyglot",
-            publishDate:  "2014-02-18",
+            publishDate:  "2014-03-19",
             previousPublishDate:  "2010-10-19",
             // previousDiffURI:  "http://htmlwg.org/heartbeat/WD-html-polyglot-20131008/",
 previousMaturity:  "WD",
@@ -804,18 +804,18 @@
         <ul>
             <li> The CDATA section is subject to HTML’s restrictions on <code>&lt;script></code> and <code>&lt;style></code>.</li>
             <li> There can be only one CDATA section per raw text element.</li>
-            <li> Before the CDATA section there can only be one node - preferrably only one line of code, which may
+            <!--<li> Before the CDATA section there can only be one node - preferrably only one line of code, which may
                 consist of whitespace, or an XML comment, or a construct of the  scripting/styling language (usually
                 a comment of the scripting/styling language).</li>
             <li> After the CDATA section there can only be one node - preferrably only one line of code, which may
                 consist of whitespace, or an XML comment, or a construct of the  scripting/styling language (usually
-                a comment of the scripting/styling language).</li>
+                a comment of the scripting/styling language).</li>-->
         </ul>
         <p>The <code>]]&gt;</code> string:</p>
         <ul>
             <li> is always commented out if <code>&lt;![CDATA[</code> is commented out.</li>
             <li> is never commented out if <code>&lt;![CDATA[</code> is not commented out.</li>
-            <li> <pre class="example highlight">//]]&gt;  &lt;/script></pre></li></ul>
+            <li> <pre class="example highlight">&lt;script&gt; //&lt;![CDATA[ Foo; //]]&gt;  &lt;/script></pre></li></ul>
 
         <p>The <code>&lt;![CDATA[</code> string can be handled in 3 ways:</p>
         <ol>
@@ -895,10 +895,12 @@
     <!--End section: White Space in textarea and pre Elements-->
 </section>
 <section id="normal-elements" class="section">
-    <h4>Normal elements</h4>
-    <p>Normal elements have no special restrictions other than those that generally apply to polyglot markup.
-        Note that some elements (such as the <code>iframe</code> element) must be empty in polyglot markup,
-        because the HTML specification sets this requirement on <code>iframe</code> in the XHTML syntax.</p>
+    <h4>Special elements</h4>
+    <p>Unless otherwise specified, elements have no special restrictions other than those that apply to all polyglot markup.</p>
+    <p>The <code>iframe</code> element has restrictions in polyglot markup,
+        because the 
+        <a href="http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-iframe-element">HTML specification 
+            sets special restraints</a> on <code>iframe</code> in XML documents. [[!HTML5]]</p>
     <!--End section: White Space in textarea and pre Elements-->
 </section>
 </section>
@@ -907,7 +909,9 @@
     <section id="newlines-in-textarea-and-pre" class="section">
         <h4>Newlines in <code>textarea</code> and <code>pre</code> elements</h4>
         <p>When <a>polyglot markup</a> uses either a <code>textarea</code> or <code>pre</code> element,
-            the text within the element should not begin with a <a href="http://dev.w3.org/html5/spec/syntax.html#syntax-newlines">newline</a>.</p>
+            the text within the element should not begin with a <a href="http://dev.w3.org/html5/spec/syntax.html#syntax-newlines">newline</a>.
+            This is because HTML and SGML-based systems delete the initial newline on parsing, while XML parsers do not.
+        </p>
         <!--End section: White Space in textarea and pre Elements-->
     </section>
     <!-- End section: text-->
@@ -925,8 +929,11 @@
         Within an attribute's value, <a>polyglot markup</a> represents tabs, line feeds, and carriage returns
         as numeric character references rather than by using literal characters.
         For example, within an attribute's value, <a>polyglot markup</a> uses <code>&amp;#x9;</code> for a tab
-        rather than the literal character <code>'\t'</code>.
-        This is because of attribute-value normalization in XML [[!XML10]].
+        rather than the verbatim string literal, <code>\t</code>.
+        This is because of <a href="http://www.w3.org/TR/xml/#AVNormalize">attribute normalization</a> in XML [[!XML10]].
+        Note, too, that JavaScript and CSS in attribute values are affected by attribute value normalization, 
+        because a comment ends up commenting out not to the end of the source line but to the end of the entire 
+        attribute value.
     </p>
     <p>
         The following example uses numeric character references (escaped characters) for the line feed, tab, and less-than characters within a <code>srcdoc</code> attribute.
@@ -944,9 +951,11 @@
             <li>explicitly examined by JavaScript, rendering the differences of small consequence.</li>
             <li>used in attributes whose content is rendered visually, such as the content of <code>@alt</code>.</li>
         </ul>
+        
         <p>
             Note that directly typed newline characters are overtly not allowed in any attribute containing a URI.
         </p>
+                
     </div>
     <p>
         See also <a href="#attribute-values">Attribute values</a>.
@@ -954,7 +963,7 @@
 
     <section id="disallowed-attributes" class="section">
         <h3>Disallowed attributes</h3>
-        <p>The following attributes are not allowed in <a>polyglot markup</a>.
+        <p>The following attributes are not allowed in HTML or XHTML within <a>polyglot markup</a>.
             These attributes have effects in documents parsed as XML but do not have effects in documents parsed as <code>text/html</code>.
             The HTML5 spec therefore defines them as invalid in text/html documents. [[!HTML5]]
         </p>
@@ -962,7 +971,8 @@
             <li><code>xml:space</code></li>
             <li><code>xml:base</code></li>
         </ul>
-        <p>	Note that the <code>xml:space</code> and <code>xml:base</code> attributes are allowed on SVG and MathML elements.</p>
+        <p>Note that the <code>xml:space</code> and <code>xml:base</code> attributes <strong>are</strong> allowed on SVG and MathML elements. 
+            The attributes may therefore appear in <a>polyglot markup</a> when they appear within SVG or MathML as foreign content.</p>
 
         <!--End section: Disallowed Attributes-->
     </section>
@@ -995,6 +1005,11 @@
                 <a title="polyglot markup">Polyglot markup</a> does not contain any space characters within the value of an <code>id</code> attribute.
                 This is because values for the <code>id</code> attribute <a href="http://dev.w3.org/html5/spec/elements.html#the-id-attribute">may not contain space characters</a> in HTML5. [[!HTML5]]
             </p>
+            <p>
+               <a title="polyglot markup">Polyglot markup</a> ensures that every id attribute must be unique 
+                within the document and must be a legal XML name, starting with a letter. [[!XML10]]
+               
+            </p>
             <!-- End section: The id Attribute -->
         </section>
 
@@ -1024,7 +1039,10 @@
         that content SHOULD use the hexadecimal form of character escapes rather than the decimal form when both are available. [[!CHARMOD]]
     </p>
     <p>
-        <a title="polyglot markup">Polyglot markup</a> always uses character references for the less than sign (<code>&lt;</code>) and ampersand (<code>&amp;</code>) when they are used as characters, however for CDATA inside foreign content and for <a href="#safe-CDATA-content">safe CDATA</a>, the following rules apply:</p>
+        <a title="polyglot markup">Polyglot markup</a> always uses character references for the less than sign (<code>&lt;</code>) 
+        and ampersand (<code>&amp;</code>) when they are used as characters, 
+        however for CDATA inside foreign content, strings within comments, and for <a href="#safe-CDATA-content">safe CDATA</a>, 
+        the following rules apply:</p>
     <ul>
         <li>for <code>script</code> and <code>style</code> elements that contain <a href="#safe-CDATA-content">safe CDATA</a>, they may used as defined by the rules for safe CDATA;</li>
         <li>for CDATA sections <a href="http://www.w3.org/TR/html5/syntax.html#cdata-sections">in a foreign content section</a> (SVG, MathML), the XML rules for CDATA apply;</li>
@@ -1035,6 +1053,7 @@
 <section id="comments" class="section">
     <h2>Comments</h2>
     <p>
+        <a title="polyglot markup">Polyglot markup</a> begins a comment with either "<code>&lt;!</code>" or "<code>&lt;!--</code>".
         <a title="polyglot markup">Polyglot markup</a> does not begin a comment with either "<code>></code>" or "<code>&#x2D;></code>".
     </p>
 
@@ -1055,7 +1074,7 @@
             which works for both HTML and XHTML.
         </p>
         <p class="note">
-            The <code>innerHTML</code> property takes a string. However, XML parsers will parse that string as XML in XHTM
+            The <code>innerHTML</code> property takes a string. However, XML parsers will parse that string as XML in XHTML
             while HTML parsers parse will parse that string as HTML in HTML.  And because of this difference in parsing,
             the code that <code>innerHTML</code> inserts must follow the guidelines for <a>polyglot markup</a> so that
             the resulting DOM generated by the XML parser do not differ from the DOM generated by the HTML parser.
@@ -1063,17 +1082,22 @@
     </section>
     <section id="css-and-namespaced-attributes" class="section">
         <h3>CSS: Attribute selectors that require a namespace prefix</h3>
-        <p>CSS allows authors to select elements by referencing their attributes using so called attribute selectors:
-            <code class="css">[attr]{rule:foo}</code>. And for the most part, attribute selectors can be used freely
+        <p>CSS enables authors to select elements by referencing their attributes using attribute selectors:
+            <code class="css">[attr]{property:value}</code>. Generally speaking, attribute selectors can be used freely
             since <a>polyglot markup</a> relies on default namespaces, which do not affect attributes.
-            However, some of the attributes required by <a>polyglot markup</a>, are namespaced – either by default (such
-            as for the <code>xmlns</code> attribute) or via a prefix that by default is namespaced (such as <code>xml:</code>,
-            <code>xmlns:</code>, <code>xlink:</code>). Extension specs might allow even other namespaced attributes than
-            those defined by the HTML specification. As result, a selector such as <code class="css">[xmlns]{rule:foo}</code>
-            will only work in HTML – it will not work in XHTML, where it is a namespace attribute. And the same goes for prefixed
-            attributes – even if one escapes the colon (<code class="css">[xml\:lang]{rule:foo}</code>), such selectors
-            will only work in HTML, except that for the namespace declaration for the <code>xlink:</code> prefix, then
-            it works like in XML even in the HTML syntax and must thus be selected in a namespaced way in both syntaxes.</p>
+        </p>
+        <p>However, some of the attributes required by <a>polyglot markup</a> are namespaced. 
+            Some are namespaced by default, such as the <code>xmlns</code> attribute.
+            Some attributes are namespaced by a prefix that is namespaced by default, such as <code>xml:</code>,
+            <code>xmlns:</code>, and <code>xlink:</code>. 
+            In addition, extension specs may allow namespaced attributes other than those defined by the HTML specification. 
+            As result, a selector such as <code class="css">[xmlns]{rule:foo}</code> will not work in XHTML, 
+            where the attribute has an associated namespace. 
+            The same is true for prefixed attributes.
+            Even if one escapes the colon (<code class="css">[xml\:lang]{rule:foo}</code>), such selectors
+            will only work in HTML 
+            (except for the namespace declaration for the <code>xlink:</code> prefix. 
+            This works in XML and in HTML and must thus be selected in a namespaced way in both syntaxes).</p>
 
         <p>To be able to select namespaced attributes in XML, the attribute selector must include a <a
                 href="http://www.w3.org/TR/css3-selectors/#attrnmsp">namespace prefix</a>. [[!SELECT]]</p>

Received on Wednesday, 19 March 2014 23:56:15 UTC