[html5] r4340 - [ac] (2) Restrict the contents of <style> for compat with IE/Opera/WebKit. Loose [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Oct 26 23:25:28 PDT 2009


Author: ianh
Date: 2009-10-26 23:25:25 -0700 (Mon, 26 Oct 2009)
New Revision: 4340

Modified:
   complete.html
   index
   source
Log:
[ac] (2) 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.

Modified: complete.html
===================================================================
--- complete.html	2009-10-27 06:08:32 UTC (rev 4339)
+++ complete.html	2009-10-27 06:25:25 UTC (rev 4340)
@@ -11930,7 +11930,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>
@@ -12017,6 +12017,23 @@
   <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.</p>
 
+  <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></p>
+
+  <pre>style         = no-c-start *( "<!--" no-c-end "-->" no-c-start )
+no-c-start    = <any string that doesn't contain the substring "<!--" >
+no-c-end      = <any string that doesn't contain the substring "-->" ></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
@@ -12893,7 +12910,7 @@
 
   <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>The contents of a <code><a href=#script>script</a></code> element must match the
+  <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></p>
 
@@ -12901,10 +12918,10 @@
 escape        = "<!--" data2 *( script-start data3 script-end data2 )
 
 data1         = <any string that doesn't contain a substring that matches not-data1>
-not-data1     = script-end / "<!--"
+not-data1     = <!-- script-end / -->"<!--"             <!-- the script-end is redundant here since it would close the element -->
 
 data2         = <any string that doesn't contain a substring that matches not-data2>
-not-data2     = script-end / script-start / "-->"
+not-data2     = <!-- script-end / -->script-start / "-->"  <!-- the script-end is redundant here since it would close the element -->
 
 data3         = <any string that doesn't contain a substring that matches not-data3>
 not-data3     = script-end / "-->"

Modified: index
===================================================================
--- index	2009-10-27 06:08:32 UTC (rev 4339)
+++ index	2009-10-27 06:25:25 UTC (rev 4340)
@@ -11740,7 +11740,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>
@@ -11827,6 +11827,23 @@
   <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.</p>
 
+  <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></p>
+
+  <pre>style         = no-c-start *( "<!--" no-c-end "-->" no-c-start )
+no-c-start    = <any string that doesn't contain the substring "<!--" >
+no-c-end      = <any string that doesn't contain the substring "-->" ></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
@@ -12703,7 +12720,7 @@
 
   <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>The contents of a <code><a href=#script>script</a></code> element must match the
+  <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></p>
 
@@ -12711,10 +12728,10 @@
 escape        = "<!--" data2 *( script-start data3 script-end data2 )
 
 data1         = <any string that doesn't contain a substring that matches not-data1>
-not-data1     = script-end / "<!--"
+not-data1     = <!-- script-end / -->"<!--"             <!-- the script-end is redundant here since it would close the element -->
 
 data2         = <any string that doesn't contain a substring that matches not-data2>
-not-data2     = script-end / script-start / "-->"
+not-data2     = <!-- script-end / -->script-start / "-->"  <!-- the script-end is redundant here since it would close the element -->
 
 data3         = <any string that doesn't contain a substring that matches not-data3>
 not-data3     = script-end / "-->"

Modified: source
===================================================================
--- source	2009-10-27 06:08:32 UTC (rev 4339)
+++ source	2009-10-27 06:25:25 UTC (rev 4340)
@@ -12411,7 +12411,7 @@
    <dd>If the <code title="attr-style-scoped">scoped</code> attribute is absent: in a <code>noscript</code> element that is a child of a <code>head</code> element.</dd>
    <dd>If the <code title="attr-style-scoped">scoped</code> attribute is present: where <span>flow content</span> is expected, but before any other <span>flow content</span> other than other <code>style</code> elements and <span>inter-element whitespace</span>.</dd>
    <dt>Content model:</dt>
-   <dd>Depends on the value of the <code title="attr-style-type">type</code> attribute.</dd>
+   <dd>Depends on the value of the <code title="attr-style-type">type</code> attribute, but must match requirements described in prose below.</dd>
    <dt>Content attributes:</dt>
    <dd><span>Global attributes</span></dd>
    <dd><code title="attr-style-media">media</code></dd>
@@ -12508,6 +12508,24 @@
   <code>style</code> block without a title does not inherit the title
   of the parent element: it merely has no title.</p>
 
+  <p>The <code>textContent</code> of a <code>style</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></p>
+
+  <pre>style         = no-c-start *( "<!--" no-c-end "-->" no-c-start )
+no-c-start    = <any string that doesn't contain the substring "<!--" >
+no-c-end      = <any string that doesn't contain the substring "-->" ></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
@@ -13517,7 +13535,7 @@
 
   <h5><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5>
 
-  <p>The contents of a <code>script</code> element must match the
+  <p>The <code>textContent</code> of a <code>script</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></p>
@@ -13526,10 +13544,10 @@
 escape        = "<!--" data2 *( script-start data3 script-end data2 )
 
 data1         = <any string that doesn't contain a substring that matches not-data1>
-not-data1     = script-end / "<!--"
+not-data1     = <!-- script-end / -->"<!--"             <!-- the script-end is redundant here since it would close the element -->
 
 data2         = <any string that doesn't contain a substring that matches not-data2>
-not-data2     = script-end / script-start / "-->"
+not-data2     = <!-- script-end / -->script-start / "-->"  <!-- the script-end is redundant here since it would close the element -->
 
 data3         = <any string that doesn't contain a substring that matches not-data3>
 not-data3     = script-end / "-->"




More information about the Commit-Watchers mailing list