2010-09-08  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

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

        Previously, TextDocument reinvented the wheel to parse text.  This
        patch replaces TextDocument's hand-rolled parser with a parser built on
        the HTML parser infrustructure, which gives us that stuff for free.  I
        also disentangled TextDocument from HTMLViewSourceDocument.

        In a future patch, I'll move TextDocument out of the "loader" directory.

        * Android.mk:
        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLViewSourceDocument.cpp:
        (WebCore::HTMLViewSourceDocument::createParser):
        * html/HTMLViewSourceDocument.h:
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::constructTreeFromToken):
        (WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken):
        * html/parser/HTMLTreeBuilder.h:
        * html/parser/HTMLViewSourceParser.cpp:
        (WebCore::HTMLViewSourceParser::forcePlaintext):
        * html/parser/HTMLViewSourceParser.h:
        * html/parser/TextDocumentParser.cpp: Added.
        (WebCore::TextDocumentParser::TextDocumentParser):
        (WebCore::TextDocumentParser::~TextDocumentParser):
        (WebCore::TextDocumentParser::insertFakePreElement):
        * html/parser/TextDocumentParser.h: Added.
        (WebCore::TextDocumentParser::create):
        * loader/TextDocument.cpp:
        * loader/TextDocument.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 1abaac3..4c263ae 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -751,6 +751,7 @@
     html/parser/HTMLTokenizer.cpp \
     html/parser/HTMLTreeBuilder.cpp \
     html/parser/HTMLViewSourceParser.cpp \
+    html/parser/TextDocumentParser.cpp \
     inspector/ConsoleMessage.cpp \
     inspector/InjectedScript.cpp \
     inspector/InjectedScriptHost.cpp \