Show
Ignore:
Timestamp:
03/13/07 07:19:32 (22 months ago)
Author:
darin
Message:

LayoutTests:

Reviewed by Adele.

  • fast/forms/old-names-expected.txt: Added.
  • fast/forms/old-names.html: Added.
  • check in files that were somehow left out in the last check-in
  • fast/js/resources/js-test-pre.js: Improve the format of the failure message when both the real results and expected results are strings.
  • fast/dom/wrapper-classes-expected.txt: Changed back to use the new format.

WebCore:

Reviewed by Adele.

Test: fast/forms/old-names.html

  • bindings/js/JSHTMLFormElementCustom.cpp: (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has nothing for a given name, try the form's oldNamedElement function. (WebCore::JSHTMLFormElement::nameGetter): Ditto.
  • bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use a class derived from NodeList.
  • bindings/js/kjs_dom.cpp: Ditto.
  • bindings/js/kjs_html.cpp: (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived from NodeList to be used for the named items result from a collection -- uses a vector of node pointers. (KJS::VectorNodeList::length): Added. (KJS::VectorNodeList::item): Added. (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
  • dom/ChildNodeList.h:
  • dom/ChildNodeList.cpp: (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList, since NodeList is now a simpler class. (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
  • dom/NameNodeList.h:
  • dom/NameNodeList.cpp: (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList, since NodeList is now a simpler class. (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and parameter change.
  • dom/Node.h: Change register/unregister functions to take TreeNodeList.
  • dom/Node.cpp: (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList, since NodeList is now a simpler abstract class. (WebCore::TagNodeList::elementMatches): Updated for name and parameter change. (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList. (WebCore::Node::unregisterNodeList): Ditto.
  • dom/NodeList.h: Broke NodeList into a simpler base class and a derived class with the machinery for iterating a tree, called TreeNodeList.
  • dom/NodeList.cpp: (WebCore::NodeList::~NodeList): Added. (WebCore::NodeList::itemWithName): Factored out of the old itemWithName. (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList. (WebCore::TreeNodeList::~TreeNodeList): Ditto. (WebCore::TreeNodeList::recursiveLength): Ditto. (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto. (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto. (WebCore::TreeNodeList::recursiveItem): Ditto. (WebCore::TreeNodeList::itemWithName): Factored half of this into this function, the other half in NodeList::itemWithName. (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline. (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
  • html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement fucntions, and a map called m_oldNames. Also removed m_boundary, which I thought I had already done.
  • html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0. Switched the rest of the members to initialization syntax. (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames. (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference to one element under each of its old names. (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element that once had a given name.
  • html/HTMLGenericFormElement.h:
  • html/HTMLGenericFormElement.cpp: (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name attribute changes, tell the form about the old name. (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form about an element, also store away the old name so that we can use it when the name changes later.
  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the base class in the nameAttr case, so the code in HTMLGenericFormElement above will get called in the input element case.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/dom/Node.h

    r20028 r20148  
    5555class RenderStyle; 
    5656class TextStream; 
     57class TreeNodeList; 
    5758 
    5859typedef int ExceptionCode; 
     
    440441#endif 
    441442 
    442     void registerNodeList(NodeList*); 
    443     void unregisterNodeList(NodeList*); 
     443    void registerNodeList(TreeNodeList*); 
     444    void unregisterNodeList(TreeNodeList*); 
    444445    void notifyNodeListsChildrenChanged(); 
    445446    void notifyLocalNodeListsChildrenChanged(); 
     
    457458 
    458459protected: 
    459     typedef HashSet<NodeList*> NodeListSet; 
     460    typedef HashSet<TreeNodeList*> NodeListSet; 
    460461    NodeListSet* m_nodeLists; 
    461462