2010-08-12 Adam Barth <abarth@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Aug 2010 03:18:16 +0000 (03:18 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Aug 2010 03:18:16 +0000 (03:18 +0000)
commit230040f3987adf7a71d16e7e6047f5ddc1984486
tree5b6b679f05cd583a4a65d1c59d57faf684119163
parent9a63162240e1dcfd2cbb7f82025aa8dcae0cd4fc
2010-08-12  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Add support for MathML entities
        https://bugs.webkit.org/show_bug.cgi?id=43949

        Test progression for proper entity support.

        * html5lib/runner-expected-html5.txt:
        * html5lib/runner-expected.txt:
2010-08-09  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Add support for MathML entities
        https://bugs.webkit.org/show_bug.cgi?id=43949

        Implementing the HTML5 entity parsing algorithm require refactoring how
        we search for entity names.  Instead of using a perfect hash, we now
        use a sorted list.  As we advance through the input, we walk down a
        binary search of the table looking for an entity.

        Using this data structure lets us keep track of whether the current
        string is a prefix of an existing entity, which we need for the
        algorithm.  In a future patch, I plan to add some indices to the
        table, which should let us narrow down the range of interesting entries
        more quickly.

        The one nasty piece of the algorithm is if we walk too far down the
        input and we need to back up to a previous match.  In this patch, we
        accomplish this by rewinding the input and consuming a known number of
        characters to resync the source.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLEntityParser.cpp:
        (WebCore::consumeHTMLEntity):
        * html/HTMLEntitySearch.cpp: Added.
        (WebCore::):
        (WebCore::HTMLEntitySearch::HTMLEntitySearch):
        (WebCore::HTMLEntitySearch::compare):
        (WebCore::HTMLEntitySearch::findStart):
        (WebCore::HTMLEntitySearch::findEnd):
        (WebCore::HTMLEntitySearch::advance):
        * html/HTMLEntitySearch.h: Added.
        (WebCore::HTMLEntitySearch::isEntityPrefix):
        (WebCore::HTMLEntitySearch::currentValue):
        (WebCore::HTMLEntitySearch::lastMatch):
        (WebCore::HTMLEntitySearch::):
        (WebCore::HTMLEntitySearch::fail):
        * html/HTMLEntityTable.h: Added.
        (WebCore::HTMLEntityTableEntry::lastCharacter):
2010-08-12  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Add support for MathML entities
        https://bugs.webkit.org/show_bug.cgi?id=43949

        A script for generating the C++ state data structure describing all the
        entities from a JSON description.

        * Scripts/create-html-entity-table: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/html5lib/runner-expected-html5.txt
LayoutTests/html5lib/runner-expected.txt
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/GNUmakefile.am
WebCore/WebCore.gyp/WebCore.gyp
WebCore/WebCore.gypi
WebCore/WebCore.pri
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/html/HTMLEntityNames.gperf [deleted file]
WebCore/html/HTMLEntityParser.cpp
WebCore/html/HTMLEntitySearch.cpp [new file with mode: 0644]
WebCore/html/HTMLEntitySearch.h [new file with mode: 0644]
WebCore/html/HTMLEntityTable.h [new file with mode: 0644]
WebCore/make-hash-tools.pl
WebKitTools/ChangeLog
WebKitTools/Scripts/create-html-entity-table [new file with mode: 0755]