hixie: Restrict the contents of <style> for compat with IE/Opera/WebKit. Loosen the restrictions on <script> where they would be impossible to violate in text/html. (whatwg r4340)

hixie: Restrict the contents of <style> for compat with IE/Opera/WebKit.
Loosen the restrictions on <script> where they would be impossible to
violate in text/html. (whatwg r4340)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3474&r2=1.3475&f=h
http://html5.org/tools/web-apps-tracker?from=4339&to=4340

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3474
retrieving revision 1.3475
diff -u -d -r1.3474 -r1.3475
--- Overview.html 27 Oct 2009 06:08:31 -0000 1.3474
+++ Overview.html 27 Oct 2009 06:25:23 -0000 1.3475
@@ -10435,7 +10435,7 @@
    <dd>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is absent: in a <code><a href="#the-noscript-element">noscript</a></code> element that is a child of a <code><a href="#the-head-element-0">head</a></code> element.</dd>
    <dd>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is present: where <a href="#flow-content">flow content</a> is expected, but before any other <a href="#flow-content">flow content</a> other than other <code><a href="#the-style-element">style</a></code> elements and <a href="#inter-element-whitespace">inter-element whitespace</a>.</dd>
    <dt>Content model:</dt>
-   <dd>Depends on the value of the <code title="attr-style-type"><a href="#attr-style-type">type</a></code> attribute.</dd>
+   <dd>Depends on the value of the <code title="attr-style-type"><a href="#attr-style-type">type</a></code> attribute, but must match requirements described in prose below.</dd>
    <dt>Content attributes:</dt>
    <dd><a href="#global-attributes">Global attributes</a></dd>
    <dd><code title="attr-style-media"><a href="#attr-style-media">media</a></code></dd>
@@ -10502,7 +10502,18 @@
   attribute on <code><a href="#the-style-element">style</a></code> elements, like the <code title="attr-link-title"><a href="#attr-link-title">title</a></code> attribute on <code><a href="#the-link-element">link</a></code>
   elements, differs from the global <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute in that a
   <code><a href="#the-style-element">style</a></code> block without a title does not inherit the title
-  of the parent element: it merely has no title.<div class="impl">
+  of the parent element: it merely has no title.<p>The <code>textContent</code> of a <code><a href="#the-style-element">style</a></code> element must
+  match the <code title="">style</code> production in the following
+  ABNF, the character set for which is Unicode. <a href="#refsABNF">[ABNF]</a><pre>style         = no-c-start *( "&lt;!--" no-c-end "--&gt;" no-c-start )
+no-c-start    = &lt;any string that doesn't contain the substring "&lt;!--" &gt;
+no-c-end      = &lt;any string that doesn't contain the substring "--&gt;" &gt;</pre><!-- Unmatched comment-like syntax is invalid on a temporary basis,
+       waiting for IE, WebKit, and Opera to fix their parsing bug
+       whereby such comments trigger a weird escape in which </style>
+       is ignored. Otherwise, parsing behaviour in those browsers
+       could differ substantially from the parsing behaviour of HTML5.
+       Once everyone follows the HTML5 spec, we can drop this
+       requirement.
+  --><div class="impl">
 
   <p>All descendant elements must be processed, according to their
   semantics, before the <code><a href="#the-style-element">style</a></code> element itself is
@@ -11293,16 +11304,16 @@
   parameter for the purpose of comparing <a href="#mime-type" title="MIME type">MIME
   types</a> here.</p>
 
-  </div><h5 id="restrictions-for-contents-of-script-elements"><span class="secno">4.3.1.2 </span><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><p>The contents of a <code><a href="#script">script</a></code> element must match the
+  </div><h5 id="restrictions-for-contents-of-script-elements"><span class="secno">4.3.1.2 </span><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i><p>The <code>textContent</code> of a <code><a href="#script">script</a></code> element must match the
   <code title="">script</code> production in the following ABNF, the
   character set for which is Unicode. <a href="#refsABNF">[ABNF]</a><pre>script        = data1 *( escape [ script-start data3 ] "--&gt;" data1 ) [ escape ]
 escape        = "&lt;!--" data2 *( script-start data3 script-end data2 )
 
 data1         = &lt;any string that doesn't contain a substring that matches not-data1&gt;
-not-data1     = script-end / "&lt;!--"
+not-data1     = <!-- script-end / -->"&lt;!--"             <!-- the script-end is redundant here since it would close the element -->
 
 data2         = &lt;any string that doesn't contain a substring that matches not-data2&gt;
-not-data2     = script-end / script-start / "--&gt;"
+not-data2     = <!-- script-end / -->script-start / "--&gt;"  <!-- the script-end is redundant here since it would close the element -->
 
 data3         = &lt;any string that doesn't contain a substring that matches not-data3&gt;
 not-data3     = script-end / "--&gt;"

Received on Tuesday, 27 October 2009 06:26:26 UTC