2008-10-17 David Hyatt <hyatt@apple.com>
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2008 22:02:16 +0000 (22:02 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2008 22:02:16 +0000 (22:02 +0000)
        Eliminate the EAppearance enum in favor of the new ControlPart enum.  Cut out the scrollbar
        values from the enum since they are handled by ScrollbarTheme instead.

        Reviewed by Tim Hatcher

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator ControlPart):
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::adjustRenderStyle):
        * css/CSSValueKeywords.in:
        * platform/gtk/RenderThemeGtk.cpp:
        (WebCore::supportsFocus):
        (WebCore::RenderThemeGtk::baselinePosition):
        (WebCore::setToggleSize):
        (WebCore::RenderThemeGtk::setCheckboxSize):
        (WebCore::RenderThemeGtk::setRadioSize):
        (WebCore::RenderThemeGtk::adjustButtonStyle):
        * platform/qt/RenderThemeQt.cpp:
        (WebCore::RenderThemeQt::baselinePosition):
        (WebCore::RenderThemeQt::controlSupportsTints):
        (WebCore::RenderThemeQt::adjustRepaintRect):
        (WebCore::RenderThemeQt::isControlStyled):
        (WebCore::computeSizeBasedOnStyle):
        (WebCore::RenderThemeQt::paintButton):
        (WebCore::RenderThemeQt::paintTextField):
        (WebCore::RenderThemeQt::paintMenuList):
        (WebCore::RenderThemeQt::supportsFocus):
        (WebCore::RenderThemeQt::applyTheme):
        (WebCore::RenderThemeQt::adjustSliderThumbSize):
        * platform/qt/RenderThemeQt.h:
        * rendering/RenderSlider.cpp:
        (WebCore::RenderSlider::createThumbStyle):
        (WebCore::RenderSlider::layout):
        (WebCore::RenderSlider::setValueForPosition):
        (WebCore::RenderSlider::setPositionFromValue):
        (WebCore::RenderSlider::positionForOffset):
        (WebCore::RenderSlider::currentPosition):
        (WebCore::RenderSlider::setCurrentPosition):
        (WebCore::RenderSlider::trackSize):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        (WebCore::RenderTheme::paint):
        (WebCore::RenderTheme::paintBorderOnly):
        (WebCore::RenderTheme::paintDecorations):
        (WebCore::RenderTheme::isControlContainer):
        (WebCore::RenderTheme::isControlStyled):
        (WebCore::RenderTheme::supportsFocusRing):
        (WebCore::RenderTheme::isDefault):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::isControlStyled):
        (WebCore::RenderThemeMac::adjustRepaintRect):
        (WebCore::RenderThemeMac::baselinePosition):
        (WebCore::RenderThemeMac::controlSupportsTints):
        (WebCore::RenderThemeMac::adjustButtonStyle):
        (WebCore::RenderThemeMac::setButtonCellState):
        (WebCore::RenderThemeMac::popupInternalPaddingLeft):
        (WebCore::RenderThemeMac::popupInternalPaddingRight):
        (WebCore::RenderThemeMac::popupInternalPaddingTop):
        (WebCore::RenderThemeMac::popupInternalPaddingBottom):
        (WebCore::RenderThemeMac::paintSliderTrack):
        (WebCore::RenderThemeMac::paintSliderThumb):
        (WebCore::RenderThemeMac::adjustSliderThumbSize):
        * rendering/RenderThemeSafari.cpp:
        (WebCore::RenderThemeSafari::isControlStyled):
        (WebCore::RenderThemeSafari::adjustRepaintRect):
        (WebCore::RenderThemeSafari::baselinePosition):
        (WebCore::RenderThemeSafari::controlSupportsTints):
        (WebCore::RenderThemeSafari::adjustButtonStyle):
        (WebCore::RenderThemeSafari::popupInternalPaddingLeft):
        (WebCore::RenderThemeSafari::popupInternalPaddingRight):
        (WebCore::RenderThemeSafari::popupInternalPaddingTop):
        (WebCore::RenderThemeSafari::popupInternalPaddingBottom):
        (WebCore::RenderThemeSafari::paintSliderTrack):
        (WebCore::RenderThemeSafari::adjustSliderThumbSize):
        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderThemeWin::supportsFocus):
        (WebCore::RenderThemeWin::determineClassicState):
        (WebCore::RenderThemeWin::getClassicThemeData):
        (WebCore::RenderThemeWin::getThemeData):
        (WebCore::drawControl):
        (WebCore::RenderThemeWin::paintSliderTrack):
        (WebCore::RenderThemeWin::adjustSliderThumbSize):
        * rendering/RenderThemeWin.h:
        * rendering/style/RenderStyle.h:
        (WebCore::InheritedFlags::hasAppearance):
        (WebCore::InheritedFlags::appearance):
        (WebCore::InheritedFlags::setAppearance):
        (WebCore::InheritedFlags::initialAppearance):
        * rendering/style/RenderStyleConstants.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37663 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
WebCore/ChangeLog
WebCore/css/CSSPrimitiveValueMappings.h
WebCore/css/CSSStyleSelector.cpp
WebCore/css/CSSValueKeywords.in
WebCore/platform/gtk/RenderThemeGtk.cpp
WebCore/platform/qt/RenderThemeQt.cpp
WebCore/platform/qt/RenderThemeQt.h
WebCore/rendering/RenderSlider.cpp
WebCore/rendering/RenderTheme.cpp
WebCore/rendering/RenderTheme.h
WebCore/rendering/RenderThemeMac.mm
WebCore/rendering/RenderThemeSafari.cpp
WebCore/rendering/RenderThemeWin.cpp
WebCore/rendering/RenderThemeWin.h
WebCore/rendering/style/RenderStyle.h
WebCore/rendering/style/RenderStyleConstants.h

index 11885b8db4cb095fd678363a1b150d3cf5cb0213..639e9ebbacde63b52beb88a293602c7dbc6ff237 100644 (file)
@@ -1,3 +1,97 @@
+2008-10-17  David Hyatt  <hyatt@apple.com>
+
+        Eliminate the EAppearance enum in favor of the new ControlPart enum.  Cut out the scrollbar
+        values from the enum since they are handled by ScrollbarTheme instead.
+
+        Reviewed by Tim Hatcher
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator ControlPart):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::adjustRenderStyle):
+        * css/CSSValueKeywords.in:
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::supportsFocus):
+        (WebCore::RenderThemeGtk::baselinePosition):
+        (WebCore::setToggleSize):
+        (WebCore::RenderThemeGtk::setCheckboxSize):
+        (WebCore::RenderThemeGtk::setRadioSize):
+        (WebCore::RenderThemeGtk::adjustButtonStyle):
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::baselinePosition):
+        (WebCore::RenderThemeQt::controlSupportsTints):
+        (WebCore::RenderThemeQt::adjustRepaintRect):
+        (WebCore::RenderThemeQt::isControlStyled):
+        (WebCore::computeSizeBasedOnStyle):
+        (WebCore::RenderThemeQt::paintButton):
+        (WebCore::RenderThemeQt::paintTextField):
+        (WebCore::RenderThemeQt::paintMenuList):
+        (WebCore::RenderThemeQt::supportsFocus):
+        (WebCore::RenderThemeQt::applyTheme):
+        (WebCore::RenderThemeQt::adjustSliderThumbSize):
+        * platform/qt/RenderThemeQt.h:
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::createThumbStyle):
+        (WebCore::RenderSlider::layout):
+        (WebCore::RenderSlider::setValueForPosition):
+        (WebCore::RenderSlider::setPositionFromValue):
+        (WebCore::RenderSlider::positionForOffset):
+        (WebCore::RenderSlider::currentPosition):
+        (WebCore::RenderSlider::setCurrentPosition):
+        (WebCore::RenderSlider::trackSize):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::adjustStyle):
+        (WebCore::RenderTheme::paint):
+        (WebCore::RenderTheme::paintBorderOnly):
+        (WebCore::RenderTheme::paintDecorations):
+        (WebCore::RenderTheme::isControlContainer):
+        (WebCore::RenderTheme::isControlStyled):
+        (WebCore::RenderTheme::supportsFocusRing):
+        (WebCore::RenderTheme::isDefault):
+        * rendering/RenderTheme.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::isControlStyled):
+        (WebCore::RenderThemeMac::adjustRepaintRect):
+        (WebCore::RenderThemeMac::baselinePosition):
+        (WebCore::RenderThemeMac::controlSupportsTints):
+        (WebCore::RenderThemeMac::adjustButtonStyle):
+        (WebCore::RenderThemeMac::setButtonCellState):
+        (WebCore::RenderThemeMac::popupInternalPaddingLeft):
+        (WebCore::RenderThemeMac::popupInternalPaddingRight):
+        (WebCore::RenderThemeMac::popupInternalPaddingTop):
+        (WebCore::RenderThemeMac::popupInternalPaddingBottom):
+        (WebCore::RenderThemeMac::paintSliderTrack):
+        (WebCore::RenderThemeMac::paintSliderThumb):
+        (WebCore::RenderThemeMac::adjustSliderThumbSize):
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::isControlStyled):
+        (WebCore::RenderThemeSafari::adjustRepaintRect):
+        (WebCore::RenderThemeSafari::baselinePosition):
+        (WebCore::RenderThemeSafari::controlSupportsTints):
+        (WebCore::RenderThemeSafari::adjustButtonStyle):
+        (WebCore::RenderThemeSafari::popupInternalPaddingLeft):
+        (WebCore::RenderThemeSafari::popupInternalPaddingRight):
+        (WebCore::RenderThemeSafari::popupInternalPaddingTop):
+        (WebCore::RenderThemeSafari::popupInternalPaddingBottom):
+        (WebCore::RenderThemeSafari::paintSliderTrack):
+        (WebCore::RenderThemeSafari::adjustSliderThumbSize):
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::RenderThemeWin::supportsFocus):
+        (WebCore::RenderThemeWin::determineClassicState):
+        (WebCore::RenderThemeWin::getClassicThemeData):
+        (WebCore::RenderThemeWin::getThemeData):
+        (WebCore::drawControl):
+        (WebCore::RenderThemeWin::paintSliderTrack):
+        (WebCore::RenderThemeWin::adjustSliderThumbSize):
+        * rendering/RenderThemeWin.h:
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::hasAppearance):
+        (WebCore::InheritedFlags::appearance):
+        (WebCore::InheritedFlags::setAppearance):
+        (WebCore::InheritedFlags::initialAppearance):
+        * rendering/style/RenderStyleConstants.h:
+
 2008-10-17  David Hyatt  <hyatt@apple.com>
 
         Beginning of the RenderTheme re-architecture (to share more code).  Add the new Theme API header
index 1312c2ac23c01d0047c2a3eb5d78359c811a7ff3..231e951a4d2b667936c2826396eb507df04fb040 100644 (file)
@@ -161,148 +161,121 @@ template<> inline CSSPrimitiveValue::operator CompositeOperator() const
     }
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAppearance e)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
     : m_type(CSS_IDENT)
 {
     switch (e) {
-        case NoAppearance:
+        case NoControlPart:
             m_value.ident = CSSValueNone;
             break;
-        case CheckboxAppearance:
+        case CheckboxPart:
             m_value.ident = CSSValueCheckbox;
             break;
-        case RadioAppearance:
+        case RadioPart:
             m_value.ident = CSSValueRadio;
             break;
-        case PushButtonAppearance:
+        case PushButtonPart:
             m_value.ident = CSSValuePushButton;
             break;
-        case SquareButtonAppearance:
+        case SquareButtonPart:
             m_value.ident = CSSValueSquareButton;
             break;
-        case ButtonAppearance:
+        case ButtonPart:
             m_value.ident = CSSValueButton;
             break;
-        case ButtonBevelAppearance:
+        case ButtonBevelPart:
             m_value.ident = CSSValueButtonBevel;
             break;
-        case DefaultButtonAppearance:
+        case DefaultButtonPart:
             m_value.ident = CSSValueDefaultButton;
             break;
-        case ListboxAppearance:
+        case ListboxPart:
             m_value.ident = CSSValueListbox;
             break;
-        case ListItemAppearance:
+        case ListItemPart:
             m_value.ident = CSSValueListitem;
             break;
-        case MediaFullscreenButtonAppearance:
+        case MediaFullscreenButtonPart:
             m_value.ident = CSSValueMediaFullscreenButton;
             break;
-        case MediaPlayButtonAppearance:
+        case MediaPlayButtonPart:
             m_value.ident = CSSValueMediaPlayButton;
             break;
-        case MediaMuteButtonAppearance:
+        case MediaMuteButtonPart:
             m_value.ident = CSSValueMediaMuteButton;
             break;
-        case MediaSeekBackButtonAppearance:
+        case MediaSeekBackButtonPart:
             m_value.ident = CSSValueMediaSeekBackButton;
             break;
-        case MediaSeekForwardButtonAppearance:
+        case MediaSeekForwardButtonPart:
             m_value.ident = CSSValueMediaSeekForwardButton;
             break;
-        case MediaSliderAppearance:
+        case MediaSliderPart:
             m_value.ident = CSSValueMediaSlider;
             break;
-        case MediaSliderThumbAppearance:
+        case MediaSliderThumbPart:
             m_value.ident = CSSValueMediaSliderthumb;
             break;
-        case MenulistAppearance:
+        case MenulistPart:
             m_value.ident = CSSValueMenulist;
             break;
-        case MenulistButtonAppearance:
+        case MenulistButtonPart:
             m_value.ident = CSSValueMenulistButton;
             break;
-        case MenulistTextAppearance:
+        case MenulistTextPart:
             m_value.ident = CSSValueMenulistText;
             break;
-        case MenulistTextFieldAppearance:
+        case MenulistTextFieldPart:
             m_value.ident = CSSValueMenulistTextfield;
             break;
-        case ScrollbarButtonUpAppearance:
-            m_value.ident = CSSValueScrollbarbuttonUp;
-            break;
-        case ScrollbarButtonDownAppearance:
-            m_value.ident = CSSValueScrollbarbuttonDown;
-            break;
-        case ScrollbarButtonLeftAppearance:
-            m_value.ident = CSSValueScrollbarbuttonLeft;
-            break;
-        case ScrollbarButtonRightAppearance:
-            m_value.ident = CSSValueScrollbarbuttonRight;
-            break;
-        case ScrollbarTrackHorizontalAppearance:
-            m_value.ident = CSSValueScrollbartrackHorizontal;
-            break;
-        case ScrollbarTrackVerticalAppearance:
-            m_value.ident = CSSValueScrollbartrackVertical;
-            break;
-        case ScrollbarThumbHorizontalAppearance:
-            m_value.ident = CSSValueScrollbarthumbHorizontal;
-            break;
-        case ScrollbarThumbVerticalAppearance:
-            m_value.ident = CSSValueScrollbarthumbVertical;
-            break;
-        case ScrollbarGripperHorizontalAppearance:
-            m_value.ident = CSSValueScrollbargripperHorizontal;
-            break;
-        case ScrollbarGripperVerticalAppearance:
-            m_value.ident = CSSValueScrollbargripperVertical;
-            break;
-        case SliderHorizontalAppearance:
+        case SliderHorizontalPart:
             m_value.ident = CSSValueSliderHorizontal;
             break;
-        case SliderVerticalAppearance:
+        case SliderVerticalPart:
             m_value.ident = CSSValueSliderVertical;
             break;
-        case SliderThumbHorizontalAppearance:
+        case SliderThumbHorizontalPart:
             m_value.ident = CSSValueSliderthumbHorizontal;
             break;
-        case SliderThumbVerticalAppearance:
+        case SliderThumbVerticalPart:
             m_value.ident = CSSValueSliderthumbVertical;
             break;
-        case CaretAppearance:
+        case CaretPart:
             m_value.ident = CSSValueCaret;
             break;
-        case SearchFieldAppearance:
+        case SearchFieldPart:
             m_value.ident = CSSValueSearchfield;
             break;
-        case SearchFieldDecorationAppearance:
+        case SearchFieldDecorationPart:
             m_value.ident = CSSValueSearchfieldDecoration;
             break;
-        case SearchFieldResultsDecorationAppearance:
+        case SearchFieldResultsDecorationPart:
             m_value.ident = CSSValueSearchfieldResultsDecoration;
             break;
-        case SearchFieldResultsButtonAppearance:
+        case SearchFieldResultsButtonPart:
             m_value.ident = CSSValueSearchfieldResultsButton;
             break;
-        case SearchFieldCancelButtonAppearance:
+        case SearchFieldCancelButtonPart:
             m_value.ident = CSSValueSearchfieldCancelButton;
             break;
-        case TextFieldAppearance:
+        case TextFieldPart:
             m_value.ident = CSSValueTextfield;
             break;
-        case TextAreaAppearance:
+        case TextAreaPart:
             m_value.ident = CSSValueTextarea;
             break;
+        case CapsLockIndicatorPart:
+            m_value.ident = CSSValueCapsLockIndicator;
+            break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator EAppearance() const
+template<> inline CSSPrimitiveValue::operator ControlPart() const
 {
     if (m_value.ident == CSSValueNone)
-        return NoAppearance;
+        return NoControlPart;
     else
-        return EAppearance(m_value.ident - CSSValueCheckbox + 1);
+        return ControlPart(m_value.ident - CSSValueCheckbox + 1);
 }
 
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
index ef811cb830ba2f189b006335ea63e23602ea89d5..a061fbe901f08f3063c61ecd9eb2f6b29ae421f6 100644 (file)
@@ -1452,7 +1452,7 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
     }
 
     // Menulists should have visible overflow
-    if (style->appearance() == MenulistAppearance) {
+    if (style->appearance() == MenulistPart) {
         style->setOverflowX(OVISIBLE);
         style->setOverflowY(OVISIBLE);
     }
index cc64510974f34bc8c915674b99754ffef445c32f..2a3e8cbfb14de88193056fe3ccc96f904e091567 100644 (file)
@@ -508,16 +508,6 @@ menulist
 menulist-button
 menulist-text
 menulist-textfield
-scrollbarbutton-up
-scrollbarbutton-down
-scrollbarbutton-left
-scrollbarbutton-right
-scrollbartrack-horizontal
-scrollbartrack-vertical
-scrollbarthumb-horizontal
-scrollbarthumb-vertical
-scrollbargripper-horizontal
-scrollbargripper-vertical
 slider-horizontal
 slider-vertical
 sliderthumb-horizontal
@@ -530,6 +520,7 @@ searchfield-results-button
 searchfield-cancel-button
 textfield
 textarea
+caps-lock-indicator
 
 #
 # CSS_PROP_BORDER_IMAGE
index 67d3414721ea97b97ad9d9cf10eb565f6b686064..8f094dcd6638a7f1a412d79e44376a563a3424bc 100644 (file)
@@ -53,17 +53,17 @@ RenderThemeGtk::RenderThemeGtk()
     }
 }
 
-static bool supportsFocus(EAppearance appearance)
+static bool supportsFocus(ControlPart appearance)
 {
     switch (appearance) {
-        case PushButtonAppearance:
-        case ButtonAppearance:
-        case TextFieldAppearance:
-        case TextAreaAppearance:
-        case SearchFieldAppearance:
-        case MenulistAppearance:
-        case RadioAppearance:
-        case CheckboxAppearance:
+        case PushButtonPart:
+        case ButtonPart:
+        case TextFieldPart:
+        case TextAreaPart:
+        case SearchFieldPart:
+        case MenulistPart:
+        case RadioPart:
+        case CheckboxPart:
             return true;
         default:
             return false;
@@ -83,8 +83,8 @@ bool RenderThemeGtk::controlSupportsTints(const RenderObject* o) const
 int RenderThemeGtk::baselinePosition(const RenderObject* o) const
 {
     // FIXME: This strategy is possibly incorrect for the GTK+ port.
-    if (o->style()->appearance() == CheckboxAppearance ||
-        o->style()->appearance() == RadioAppearance)
+    if (o->style()->appearance() == CheckboxPart ||
+        o->style()->appearance() == RadioPart)
         return o->marginTop() + o->height() - 2;
     return RenderTheme::baselinePosition(o);
 }
@@ -194,7 +194,7 @@ static void setButtonPadding(RenderStyle* style)
     style->setPaddingBottom(Length(padding / 2, Fixed));
 }
 
-static void setToggleSize(RenderStyle* style, EAppearance appearance)
+static void setToggleSize(RenderStyle* style, ControlPart appearance)
 {
     // The width and height are both specified, so we shouldn't change them.
     if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto())
@@ -204,11 +204,11 @@ static void setToggleSize(RenderStyle* style, EAppearance appearance)
     gint indicator_size, indicator_spacing;
 
     switch (appearance) {
-        case CheckboxAppearance:
+        case CheckboxPart:
             if (moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing) != MOZ_GTK_SUCCESS)
                 return;
             break;
-        case RadioAppearance:
+        case RadioPart:
             if (moz_gtk_radio_get_metrics(&indicator_size, &indicator_spacing) != MOZ_GTK_SUCCESS)
                 return;
             break;
@@ -228,7 +228,7 @@ static void setToggleSize(RenderStyle* style, EAppearance appearance)
 
 void RenderThemeGtk::setCheckboxSize(RenderStyle* style) const
 {
-    setToggleSize(style, RadioAppearance);
+    setToggleSize(style, RadioPart);
 }
 
 bool RenderThemeGtk::paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
@@ -238,7 +238,7 @@ bool RenderThemeGtk::paintCheckbox(RenderObject* o, const RenderObject::PaintInf
 
 void RenderThemeGtk::setRadioSize(RenderStyle* style) const
 {
-    setToggleSize(style, RadioAppearance);
+    setToggleSize(style, RadioPart);
 }
 
 bool RenderThemeGtk::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
@@ -249,7 +249,7 @@ bool RenderThemeGtk::paintRadio(RenderObject* o, const RenderObject::PaintInfo&
 void RenderThemeGtk::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const
 {
     // FIXME: Is this condition necessary?
-    if (style->appearance() == PushButtonAppearance) {
+    if (style->appearance() == PushButtonPart) {
         style->resetBorder();
         style->setHeight(Length(Auto));
         style->setWhiteSpace(PRE);
index 7026865a846a65e008d8df669fc6b57035e21f91..2a33e458af13457ff5ed8ba21c3106affa25f3f3 100644 (file)
@@ -151,8 +151,8 @@ bool RenderThemeQt::supportsFocusRing(const RenderStyle* style) const
 
 int RenderThemeQt::baselinePosition(const RenderObject* o) const
 {
-    if (o->style()->appearance() == CheckboxAppearance ||
-        o->style()->appearance() == RadioAppearance)
+    if (o->style()->appearance() == CheckboxPart ||
+        o->style()->appearance() == RadioPart)
         return o->marginTop() + o->height() - 2; // Same as in old khtml
     return RenderTheme::baselinePosition(o);
 }
@@ -163,7 +163,7 @@ bool RenderThemeQt::controlSupportsTints(const RenderObject* o) const
         return false;
 
     // Checkboxes only have tint when checked.
-    if (o->style()->appearance() == CheckboxAppearance)
+    if (o->style()->appearance() == CheckboxPart)
         return isChecked(o);
 
     // For now assume other controls have tint if enabled.
@@ -198,19 +198,19 @@ static QRect inflateButtonRect(const QRect& originalRect)
 void RenderThemeQt::adjustRepaintRect(const RenderObject* o, IntRect& r)
 {
     switch (o->style()->appearance()) {
-    case CheckboxAppearance: {
+    case CheckboxPart: {
         break;
     }
-    case RadioAppearance: {
+    case RadioPart: {
         break;
     }
-    case PushButtonAppearance:
-    case ButtonAppearance: {
+    case PushButtonPart:
+    case ButtonPart: {
         QRect inflatedRect = inflateButtonRect(r);
         r = IntRect(inflatedRect.x(), inflatedRect.y(), inflatedRect.width(), inflatedRect.height());
         break;
     }
-    case MenulistAppearance: {
+    case MenulistPart: {
         break;
     }
     default:
@@ -221,9 +221,9 @@ void RenderThemeQt::adjustRepaintRect(const RenderObject* o, IntRect& r)
 bool RenderThemeQt::isControlStyled(const RenderStyle* style, const BorderData& border,
                                      const FillLayer& background, const Color& backgroundColor) const
 {
-    if (style->appearance() == TextFieldAppearance
-            || style->appearance() == TextAreaAppearance
-            || style->appearance() == ListboxAppearance) {
+    if (style->appearance() == TextFieldPart
+            || style->appearance() == TextAreaPart
+            || style->appearance() == ListboxPart) {
         return style->border() != border;
     }
 
@@ -276,7 +276,7 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle)
     QStyle* applicationStyle = QApplication::style();
 
     switch (renderStyle->appearance()) {
-    case CheckboxAppearance: {
+    case CheckboxPart: {
         QStyleOption styleOption;
         styleOption.state |= QStyle::State_Small;
         int checkBoxWidth = applicationStyle->pixelMetric(QStyle::PM_IndicatorWidth,
@@ -284,7 +284,7 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle)
         size = QSize(checkBoxWidth, checkBoxWidth);
         break;
     }
-    case RadioAppearance: {
+    case RadioPart: {
         QStyleOption styleOption;
         styleOption.state |= QStyle::State_Small;
         int radioWidth = applicationStyle->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth,
@@ -292,8 +292,8 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle)
         size = QSize(radioWidth, radioWidth);
         break;
     }
-    case PushButtonAppearance:
-    case ButtonAppearance: {
+    case PushButtonPart:
+    case ButtonPart: {
         QStyleOptionButton styleOption;
         styleOption.state |= QStyle::State_Small;
         QSize contentSize = fm.size(Qt::TextShowMnemonic, QString::fromLatin1("X"));
@@ -315,7 +315,7 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle)
 
         break;
     }
-    case MenulistAppearance: {
+    case MenulistPart: {
         QStyleOptionComboBox styleOption;
         styleOption.state |= QStyle::State_Small;
         int contentHeight = qMax(fm.lineSpacing(), 14) + 2;
@@ -326,7 +326,7 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle)
         size.setHeight(menuListSize.height());
         break;
     }
-    case TextFieldAppearance: {
+    case TextFieldPart: {
         const int verticalMargin = 1;
         const int horizontalMargin = 2;
         int h = qMax(fm.lineSpacing(), 14) + 2*verticalMargin;
@@ -461,13 +461,13 @@ bool RenderThemeQt::paintButton(RenderObject* o, const RenderObject::PaintInfo&
     option.rect = r;
     option.state |= QStyle::State_Small;
 
-    EAppearance appearance = applyTheme(option, o);
-    if(appearance == PushButtonAppearance || appearance == ButtonAppearance) {
+    ControlPart appearance = applyTheme(option, o);
+    if(appearance == PushButtonPart || appearance == ButtonPart) {
         option.rect = inflateButtonRect(option.rect);
         p.drawControl(QStyle::CE_PushButton, option);
-    } else if(appearance == RadioAppearance) {
+    } else if(appearance == RadioPart) {
        p.drawControl(QStyle::CE_RadioButton, option);
-    } else if(appearance == CheckboxAppearance) {
+    } else if(appearance == CheckboxPart) {
        p.drawControl(QStyle::CE_CheckBox, option);
     }
 
@@ -496,11 +496,11 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf
     panel.features = QStyleOptionFrameV2::None;
 
     // Get the correct theme data for a text field
-    EAppearance appearance = applyTheme(panel, o);
-    if (appearance != TextFieldAppearance
-        && appearance != SearchFieldAppearance
-        && appearance != TextAreaAppearance
-        && appearance != ListboxAppearance)
+    ControlPart appearance = applyTheme(panel, o);
+    if (appearance != TextFieldPart
+        && appearance != SearchFieldPart
+        && appearance != TextAreaPart
+        && appearance != ListboxPart)
         return true;
 
     // Now paint the text field.
@@ -560,7 +560,7 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo
     QStyleOptionComboBox opt;
     if (p.widget)
         opt.initFrom(p.widget);
-    EAppearance appearance = applyTheme(opt, o);
+    ControlPart appearance = applyTheme(opt, o);
 
     const QPoint topLeft = r.topLeft();
     p.painter->translate(topLeft);
@@ -686,24 +686,24 @@ bool RenderThemeQt::paintSearchFieldResultsDecoration(RenderObject* o, const Ren
     return RenderTheme::paintSearchFieldResultsDecoration(o, pi, r);
 }
 
-bool RenderThemeQt::supportsFocus(EAppearance appearance) const
+bool RenderThemeQt::supportsFocus(ControlPart appearance) const
 {
     switch (appearance) {
-        case PushButtonAppearance:
-        case ButtonAppearance:
-        case TextFieldAppearance:
-        case TextAreaAppearance:
-        case ListboxAppearance:
-        case MenulistAppearance:
-        case RadioAppearance:
-        case CheckboxAppearance:
+        case PushButtonPart:
+        case ButtonPart:
+        case TextFieldPart:
+        case TextAreaPart:
+        case ListboxPart:
+        case MenulistPart:
+        case RadioPart:
+        case CheckboxPart:
             return true;
         default: // No for all others...
             return false;
     }
 }
 
-EAppearance RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) const
+ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) const
 {
     // Default bits: no focus, no mouse over
     option.state &= ~(QStyle::State_HasFocus | QStyle::State_MouseOver);
@@ -721,32 +721,26 @@ EAppearance RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con
     if (isHovered(o))
         option.state |= QStyle::State_MouseOver;
 
-    EAppearance result = o->style()->appearance();
+    ControlPart result = o->style()->appearance();
 
     switch (result) {
-        case PushButtonAppearance:
-        case SquareButtonAppearance:
-        case ButtonAppearance:
-        case ButtonBevelAppearance:
-        case ListItemAppearance:
-        case MenulistButtonAppearance:
-        case ScrollbarButtonLeftAppearance:
-        case ScrollbarButtonRightAppearance:
-        case ScrollbarTrackHorizontalAppearance:
-        case ScrollbarTrackVerticalAppearance:
-        case ScrollbarThumbHorizontalAppearance:
-        case ScrollbarThumbVerticalAppearance:
-        case SearchFieldResultsButtonAppearance:
-        case SearchFieldCancelButtonAppearance: {
+        case PushButtonPart:
+        case SquareButtonPart:
+        case ButtonPart:
+        case ButtonBevelPart:
+        case ListItemPart:
+        case MenulistButtonPart:
+        case SearchFieldResultsButtonPart:
+        case SearchFieldCancelButtonPart: {
             if (isPressed(o))
                 option.state |= QStyle::State_Sunken;
-            else if (result == PushButtonAppearance)
+            else if (result == PushButtonPart)
                 option.state |= QStyle::State_Raised;
             break;
         }
     }
 
-    if(result == RadioAppearance || result == CheckboxAppearance)
+    if(result == RadioPart || result == CheckboxPart)
         option.state |= (isChecked(o) ? QStyle::State_On : QStyle::State_Off);
 
     // If the webview has a custom palette, use it
@@ -938,7 +932,7 @@ bool RenderThemeQt::paintMediaSliderThumb(RenderObject* o, const RenderObject::P
 
 void RenderThemeQt::adjustSliderThumbSize(RenderObject* o) const
 {
-    if (o->style()->appearance() == MediaSliderThumbAppearance) {
+    if (o->style()->appearance() == MediaSliderThumbPart) {
         RenderStyle* parentStyle = o->parent()->style();
         Q_ASSERT(parentStyle);
 
index ebcad56d7de466c1828912349c7c50923db8d0db..a5e18d385091f9b5139a55979f38da210ea7a6f2 100644 (file)
@@ -124,7 +124,7 @@ private:
 #endif
 
 private:
-    bool supportsFocus(EAppearance) const;
+    bool supportsFocus(ControlPart) const;
 
     EAppearance applyTheme(QStyleOption&, RenderObject*) const;
 
index 9c8a390828dffb4c3a461915e096e42cfee9a58d..7d8b0b09a97bd59cc34c560ac273e7a5ff78be48 100644 (file)
@@ -194,12 +194,12 @@ PassRefPtr<RenderStyle> RenderSlider::createThumbStyle(const RenderStyle* parent
         style->setTop(oldStyle->top());
     }
 
-    if (parentStyle->appearance() == SliderVerticalAppearance)
-       style->setAppearance(SliderThumbVerticalAppearance);
-    else if (parentStyle->appearance() == SliderHorizontalAppearance)
-       style->setAppearance(SliderThumbHorizontalAppearance);
-    else if (parentStyle->appearance() == MediaSliderAppearance)
-        style->setAppearance(MediaSliderThumbAppearance);
+    if (parentStyle->appearance() == SliderVerticalPart)
+       style->setAppearance(SliderThumbVerticalPart);
+    else if (parentStyle->appearance() == SliderHorizontalPart)
+       style->setAppearance(SliderThumbHorizontalPart);
+    else if (parentStyle->appearance() == MediaSliderPart)
+        style->setAppearance(MediaSliderThumbPart);
 
     return style.release();
 }
@@ -222,7 +222,7 @@ void RenderSlider::layout()
         if (m_thumb->renderer()->style()->hasAppearance())
             theme()->adjustSliderThumbSize(m_thumb->renderer());
 
-        if (style()->appearance() == SliderVerticalAppearance) {
+        if (style()->appearance() == SliderVerticalPart) {
             // FIXME: Handle percentage widths correctly. See http://bugs.webkit.org/show_bug.cgi?id=12104
             m_thumb->renderer()->style()->setLeft(Length(contentWidth() / 2 - m_thumb->renderer()->style()->width().value() / 2, Fixed));
         } else {
@@ -276,7 +276,7 @@ void RenderSlider::setValueForPosition(int position)
     
     // Calculate the new value based on the position
     double factor = (double)position / (double)trackSize();
-    if (style()->appearance() == SliderVerticalAppearance)
+    if (style()->appearance() == SliderVerticalPart)
         factor = 1.0 - factor;
     double val = minVal + factor * (maxVal - minVal);
             
@@ -320,7 +320,7 @@ double RenderSlider::setPositionFromValue(bool inLayout)
 
     // Calculate the new position based on the value
     double factor = (val - minVal) / (maxVal - minVal);
-    if (style()->appearance() == SliderVerticalAppearance)
+    if (style()->appearance() == SliderVerticalPart)
         factor = 1.0 - factor;
 
     setCurrentPosition((int)(factor * trackSize()));
@@ -337,7 +337,7 @@ int RenderSlider::positionForOffset(const IntPoint& p)
         return 0;
    
     int position;
-    if (style()->appearance() == SliderVerticalAppearance)
+    if (style()->appearance() == SliderVerticalPart)
         position = p.y() - m_thumb->renderer()->height() / 2;
     else
         position = p.x() - m_thumb->renderer()->width() / 2;
@@ -356,7 +356,7 @@ int RenderSlider::currentPosition()
     if (!m_thumb || !m_thumb->renderer())
         return 0;
 
-    if (style()->appearance() == SliderVerticalAppearance)
+    if (style()->appearance() == SliderVerticalPart)
         return m_thumb->renderer()->style()->top().value();
     return m_thumb->renderer()->style()->left().value();
 }
@@ -366,7 +366,7 @@ void RenderSlider::setCurrentPosition(int pos)
     if (!m_thumb || !m_thumb->renderer())
         return;
 
-    if (style()->appearance() == SliderVerticalAppearance)
+    if (style()->appearance() == SliderVerticalPart)
         m_thumb->renderer()->style()->setTop(Length(pos, Fixed));
     else
         m_thumb->renderer()->style()->setLeft(Length(pos, Fixed));
@@ -381,7 +381,7 @@ int RenderSlider::trackSize()
     if (!m_thumb || !m_thumb->renderer())
         return 0;
 
-    if (style()->appearance() == SliderVerticalAppearance)
+    if (style()->appearance() == SliderVerticalPart)
         return contentHeight() - m_thumb->renderer()->height();
     return contentWidth() - m_thumb->renderer()->width();
 }
index eaf88576911d5200ac4e75dd81d235d9f58fe2f8..2f6855ae07deea53a7d9d0bde2371f0312b8cb89 100644 (file)
@@ -60,47 +60,47 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
         style->setDisplay(BLOCK);
 
     if (UAHasAppearance && theme()->isControlStyled(style, border, background, backgroundColor)) {
-        if (style->appearance() == MenulistAppearance)
-            style->setAppearance(MenulistButtonAppearance);
+        if (style->appearance() == MenulistPart)
+            style->setAppearance(MenulistButtonPart);
         else
-            style->setAppearance(NoAppearance);
+            style->setAppearance(NoControlPart);
     }
 
     // Call the appropriate style adjustment method based off the appearance value.
     switch (style->appearance()) {
-        case CheckboxAppearance:
+        case CheckboxPart:
             return adjustCheckboxStyle(selector, style, e);
-        case RadioAppearance:
+        case RadioPart:
             return adjustRadioStyle(selector, style, e);
-        case PushButtonAppearance:
-        case SquareButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance:
+        case PushButtonPart:
+        case SquareButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart:
             return adjustButtonStyle(selector, style, e);
-        case TextFieldAppearance:
+        case TextFieldPart:
             return adjustTextFieldStyle(selector, style, e);
-        case TextAreaAppearance:
+        case TextAreaPart:
             return adjustTextAreaStyle(selector, style, e);
-        case MenulistAppearance:
+        case MenulistPart:
             return adjustMenuListStyle(selector, style, e);
-        case MenulistButtonAppearance:
+        case MenulistButtonPart:
             return adjustMenuListButtonStyle(selector, style, e);
-        case MediaSliderAppearance:
-        case SliderHorizontalAppearance:
-        case SliderVerticalAppearance:
+        case MediaSliderPart:
+        case SliderHorizontalPart:
+        case SliderVerticalPart:
             return adjustSliderTrackStyle(selector, style, e);
-        case SliderThumbHorizontalAppearance:
-        case SliderThumbVerticalAppearance:
+        case SliderThumbHorizontalPart:
+        case SliderThumbVerticalPart:
             return adjustSliderThumbStyle(selector, style, e);
-        case SearchFieldAppearance:
+        case SearchFieldPart:
             return adjustSearchFieldStyle(selector, style, e);
-        case SearchFieldCancelButtonAppearance:
+        case SearchFieldCancelButtonPart:
             return adjustSearchFieldCancelButtonStyle(selector, style, e);
-        case SearchFieldDecorationAppearance:
+        case SearchFieldDecorationPart:
             return adjustSearchFieldDecorationStyle(selector, style, e);
-        case SearchFieldResultsDecorationAppearance:
+        case SearchFieldResultsDecorationPart:
             return adjustSearchFieldResultsDecorationStyle(selector, style, e);
-        case SearchFieldResultsButtonAppearance:
+        case SearchFieldResultsButtonPart:
             return adjustSearchFieldResultsButtonStyle(selector, style, e);
         default:
             break;
@@ -128,56 +128,56 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
 
     // Call the appropriate paint method based off the appearance value.
     switch (o->style()->appearance()) {
-        case CheckboxAppearance:
+        case CheckboxPart:
             return paintCheckbox(o, paintInfo, r);
-        case RadioAppearance:
+        case RadioPart:
             return paintRadio(o, paintInfo, r);
-        case PushButtonAppearance:
-        case SquareButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance:
+        case PushButtonPart:
+        case SquareButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart:
             return paintButton(o, paintInfo, r);
-        case MenulistAppearance:
+        case MenulistPart:
             return paintMenuList(o, paintInfo, r);
-        case SliderHorizontalAppearance:
-        case SliderVerticalAppearance:
+        case SliderHorizontalPart:
+        case SliderVerticalPart:
             return paintSliderTrack(o, paintInfo, r);
-        case SliderThumbHorizontalAppearance:
-        case SliderThumbVerticalAppearance:
+        case SliderThumbHorizontalPart:
+        case SliderThumbVerticalPart:
             if (o->parent()->isSlider())
                 return paintSliderThumb(o, paintInfo, r);
             // We don't support drawing a slider thumb without a parent slider
             break;
-        case MediaFullscreenButtonAppearance:
+        case MediaFullscreenButtonPart:
             return paintMediaFullscreenButton(o, paintInfo, r);
-        case MediaPlayButtonAppearance:
+        case MediaPlayButtonPart:
             return paintMediaPlayButton(o, paintInfo, r);
-        case MediaMuteButtonAppearance:
+        case MediaMuteButtonPart:
             return paintMediaMuteButton(o, paintInfo, r);
-        case MediaSeekBackButtonAppearance:
+        case MediaSeekBackButtonPart:
             return paintMediaSeekBackButton(o, paintInfo, r);
-        case MediaSeekForwardButtonAppearance:
+        case MediaSeekForwardButtonPart:
             return paintMediaSeekForwardButton(o, paintInfo, r);
-        case MediaSliderAppearance:
+        case MediaSliderPart:
             return paintMediaSliderTrack(o, paintInfo, r);
-        case MediaSliderThumbAppearance:
+        case MediaSliderThumbPart:
             if (o->parent()->isSlider())
                 return paintMediaSliderThumb(o, paintInfo, r);
             break;
-        case MenulistButtonAppearance:
-        case TextFieldAppearance:
-        case TextAreaAppearance:
-        case ListboxAppearance:
+        case MenulistButtonPart:
+        case TextFieldPart:
+        case TextAreaPart:
+        case ListboxPart:
             return true;
-        case SearchFieldAppearance:
+        case SearchFieldPart:
             return paintSearchField(o, paintInfo, r);
-        case SearchFieldCancelButtonAppearance:
+        case SearchFieldCancelButtonPart:
             return paintSearchFieldCancelButton(o, paintInfo, r);
-        case SearchFieldDecorationAppearance:
+        case SearchFieldDecorationPart:
             return paintSearchFieldDecoration(o, paintInfo, r);
-        case SearchFieldResultsDecorationAppearance:
+        case SearchFieldResultsDecorationPart:
             return paintSearchFieldResultsDecoration(o, paintInfo, r);
-        case SearchFieldResultsButtonAppearance:
+        case SearchFieldResultsButtonPart:
             return paintSearchFieldResultsButton(o, paintInfo, r);
         default:
             break;
@@ -193,29 +193,29 @@ bool RenderTheme::paintBorderOnly(RenderObject* o, const RenderObject::PaintInfo
 
     // Call the appropriate paint method based off the appearance value.
     switch (o->style()->appearance()) {
-        case TextFieldAppearance:
+        case TextFieldPart:
             return paintTextField(o, paintInfo, r);
-        case ListboxAppearance:
-        case TextAreaAppearance:
+        case ListboxPart:
+        case TextAreaPart:
             return paintTextArea(o, paintInfo, r);
-        case MenulistButtonAppearance:
+        case MenulistButtonPart:
             return true;
-        case CheckboxAppearance:
-        case RadioAppearance:
-        case PushButtonAppearance:
-        case SquareButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance:
-        case MenulistAppearance:
-        case SliderHorizontalAppearance:
-        case SliderVerticalAppearance:
-        case SliderThumbHorizontalAppearance:
-        case SliderThumbVerticalAppearance:
-        case SearchFieldAppearance:
-        case SearchFieldCancelButtonAppearance:
-        case SearchFieldDecorationAppearance:
-        case SearchFieldResultsDecorationAppearance:
-        case SearchFieldResultsButtonAppearance:
+        case CheckboxPart:
+        case RadioPart:
+        case PushButtonPart:
+        case SquareButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart:
+        case MenulistPart:
+        case SliderHorizontalPart:
+        case SliderVerticalPart:
+        case SliderThumbHorizontalPart:
+        case SliderThumbVerticalPart:
+        case SearchFieldPart:
+        case SearchFieldCancelButtonPart:
+        case SearchFieldDecorationPart:
+        case SearchFieldResultsDecorationPart:
+        case SearchFieldResultsButtonPart:
         default:
             break;
     }
@@ -230,27 +230,27 @@ bool RenderTheme::paintDecorations(RenderObject* o, const RenderObject::PaintInf
 
     // Call the appropriate paint method based off the appearance value.
     switch (o->style()->appearance()) {
-        case MenulistButtonAppearance:
+        case MenulistButtonPart:
             return paintMenuListButton(o, paintInfo, r);
-        case TextFieldAppearance:
-        case TextAreaAppearance:
-        case ListboxAppearance:
-        case CheckboxAppearance:
-        case RadioAppearance:
-        case PushButtonAppearance:
-        case SquareButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance:
-        case MenulistAppearance:
-        case SliderHorizontalAppearance:
-        case SliderVerticalAppearance:
-        case SliderThumbHorizontalAppearance:
-        case SliderThumbVerticalAppearance:
-        case SearchFieldAppearance:
-        case SearchFieldCancelButtonAppearance:
-        case SearchFieldDecorationAppearance:
-        case SearchFieldResultsDecorationAppearance:
-        case SearchFieldResultsButtonAppearance:
+        case TextFieldPart:
+        case TextAreaPart:
+        case ListboxPart:
+        case CheckboxPart:
+        case RadioPart:
+        case PushButtonPart:
+        case SquareButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart:
+        case MenulistPart:
+        case SliderHorizontalPart:
+        case SliderVerticalPart:
+        case SliderThumbHorizontalPart:
+        case SliderThumbVerticalPart:
+        case SearchFieldPart:
+        case SearchFieldCancelButtonPart:
+        case SearchFieldDecorationPart:
+        case SearchFieldResultsDecorationPart:
+        case SearchFieldResultsButtonPart:
         default:
             break;
     }
@@ -321,27 +321,27 @@ int RenderTheme::baselinePosition(const RenderObject* o) const
     return o->height() + o->marginTop();
 }
 
-bool RenderTheme::isControlContainer(EAppearance appearance) const
+bool RenderTheme::isControlContainer(ControlPart appearance) const
 {
     // There are more leaves than this, but we'll patch this function as we add support for
     // more controls.
-    return appearance != CheckboxAppearance && appearance != RadioAppearance;
+    return appearance != CheckboxPart && appearance != RadioPart;
 }
 
 bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& border, const FillLayer& background,
                                   const Color& backgroundColor) const
 {
     switch (style->appearance()) {
-        case PushButtonAppearance:
-        case SquareButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance:
-        case ListboxAppearance:
-        case MenulistAppearance:
+        case PushButtonPart:
+        case SquareButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart:
+        case ListboxPart:
+        case MenulistPart:
         // FIXME: Uncomment this when making search fields style-able.
-        // case SearchFieldAppearance:
-        case TextFieldAppearance:
-        case TextAreaAppearance:
+        // case SearchFieldPart:
+        case TextFieldPart:
+        case TextAreaPart:
             // Test the style to see if the UA border and background match.
             return (style->border() != border ||
                     *style->backgroundLayers() != background ||
@@ -353,7 +353,7 @@ bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& bo
 
 bool RenderTheme::supportsFocusRing(const RenderStyle* style) const
 {
-    return (style->hasAppearance() && style->appearance() != TextFieldAppearance && style->appearance() != TextAreaAppearance && style->appearance() != MenulistButtonAppearance && style->appearance() != ListboxAppearance);
+    return (style->hasAppearance() && style->appearance() != TextFieldPart && style->appearance() != TextAreaPart && style->appearance() != MenulistButtonPart && style->appearance() != ListboxPart);
 }
 
 bool RenderTheme::stateChanged(RenderObject* o, ControlState state) const
@@ -454,7 +454,7 @@ bool RenderTheme::isDefault(const RenderObject* o) const
     if (!o->style())
         return false;
     
-    return o->style()->appearance() == DefaultButtonAppearance;
+    return o->style()->appearance() == DefaultButtonPart;
 }
 
 void RenderTheme::adjustCheckboxStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
index 0873b4a957daaa4a943a35b93142921b9d960328..aecd4b88e4f0d67289687a048e32f85d60d27e15 100644 (file)
@@ -71,7 +71,7 @@ public:
 
     // A method for asking if a control is a container or not.  Leaf controls have to have some special behavior (like
     // the baseline position API above).
-    virtual bool isControlContainer(EAppearance) const;
+    bool isControlContainer(ControlPart) const;
 
     // A method asking if the control changes its tint when the window has focus or not.
     virtual bool controlSupportsTints(const RenderObject*) const { return false; }
index 5dca58989e2fc5981a546376e4dd7cbdaacff33d..991b5b79e9c32640cd50e83b97ee3f6b5b24a8ef 100644 (file)
@@ -414,7 +414,7 @@ Color RenderThemeMac::systemColor(int cssValueId) const
 bool RenderThemeMac::isControlStyled(const RenderStyle* style, const BorderData& border,
                                      const FillLayer& background, const Color& backgroundColor) const
 {
-    if (style->appearance() == TextFieldAppearance || style->appearance() == TextAreaAppearance || style->appearance() == ListboxAppearance)
+    if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
         return style->border() != border;
     return RenderTheme::isControlStyled(style, border, background, backgroundColor);
 }
@@ -424,7 +424,7 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
     float zoomLevel = o->style()->effectiveZoom();
 
     switch (o->style()->appearance()) {
-        case CheckboxAppearance: {
+        case CheckboxPart: {
             // Since we query the prototype cell, we need to update its state to match.
             setCheckboxCellState(o, r);
 
@@ -436,7 +436,7 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
             r = inflateRect(r, size, checkboxMargins(), zoomLevel);
             break;
         }
-        case RadioAppearance: {
+        case RadioPart: {
             // Since we query the prototype cell, we need to update its state to match.
             setRadioCellState(o, r);
 
@@ -448,9 +448,9 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
             r = inflateRect(r, size, radioMargins(), zoomLevel);
             break;
         }
-        case PushButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance: {
+        case PushButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart: {
             // Since we query the prototype cell, we need to update its state to match.
             setButtonCellState(o, r);
 
@@ -464,7 +464,7 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
             }
             break;
         }
-        case MenulistAppearance: {
+        case MenulistPart: {
             setPopupButtonCellState(o, r);
             IntSize size = popupButtonSizes()[[popupButton() controlSize]];
             size.setHeight(size.height() * zoomLevel);
@@ -537,7 +537,7 @@ void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject* o)
 
 int RenderThemeMac::baselinePosition(const RenderObject* o) const
 {
-    if (o->style()->appearance() == CheckboxAppearance || o->style()->appearance() == RadioAppearance)
+    if (o->style()->appearance() == CheckboxPart || o->style()->appearance() == RadioPart)
         return o->marginTop() + o->height() - 2 * o->style()->effectiveZoom(); // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
     return RenderTheme::baselinePosition(o);
 }
@@ -553,7 +553,7 @@ bool RenderThemeMac::controlSupportsTints(const RenderObject* o) const
         return false;
 
     // Checkboxes only have tint when checked.
-    if (o->style()->appearance() == CheckboxAppearance)
+    if (o->style()->appearance() == CheckboxPart)
         return isChecked(o);
 
     // For now assume other controls have tint if enabled.
@@ -818,7 +818,7 @@ void RenderThemeMac::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle*
     // Determine our control size based off our font.
     NSControlSize controlSize = controlSizeForFont(style);
 
-    if (style->appearance() == PushButtonAppearance) {
+    if (style->appearance() == PushButtonPart) {
         // Ditch the border.
         style->resetBorder();
 
@@ -882,7 +882,7 @@ void RenderThemeMac::setButtonCellState(const RenderObject* o, const IntRect& r)
     NSButtonCell* button = this->button();
 
     // Set the control size based off the rectangle we're painting into.
-    if (o->style()->appearance() == SquareButtonAppearance ||
+    if (o->style()->appearance() == SquareButtonPart ||
         r.height() > buttonSizes()[NSRegularControlSize].height() * o->style()->effectiveZoom()) {
         // Use the square button
         if ([button bezelStyle] != NSShadowlessSquareBezelStyle)
@@ -1268,18 +1268,18 @@ void RenderThemeMac::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle
 
 int RenderThemeMac::popupInternalPaddingLeft(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[leftPadding] * style->effectiveZoom();
-    if (style->appearance() == MenulistButtonAppearance)
+    if (style->appearance() == MenulistButtonPart)
         return styledPopupPaddingLeft * style->effectiveZoom();
     return 0;
 }
 
 int RenderThemeMac::popupInternalPaddingRight(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[rightPadding] * style->effectiveZoom();
-    if (style->appearance() == MenulistButtonAppearance) {
+    if (style->appearance() == MenulistButtonPart) {
         float fontScale = style->fontSize() / baseFontSize;
         float arrowWidth = baseArrowWidth * fontScale;
         return static_cast<int>(ceilf(arrowWidth + (arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator) * style->effectiveZoom()));
@@ -1289,18 +1289,18 @@ int RenderThemeMac::popupInternalPaddingRight(RenderStyle* style) const
 
 int RenderThemeMac::popupInternalPaddingTop(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[topPadding] * style->effectiveZoom();
-    if (style->appearance() == MenulistButtonAppearance)
+    if (style->appearance() == MenulistButtonPart)
         return styledPopupPaddingTop * style->effectiveZoom();
     return 0;
 }
 
 int RenderThemeMac::popupInternalPaddingBottom(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[bottomPadding] * style->effectiveZoom();
-    if (style->appearance() == MenulistButtonAppearance)
+    if (style->appearance() == MenulistButtonPart)
         return styledPopupPaddingBottom * style->effectiveZoom();
     return 0;
 }
@@ -1357,10 +1357,10 @@ bool RenderThemeMac::paintSliderTrack(RenderObject* o, const RenderObject::Paint
     float zoomLevel = o->style()->effectiveZoom();
     float zoomedTrackWidth = trackWidth * zoomLevel;
 
-    if (o->style()->appearance() ==  SliderHorizontalAppearance || o->style()->appearance() ==  MediaSliderAppearance) {
+    if (o->style()->appearance() ==  SliderHorizontalPart || o->style()->appearance() ==  MediaSliderPart) {
         bounds.setHeight(zoomedTrackWidth);
         bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2);
-    } else if (o->style()->appearance() == SliderVerticalAppearance) {
+    } else if (o->style()->appearance() == SliderVerticalPart) {
         bounds.setWidth(zoomedTrackWidth);
         bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2);
     }
@@ -1375,7 +1375,7 @@ bool RenderThemeMac::paintSliderTrack(RenderObject* o, const RenderObject::Paint
     struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
     RetainPtr<CGFunctionRef> mainFunction(AdoptCF, CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
     RetainPtr<CGShadingRef> mainShading;
-    if (o->style()->appearance() == SliderVerticalAppearance)
+    if (o->style()->appearance() == SliderVerticalPart)
         mainShading.adoptCF(CGShadingCreateAxial(cspace.get(), CGPointMake(bounds.x(),  bounds.bottom()), CGPointMake(bounds.right(), bounds.bottom()), mainFunction.get(), false, false));
     else
         mainShading.adoptCF(CGShadingCreateAxial(cspace.get(), CGPointMake(bounds.x(),  bounds.y()), CGPointMake(bounds.x(), bounds.bottom()), mainFunction.get(), false, false));
@@ -1401,7 +1401,7 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const RenderObject::Paint
 {
     ASSERT(o->parent()->isSlider());
 
-    NSSliderCell* sliderThumbCell = o->style()->appearance() == SliderThumbVerticalAppearance
+    NSSliderCell* sliderThumbCell = o->style()->appearance() == SliderThumbVerticalPart
         ? sliderThumbVertical()
         : sliderThumbHorizontal();
 
@@ -1413,14 +1413,14 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const RenderObject::Paint
 
     // Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it.
     bool oldPressed;
-    if (o->style()->appearance() == SliderThumbVerticalAppearance)
+    if (o->style()->appearance() == SliderThumbVerticalPart)
         oldPressed = m_isSliderThumbVerticalPressed;
     else
         oldPressed = m_isSliderThumbHorizontalPressed;
 
     bool pressed = static_cast<RenderSlider*>(o->parent())->inDragMode();
 
-    if (o->style()->appearance() == SliderThumbVerticalAppearance)
+    if (o->style()->appearance() == SliderThumbVerticalPart)
         m_isSliderThumbVerticalPressed = pressed;
     else
         m_isSliderThumbHorizontalPressed = pressed;
@@ -1434,7 +1434,7 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const RenderObject::Paint
 
     FloatRect bounds = r;
     // Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider.
-    if (o->style()->appearance() == SliderThumbVerticalAppearance)
+    if (o->style()->appearance() == SliderThumbVerticalPart)
         bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style()->effectiveZoom());
 
     paintInfo.context->save();
@@ -1465,10 +1465,10 @@ const int mediaSliderThumbHeight = 14;
 void RenderThemeMac::adjustSliderThumbSize(RenderObject* o) const
 {
     float zoomLevel = o->style()->effectiveZoom();
-    if (o->style()->appearance() == SliderThumbHorizontalAppearance || o->style()->appearance() == SliderThumbVerticalAppearance) {
+    if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) {
         o->style()->setWidth(Length(static_cast<int>(sliderThumbWidth * zoomLevel), Fixed));
         o->style()->setHeight(Length(static_cast<int>(sliderThumbHeight * zoomLevel), Fixed));
-    } else if (o->style()->appearance() == MediaSliderThumbAppearance) {
+    } else if (o->style()->appearance() == MediaSliderThumbPart) {
         o->style()->setWidth(Length(mediaSliderThumbWidth, Fixed));
         o->style()->setHeight(Length(mediaSliderThumbHeight, Fixed));
     }
index 26dc81a76f16e18538974d1365c30dae3b3ca95a..fee1cb600892378bc317fb1e3e5111f4da60d066 100644 (file)
@@ -212,7 +212,7 @@ bool RenderThemeSafari::isControlStyled(const RenderStyle* style, const BorderDa
     if (!SafariThemeLibrary())
         return true;
 
-    if (style->appearance() == TextFieldAppearance || style->appearance() == TextAreaAppearance || style->appearance() == ListboxAppearance)
+    if (style->appearance() == TextFieldPart || style->appearance() == TextAreaPart || style->appearance() == ListboxPart)
         return style->border() != border;
     return RenderTheme::isControlStyled(style, border, background, backgroundColor);
 }
@@ -222,28 +222,28 @@ void RenderThemeSafari::adjustRepaintRect(const RenderObject* o, IntRect& r)
     NSControlSize controlSize = controlSizeForFont(o->style());
 
     switch (o->style()->appearance()) {
-        case CheckboxAppearance: {
+        case CheckboxPart: {
             // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
             // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
             r = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize));
             break;
         }
-        case RadioAppearance: {
+        case RadioPart: {
             // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
             // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
             r = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize));
             break;
         }
-        case PushButtonAppearance:
-        case DefaultButtonAppearance:
-        case ButtonAppearance: {
+        case PushButtonPart:
+        case DefaultButtonPart:
+        case ButtonPart: {
             // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
             // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
             if (r.height() <= buttonSizes()[NSRegularControlSize].height())
                 r = inflateRect(r, buttonSizes()[controlSize], buttonMargins(controlSize));
             break;
         }
-        case MenulistAppearance: {
+        case MenulistPart: {
             r = inflateRect(r, popupButtonSizes()[controlSize], popupButtonMargins(controlSize));
             break;
         }
@@ -272,7 +272,7 @@ IntRect RenderThemeSafari::inflateRect(const IntRect& r, const IntSize& size, co
 
 int RenderThemeSafari::baselinePosition(const RenderObject* o) const
 {
-    if (o->style()->appearance() == CheckboxAppearance || o->style()->appearance() == RadioAppearance)
+    if (o->style()->appearance() == CheckboxPart || o->style()->appearance() == RadioPart)
         return o->marginTop() + o->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
     return RenderTheme::baselinePosition(o);
 }
@@ -283,7 +283,7 @@ bool RenderThemeSafari::controlSupportsTints(const RenderObject* o) const
         return false;
 
     // Checkboxes only have tint when checked.
-    if (o->style()->appearance() == CheckboxAppearance)
+    if (o->style()->appearance() == CheckboxPart)
         return isChecked(o);
 
     // For now assume other controls have tint if enabled.
@@ -469,7 +469,7 @@ void RenderThemeSafari::adjustButtonStyle(CSSStyleSelector* selector, RenderStyl
     // Determine our control size based off our font.
     NSControlSize controlSize = controlSizeForFont(style);
 
-    if (style->appearance() == PushButtonAppearance) {
+    if (style->appearance() == PushButtonPart) {
         // Ditch the border.
         style->resetBorder();
 
@@ -841,18 +841,18 @@ void RenderThemeSafari::adjustMenuListStyle(CSSStyleSelector* selector, RenderSt
 
 int RenderThemeSafari::popupInternalPaddingLeft(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[leftPadding];
-    if (style->appearance() == MenulistButtonAppearance)
+    if (style->appearance() == MenulistButtonPart)
         return styledPopupPaddingLeft;
     return 0;
 }
 
 int RenderThemeSafari::popupInternalPaddingRight(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[rightPadding];
-    if (style->appearance() == MenulistButtonAppearance) {
+    if (style->appearance() == MenulistButtonPart) {
         float fontScale = style->fontSize() / baseFontSize;
         float arrowWidth = baseArrowWidth * fontScale;
         return static_cast<int>(ceilf(arrowWidth + arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator));
@@ -862,18 +862,18 @@ int RenderThemeSafari::popupInternalPaddingRight(RenderStyle* style) const
 
 int RenderThemeSafari::popupInternalPaddingTop(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[topPadding];
-    if (style->appearance() == MenulistButtonAppearance)
+    if (style->appearance() == MenulistButtonPart)
         return styledPopupPaddingTop;
     return 0;
 }
 
 int RenderThemeSafari::popupInternalPaddingBottom(RenderStyle* style) const
 {
-    if (style->appearance() == MenulistAppearance)
+    if (style->appearance() == MenulistPart)
         return popupButtonPadding(controlSizeForFont(style))[bottomPadding];
-    if (style->appearance() == MenulistButtonAppearance)
+    if (style->appearance() == MenulistButtonPart)
         return styledPopupPaddingBottom;
     return 0;
 }
@@ -909,11 +909,11 @@ bool RenderThemeSafari::paintSliderTrack(RenderObject* o, const RenderObject::Pa
 {
     IntRect bounds = r;
 
-    if (o->style()->appearance() ==  SliderHorizontalAppearance || 
-        o->style()->appearance() == MediaSliderAppearance) {
+    if (o->style()->appearance() ==  SliderHorizontalPart || 
+        o->style()->appearance() == MediaSliderPart) {
         bounds.setHeight(trackWidth);
         bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
-    } else if (o->style()->appearance() == SliderVerticalAppearance) {
+    } else if (o->style()->appearance() == SliderVerticalPart) {
         bounds.setWidth(trackWidth);
         bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
     }
@@ -927,7 +927,7 @@ bool RenderThemeSafari::paintSliderTrack(RenderObject* o, const RenderObject::Pa
     struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
     RetainPtr<CGFunctionRef> mainFunction(AdoptCF, CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
     RetainPtr<CGShadingRef> mainShading;
-    if (o->style()->appearance() == SliderVerticalAppearance)
+    if (o->style()->appearance() == SliderVerticalPart)
         mainShading.adoptCF(CGShadingCreateAxial(cspace.get(), CGPointMake(bounds.x(),  bounds.bottom()), CGPointMake(bounds.right(), bounds.bottom()), mainFunction.get(), false, false));
     else
         mainShading.adoptCF(CGShadingCreateAxial(cspace.get(), CGPointMake(bounds.x(),  bounds.y()), CGPointMake(bounds.x(), bounds.bottom()), mainFunction.get(), false, false));
@@ -972,10 +972,10 @@ const int mediaSliderThumbHeight = 14;
 
 void RenderThemeSafari::adjustSliderThumbSize(RenderObject* o) const
 {
-    if (o->style()->appearance() == SliderThumbHorizontalAppearance || o->style()->appearance() == SliderThumbVerticalAppearance) {
+    if (o->style()->appearance() == SliderThumbHorizontalPart || o->style()->appearance() == SliderThumbVerticalPart) {
         o->style()->setWidth(Length(sliderThumbWidth, Fixed));
         o->style()->setHeight(Length(sliderThumbHeight, Fixed));
-    } else if (o->style()->appearance() == MediaSliderThumbAppearance) {
+    } else if (o->style()->appearance() == MediaSliderThumbPart) {
         o->style()->setWidth(Length(mediaSliderThumbWidth, Fixed));
         o->style()->setHeight(Length(mediaSliderThumbHeight, Fixed));
     }
index 19ed97f0d8050ff21cfc3e73acd901d18333ef2b..1653d477c0cd6fccb89cdabd669660ce0acbaba6 100644 (file)
@@ -286,16 +286,16 @@ void RenderThemeWin::systemFont(int propId, FontDescription& fontDescription) co
     }
 }
 
-bool RenderThemeWin::supportsFocus(EAppearance appearance)
+bool RenderThemeWin::supportsFocus(ControlPart appearance)
 {
     switch (appearance) {
-        case PushButtonAppearance:
-        case ButtonAppearance:
-        case DefaultButtonAppearance:
-        case TextFieldAppearance:
-        case TextAreaAppearance:
+        case PushButtonPart:
+        case ButtonPart:
+        case DefaultButtonPart:
+        case TextFieldPart:
+        case TextAreaPart:
             return true;
-        case MenulistAppearance:
+        case MenulistPart:
             return false;
         default:
             return false;
@@ -306,18 +306,18 @@ unsigned RenderThemeWin::determineClassicState(RenderObject* o)
 {
     unsigned state = 0;
     switch (o->style()->appearance()) {
-        case PushButtonAppearance:
-        case ButtonAppearance:
-        case DefaultButtonAppearance:
+        case PushButtonPart:
+        case ButtonPart:
+        case DefaultButtonPart:
             state = DFCS_BUTTONPUSH;
             if (!isEnabled(o))
                 state |= DFCS_INACTIVE;
             else if (isPressed(o))
                 state |= DFCS_PUSHED;
             break;
-        case RadioAppearance:
-        case CheckboxAppearance:
-            state = (o->style()->appearance() == RadioAppearance) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
+        case RadioPart:
+        case CheckboxPart:
+            state = (o->style()->appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
             if (isChecked(o))
                 state |= DFCS_CHECKED;
             if (!isEnabled(o))
@@ -325,7 +325,7 @@ unsigned RenderThemeWin::determineClassicState(RenderObject* o)
             else if (isPressed(o))
                 state |= DFCS_PUSHED;
             break;
-        case MenulistAppearance:
+        case MenulistPart:
             state = DFCS_SCROLLCOMBOBOX;
             if (!isEnabled(o))
                 state |= DFCS_INACTIVE;
@@ -389,36 +389,36 @@ ThemeData RenderThemeWin::getClassicThemeData(RenderObject* o)
 {
     ThemeData result;
     switch (o->style()->appearance()) {
-        case PushButtonAppearance:
-        case ButtonAppearance:
-        case DefaultButtonAppearance:
-        case CheckboxAppearance:
-        case RadioAppearance:
+        case PushButtonPart:
+        case ButtonPart:
+        case DefaultButtonPart:
+        case CheckboxPart:
+        case RadioPart:
             result.m_part = DFC_BUTTON;
             result.m_state = determineClassicState(o);
             break;
-        case MenulistAppearance:
+        case MenulistPart:
             result.m_part = DFC_SCROLL;
             result.m_state = determineClassicState(o);
             break;
-        case TextFieldAppearance:
-        case TextAreaAppearance:
+        case TextFieldPart:
+        case TextAreaPart:
             result.m_part = TFP_TEXTFIELD;
             result.m_state = determineState(o);
             break;
-        case SliderHorizontalAppearance:
+        case SliderHorizontalPart:
             result.m_part = TKP_TRACK;
             result.m_state = TS_NORMAL;
             break;
-        case SliderVerticalAppearance:
+        case SliderVerticalPart:
             result.m_part = TKP_TRACKVERT;
             result.m_state = TS_NORMAL;
             break;
-        case SliderThumbHorizontalAppearance:
+        case SliderThumbHorizontalPart:
             result.m_part = TKP_THUMBBOTTOM;
             result.m_state = determineSliderThumbState(o);
             break;
-        case SliderThumbVerticalAppearance:
+        case SliderThumbVerticalPart:
             result.m_part = TKP_THUMBRIGHT;
             result.m_state = determineSliderThumbState(o);
             break;
@@ -435,43 +435,43 @@ ThemeData RenderThemeWin::getThemeData(RenderObject* o)
 
     ThemeData result;
     switch (o->style()->appearance()) {
-        case PushButtonAppearance:
-        case ButtonAppearance:
-        case DefaultButtonAppearance:
+        case PushButtonPart:
+        case ButtonPart:
+        case DefaultButtonPart:
             result.m_part = BP_BUTTON;
             result.m_state = determineButtonState(o);
             break;
-        case CheckboxAppearance:
+        case CheckboxPart:
             result.m_part = BP_CHECKBOX;
             result.m_state = determineState(o);
             break;
-        case MenulistAppearance:
-        case MenulistButtonAppearance:
+        case MenulistPart:
+        case MenulistButtonPart:
             result.m_part = CP_DROPDOWNBUTTON;
             result.m_state = determineState(o);
             break;
-        case RadioAppearance:
+        case RadioPart:
             result.m_part = BP_RADIO;
             result.m_state = determineState(o);
             break;
-        case TextFieldAppearance:
-        case TextAreaAppearance:
+        case TextFieldPart:
+        case TextAreaPart:
             result.m_part = TFP_TEXTFIELD;
             result.m_state = determineState(o);
             break;
-        case SliderHorizontalAppearance:
+        case SliderHorizontalPart:
             result.m_part = TKP_TRACK;
             result.m_state = TS_NORMAL;
             break;
-        case SliderVerticalAppearance:
+        case SliderVerticalPart:
             result.m_part = TKP_TRACKVERT;
             result.m_state = TS_NORMAL;
             break;
-        case SliderThumbHorizontalAppearance:
+        case SliderThumbHorizontalPart:
             result.m_part = TKP_THUMBBOTTOM;
             result.m_state = determineSliderThumbState(o);
             break;
-        case SliderThumbVerticalAppearance:
+        case SliderThumbVerticalPart:
             result.m_part = TKP_THUMBRIGHT;
             result.m_state = determineSliderThumbState(o);
             break;
@@ -499,8 +499,8 @@ static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme,
         } else if (themeData.m_part == TKP_TRACK || themeData.m_part == TKP_TRACKVERT) {
             ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
             ::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH));
-        } else if ((o->style()->appearance() == SliderThumbHorizontalAppearance ||
-                    o->style()->appearance() == SliderThumbVerticalAppearance) && 
+        } else if ((o->style()->appearance() == SliderThumbHorizontalPart ||
+                    o->style()->appearance() == SliderThumbVerticalPart) && 
                    (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP || 
                     themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
             ::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
@@ -526,7 +526,7 @@ static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme,
             }
         } else {
             // Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists.
-            if (o->style()->appearance() == DefaultButtonAppearance) {
+            if (o->style()->appearance() == DefaultButtonPart) {
                 HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW);
                 ::FrameRect(hdc, &widgetRect, brush);
                 ::InflateRect(&widgetRect, -1, -1);
@@ -633,10 +633,10 @@ bool RenderThemeWin::paintSliderTrack(RenderObject* o, const RenderObject::Paint
 {
     IntRect bounds = r;
     
-    if (o->style()->appearance() ==  SliderHorizontalAppearance) {
+    if (o->style()->appearance() ==  SliderHorizontalPart) {
         bounds.setHeight(trackWidth);
         bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
-    } else if (o->style()->appearance() == SliderVerticalAppearance) {
+    } else if (o->style()->appearance() == SliderVerticalPart) {
         bounds.setWidth(trackWidth);
         bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
     }
@@ -656,10 +656,10 @@ const int sliderThumbHeight = 15;
 
 void RenderThemeWin::adjustSliderThumbSize(RenderObject* o) const
 {
-    if (o->style()->appearance() == SliderThumbVerticalAppearance) {
+    if (o->style()->appearance() == SliderThumbVerticalPart) {
         o->style()->setWidth(Length(sliderThumbHeight, Fixed));
         o->style()->setHeight(Length(sliderThumbWidth, Fixed));
-    } else if (o->style()->appearance() == SliderThumbHorizontalAppearance) {
+    } else if (o->style()->appearance() == SliderThumbHorizontalPart) {
         o->style()->setWidth(Length(sliderThumbWidth, Fixed));
         o->style()->setHeight(Length(sliderThumbHeight, Fixed));
     }
index 1b3e595f2a643f1ebc81e0fea58a3ac1f4d1c54e..513f6b5e4b8471b0f2252282b340096db74425e2 100644 (file)
@@ -121,7 +121,7 @@ private:
     unsigned determineSliderThumbState(RenderObject*);
     unsigned determineButtonState(RenderObject*);
 
-    bool supportsFocus(EAppearance);
+    bool supportsFocus(ControlPart);
 
     ThemeData getThemeData(RenderObject*);
     ThemeData getClassicThemeData(RenderObject* o);
index 3d1711bdc68ce81f8452033832b61ae95625f372..d88fc2582f8db001c2eb4314b1d3462448be6927 100644 (file)
@@ -65,6 +65,7 @@
 #include "StyleTransformData.h"
 #include "StyleVisualData.h"
 #include "TextDirection.h"
+#include "ThemeTypes.h"
 #include "TimingFunction.h"
 #include "TransformOperations.h"
 #include <wtf/OwnPtr.h>
@@ -328,7 +329,7 @@ public:
         return background->m_background.hasImage();
     }
     bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); }
-    bool hasAppearance() const { return appearance() != NoAppearance; }
+    bool hasAppearance() const { return appearance() != NoControlPart; }
 
     bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
     void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }
@@ -572,7 +573,7 @@ public:
     float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
     const Color& textFillColor() const { return rareInheritedData->textFillColor; }
     float opacity() const { return rareNonInheritedData->opacity; }
-    EAppearance appearance() const { return static_cast<EAppearance>(rareNonInheritedData->m_appearance); }
+    ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
     EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->align); }
     EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
     float boxFlex() { return rareNonInheritedData->flexibleBox->flex; }
@@ -864,7 +865,7 @@ public:
     void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) }
     void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c) }
     void setOpacity(float f) { SET_VAR(rareNonInheritedData, opacity, f); }
-    void setAppearance(EAppearance a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
+    void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
     void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->flexibleBox, align, a); }
     void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
     void setBoxFlex(float f) { SET_VAR(rareNonInheritedData.access()->flexibleBox, flex, f); }
@@ -1090,7 +1091,7 @@ public:
     static const AtomicString& initialHighlight() { return nullAtom; }
     static EBorderFit initialBorderFit() { return BorderFitBorder; }
     static EResize initialResize() { return RESIZE_NONE; }
-    static EAppearance initialAppearance() { return NoAppearance; }
+    static ControlPart initialAppearance() { return NoControlPart; }
     static bool initialVisuallyOrdered() { return false; }
     static float initialTextStrokeWidth() { return 0; }
     static unsigned short initialColumnCount() { return 1; }
index 8c4d3d2c8734015602c5660f85ebdcefd2bd4791..73b310df2d1ed38dc50fd1e8bdc2ca62d4a1d0e5 100644 (file)
@@ -155,23 +155,6 @@ enum EResize {
     RESIZE_NONE, RESIZE_BOTH, RESIZE_HORIZONTAL, RESIZE_VERTICAL
 };
 
-enum EAppearance {
-    NoAppearance, CheckboxAppearance, RadioAppearance, PushButtonAppearance, SquareButtonAppearance, ButtonAppearance,
-    ButtonBevelAppearance, DefaultButtonAppearance, ListboxAppearance, ListItemAppearance, 
-    MediaFullscreenButtonAppearance, MediaMuteButtonAppearance, MediaPlayButtonAppearance,
-    MediaSeekBackButtonAppearance, MediaSeekForwardButtonAppearance, MediaSliderAppearance, MediaSliderThumbAppearance,
-    MenulistAppearance, MenulistButtonAppearance, MenulistTextAppearance, MenulistTextFieldAppearance,
-    ScrollbarButtonUpAppearance, ScrollbarButtonDownAppearance, 
-    ScrollbarButtonLeftAppearance, ScrollbarButtonRightAppearance,
-    ScrollbarTrackHorizontalAppearance, ScrollbarTrackVerticalAppearance,
-    ScrollbarThumbHorizontalAppearance, ScrollbarThumbVerticalAppearance,
-    ScrollbarGripperHorizontalAppearance, ScrollbarGripperVerticalAppearance,
-    SliderHorizontalAppearance, SliderVerticalAppearance, SliderThumbHorizontalAppearance,
-    SliderThumbVerticalAppearance, CaretAppearance, SearchFieldAppearance, SearchFieldDecorationAppearance,
-    SearchFieldResultsDecorationAppearance, SearchFieldResultsButtonAppearance,
-    SearchFieldCancelButtonAppearance, TextFieldAppearance, TextAreaAppearance
-};
-
 enum EListStyleType {
      DISC, CIRCLE, SQUARE, LDECIMAL, DECIMAL_LEADING_ZERO,
      LOWER_ROMAN, UPPER_ROMAN, LOWER_GREEK,