LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2006 23:32:34 +0000 (23:32 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Jul 2006 23:32:34 +0000 (23:32 +0000)
commitbc3b6c7549cdfc5a24255b3664122e465100d410
tree673d22fc5ea66c99b9c9604acada182b0ac4f49d
parent1b98fc388a17ebe6117150240b273e6cda9c2efc
LayoutTests:

        Reviewed by Hyatt.

        Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
        REGRESSION: Can't dynamically change list box to popup

        * fast/forms/select-change-listbox-to-popup-expected.checksum: Added.
        * fast/forms/select-change-listbox-to-popup-expected.png: Added.
        * fast/forms/select-change-listbox-to-popup-expected.txt: Added.
        * fast/forms/select-change-listbox-to-popup.html: Added.
        * fast/forms/select-change-popup-to-listbox.html:

WebCore:

        Reviewed by Hyatt.

        - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
        REGRESSION: Can't dynamically change list box to popup

        and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
        REGRESSION: Can't dynamically change popup to list box

        The original fix for 9859 was in the renderer, and I think we can catch the change
        earlier in the element to detach and reattach.

        I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect

        Test: fast/forms/select-change-listbox-to-popup.html

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
        and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
        when we attach.
        (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
        (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
        (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
        (WebCore::HTMLSelectElement::createRenderer): ditto.
        (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
        (WebCore::HTMLSelectElement::reset): ditto.
        (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
        (WebCore::HTMLSelectElement::defaultEventHandler): ditto.

        * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
        This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
        to determine whether or not to use the new menu list implementation.

        * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
        * rendering/DeprecatedRenderSelect.cpp:
        (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
        (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
        (WebCore::DeprecatedRenderSelect::updateFromElement):
        (WebCore::DeprecatedRenderSelect::baselinePosition):
        (WebCore::DeprecatedRenderSelect::layout):
        (WebCore::DeprecatedRenderSelect::updateSelection):

        * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
        Backed out previous fix since this is now done in HTMLSelectElement.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/select-change-listbox-to-popup-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/select-change-listbox-to-popup-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/select-change-listbox-to-popup-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/select-change-listbox-to-popup.html [new file with mode: 0644]
LayoutTests/fast/forms/select-change-popup-to-listbox.html
WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLSelectElement.h
WebCore/rendering/DeprecatedRenderSelect.cpp
WebCore/rendering/DeprecatedRenderSelect.h
WebCore/rendering/RenderMenuList.cpp