-
eric@webkit.org authored
Reviewed by Eric Seidel. Teach HTML5 parser how to lex comments correctly https://bugs.webkit.org/show_bug.cgi?id=39537 Added a new data file for testing comment parsing. There are some more things we can test here once we implement the bogus comment state. * html5lib/resources/comments01.dat: Added. * html5lib/webkit-runner-expected.txt: - Some of these tests fail in our current parser because our current parser doesn't comply with HTML5. I've set these expectations to failing so the tests will "pass" in the current parser. I've double-checked the results in comments01.dat with a nightly build of Firefox to make sure we agree on our implementation of the spec. * html5lib/webkit-runner.html: 2010-05-23 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Teach HTML5 parser how to lex comments correctly https://bugs.webkit.org/show_bug.cgi?id=39537 Implement the non-bogus comment states for the lexer. There's more work to do in some of these states (e.g., to handle doctype tokens and bogus comments), but I'm trying to keep the patches small. Tests: comments01.dat * html/HTML5Lexer.cpp: (WebCore::HTML5Lexer::nextToken): * html/HTML5Lexer.h: * html/HTML5Token.h: (WebCore::HTML5Token::beginComment): (WebCore::HTML5Token::appendToComment): (WebCore::HTML5Token::data): * html/HTML5Tokenizer.cpp: (WebCore::convertToOldStyle): * platform/text/SegmentedString.h: (WebCore::SegmentedString::): (WebCore::SegmentedString::peek): - Occationally, the HTML5 parsing algorithm looks ahead in the input stream. The implementation here is incomplete, but its enough to run the current HTML5 parsing tests. I'll eventually need to implement the slow case here. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1b4078bd