Skip to content
  • antti's avatar
    LayoutTests: · 8a2eb6b0
    antti authored
            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: http://svn.webkit.org/repository/webkit/trunk@20260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8a2eb6b0