Reviewed by Geoff.
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2006 18:55:19 +0000 (18:55 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2006 18:55:19 +0000 (18:55 +0000)
        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: https://svn.webkit.org/repository/webkit/trunk@16739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp

index 80532e334638f9ac05aa5444f1d1ef6a5aa962aa..ccd790170e66e4ee18483a906340c0aa6f61c8a7 100644 (file)
@@ -1,3 +1,18 @@
+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.
index 146445413b8b43cae4bc1c953c369399a4d331f3..bf571bb1cb36f008840b11ec6a3a59c05d9de40e 100644 (file)
@@ -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);
 }