Reviewed by Adele.
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Oct 2006 21:57:14 +0000 (21:57 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Oct 2006 21:57:14 +0000 (21:57 +0000)
commit041d814d1afbccabf69692ad583f846e16c7faf2
tree2f945821e7c593fd7bd31fa057ff6da0fdef97ee
parent1f2cb4c877d93a55f6529aa2f1ae556f896ca509
    Reviewed by Adele.

        Improve popup menu behavior.

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::HTMLSelectElement): Cache
        m_lastOnChangeIndex so we know when to fire onChange.
        (WebCore::HTMLSelectElement::setSelectedIndex): Added parameter to
        specify whether we should fire onChange.
        (WebCore::HTMLSelectElement::dispatchBlurEvent): Fire onChange on blur.
        (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Fire
        onChange when using the Enter key to change the selection.
        * html/HTMLSelectElement.h:
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::updateFromElement): Extract setText logic
        into its own method.
        (WebCore::RenderMenuList::setTextFromOption): New method.
        (WebCore::RenderMenuList::valueChanged): Let setSelectedIndex call
        onChange instead of calling it directly here.
        * rendering/RenderMenuList.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLSelectElement.h
WebCore/rendering/RenderMenuList.cpp
WebCore/rendering/RenderMenuList.h