LayoutTests:
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2007 11:53:55 +0000 (11:53 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2007 11:53:55 +0000 (11:53 +0000)
commit440730cf492f9d0af96bd8552e812a86650c9722
tree830f0bcc4ffc7306dad796977e52c986ed19d49c
parent883d99446b149d41139ab20555cef39ca62eda5a
LayoutTests:

        Reviewed by Adele.

        Test for http://bugs.webkit.org/show_bug.cgi?id=12595
        REGRESSION: Can't add item to cart at lnt.com (JS type error)
        <rdar://problem/4722863>

        Expanded version of Darin's test case.

        * fast/forms/old-names-expected.txt: Added.
        * fast/forms/old-names.html: Added.

WebCore:

        Reviewed by Adele.

        Fix http://bugs.webkit.org/show_bug.cgi?id=12595
        REGRESSION: Can't add item to cart at lnt.com (JS type error)
        <rdar://problem/4722863>

        Emulate Firefox behavior where form elements accessed by a name
        can be accessed with that name later even if the name changes or
        even if element is removed from the document.

        This is loosely based on Darin's earlier patch for the same problem but
        is much less expansive. It takes somewhat different approach to more closely
        mimic Firefox behavior. Includes expanded test case.

        * bindings/js/JSHTMLFormElementCustom.cpp:
        (WebCore::JSHTMLFormElement::canGetItemsForName):
            Use new the HTMLFormElement::getNamedElements() method
        (WebCore::JSHTMLFormElement::nameGetter):
            Use new the HTMLFormElement::getNamedElements() method
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::HTMLFormElement):
        (WebCore::HTMLFormElement::~HTMLFormElement):
        (WebCore::HTMLFormElement::elementForAlias):
        (WebCore::HTMLFormElement::addElementAlias):
            Maintain a map of known element aliases
        (WebCore::HTMLFormElement::getNamedElements):
            Get a list of elements matching the name, based both their
            current names and known aliases (earlier names).
            Keep the alias list in sync.
        * html/HTMLFormElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/old-names-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/old-names.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/JSHTMLFormElementCustom.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h