Changeset 60781 in webkit


Ignore:
Timestamp:
Jun 7, 2010 7:41:13 AM (14 years ago)
Author:
jchaffraix@webkit.org
Message:

WebCore: Space should be allowed between -- and > in comment end
https://bugs.webkit.org/show_bug.cgi?id=21945

Reviewed by Alexey Proskuryakov.

Implemented the HTML comment parsing algorithm so that we match HTML5 and
FF when parsing comments. Missing from this patch is
the parser errors, which will be added in a follow up patch.

Added tests cases for broken comments.

Tests: fast/parser/broken-comment-1.html

fast/parser/broken-comment-2.html
fast/parser/broken-comment-3.html
fast/parser/broken-comment-4.html
fast/parser/broken-comment-5.html
fast/parser/broken-comment-6.html
fast/parser/broken-comment-in-head-1.html
fast/parser/broken-comment-in-head-2.html
fast/parser/broken-comment-in-head-3.html
fast/parser/broken-comment-in-head-4.html
fast/parser/broken-comment-in-head-5.html

  • html/HTMLTokenizer.cpp:

(WebCore::HTMLTokenizer::parseComment): Now we use a state machine
that matches the HTML5 specification.
(WebCore::HTMLTokenizer::emitCommentToken): This emits the comment token
and keep some of the original behavior as parseComment is called in wrong
context (inside a <title> for example). Added a more explicit comment about
this.
(WebCore::HTMLTokenizer::parseTag): Remove the handling of <!--> in quirks mode.
HTML5 specifies that we should accept this in strict mode too.

  • html/HTMLTokenizer.h:

(WebCore::HTMLTokenizer::): Added a new enum for the comment parsing state.

LayoutTests: Tests for:
Space should be allowed between -- and > in comment end
https://bugs.webkit.org/show_bug.cgi?id=21945

Reviewed by Alexey Proskuryakov.

  • fast/css/word-space-extra.html: Tweaked the comment as -- > is now

a valid comment end.

  • fast/parser/broken-comment-1-expected.txt: Added.
  • fast/parser/broken-comment-1.html: Added.
  • fast/parser/broken-comment-2-expected.txt: Added.
  • fast/parser/broken-comment-2.html: Added.
  • fast/parser/broken-comment-3-expected.txt: Added.
  • fast/parser/broken-comment-3.html: Added.
  • fast/parser/broken-comment-4-expected.txt: Added.
  • fast/parser/broken-comment-4.html: Added.
  • fast/parser/broken-comment-5-expected.txt: Added.
  • fast/parser/broken-comment-5.html: Added.
  • fast/parser/broken-comment-6-expected.txt: Added.
  • fast/parser/broken-comment-6.html: Added.

Those test checks that broken comments in body are correctly parsed.

  • fast/parser/broken-comment-in-head-1-expected.txt: Added.
  • fast/parser/broken-comment-in-head-1.html: Added.
  • fast/parser/broken-comment-in-head-2-expected.txt: Added.
  • fast/parser/broken-comment-in-head-2.html: Added.
  • fast/parser/broken-comment-in-head-3-expected.txt: Added.
  • fast/parser/broken-comment-in-head-3.html: Added.
  • fast/parser/broken-comment-in-head-4-expected.txt: Added.
  • fast/parser/broken-comment-in-head-4.html: Added.
  • fast/parser/broken-comment-in-head-5-expected.txt: Added.
  • fast/parser/broken-comment-in-head-5.html: Added.

Those test checks that broken comments in head are correctly parsed.

  • fast/parser/broken-comments-vs-parsing-mode.html: Needed to wrap the broken comment

in a title as we match FF here and would not recover from it.

  • fast/parser/comments-expected.txt:
  • fast/parser/comments.html:

Added more tests for comment parsing. Made sure that we close empty comments
<!--> and <!---> as is specified in HTML5.

  • html5lib/runner-expected.txt: Removed the test that we now pass.
Location:
trunk
Files:
22 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60767 r60781  
     12010-06-07  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Tests for:
     6        Space should be allowed between -- and > in comment end
     7        https://bugs.webkit.org/show_bug.cgi?id=21945
     8
     9        * fast/css/word-space-extra.html: Tweaked the comment as -- > is now
     10        a valid comment end.
     11
     12        * fast/parser/broken-comment-1-expected.txt: Added.
     13        * fast/parser/broken-comment-1.html: Added.
     14        * fast/parser/broken-comment-2-expected.txt: Added.
     15        * fast/parser/broken-comment-2.html: Added.
     16        * fast/parser/broken-comment-3-expected.txt: Added.
     17        * fast/parser/broken-comment-3.html: Added.
     18        * fast/parser/broken-comment-4-expected.txt: Added.
     19        * fast/parser/broken-comment-4.html: Added.
     20        * fast/parser/broken-comment-5-expected.txt: Added.
     21        * fast/parser/broken-comment-5.html: Added.
     22        * fast/parser/broken-comment-6-expected.txt: Added.
     23        * fast/parser/broken-comment-6.html: Added.
     24        Those test checks that broken comments in body are correctly parsed.
     25        * fast/parser/broken-comment-in-head-1-expected.txt: Added.
     26        * fast/parser/broken-comment-in-head-1.html: Added.
     27        * fast/parser/broken-comment-in-head-2-expected.txt: Added.
     28        * fast/parser/broken-comment-in-head-2.html: Added.
     29        * fast/parser/broken-comment-in-head-3-expected.txt: Added.
     30        * fast/parser/broken-comment-in-head-3.html: Added.
     31        * fast/parser/broken-comment-in-head-4-expected.txt: Added.
     32        * fast/parser/broken-comment-in-head-4.html: Added.
     33        * fast/parser/broken-comment-in-head-5-expected.txt: Added.
     34        * fast/parser/broken-comment-in-head-5.html: Added.
     35        Those test checks that broken comments in head are correctly parsed.
     36
     37        * fast/parser/broken-comments-vs-parsing-mode.html: Needed to wrap the broken comment
     38        in a title as we match FF here and would not recover from it.
     39
     40        * fast/parser/comments-expected.txt:
     41        * fast/parser/comments.html:
     42        Added more tests for comment parsing. Made sure that we close empty comments
     43        <!--> and <!---> as is specified in HTML5.
     44
     45        * html5lib/runner-expected.txt: Removed the test that we now pass.
     46
    1472010-06-06  MORITA Hajime  <morrita@google.com>
    248
  • trunk/LayoutTests/fast/css/word-space-extra.html

    r11995 r60781  
    99         in <pre>foo  bar</pre>.  The block size should be approximately
    1010         numchars*(charwidth+letter_spacing)+(numwords-1)*word_spacing.
    11        * <pre>elements too</pre>, <pre>elements <!-- comment -- > too</pre> have a different
     11       * <pre>elements too</pre>, <pre>elements <!-- comment - -> too</pre> have a different
    1212         number of spaces seperating 'elements' and 'too', hence will have different sized gaps
    1313       * <pre> blocks are already using a monospace font so no difference may be visible in
  • trunk/LayoutTests/fast/parser/broken-comments-vs-parsing-mode.html

    r48921 r60781  
    11<html>
     2<head>
     3<title>
    24<!-- A broken comment ->
     5</title>
     6</head>
    37<body>
    48<p><a href="https://bugs.webkit.org/show_bug.cgi?id=8626">bug 8626</a>:
  • trunk/LayoutTests/fast/parser/comments-expected.txt

    r56783 r60781  
    1 Output of this test should match WinIE (no strict SGML comment parsing).
     1Output of this test should match HTML5 (no strict SGML comment parsing).
    22
    3 Basic comments (1 PASSED):
    4 PASSED
    5 Comment series (1 PASSED):
    6 PASSED
    7 Dash runs (3 PASSED):
     3Basic comments (2 PASSED):
     4PASSED PASSED
     5Comment series (3 PASSED):
    86PASSED PASSED PASSED
    97
    10 Empty comments (2 PASSED):
     8Dash runs (5 PASSED):
     9PASSED PASSED PASSED PASSED PASSED
     10
     11Empty comments (5 PASSED):
     12PASSED PASSED PASSED PASSED PASSED
     13
     14Multiple lines (4 PASSED):
     15PASSED PASSED PASSED PASSED
     16
     17Compatibility (7 PASSED):
     18PASSED PASSED PASSED PASSED PASSED PASSED PASSED
     19
     20White space after comment close (4 PASSED):
     21PASSED PASSED PASSED PASSED
     22
     23Text after comment close:
     24Extra comment after markup declaration close (2 PASSED):
     25FAILED: extra comment end and markup declaration close -->
    1126PASSED PASSED
    1227
    13 Multiple lines (1 PASSED):
    14 PASSED
    15 
    16 Compatibility (2 PASSED):
    17 PASSED PASSED
    18 
    19 Tab after comment close:
    20 Text after comment close:
    21 Extra comment after markup declaration close:
    22 FAILED: extra comment end and markup declaration close -->
    2328Nested comment (1 PASSED):
    2429PASSED (outer nested comment) -->
  • trunk/LayoutTests/fast/parser/comments.html

    r56783 r60781  
    22<html>
    33<body>
    4 <p>Output of this test should match WinIE (no strict SGML comment parsing).</p>
     4<p>Output of this test should match HTML5 (no strict SGML comment parsing).</p>
    55
    66<script>
     
    88    layoutTestController.dumpAsText();
    99</script>
    10 <p>Basic comments (1 PASSED):<br>
     10<p>Basic comments (2 PASSED):<br>
    1111<!-- basic comment -->PASSED
    12 <!-- basic comment with spaces after comment end --    >FAILED--></p>
    13 <p>Comment series (1 PASSED):<br>
     12<!-- basic comment with spaces after comment end --    >PASSED
     13<!-- basic comment with spaces after comment end - -    >FAILED--></p>
     14<p>Comment series (3 PASSED):<br>
    1415<!-- comment -- -- series-->PASSED
    15 <!-- comment -- -- series with spaces after comment end-- >FAILED--></p>
    16 <p>Dash runs (3 PASSED):<br>
     16<!-- comment -- -- series with space after comment end-- >PASSED
     17<!-- comment -- -- series with spaces after comment end--  >PASSED</p>
     18<!-- comment -- -- series with spaces after comment end- -  >FAILED--></p>
     19<p>Dash runs (5 PASSED):<br>
    1720<!------ Hello -->PASSED
    18 <!------ Hello -- >FAILED
     21<!------ Hello -- >PASSED
     22<!------ Hello --  >PASSED
     23<!------ Hello - -  >FAILED
    1924<!-- --- Hello -->PASSED
    2025<!-- Hello --->PASSED</p>
    21 <p>Empty comments (2 PASSED):<br>
     26<p>Empty comments (5 PASSED):<br>
    2227<!---->PASSED
    23 <!---- >FAILED-->
    24 <!>PASSED</p>
    25 <p>Multiple lines (1 PASSED):<br>
     28<!---- >PASSED
     29<!>PASSED
     30<!-->PASSED
     31<!--->PASSED</p>
     32<p>Multiple lines (4 PASSED):<br>
    2633<!-- here's a comment, a little longer,
    2734    which occupies more than one line -->PASSED
    2835<!-- here's a comment, a little longer,
    29     which occupies more than one line -- >FAILED-->
     36    which occupies more than one line -- >PASSED
     37<!-- here's a comment, a little longer,
     38    which occupies more than one line --         >PASSED
     39<!-- here's a comment, a little longer,
     40    which occupies more than one line --         
     41    >PASSED
     42<!-- here's a comment, a little longer,
     43    which occupies more than one line - -        >FAILED-->
    3044</p>
    3145
    32 <p>Compatibility (2 PASSED):<br>
     46<p>Compatibility (7 PASSED):<br>
    3347<!-- Compatibility: comment series with --extraneous-- text -- between -- the comments -->PASSED
    34 <!-- Compatibility: comment series with --extraneous-- text -- between -- the comments -- >FAILED-->
     48<!-- Compatibility: comment series with --extraneous-- text -- between -- the comments -- >PASSED
     49<!-- Compatibility: comment series with --extraneous-- text -- between -- the comments --  >PASSED
     50<!-- Compatibility: comment series with --extraneous-- text -- between -- the comments - -  >FAILED-->
    3551<!-- Compatibility: <!--extra comment start like www.the-leaky-cauldron.com has <rdar://problem/4226539>-->PASSED
    36 <!-- Compatibility: <!--extra comment start like www.the-leaky-cauldron.com has <rdar://problem/4226539> -- >FAILED-->
     52<!-- Compatibility: <!--extra comment start like www.the-leaky-cauldron.com has <rdar://problem/4226539>-- >PASSED
     53<!-- Compatibility: <!--extra comment start like www.the-leaky-cauldron.com has <rdar://problem/4226539> --  >PASSED
     54<!-- Compatibility: <!--extra comment start like www.the-leaky-cauldron.com has <rdar://problem/4226539> --  >PASSED
     55<!-- Compatibility: <!--extra comment start like www.the-leaky-cauldron.com has <rdar://problem/4226539> - -  >FAILED-->
    3756</p>
    3857
    39 <p>Tab after comment close:<br>
    40 <!-- tab after comment close--  >FAILED: should be part of the comment --></p>
     58<p>White space after comment close (4 PASSED):<br>
     59<!-- tab after comment close--  >PASSED
     60<!-- LF after comment close--
     61>PASSED
     62<!-- CR after comment close--
     63>PASSED
     64<!-- tab after comment close--  >PASSED</p>
     65
     66
    4167<p>Text after comment close:<br>
    4268<!-- text after comment close--ouch>FAILED: should be part of the comment --></p>
    4369
    4470
    45 <p>Extra comment after markup declaration close:<br>
     71<p>Extra comment after markup declaration close (2 PASSED):<br>
    4672<!-- Comment --> FAILED: extra comment end and markup declaration close --><br>
    47 <!-- Comment with a whitespace in markup declaration close -- > FAILED: extra comment end w/space and markup declaration close --></p>
     73<!-- Comment with a whitespace in markup declaration close -- >PASSED
     74<!-- Comment with a whitespace in markup declaration close --    >PASSED</p>
    4875
    4976<p>Nested comment (1 PASSED):<br>
  • trunk/LayoutTests/html5lib/runner-expected.txt

    r60465 r60781  
    55resources/tests1.dat:
    6625
    7 27
    8729
    9830
     
    686729
    696832
    70 33
    716936
    72 40
    737042
    747144
     
    777454
    787556
    79 57
    807659
    8177
     
    1081044
    1091055
    110 6
    1111068
    1121079
     
    450445
    451446resources/comments01.dat:
    452 3
    453 6
    454 8
    455 9
    456 10
    457 11
    458 12
     44710
     44811
     44912
  • trunk/WebCore/ChangeLog

    r60780 r60781  
     12010-06-07  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Space should be allowed between -- and > in comment end
     6        https://bugs.webkit.org/show_bug.cgi?id=21945
     7
     8        Implemented the HTML comment parsing algorithm so that we match HTML5 and
     9        FF when parsing comments. Missing from this patch is
     10        the parser errors, which will be added in a follow up patch.
     11
     12        Added tests cases for broken comments.
     13
     14        Tests: fast/parser/broken-comment-1.html
     15               fast/parser/broken-comment-2.html
     16               fast/parser/broken-comment-3.html
     17               fast/parser/broken-comment-4.html
     18               fast/parser/broken-comment-5.html
     19               fast/parser/broken-comment-6.html
     20               fast/parser/broken-comment-in-head-1.html
     21               fast/parser/broken-comment-in-head-2.html
     22               fast/parser/broken-comment-in-head-3.html
     23               fast/parser/broken-comment-in-head-4.html
     24               fast/parser/broken-comment-in-head-5.html
     25
     26        * html/HTMLTokenizer.cpp:
     27        (WebCore::HTMLTokenizer::parseComment): Now we use a state machine
     28        that matches the HTML5 specification.
     29        (WebCore::HTMLTokenizer::emitCommentToken): This emits the comment token
     30        and keep some of the original behavior as parseComment is called in wrong
     31        context (inside a <title> for example). Added a more explicit comment about
     32        this.
     33        (WebCore::HTMLTokenizer::parseTag): Remove the handling of <!--> in quirks mode.
     34        HTML5 specifies that we should accept this in strict mode too.
     35        * html/HTMLTokenizer.h:
     36        (WebCore::HTMLTokenizer::): Added a new enum for the comment parsing state.
     37
    1382010-06-07  Mahesh Kulakrni  <mahesh.kulkarni@nokia.com>
    239
  • trunk/WebCore/html/HTMLTokenizer.cpp

    r60683 r60781  
    608608    // FIXME: Why does this code even run for comments inside <script> and <style>? This seems bogus.
    609609    checkScriptBuffer(src.length());
     610    CommentParserState commentState = CommentStartState;
    610611    while (!src.isEmpty()) {
    611612        UChar ch = *src;
    612         m_scriptCode[m_scriptCodeSize++] = ch;
    613         if (ch == '>') {
    614             bool handleBrokenComments = m_brokenComments && !(state.inScript() || state.inStyle());
    615             int endCharsCount = 1; // start off with one for the '>' character
    616             if (m_scriptCodeSize > 2 && m_scriptCode[m_scriptCodeSize-3] == '-' && m_scriptCode[m_scriptCodeSize-2] == '-') {
    617                 endCharsCount = 3;
    618             } else if (m_scriptCodeSize > 3 && m_scriptCode[m_scriptCodeSize-4] == '-' && m_scriptCode[m_scriptCodeSize-3] == '-' &&
    619                 m_scriptCode[m_scriptCodeSize-2] == '!') {
    620                 // Other browsers will accept --!> as a close comment, even though it's
    621                 // not technically valid.
    622                 endCharsCount = 4;
    623             }
    624             if (handleBrokenComments || endCharsCount > 1) {
    625                 src.advancePastNonNewline();
    626                 if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() || state.inIFrame())) {
    627                     checkScriptBuffer();
    628                     m_scriptCode[m_scriptCodeSize] = 0;
    629                     m_scriptCode[m_scriptCodeSize + 1] = 0;
    630                     m_currentToken.tagName = commentAtom;
    631                     m_currentToken.beginTag = true;
    632                     state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize - endCharsCount), state);
    633                     processToken();
    634                     m_currentToken.tagName = commentAtom;
    635                     m_currentToken.beginTag = false;
    636                     processToken();
    637                     m_scriptCodeSize = 0;
    638                 }
    639                 state.setInComment(false);
    640                 return state; // Finished parsing comment
    641             }
     613        switch (commentState) {
     614        case CommentStartState:
     615            if (ch == '>') {
     616                // FIXME: We should emit a parse error.
     617                return emitCommentToken(src, state, commentState);
     618            }
     619            if (ch == '-')
     620                commentState = CommentStartDashState;
     621            else {
     622                m_scriptCode[m_scriptCodeSize++] = ch;
     623                commentState = CommentState;
     624            }
     625            break;
     626        case CommentStartDashState:
     627            if (ch == '>') {
     628                // FIXME: We should emit a parse error.
     629                return emitCommentToken(src, state, commentState);
     630            }
     631            if (ch == '-')
     632                commentState = CommentEndState;
     633            else {
     634                m_scriptCode[m_scriptCodeSize++] = '-';
     635                m_scriptCode[m_scriptCodeSize++] = ch;
     636                commentState = CommentState;
     637            }
     638            break;
     639        case CommentState:
     640            if (ch == '-')
     641                commentState = CommentEndDashState;
     642            else
     643                m_scriptCode[m_scriptCodeSize++] = ch;
     644            break;
     645        case CommentEndDashState:
     646            if (ch == '-')
     647                commentState = CommentEndState;
     648            else {
     649                m_scriptCode[m_scriptCodeSize++] = '-';
     650                m_scriptCode[m_scriptCodeSize++] = ch;
     651                commentState = CommentState;
     652            }
     653            break;
     654        case CommentEndState:
     655            if (ch == '>')
     656                return emitCommentToken(src, state, commentState);
     657
     658            if (ch == '\t' || ch == '\n' || ch == '\f' || ch == ' ') {
     659                // FIXME: We should emit a parse error.
     660                m_scriptCode[m_scriptCodeSize++] = '-';
     661                m_scriptCode[m_scriptCodeSize++] = '-';
     662                m_scriptCode[m_scriptCodeSize++] = ch;
     663                commentState = CommentEndSpaceState;
     664            } else if (ch == '!') {
     665                // FIXME: We should emit a parse error.
     666                commentState = CommentEndBangState;
     667            } else if (ch == '-')
     668                m_scriptCode[m_scriptCodeSize++] = ch;
     669            else {
     670                // FIXME: We should emit a parse error.
     671                m_scriptCode[m_scriptCodeSize++] = '-';
     672                m_scriptCode[m_scriptCodeSize++] = '-';
     673                m_scriptCode[m_scriptCodeSize++] = ch;
     674                commentState = CommentState;
     675            }
     676            break;
     677        case CommentEndBangState:
     678            if (ch == '>')
     679                return emitCommentToken(src, state, commentState);
     680            if (ch == '-') {
     681                m_scriptCode[m_scriptCodeSize++] = '-';
     682                m_scriptCode[m_scriptCodeSize++] = '-';
     683                m_scriptCode[m_scriptCodeSize++] = '!';
     684                commentState = CommentEndState;
     685            } else {
     686                m_scriptCode[m_scriptCodeSize++] = '-';
     687                m_scriptCode[m_scriptCodeSize++] = '-';
     688                m_scriptCode[m_scriptCodeSize++] = '!';
     689                commentState = CommentState;
     690            }
     691            break;
     692        case CommentEndSpaceState:
     693            if (ch == '>')
     694                return emitCommentToken(src, state, commentState);
     695            if (ch == '\t' || ch == '\n' || ch == '\f' || ch == ' ')
     696                m_scriptCode[m_scriptCodeSize++] = ch;
     697            else if (ch == '-')
     698                commentState = CommentEndDashState;
     699            else {
     700                m_scriptCode[m_scriptCodeSize++] = ch;
     701                commentState = CommentState;
     702            }
     703            break;
    642704        }
    643705        src.advance(m_lineNumber);
    644706    }
    645 
    646     return state;
     707    ASSERT(src.isEmpty());
     708    // FIXME: We should emit a parse error.
     709    return emitCommentToken(src, state, commentState);
     710}
     711
     712HTMLTokenizer::State HTMLTokenizer::emitCommentToken(SegmentedString& src, State state, CommentParserState commentState)
     713{
     714    if (!src.isEmpty())
     715        src.advancePastNonNewline();
     716
     717    // FIXME: We should not be parsing HTML comments in these states in the first place. The else statement is trying to recover
     718    // from this broken behaviour.
     719    if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() || state.inIFrame())) {
     720        checkScriptBuffer();
     721        m_scriptCode[m_scriptCodeSize] = 0;
     722        m_scriptCode[m_scriptCodeSize + 1] = 0;
     723        m_currentToken.tagName = commentAtom;
     724        m_currentToken.beginTag = true;
     725        state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize), state);
     726        processToken();
     727        m_currentToken.tagName = commentAtom;
     728        m_currentToken.beginTag = false;
     729        processToken();
     730        m_scriptCodeSize = 0;
     731    } else {
     732        // This behaviour is needed to properly parse broken comments.
     733        if (src.isEmpty())
     734            return state;
     735
     736        // We need to properly reconstruct the original comment.
     737        // FIXME: Drop the commentState parameter from the method when this code is removed.
     738        checkScriptBuffer();
     739        if (commentState != CommentStartState) {
     740            m_scriptCode[m_scriptCodeSize++] = '-';
     741            if (commentState != CommentStartDashState)
     742                m_scriptCode[m_scriptCodeSize++] = '-';
     743        }
     744        if (commentState == CommentEndBangState)
     745            m_scriptCode[m_scriptCodeSize++] = '!';
     746
     747        m_scriptCode[m_scriptCodeSize++] = '>';
     748    }
     749
     750    state.setInComment(false);
     751    return state; // Finished parsing comment
    647752}
    648753
     
    11391244                        state.setInComment(true);
    11401245                        state.setTagState(NoTag);
    1141 
    1142                         // Fix bug 34302 at kde.bugs.org.  Go ahead and treat
    1143                         // <!--> as a valid comment, since both mozilla and IE on windows
    1144                         // can handle this case.  Only do this in quirks mode. -dwh
    1145                         if (!src.isEmpty() && *src == '>' && m_doc->inCompatMode()) {
    1146                             state.setInComment(false);
    1147                             src.advancePastNonNewline();
    1148                             if (!src.isEmpty())
    1149                                 m_cBuffer[cBufferPos++] = *src;
    1150                         } else
    1151                           state = parseComment(src, state);
    1152 
     1246                        state = parseComment(src, state);
    11531247                        m_cBufferPos = cBufferPos;
    11541248                        return state; // Finished parsing tag!
  • trunk/WebCore/html/HTMLTokenizer.h

    r60052 r60781  
    194194    void setSrc(const SegmentedString&);
    195195 
     196    // HTML5 Comment state.
     197    enum CommentParserState {
     198        CommentStartState,
     199        CommentStartDashState,
     200        CommentState,
     201        CommentEndDashState,
     202        CommentEndState,
     203        CommentEndBangState,
     204        CommentEndSpaceState
     205    };
     206
     207    State emitCommentToken(SegmentedString&, State, CommentParserState);
     208
    196209    // check if we have enough space in the buffer.
    197210    // if not enlarge it
Note: See TracChangeset for help on using the changeset viewer.