Skip to content
Permalink
Browse files

[c] (0) Change how <script>'s content restrictions are written to mak…

…e it more clear what is allowed and what isn't, since with prose rules in ABNF it can be a bit ambiguous.

git-svn-id: http://svn.whatwg.org/webapps@4179 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Oct 20, 2009
1 parent bc1466f commit 289ae9ec9d58ceb9ec413b8d61eff1e00e4dc1c1
Showing with 30 additions and 36 deletions.
  1. +10 −12 complete.html
  2. +10 −12 index
  3. +10 −12 source
<code title="">script</code> production in the following ABNF, the
character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>

<pre>script = body1
<pre>script = data1 *( escape [ script-start data3 ] "--&gt;" data1 ) [ escape ]
escape = "&amp;lt!--" data2 *( script-start data3 script-end data2 )

body1 = *( text1 / body2 )
body2 = "&lt;!--" *( text2 / body3 script-end ) [ body3 ] "--&gt;"
body3 = script-start *text3
data1 = &lt;any string that doesn't contain a substring that matches not-data1&gt;
not-data1 = script-end / "&lt;!--"

script-start = lt s c r i p t tag-end
script-end = lt slash s c r i p t tag-end
data2 = &lt;any string that doesn't contain a substring that matches not-data2&gt;
not-data2 = script-end / script-start / "--&gt;"

text1 = &lt;anything that doesn't match not-text1&gt;
text2 = &lt;anything that doesn't match not-text2&gt;
text3 = &lt;anything that doesn't match not-text3&gt;
data3 = &lt;any string that doesn't contain a substring that matches not-data3&gt;
not-data3 = script-end / "--&gt;"

not-text1 = "&lt;!--" / script-end
not-text2 = script-start / script-end / "--&gt;"
not-text3 = script-end / "--&gt;"
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 (/)
22 index
<code title="">script</code> production in the following ABNF, the
character set for which is Unicode. <a href=#refsABNF>[ABNF]</a></p>

<pre>script = body1
<pre>script = data1 *( escape [ script-start data3 ] "--&gt;" data1 ) [ escape ]
escape = "&amp;lt!--" data2 *( script-start data3 script-end data2 )

body1 = *( text1 / body2 )
body2 = "&lt;!--" *( text2 / body3 script-end ) [ body3 ] "--&gt;"
body3 = script-start *text3
data1 = &lt;any string that doesn't contain a substring that matches not-data1&gt;
not-data1 = script-end / "&lt;!--"

script-start = lt s c r i p t tag-end
script-end = lt slash s c r i p t tag-end
data2 = &lt;any string that doesn't contain a substring that matches not-data2&gt;
not-data2 = script-end / script-start / "--&gt;"

text1 = &lt;anything that doesn't match not-text1&gt;
text2 = &lt;anything that doesn't match not-text2&gt;
text3 = &lt;anything that doesn't match not-text3&gt;
data3 = &lt;any string that doesn't contain a substring that matches not-data3&gt;
not-data3 = script-end / "--&gt;"

not-text1 = "&lt;!--" / script-end
not-text2 = script-start / script-end / "--&gt;"
not-text3 = script-end / "--&gt;"
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 (/)
22 source
character set for which is Unicode. <a
href="#refsABNF">[ABNF]</a></p>

<pre>script = body1
<pre>script = data1 *( escape [ script-start data3 ] "-->" data1 ) [ escape ]
escape = "&lt!--" data2 *( script-start data3 script-end data2 )

body1 = *( text1 / body2 )
body2 = "&lt;!--" *( text2 / body3 script-end ) [ body3 ] "-->"
body3 = script-start *text3
data1 = &lt;any string that doesn't contain a substring that matches not-data1>
not-data1 = script-end / "&lt;!--"

script-start = lt s c r i p t tag-end
script-end = lt slash s c r i p t tag-end
data2 = &lt;any string that doesn't contain a substring that matches not-data2>
not-data2 = script-end / script-start / "-->"

text1 = &lt;anything that doesn't match not-text1>
text2 = &lt;anything that doesn't match not-text2>
text3 = &lt;anything that doesn't match not-text3>
data3 = &lt;any string that doesn't contain a substring that matches not-data3>
not-data3 = script-end / "-->"

not-text1 = "&lt;!--" / script-end
not-text2 = script-start / script-end / "-->"
not-text3 = script-end / "-->"
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 (/)

0 comments on commit 289ae9e

Please sign in to comment.
You can’t perform that action at this time.