<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23590</bug_id>
          
          <creation_ts>2013-10-22 07:59:56 +0000</creation_ts>
          <short_desc>Provide rationale for content restrictions for script tag</short_desc>
          <delta_ts>2013-12-07 08:19:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          <dependson>23587</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="steve faulkner">faulkner.steve</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mathias</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>qbolec</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>95073</commentid>
    <comment_count>0</comment_count>
    <who name="steve faulkner">faulkner.steve</who>
    <bug_when>2013-10-22 07:59:56 +0000</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #23587 +++

Consider following HTML:

&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
  var user={name:&quot;Jakub &lt;!-- &lt;script&gt;&quot;}&lt;/script&gt;

  &lt;!-- innocent comment --&gt;

  &lt;script type=&quot;text/javascript&quot;&gt;
  console.log(&quot;Hello&quot; + user.name);
  &lt;/script&gt;

&lt;/head&gt;
&lt;/html&gt;

To put it into perspective imagine, that the server which generated it was executing something &quot;innocent&quot; like this:

&lt;?php echo &apos;var user=&apos; . json_encode($user) ?&gt;

The problem is, that given the current automaton description found at http://www.w3.org/TR/html5/syntax.html#script-data-state it leads to matching the &quot;&lt;!--&quot; found in the username with &quot;--&gt;&quot; located after the &quot;innocent comment&quot;. Moreover the script body surprisingly extends over to the &quot;next&quot; script. This can be verified in current version of Chrome for example, using the Chrome&apos;s console:

$$(&apos;script&apos;)[0].innerHTML
&quot;
  var user={name:&quot;Jakub &lt;!-- &lt;script&gt;&quot;}&lt;/script&gt;

  &lt;!-- innocent comment --&gt;

  &lt;script type=&quot;text/javascript&quot;&gt;
  console.log(&quot;Hello&quot; + user.name);
  &quot;

Observe that there is no warning for the developer at the moment of parsing HTML. However when the JS parser kicks in it gives a (rather) surprising error:

Uncaught SyntaxError: Invalid regular expression: missing / 

The reason for that is that the line
  var user={name:&quot;Jakub &lt;!-- &lt;script&gt;&quot;}&lt;/script&gt;
gets parsed as
  var user=X&lt;Y
where Y is &quot;/script&gt;&quot;, which resembles a regular expression.

Now, what I want to complain about is that the story can end in various different ways depending on such &quot;details&quot; as:
1. do I put the &lt;/script&gt; in the same line or not
2. do I put semicolon after definition of user variable
3. do I have an &lt;!-- innocent comment --&gt; after the tag or not
4. do I have a second &lt;script&gt; tag after the innocent comment or not

Clearly, this does not help to reach goals which are mentioned in Section &quot;1.10.3 Restrictions on content models and on attribute values&quot;, as I wasted 8 hours today debugging this issue in a real life scenario.
The reason it was so hard to debug, was that it required aligment of so many planets to reproduce (the username had to contain both &lt;!-- and &lt;script&gt; but not &lt;/script&gt;, we needed an html comment afterwards, and another script tag, all of which were independent conditions which happened or not depending on things like adserver targeting etc.).

It would help me a lot if the section &quot;4.3.1.2 Restrictions for contents of script elements&quot; at least provided reasons behind this strange set of rules -- I would really like to understand why the &quot;double escape&quot; mode triggered by &quot;&lt;!-- &lt;script&gt;&quot; combo is needed. It would helped even more if some practices were suggested, which could help avoided such problems (for example: &quot;Authors should always escape &quot;&lt;&quot; character as &quot;\x3C&quot; in their strings&quot; or something).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95091</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-10-22 12:41:51 +0000</bug_when>
    <thetext>My recommendation is to introduce a parse error here:

[[
If the temporary buffer is the string &quot;script&quot;, then switch to the script data double escaped state.
]]
http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#script-data-double-escape-start-state

Rationale: it&apos;s only once you enter that state where the parser can swallow a &quot;&lt;/script&gt;&quot;, which is a problematic thing in conforming parsers that currently goes without any error in validators despite checking the content model restrictions.

The &quot;false positive&quot; case of people doing something like

&lt;script&gt;&lt;!--
document.write(&apos;&lt;script&gt;&lt;/&apos;+&apos;script&gt;&apos;)
//--&gt;&lt;/script&gt;

is relatively rare and I don&apos;t mind the validator flagging an error about it.

The current spec catches various errors already (that are less severe now that legacy parsers aren&apos;t around), but doesn&apos;t properly cover this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95103</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-22 17:26:15 +0000</bug_when>
    <thetext>Jakub: I recommend reading the WHATWG spec, not the W3C spec, and definitely not the spec on the W3C&apos;s TR page. The W3C spec is an out-of-date fork of the WHATWG spec with numerous differences (and it&apos;s unclear which are intentional — they haven&apos;t documented their changes).

The WHATWG HTML standard (as of yesterday) has some text that explains this, at the top (in green) and the bottom (in an example) of this section:

   http://whatwg.org/specs/web-apps/current-work/#restrictions-for-contents-of-script-elements

Is that sufficient?


Simon: How would you phrase the corresponding authoring conformance criteria? Would it actually really just mean changing the &quot;Restrictions for contents of script elements&quot; in some way? (What way?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95105</commentid>
    <comment_count>3</comment_count>
    <who name="Jakub Łopuszański">qbolec</who>
    <bug_when>2013-10-22 18:09:07 +0000</bug_when>
    <thetext>Ian &apos;Hixie&apos; Hickson : Yes, the explanations are very good. However, I would prefer a simplier advice for developers: &quot;escape &lt; character as \u003C&quot;, which is (I think) much easier to implement and remember.

Also, maybe it&apos;s just me, by do not understand this part of explanation:
  
  What is going on here is that for legacy reasons, &quot;&lt;!--&quot; and &quot;&lt;script&quot; strings in script elements in HTML need to be balanced in order for the parser to consider closing the block.

If that&apos;s really the reason behind this, then why the grammar does not actually require them to be balanced? In a context free gram,ar that should be trivial to express, yet the current grammar does something quite different (I do not even understand what it does, but it seems that &lt;script&gt;&lt;!-- &lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;/script&gt; --&gt;&lt;/script&gt; is a good HTML even though it is clearly not balanced).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95106</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-10-22 18:14:25 +0000</bug_when>
    <thetext>Yeah I guess we could ban &lt;script (and maybe also &lt;/script while at it?) in &lt;!-- --&gt; in the ABNF. Don&apos;t ask me how, sorry. I can follow the parser but not the ABNF. :-|</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95124</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-22 21:34:52 +0000</bug_when>
    <thetext>(In reply to Jakub Łopuszański from comment #3)
&gt; Ian &apos;Hixie&apos; Hickson : Yes, the explanations are very good. However, I would
&gt; prefer a simplier advice for developers: &quot;escape &lt; character as \u003C&quot;,
&gt; which is (I think) much easier to implement and remember.

That would work too, sure. I&apos;ll add that in.


&gt; Also, maybe it&apos;s just me, by do not understand this part of explanation:
&gt;   
&gt;   What is going on here is that for legacy reasons, &quot;&lt;!--&quot; and &quot;&lt;script&quot;
&gt; strings in script elements in HTML need to be balanced in order for the
&gt; parser to consider closing the block.
&gt; 
&gt; If that&apos;s really the reason behind this, then why the grammar does not
&gt; actually require them to be balanced?

Yeah, &quot;balanced&quot; is the wrong word. I&apos;m not sure what the right word is.


&gt; In a context free gramar that should
&gt; be trivial to express, yet the current grammar does something quite
&gt; different (I do not even understand what it does, but it seems that
&gt; &lt;script&gt;&lt;!-- &lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;script&gt;&lt;/script&gt;
&gt; --&gt;&lt;/script&gt; is a good HTML even though it is clearly not balanced).

Yeah... it&apos;s more like, it has to be balanced, but only the outer most of each type counts, and only in a particular order, and you can have a trailing &lt;!--, and it&apos;s ok to be missing the &lt;/script&gt; if you have a --&gt;, and... I tried to write it in prose one time, and couldn&apos;t figure out how to do it, which is why it&apos;s in ABNF.


(In reply to Simon Pieters from comment #4)
&gt; Yeah I guess we could ban &lt;script (and maybe also &lt;/script while at it?) in
&gt; &lt;!-- --&gt; in the ABNF. Don&apos;t ask me how, sorry. I can follow the parser but
&gt; not the ABNF. :-|

script        = data1 *( comment-start data2 [ comment-end data1 ] )

data1         = &lt; string that doesn&apos;t contain substring that matches not-data1 &gt;
not-data1     = comment-start

data2         = &lt; string that doesn&apos;t contain substring that matches not-data2 &gt;
not-data2     = script-start / script-end / comment-end

command-start = &quot;&lt;!--&quot;
comment-end   = &quot;--&gt;&quot;
script-start  = lt       s c r i p t tag-end
script-end    = lt slash s c r i p t tag-end

lt            =  %x003C ; U+003C LESS-THAN SIGN character (&lt;)
slash         =  %x002F ; U+002F SOLIDUS character (/)

s             =  %x0053 ; U+0053 LATIN CAPITAL LETTER S
s             =/ %x0073 ; U+0073 LATIN SMALL LETTER S
c             =  %x0043 ; U+0043 LATIN CAPITAL LETTER C
c             =/ %x0063 ; U+0063 LATIN SMALL LETTER C
r             =  %x0052 ; U+0052 LATIN CAPITAL LETTER R
r             =/ %x0072 ; U+0072 LATIN SMALL LETTER R
i             =  %x0049 ; U+0049 LATIN CAPITAL LETTER I
i             =/ %x0069 ; U+0069 LATIN SMALL LETTER I
p             =  %x0050 ; U+0050 LATIN CAPITAL LETTER P
p             =/ %x0070 ; U+0070 LATIN SMALL LETTER P
t             =  %x0054 ; U+0054 LATIN CAPITAL LETTER T
t             =/ %x0074 ; U+0074 LATIN SMALL LETTER T

tag-end       =  %x0009 ; U+0009 CHARACTER TABULATION (tab)
tag-end       =/ %x000A ; U+000A LINE FEED (LF)
tag-end       =/ %x000C ; U+000C FORM FEED (FF)
tag-end       =/ %x0020 ; U+0020 SPACE
tag-end       =/ %x002F ; U+002F SOLIDUS (/)
tag-end       =/ %x003E ; U+003E GREATER-THAN SIGN (&gt;)


...but IIRC the reason we didn&apos;t do this in the first place was that we decided it would match too many pages, and thus cause too many pages to be non-conforming despite working fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95128</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-10-22 21:37:55 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8236.
Check-in comment: Add a related way to escape scripts.
http://html5.org/tools/web-apps-tracker?from=8235&amp;to=8236</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95133</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-10-22 21:53:20 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #5)

&gt; ...but IIRC the reason we didn&apos;t do this in the first place was that we
&gt; decided it would match too many pages, and thus cause too many pages to be
&gt; non-conforming despite working fine.

I think the focus back then was on the behavior, document conformance wasn&apos;t discussed much.

I think &lt;script&gt;&lt;!--...&lt;/script&gt; is more common than &lt;script&gt;&lt;!--&lt;script&gt;&lt;/script&gt;...--&gt;...&lt;/script&gt;. We give an error for the former but not the latter, even though the former works fine (in non-legacy parsers) but the latter might not match what was intended.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95138</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-10-22 22:03:31 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8237.
Check-in comment: Missed a case in previous checkin.
http://html5.org/tools/web-apps-tracker?from=8236&amp;to=8237</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95145</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-22 22:24:38 +0000</bug_when>
    <thetext>Actually I&apos;m going to back out the suggestion to just escape &quot;&lt;&quot;, because you can&apos;t escape it in expressions but it could still be problematic there, as in:

   var didOk = actualCount&lt;script


(In reply to Simon Pieters from comment #7)
&gt; 
&gt; I think the focus back then was on the behavior, document conformance wasn&apos;t
&gt; discussed much.

We might not have discussed it. It was definitely on my mind, or I wouldn&apos;t have written this whole big section. :-)


&gt; I think &lt;script&gt;&lt;!--...&lt;/script&gt; is more common than
&gt; &lt;script&gt;&lt;!--&lt;script&gt;&lt;/script&gt;...--&gt;...&lt;/script&gt;. We give an error for the
&gt; former but not the latter, even though the former works fine (in non-legacy
&gt; parsers) but the latter might not match what was intended.

We shouldn&apos;t give an error for the former as far as I can tell from reading the spec. Why do you think it should give an error?

(I&apos;m assuming your outer &lt;script&gt; and &lt;/script&gt; tags are wrapping the contents of a script element, and are not part of the script element&apos;s contents.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95146</commentid>
    <comment_count>10</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-10-22 22:28:39 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8238.
Check-in comment: Revert the last two checkins.
http://html5.org/tools/web-apps-tracker?from=8237&amp;to=8238</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95162</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-10-23 08:25:20 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #9)

&gt; We shouldn&apos;t give an error for the former as far as I can tell from reading
&gt; the spec. Why do you think it should give an error?

Hmm. I thought it did, but it appears you&apos;re right. Validator.nu gives an error though.

I think it would make sense to have an error for that case because it resulted in bad parsing in legacy UAs and is clearly a mistake. The &lt;style&gt; element doesn&apos;t allow it for that reason.

&gt; (I&apos;m assuming your outer &lt;script&gt; and &lt;/script&gt; tags are wrapping the
&gt; contents of a script element, and are not part of the script element&apos;s
&gt; contents.)

Right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95164</commentid>
    <comment_count>12</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-10-23 08:51:26 +0000</bug_when>
    <thetext>(In reply to Simon Pieters from comment #11)
&gt; (In reply to Ian &apos;Hixie&apos; Hickson from comment #9)
&gt; 
&gt; &gt; We shouldn&apos;t give an error for the former as far as I can tell from reading
&gt; &gt; the spec. Why do you think it should give an error?
&gt; 
&gt; Hmm. I thought it did, but it appears you&apos;re right. Validator.nu gives an
&gt; error though.

Maybe because of http://bugzilla.validator.nu/show_bug.cgi?id=697#c0 ? (the &quot;I&apos;d suggest having a warning for the other (r)cdata elements that don&apos;t match
the ABNF for style.&quot; part).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95197</commentid>
    <comment_count>13</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-10-23 14:19:10 +0000</bug_when>
    <thetext>I don&apos;t think so. It was asking for a warning, but it appears to not be implemented for e.g. &lt;xmp&gt;&lt;!--&lt;/xmp&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95215</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-23 18:51:08 +0000</bug_when>
    <thetext>Simon and others pointed out on IRC that even the advice in the spec now, of escaping &lt;\!-- and &lt;\script&gt; and so on, isn&apos;t really something you can always do.

Maybe the right solution is for validators to also syntax-check the scripts, so that we have three possible ways of catching the errors — the content restrictions, the HTML parser, and the JS parser — but even then I guess you can&apos;t avoid all problems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96469</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-18 23:19:52 +0000</bug_when>
    <thetext>I can&apos;t figure out a good thing to do here. What&apos;s in the spec does vaguely explin the issue, and gives an example, but I can&apos;t really see anything we could add that would make it better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96510</commentid>
    <comment_count>16</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-11-19 13:34:47 +0000</bug_when>
    <thetext>I think the spec should make these non-conforming:

&lt;script&gt;&lt;!--&lt;/script&gt; (to match &lt;style&gt; and to not get weird behavior in legacy browsers and because it&apos;s clearly a mistake)

&lt;script&gt;&lt;!--&lt;script&gt; ...(whatever)... &lt;/script&gt; (because getting into this state means confusing things can happen and author intent isn&apos;t so clear, and it&apos;s easy to avoid it by not using &lt;!-- --&gt; cargo cult and doing escaping)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96540</commentid>
    <comment_count>17</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-19 21:35:37 +0000</bug_when>
    <thetext>Ok, done. Is that enough?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96541</commentid>
    <comment_count>18</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-19 21:35:51 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8299.
Check-in comment: Remove the parts of the script content model that could lead to unbalanced crazy
http://html5.org/tools/web-apps-tracker?from=8298&amp;to=8299</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96558</commentid>
    <comment_count>19</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-11-19 22:25:00 +0000</bug_when>
    <thetext>AFAICT it still allows

&lt;script&gt;&lt;!--&lt;script&gt; ...(whatever)... &lt;/script&gt;

if the ...(whatever)... is &lt;/script&gt;--&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96710</commentid>
    <comment_count>20</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-22 18:30:30 +0000</bug_when>
    <thetext>That was my intent. I didn&apos;t realise you didn&apos;t mean to include that, my bad.

Which of the following do you want to allow vs not allow? (Each line is the textContent of a &lt;script&gt; block; actual markup not shown to avoid confusing internal textual contents with identical-looking external markup.)

   &lt;!-- --&gt;
   &lt;!-- &lt;script&gt;
   &lt;!-- &lt;script&gt; --&gt;
   &lt;!-- &lt;script&gt; &lt;/script&gt;
   &lt;!-- &lt;script&gt; &lt;/script&gt; --&gt;
   &lt;script&gt;
   &lt;script&gt; &lt;/script&gt;
   &lt;/script&gt;
   --&gt;
   &lt;!-- --&gt; &lt;!-- --&gt;
   &lt;!-- --&gt; &lt;script&gt;

...anything else?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96765</commentid>
    <comment_count>21</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-11-25 08:40:04 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #20)
&gt;    &lt;!-- --&gt;

Allow.

&gt;    &lt;!-- &lt;script&gt;
&gt;    &lt;!-- &lt;script&gt; --&gt;
&gt;    &lt;!-- &lt;script&gt; &lt;/script&gt;
&gt;    &lt;!-- &lt;script&gt; &lt;/script&gt; --&gt;

Don&apos;t allow.

&gt;    &lt;script&gt;
&gt;    &lt;script&gt; &lt;/script&gt;
&gt;    &lt;/script&gt;

Allow. (I think it&apos;s pointless to check for &lt;/script&gt; here because you can&apos;t end up with it from parsing. But I don&apos;t have a strong opinion on that either way.)

&gt;    --&gt;
&gt;    &lt;!-- --&gt; &lt;!-- --&gt;
&gt;    &lt;!-- --&gt; &lt;script&gt;

Allow.

&gt; 
&gt; ...anything else?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96786</commentid>
    <comment_count>22</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-25 18:09:30 +0000</bug_when>
    <thetext>I missed some:

   &lt;!--
   --&gt; &lt;!--
   &lt;script&gt; &lt;!--
   &lt;script&gt; &lt;!-- &lt;script&gt;
   &lt;script&gt; &lt;!-- &lt;script&gt; --&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96787</commentid>
    <comment_count>23</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-25 18:10:34 +0000</bug_when>
    <thetext>(I assume from previous comments that they&apos;re all &quot;don&apos;t allow&quot;.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96789</commentid>
    <comment_count>24</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-25 18:14:39 +0000</bug_when>
    <thetext>How about:

   &lt;!-- &lt;!-- --&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96790</commentid>
    <comment_count>25</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-25 18:38:18 +0000</bug_when>
    <thetext>I&apos;m assuming that one is ok.

Please check my latest attempt!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96791</commentid>
    <comment_count>26</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-25 18:38:45 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8313.
Check-in comment: Another attempt at redefining &lt;script&gt; content rules to make zcorpan happy
http://html5.org/tools/web-apps-tracker?from=8312&amp;to=8313</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96844</commentid>
    <comment_count>27</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-11-26 17:49:02 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #23)
&gt; (I assume from previous comments that they&apos;re all &quot;don&apos;t allow&quot;.)

Right.

(In reply to Ian &apos;Hixie&apos; Hickson from comment #25)
&gt; I&apos;m assuming that one is ok.

Yep.

&gt; Please check my latest attempt!

LGTM! Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97283</commentid>
    <comment_count>28</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-12-07 08:19:37 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #14)
&gt; Simon and others pointed out on IRC that even the advice in the spec now, of
&gt; escaping &lt;\!-- and &lt;\script&gt; and so on, isn&apos;t really something you can
&gt; always do.
&gt; 
&gt; Maybe the right solution is for validators to also syntax-check the scripts,
&gt; so that we have three possible ways of catching the errors — the content
&gt; restrictions, the HTML parser, and the JS parser — but even then I guess you
&gt; can&apos;t avoid all problems.

It&apos;s doable for the validator to syntax-check the scripts, so I guess I&apos;ll plan to go ahead and add that. (Though we&apos;re limited by whatever Rhino currently supports. And I don&apos;t know if Rhino is still be maintained and if it&apos;s up to date with ES6 now, but if not and there&apos;s any new syntax in ES6 that&apos;s not allowed in ES5, then the validator will end up flagging it as an error.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>