Reviewed by Adele.
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2006 18:19:57 +0000 (18:19 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2006 18:19:57 +0000 (18:19 +0000)
commit3718edfe0cce781d9deb024fb579f40ae3a075c6
tree71d85e2895780bc270e58050331ab2f2eeb9c649
parentc8907d6dc3e3f0176a8918d94860e73a39c4adfe
    Reviewed by Adele.

        Fix: <rdar://problem/3951815> add "type-to-select" feature for list
        boxes (<select> elements)

        This also adds type-ahead find for closed menulists (popups).

        * WebCore.xcodeproj/project.pbxproj: Version wars.
        * html/HTMLSelectElement.h: Add new instance variables for type-ahead
        find.
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::HTMLSelectElement): Initialize new
        instance variables.
        (WebCore::HTMLSelectElement::defaultEventHandler): Perform type-ahead
        find on printable character presses.
        (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Remove
        redundant check that the listIndex has changed (setSelectedIndex does
        this for us), and fix indentation.
        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Change an if
        to an else-if.
        (WebCore::stripLeadingWhiteSpace): Helper function for typeAheadFind()
        to strip leading whitespace (including non-breaking spaces) from a
        string.
        (WebCore::HTMLSelectElement::typeAheadFind): New method to perform
        type-ahead find.
        * platform/PopupMenu.h: Added new updateFromElement() method to be
        called from RenderMenuList::updateFromElement().
        * platform/mac/PopupMenuMac.mm:
        (WebCore::PopupMenu::updateFromElement): While we are using
        NSPopUpButtonCell for our popups, this method can stay empty.
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::updateFromElement): Scroll to reveal the first
        selected element.
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::updateFromElement): Tell the popup to update
        if it's visible.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLSelectElement.h
WebCore/platform/PopupMenu.h
WebCore/platform/mac/PopupMenuMac.mm
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderMenuList.cpp