Changeset 62233 in webkit


Ignore:
Timestamp:
Jul 1, 2010 12:39:52 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-07-01 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

BogusCommentState should come in from the cold
https://bugs.webkit.org/show_bug.cgi?id=41439

Test progression => :)

  • html5lib/runner-expected.txt:
  • html5lib/webkit-resumer-expected.txt:

2010-07-01 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

BogusCommentState should come in from the cold
https://bugs.webkit.org/show_bug.cgi?id=41439

The BogusCommentState has always been wrong. The proximate issue is
that it didn't handle resuming correctly when parsing a partial input
stream. Now that we have EOF working properly, we can actually
implement this state correctly.

We need to distinguish when we enter this state from when we continue
in this state. We could do that with a branch for each character, but
it seemed easier to split the state in two, even though that leaves us
with one more state in our tokenizer than we have in the HTML5 spec.

  • html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::nextToken):
  • html/HTMLTokenizer.h: (WebCore::HTMLTokenizer::):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62232 r62233  
     12010-07-01  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        BogusCommentState should come in from the cold
     6        https://bugs.webkit.org/show_bug.cgi?id=41439
     7
     8        Test progression => :)
     9
     10        * html5lib/runner-expected.txt:
     11        * html5lib/webkit-resumer-expected.txt:
     12
    1132010-07-01  Eric Seidel  <eric@webkit.org>
    214
  • trunk/LayoutTests/html5lib/runner-expected.txt

    r62232 r62233  
    101033
    111134
    12 41
    131250
    141351
  • trunk/LayoutTests/html5lib/webkit-resumer-expected.txt

    r61956 r62233  
    158158CONSOLE MESSAGE: line 2: FOO<span>BAR</span>BAZ
    159159resources/webkit01.dat:
    160 519.3
    161 520.4
    162 521.5
    163 522.6
    164 523.7
    165160593.1
    166161594.2
  • trunk/WebCore/ChangeLog

    r62229 r62233  
     12010-07-01  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        BogusCommentState should come in from the cold
     6        https://bugs.webkit.org/show_bug.cgi?id=41439
     7
     8        The BogusCommentState has always been wrong.  The proximate issue is
     9        that it didn't handle resuming correctly when parsing a partial input
     10        stream.  Now that we have EOF working properly, we can actually
     11        implement this state correctly.
     12
     13        We need to distinguish when we enter this state from when we continue
     14        in this state.  We could do that with a branch for each character, but
     15        it seemed easier to split the state in two, even though that leaves us
     16        with one more state in our tokenizer than we have in the HTML5 spec.
     17
     18        * html/HTMLTokenizer.cpp:
     19        (WebCore::HTMLTokenizer::nextToken):
     20        * html/HTMLTokenizer.h:
     21        (WebCore::HTMLTokenizer::):
     22
    1232010-06-30  Adam Barth  <abarth@webkit.org>
    224
  • trunk/WebCore/html/HTMLTokenizer.cpp

    r62229 r62233  
    10581058
    10591059    BEGIN_STATE(BogusCommentState) {
    1060         // FIXME: This state isn't correct because we'll terminate the
    1061         // comment early if we don't have the whole input stream available.
    10621060        m_token->beginComment();
    1063         while (!source.isEmpty()) {
    1064             cc = m_inputStreamPreprocessor.nextInputCharacter();
    1065             if (cc == '>')
    1066                 return emitAndResumeIn(source, DataState);
     1061        RECONSUME_IN(ContinueBogusCommentState);
     1062    }
     1063    END_STATE()
     1064
     1065    BEGIN_STATE(ContinueBogusCommentState) {
     1066        if (cc == '>')
     1067            return emitAndResumeIn(source, DataState);
     1068        else if (cc == InputStreamPreprocessor::endOfFileMarker)
     1069            return emitAndReconsumeIn(source, DataState);
     1070        else {
    10671071            m_token->appendToComment(cc);
    1068             m_inputStreamPreprocessor.advance(source, m_lineNumber);
    1069             // We ignore the return value (which indicates that |source| is
    1070             // empty) because it's checked by the loop condition above.
    1071         }
    1072         m_state = DataState;
    1073         return true;
    1074         // FIXME: Handle EOF properly.
     1072            ADVANCE_TO(ContinueBogusCommentState);
     1073        }
    10751074    }
    10761075    END_STATE()
  • trunk/WebCore/html/HTMLTokenizer.h

    r62175 r62233  
    8484        SelfClosingStartTagState,
    8585        BogusCommentState,
     86        // The ContinueBogusCommentState is not in the HTML5 spec, but we use
     87        // it internally to keep track of whether we've started the bogus
     88        // comment token yet.
     89        ContinueBogusCommentState,
    8690        MarkupDeclarationOpenState,
    8791        CommentStartState,
Note: See TracChangeset for help on using the changeset viewer.