Bugzilla – Bug 599
Support dash-dash-bang-angle comment terminators.
Last modified: 2009-11-23 17:17:30 CET
Index: source =================================================================== --- source (revision 3190) +++ source (revision 3191) @@ -74642,8 +74642,9 @@ <dd>Switch to the <span>comment start dash state</span>.</dd> <dt>U+003E GREATER-THAN SIGN (>)</dt> - <dd><span>Parse error</span>. Emit the comment token. Switch to - the <span>data state</span>.</dd> + <dd><span>Parse error</span>. Emit the comment token. Switch to the + <span>data state</span>.</dd> <!-- see comment in comment end state + --> <dt>EOF</dt> <dd><span>Parse error</span>. Emit the comment token. Reconsume @@ -74670,8 +74671,9 @@ the <span>data state</span>.</dd> <dt>EOF</dt> - <dd><span>Parse error</span>. Emit the comment token. Reconsume - the EOF character in the <span>data state</span>.</dd> + <dd><span>Parse error</span>. Emit the comment token. Reconsume the + EOF character in the <span>data state</span>.</dd> <!-- see comment + in comment end state --> <dt>Anything else</dt> <dd>Append a U+002D HYPHEN-MINUS (-) character and the input @@ -74691,12 +74693,9 @@ <dd>Switch to the <span>comment end dash state</span></dd> <dt>EOF</dt> - <dd><span>Parse error</span>. Emit the comment token. Reconsume - the EOF character in the <span>data state</span>.</dd> <!-- For - security reasons: otherwise, hostile user could put a <script> in - a comment e.g. in a blog comment and then DOS the server so that - the end tag isn't read, and then the commented <script> tag would - be treated as live code --> + <dd><span>Parse error</span>. Emit the comment token. Reconsume the + EOF character in the <span>data state</span>.</dd> <!-- see comment + in comment end state --> <dt>Anything else</dt> <dd>Append the input character to the comment token's data. Stay @@ -74715,12 +74714,9 @@ <dd>Switch to the <span>comment end state</span></dd> <dt>EOF</dt> - <dd><span>Parse error</span>. Emit the comment token. Reconsume - the EOF character in the <span>data state</span>.</dd> <!-- For - security reasons: otherwise, hostile user could put a <script> in - a comment e.g. in a blog comment and then DOS the server so that - the end tag isn't read, and then the commented <script> tag would - be treated as live code --> + <dd><span>Parse error</span>. Emit the comment token. Reconsume the + EOF character in the <span>data state</span>.</dd> <!-- see comment + in comment end state --> <dt>Anything else</dt> <dd>Append a U+002D HYPHEN-MINUS (-) character and the input @@ -74745,6 +74741,10 @@ (-) character to the comment token's data. Stay in the <span>comment end state</span>.</dd> + <dt>U+0021 EXCLAMATION MARK (!)</dt> + <dd><span>Parse error</span>. Switch to the <span>comment end bang + state</span>.</dd> + <dt>EOF</dt> <dd><span>Parse error</span>. Emit the comment token. Reconsume the EOF character in the <span>data state</span>.</dd> <!-- For @@ -74761,6 +74761,35 @@ </dl> + <h5><dfn>Comment end bang state</dfn></h5> + + <p>Consume the <span>next input character</span>:</p> + + <dl class="switch"> + + <dt>U+003E GREATER-THAN SIGN (>)</dt> + <dd>Emit the comment token. Switch to the <span>data + state</span>.</dd> + + <dt>U+002D HYPHEN-MINUS (-)</dt> + <dd>Append two U+002D HYPHEN-MINUS (-) characters and a U+0021 + EXCLAMATION MARK (!) character to the comment token's data. Switch + to the <span>comment end dash state</span>.</dd> + + <dt>EOF</dt> + <dd><span>Parse error</span>. Emit the comment token. Reconsume + the EOF character in the <span>data state</span>.</dd> <!-- see + comment in comment end state --> + + <dt>Anything else</dt> + <dd><span>Parse error</span>. Append two U+002D HYPHEN-MINUS (-) + characters, a U+0021 EXCLAMATION MARK (!) character, and the input + character to the comment token's data. Switch to the <span>comment + state</span>.</dd> + + </dl> + + <h5><dfn>DOCTYPE state</dfn></h5> <p>Consume the <span>next input character</span>:</p>