2010-10-21 James Simonsen <simonjam@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Oct 2010 05:49:12 +0000 (05:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Oct 2010 05:49:12 +0000 (05:49 +0000)
commit6cdb969f3cf2464cc7a2ddafc7a2edb3c85ab886
treeee5b3af2d3ff2de5413e038b6974b0dd5541b610
parent9b675708069d2c86e67495038c988d0790dfffc6
2010-10-21  James Simonsen  <simonjam@chromium.org>

        Reviewed by Adam Barth.

        HTMLTreeBuilder's InForeignContent code needs a re-write

        Foreign Content mode was changed significantly by:
        http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314

        The differences can be seen here:
        http://html5.org/tools/web-apps-tracker?from=5520&to=5522

        This bug addresses all spec changes in the diff except the select scope
        changes, which have already been fixed in a separate bug.

        https://bugs.webkit.org/show_bug.cgi?id=46676

        * html5lib/resources/webkit01.dat: Added the demo case for the new code. Added a case that exposes crash when not using hasTagName().
        * html5lib/runner-expected.txt: Since the behavior of InForeignContentMode has changed, the expectations need to be updated. These have been manually verified.
        * platform/chromium/html5lib/runner-expected.txt: Ditto.
        * platform/win/html5lib/runner-expected.txt: Ditto.
2010-10-21  James Simonsen  <simonjam@chromium.org>

        Reviewed by Adam Barth.

        HTMLTreeBuilder's InForeignContent code needs a re-write

        Foreign Content mode was changed significantly by:
        http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314

        The differences can be seen here:
        http://html5.org/tools/web-apps-tracker?from=5520&to=5522

        This bug addresses all spec changes in the diff except the select scope
        changes, which have already been fixed in a separate bug.

        https://bugs.webkit.org/show_bug.cgi?id=46676

        * html/parser/HTMLElementStack.cpp:
        (WebCore::HTMLNames::isScopeMarker): Add foreign elements to list.
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
        (WebCore::HTMLTreeBuilder::processDoctypeToken): Switch mode before reprocessing any tokens.
        (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto. Remove secondary insertion mode.
        (WebCore::HTMLTreeBuilder::processStartTagForInTable): Switch mode before reprocessing any tokens.
        (WebCore::HTMLTreeBuilder::processStartTag): Ditto. Remove secondary insertion mode.
        (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately): Remove foreign var. Use hasTagName() instead of == localName() to fix bug with foreign elements.
        (WebCore::HTMLTreeBuilder::processEndTagForInTableBody): Switch mode before reprocessing any tokens.
        (WebCore::HTMLTreeBuilder::processEndTagForInRow): Ditto.
        (WebCore::HTMLTreeBuilder::processEndTagForInCell): Ditto.
        (WebCore::HTMLTreeBuilder::processEndTagForInBody): Ditto.
        (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
        (WebCore::HTMLTreeBuilder::prepareToReprocessToken): Added.
        (WebCore::HTMLTreeBuilder::reprocessStartTag): Added.
        (WebCore::HTMLTreeBuilder::reprocessEndTag): Added.
        (WebCore::HTMLTreeBuilder::processForeignContentUsingInBodyModeAndResetMode): Added.
        (WebCore::HTMLTreeBuilder::resetForeignInsertionMode): Added.
        (WebCore::HTMLTreeBuilder::processComment): Switch mode before reprocessing any tokens.
        (WebCore::HTMLTreeBuilder::processCharacterBuffer): Ditto.
        (WebCore::HTMLTreeBuilder::processEndOfFile): Ditto.
        * html/parser/HTMLTreeBuilder.h: Functions and member for tracking potential switch from InForeignContentMode.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/html5lib/resources/webkit01.dat
LayoutTests/html5lib/runner-expected.txt
LayoutTests/platform/chromium/html5lib/runner-expected.txt
LayoutTests/platform/win/html5lib/runner-expected.txt
WebCore/ChangeLog
WebCore/html/parser/HTMLElementStack.cpp
WebCore/html/parser/HTMLTreeBuilder.cpp
WebCore/html/parser/HTMLTreeBuilder.h