We don't pass all of the html5lib unsafe-text.dat tests
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Dec 2011 18:35:43 +0000 (18:35 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Dec 2011 18:35:43 +0000 (18:35 +0000)
commit00baecd93357348239ed74b5baef980266d2cf72
tree3048a154de36a91513a2a1640ff0535bae480e29
parent464e9fc86381805845c29748dea3bcb471e23939
We don't pass all of the html5lib unsafe-text.dat tests
https://bugs.webkit.org/show_bug.cgi?id=74825

Reviewed by Eric Seidel.

Source/WebCore:

This patch is actually three (tiny) related patches.  Together these
changes cause use to pass the plain-text-unsafe.dat tests from html5lib.

Tests: html5lib/runner.html

* html/parser/HTMLTokenizer.cpp:
(WebCore::::shouldSkipNullCharacters):
    - We're not supposed to skip null characters in the PLAINTEXTState.
      This might cause compatibility problems with text/plain documents
      that contains NUL characters because we use the PLAINTEXTState
      to parse them.  If we run into any trouble, it's easy to fix in
      TextDocumentParser.
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::constructTreeFromToken):
    - Fix typo.
(WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken):
    - We're supposed to replace NUL characters if the next character
      token if we're in foreign content.  The previous check didn't
      quite get this case correctly.
(WebCore::HTMLTreeBuilder::processTokenInForeignContent):
    - Now that we replace NUL characters with the replacement
      character, we need to be more careful about the fact that
      replacement characters don't flip m_framesetOk to false.  Note:
      This new check matches the check for non-foreign content.

LayoutTests:

Show test progression.

* html5lib/runner-expected.txt:
* platform/chromium/html5lib/runner-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/html5lib/runner-expected.txt
LayoutTests/platform/chromium/html5lib/runner-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLTokenizer.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp