Commit 02558203 authored by adele's avatar adele

Reviewed by Geoff.

        Make code for turning off new listbox implementation mac-only, since there's no implementation on other platforms.

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::recalcStyle):
        (WebCore::HTMLSelectElement::isKeyboardFocusable):
        (WebCore::HTMLSelectElement::isMouseFocusable):
        (WebCore::HTMLSelectElement::createRenderer):
        (WebCore::HTMLSelectElement::setRecalcListItems):
        (WebCore::HTMLSelectElement::notifyOptionSelected):
        (WebCore::HTMLSelectElement::defaultEventHandler):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fd19bb38
2006-10-03 Adele Peterson <adele@apple.com>
Reviewed by Geoff.
Make code for turning off new listbox implementation mac-only, since there's no implementation on other platforms.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::recalcStyle):
(WebCore::HTMLSelectElement::isKeyboardFocusable):
(WebCore::HTMLSelectElement::isMouseFocusable):
(WebCore::HTMLSelectElement::createRenderer):
(WebCore::HTMLSelectElement::setRecalcListItems):
(WebCore::HTMLSelectElement::notifyOptionSelected):
(WebCore::HTMLSelectElement::defaultEventHandler):
2006-10-04 Darin Adler <darin@apple.com>
Reviewed by Geoff.
......@@ -92,7 +92,7 @@ void HTMLSelectElement::recalcStyle( StyleChange ch )
if (hasChangedChild() && renderer()) {
if (usesMenuList())
static_cast<RenderMenuList*>(renderer())->setOptionsChanged(true);
else if (renderer() && renderer()->style()->appearance() == ListboxAppearance)
else if (renderer() && renderer()->isListBox())
static_cast<RenderListBox*>(renderer())->setOptionsChanged(true);
else
static_cast<DeprecatedRenderSelect*>(renderer())->setOptionsChanged(true);
......@@ -325,14 +325,14 @@ void HTMLSelectElement::parseMappedAttribute(MappedAttribute *attr)
bool HTMLSelectElement::isKeyboardFocusable() const
{
if (renderer() && (usesMenuList() || renderer()->style()->appearance() == ListboxAppearance))
if (renderer() && (usesMenuList() || renderer()->isListBox()))
return isFocusable();
return HTMLGenericFormElement::isKeyboardFocusable();
}
bool HTMLSelectElement::isMouseFocusable() const
{
if (renderer() && (usesMenuList() || renderer()->style()->appearance() == ListboxAppearance))
if (renderer() && (usesMenuList() || renderer()->isListBox()))
return isFocusable();
return HTMLGenericFormElement::isMouseFocusable();
}
......@@ -341,9 +341,13 @@ RenderObject *HTMLSelectElement::createRenderer(RenderArena *arena, RenderStyle
{
if (usesMenuList())
return new (arena) RenderMenuList(this);
#if PLATFORM(MAC)
// FIXME: Remove this when DeprecatedRenderSelect is no longer needed.
if (style->appearance() == ListboxAppearance)
return new (arena) RenderListBox(this);
return new (arena) DeprecatedRenderSelect(this);
#endif
return new (arena) RenderListBox(this);
}
bool HTMLSelectElement::appendFormData(FormDataList& list, bool)
......@@ -462,7 +466,7 @@ void HTMLSelectElement::setRecalcListItems()
if (renderer()) {
if (usesMenuList())
static_cast<RenderMenuList*>(renderer())->setOptionsChanged(true);
else if (renderer() && renderer()->style()->appearance() == ListboxAppearance)
else if (renderer() && renderer()->isListBox())
static_cast<RenderListBox*>(renderer())->setOptionsChanged(true);
else
static_cast<DeprecatedRenderSelect*>(renderer())->setOptionsChanged(true);
......@@ -499,7 +503,7 @@ void HTMLSelectElement::notifyOptionSelected(HTMLOptionElement *selectedOption,
deselectItems(selectedOption);
if (renderer() && !usesMenuList()) {
if (renderer()->style()->appearance() == ListboxAppearance)
if (renderer()->isListBox())
static_cast<RenderListBox*>(renderer())->setSelectionChanged(true);
else
static_cast<DeprecatedRenderSelect*>(renderer())->setSelectionChanged(true);
......@@ -512,7 +516,7 @@ void HTMLSelectElement::defaultEventHandler(Event* evt)
{
if (usesMenuList())
menuListDefaultEventHandler(evt);
else if (renderer() && renderer()->isListBox() && renderer()->style()->appearance() == ListboxAppearance)
else if (renderer() && renderer()->isListBox() && renderer()->isListBox())
listBoxDefaultEventHandler(evt);
HTMLGenericFormElement::defaultEventHandler(evt);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment