WebCore:
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Sep 2007 23:53:32 +0000 (23:53 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Sep 2007 23:53:32 +0000 (23:53 +0000)
commit1ab6f1f2815e4160809930f15ba68d73c8d06718
treefa33384b72bc9463657e2cb6c825ebd191a09a51
parent6688c48675230abd52a3a1a2d02a0ce72df176c7
WebCore:

        Reviewed by Hyatt.

        Fix for <rdar://problem/5464998> REGRESSION (9A543): Using Sort
        options takes you back to search screen on zappos.com

        The current mechanism for preserving form elements across removes
        did not work in the case where the input was moved by the parser to
        be out of scope of the form. This fixes that problem by having the
        parser keep track of the preserve boolean rather than the current
        form element.

        * dom/Tokenizer.h:
        (WebCore::Tokenizer::isHTMLTokenizer): New function.
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::HTMLFormElement): Get rid of
        m_preserveAcrossRemove.
        * html/HTMLFormElement.h:
        (WebCore::HTMLFormElement::isMalformed): Get rid of
        m_preserveAcrossRemove.
        * html/HTMLGenericFormElement.cpp:
        (WebCore::HTMLGenericFormElement::removedFromTree): Ask the parser
        if it is currently handling residual style rather than asking the
        form if it wants to preserveAcrossRemove.
        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::HTMLParser): New boolean to initialize.
        (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): Set
        m_handlingResidualStyleAcrossBlocks to true at the beginning and
        false at the end.
        * html/HTMLParser.h:
        (WebCore::HTMLParser::isHandlingResidualStyleAcrossBlocks):
        * html/HTMLTokenizer.h:
        (WebCore::HTMLTokenizer::isHTMLTokenizer):
        (WebCore::HTMLTokenizer::htmlParser):

LayoutTests:

        Reviewed by Hyatt.

        Test for <rdar://problem/5464998> REGRESSION (9A543): Using Sort
        options takes you back to search screen on zappos.com

        * fast/forms/preserveFormDuringResidualStyle.html: Added.
        * platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.checksum: Added.
        * platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.png: Added.
        * platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/preserveFormDuringResidualStyle.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Tokenizer.h
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLParser.cpp
WebCore/html/HTMLParser.h
WebCore/html/HTMLTokenizer.h