Changeset 167755 in webkit


Ignore:
Timestamp:
Apr 24, 2014 7:27:54 AM (10 years ago)
Author:
Alan Bujtas
Message:

Transition RenderTheme API from RenderObject* to const RenderObject&
https://bugs.webkit.org/show_bug.cgi?id=132037

Reviewed by Andreas Kling.

Using const references provides better encapsulation and improve security.

No change in behavior.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::boundingBoxForQuads):

  • dom/Element.cpp:

(WebCore::Element::setActive):
(WebCore::Element::setHovered):

  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::focusedOrActiveStateChanged):

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::disabledStateChanged):
(WebCore::HTMLFormControlElement::readOnlyAttributeChanged):

  • html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::setIndeterminate):

  • html/HTMLOptionElement.cpp:

(WebCore::HTMLOptionElement::parseAttribute):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::addVisualOverflowFromTheme):
(WebCore::RenderBlock::baselinePosition):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::paintBoxDecorations):

  • rendering/RenderButton.cpp:

(WebCore::RenderButton::styleDidChange):

  • rendering/RenderFileUploadControl.cpp:

(WebCore::RenderFileUploadControl::paintObject):

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::drawLineForBoxSide):

  • rendering/RenderObject.h:
  • rendering/RenderProgress.cpp:

(WebCore::RenderProgress::computeLogicalHeight):

  • rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::paint):

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::paintBorderOnly):
(WebCore::RenderTheme::paintDecorations):
(WebCore::RenderTheme::baselinePosition):
(WebCore::RenderTheme::adjustRepaintRect):
(WebCore::RenderTheme::stateChanged):
(WebCore::RenderTheme::updateControlStatesForRenderer):
(WebCore::RenderTheme::extractControlStatesForRenderer):
(WebCore::RenderTheme::isActive):
(WebCore::RenderTheme::isChecked):
(WebCore::RenderTheme::isIndeterminate):
(WebCore::RenderTheme::isEnabled):
(WebCore::RenderTheme::isFocused):
(WebCore::RenderTheme::isPressed):
(WebCore::RenderTheme::isSpinUpButtonPartPressed):
(WebCore::RenderTheme::isReadOnlyControl):
(WebCore::RenderTheme::isHovered):
(WebCore::RenderTheme::isSpinUpButtonPartHovered):
(WebCore::RenderTheme::isDefault):
(WebCore::RenderTheme::paintInputFieldSpeechButton):
(WebCore::RenderTheme::paintMeter):
(WebCore::RenderTheme::paintSliderTicks):
(WebCore::RenderTheme::progressBarRectForBounds):

  • rendering/RenderTheme.h:

(WebCore::RenderTheme::controlSupportsTints):
(WebCore::RenderTheme::paintCapsLockIndicator):
(WebCore::RenderTheme::paintFileUploadIconDecorations):
(WebCore::RenderTheme::imageControlsButtonSize):
(WebCore::RenderTheme::paintCheckbox):
(WebCore::RenderTheme::paintRadio):
(WebCore::RenderTheme::paintButton):
(WebCore::RenderTheme::paintInnerSpinButton):
(WebCore::RenderTheme::paintCheckboxDecorations):
(WebCore::RenderTheme::paintRadioDecorations):
(WebCore::RenderTheme::paintButtonDecorations):
(WebCore::RenderTheme::paintTextField):
(WebCore::RenderTheme::paintTextFieldDecorations):
(WebCore::RenderTheme::paintTextArea):
(WebCore::RenderTheme::paintTextAreaDecorations):
(WebCore::RenderTheme::paintMenuList):
(WebCore::RenderTheme::paintMenuListDecorations):
(WebCore::RenderTheme::paintMenuListButtonDecorations):
(WebCore::RenderTheme::paintPushButtonDecorations):
(WebCore::RenderTheme::paintSquareButtonDecorations):
(WebCore::RenderTheme::paintProgressBar):
(WebCore::RenderTheme::paintSliderTrack):
(WebCore::RenderTheme::paintSliderThumb):
(WebCore::RenderTheme::paintSliderThumbDecorations):
(WebCore::RenderTheme::paintSearchField):
(WebCore::RenderTheme::paintSearchFieldDecorations):
(WebCore::RenderTheme::paintSearchFieldCancelButton):
(WebCore::RenderTheme::paintSearchFieldDecorationPart):
(WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
(WebCore::RenderTheme::paintSearchFieldResultsButton):
(WebCore::RenderTheme::paintMediaFullscreenButton):
(WebCore::RenderTheme::paintMediaPlayButton):
(WebCore::RenderTheme::paintMediaOverlayPlayButton):
(WebCore::RenderTheme::paintMediaMuteButton):
(WebCore::RenderTheme::paintMediaSeekBackButton):
(WebCore::RenderTheme::paintMediaSeekForwardButton):
(WebCore::RenderTheme::paintMediaSliderTrack):
(WebCore::RenderTheme::paintMediaSliderThumb):
(WebCore::RenderTheme::paintMediaVolumeSliderContainer):
(WebCore::RenderTheme::paintMediaVolumeSliderTrack):
(WebCore::RenderTheme::paintMediaVolumeSliderThumb):
(WebCore::RenderTheme::paintMediaRewindButton):
(WebCore::RenderTheme::paintMediaReturnToRealtimeButton):
(WebCore::RenderTheme::paintMediaToggleClosedCaptionsButton):
(WebCore::RenderTheme::paintMediaControlsBackground):
(WebCore::RenderTheme::paintMediaCurrentTime):
(WebCore::RenderTheme::paintMediaTimeRemaining):
(WebCore::RenderTheme::paintMediaFullScreenVolumeSliderTrack):
(WebCore::RenderTheme::paintMediaFullScreenVolumeSliderThumb):
(WebCore::RenderTheme::paintSnapshottedPluginOverlay):
(WebCore::RenderTheme::paintImageControlsButton):

  • rendering/RenderThemeIOS.h:
  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::addRoundedBorderClip):
(WebCore::RenderThemeIOS::paintCheckboxDecorations):
(WebCore::RenderThemeIOS::baselinePosition):
(WebCore::RenderThemeIOS::paintRadioDecorations):
(WebCore::RenderThemeIOS::paintTextFieldDecorations):
(WebCore::RenderThemeIOS::paintTextAreaDecorations):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
(WebCore::RenderThemeIOS::paintSliderTrack):
(WebCore::RenderThemeIOS::paintSliderThumbDecorations):
(WebCore::RenderThemeIOS::paintProgressBar):
(WebCore::RenderThemeIOS::paintSearchFieldDecorations):
(WebCore::RenderThemeIOS::paintButtonDecorations):
(WebCore::RenderThemeIOS::paintPushButtonDecorations):
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):

  • rendering/RenderThemeMac.h:

(WebCore::RenderThemeMac::updateActiveState):

  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::documentViewFor):
(WebCore::RenderThemeMac::adjustRepaintRect):
(WebCore::RenderThemeMac::convertToPaintingRect):
(WebCore::RenderThemeMac::updateCheckedState):
(WebCore::RenderThemeMac::updateEnabledState):
(WebCore::RenderThemeMac::updateFocusedState):
(WebCore::RenderThemeMac::updatePressedState):
(WebCore::RenderThemeMac::controlSupportsTints):
(WebCore::RenderThemeMac::paintTextField):
(WebCore::RenderThemeMac::paintCapsLockIndicator):
(WebCore::RenderThemeMac::paintTextArea):
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::paintMeter):
(WebCore::RenderThemeMac::progressBarRectForBounds):
(WebCore::RenderThemeMac::paintProgressBar):
(WebCore::RenderThemeMac::paintMenuListButtonGradients):
(WebCore::RenderThemeMac::paintMenuListButtonDecorations):
(WebCore::RenderThemeMac::setPopupButtonCellState):
(WebCore::RenderThemeMac::paintSliderTrack):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::setSearchCellState):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
(WebCore::RenderThemeMac::paintImageControlsButton):
(WebCore::RenderThemeMac::imageControlsButtonSize):

Location:
trunk/Source/WebCore
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167752 r167755  
     12014-04-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        Transition RenderTheme API from RenderObject* to const RenderObject&
     4        https://bugs.webkit.org/show_bug.cgi?id=132037
     5
     6        Reviewed by Andreas Kling.
     7
     8        Using const references provides better encapsulation and improve security.
     9
     10        No change in behavior.
     11
     12        * accessibility/AccessibilityObject.cpp:
     13        (WebCore::AccessibilityObject::boundingBoxForQuads):
     14        * dom/Element.cpp:
     15        (WebCore::Element::setActive):
     16        (WebCore::Element::setHovered):
     17        * editing/FrameSelection.cpp:
     18        (WebCore::FrameSelection::focusedOrActiveStateChanged):
     19        * html/HTMLFormControlElement.cpp:
     20        (WebCore::HTMLFormControlElement::disabledStateChanged):
     21        (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
     22        * html/HTMLInputElement.cpp:
     23        (WebCore::HTMLInputElement::setChecked):
     24        (WebCore::HTMLInputElement::setIndeterminate):
     25        * html/HTMLOptionElement.cpp:
     26        (WebCore::HTMLOptionElement::parseAttribute):
     27        * rendering/RenderBlock.cpp:
     28        (WebCore::RenderBlock::addVisualOverflowFromTheme):
     29        (WebCore::RenderBlock::baselinePosition):
     30        * rendering/RenderBox.cpp:
     31        (WebCore::RenderBox::paintBoxDecorations):
     32        * rendering/RenderButton.cpp:
     33        (WebCore::RenderButton::styleDidChange):
     34        * rendering/RenderFileUploadControl.cpp:
     35        (WebCore::RenderFileUploadControl::paintObject):
     36        * rendering/RenderFlowThread.cpp:
     37        (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
     38        * rendering/RenderObject.cpp:
     39        (WebCore::RenderObject::drawLineForBoxSide):
     40        * rendering/RenderObject.h:
     41        * rendering/RenderProgress.cpp:
     42        (WebCore::RenderProgress::computeLogicalHeight):
     43        * rendering/RenderTextControlSingleLine.cpp:
     44        (WebCore::RenderTextControlSingleLine::paint):
     45        * rendering/RenderTheme.cpp:
     46        (WebCore::RenderTheme::paint):
     47        (WebCore::RenderTheme::paintBorderOnly):
     48        (WebCore::RenderTheme::paintDecorations):
     49        (WebCore::RenderTheme::baselinePosition):
     50        (WebCore::RenderTheme::adjustRepaintRect):
     51        (WebCore::RenderTheme::stateChanged):
     52        (WebCore::RenderTheme::updateControlStatesForRenderer):
     53        (WebCore::RenderTheme::extractControlStatesForRenderer):
     54        (WebCore::RenderTheme::isActive):
     55        (WebCore::RenderTheme::isChecked):
     56        (WebCore::RenderTheme::isIndeterminate):
     57        (WebCore::RenderTheme::isEnabled):
     58        (WebCore::RenderTheme::isFocused):
     59        (WebCore::RenderTheme::isPressed):
     60        (WebCore::RenderTheme::isSpinUpButtonPartPressed):
     61        (WebCore::RenderTheme::isReadOnlyControl):
     62        (WebCore::RenderTheme::isHovered):
     63        (WebCore::RenderTheme::isSpinUpButtonPartHovered):
     64        (WebCore::RenderTheme::isDefault):
     65        (WebCore::RenderTheme::paintInputFieldSpeechButton):
     66        (WebCore::RenderTheme::paintMeter):
     67        (WebCore::RenderTheme::paintSliderTicks):
     68        (WebCore::RenderTheme::progressBarRectForBounds):
     69        * rendering/RenderTheme.h:
     70        (WebCore::RenderTheme::controlSupportsTints):
     71        (WebCore::RenderTheme::paintCapsLockIndicator):
     72        (WebCore::RenderTheme::paintFileUploadIconDecorations):
     73        (WebCore::RenderTheme::imageControlsButtonSize):
     74        (WebCore::RenderTheme::paintCheckbox):
     75        (WebCore::RenderTheme::paintRadio):
     76        (WebCore::RenderTheme::paintButton):
     77        (WebCore::RenderTheme::paintInnerSpinButton):
     78        (WebCore::RenderTheme::paintCheckboxDecorations):
     79        (WebCore::RenderTheme::paintRadioDecorations):
     80        (WebCore::RenderTheme::paintButtonDecorations):
     81        (WebCore::RenderTheme::paintTextField):
     82        (WebCore::RenderTheme::paintTextFieldDecorations):
     83        (WebCore::RenderTheme::paintTextArea):
     84        (WebCore::RenderTheme::paintTextAreaDecorations):
     85        (WebCore::RenderTheme::paintMenuList):
     86        (WebCore::RenderTheme::paintMenuListDecorations):
     87        (WebCore::RenderTheme::paintMenuListButtonDecorations):
     88        (WebCore::RenderTheme::paintPushButtonDecorations):
     89        (WebCore::RenderTheme::paintSquareButtonDecorations):
     90        (WebCore::RenderTheme::paintProgressBar):
     91        (WebCore::RenderTheme::paintSliderTrack):
     92        (WebCore::RenderTheme::paintSliderThumb):
     93        (WebCore::RenderTheme::paintSliderThumbDecorations):
     94        (WebCore::RenderTheme::paintSearchField):
     95        (WebCore::RenderTheme::paintSearchFieldDecorations):
     96        (WebCore::RenderTheme::paintSearchFieldCancelButton):
     97        (WebCore::RenderTheme::paintSearchFieldDecorationPart):
     98        (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
     99        (WebCore::RenderTheme::paintSearchFieldResultsButton):
     100        (WebCore::RenderTheme::paintMediaFullscreenButton):
     101        (WebCore::RenderTheme::paintMediaPlayButton):
     102        (WebCore::RenderTheme::paintMediaOverlayPlayButton):
     103        (WebCore::RenderTheme::paintMediaMuteButton):
     104        (WebCore::RenderTheme::paintMediaSeekBackButton):
     105        (WebCore::RenderTheme::paintMediaSeekForwardButton):
     106        (WebCore::RenderTheme::paintMediaSliderTrack):
     107        (WebCore::RenderTheme::paintMediaSliderThumb):
     108        (WebCore::RenderTheme::paintMediaVolumeSliderContainer):
     109        (WebCore::RenderTheme::paintMediaVolumeSliderTrack):
     110        (WebCore::RenderTheme::paintMediaVolumeSliderThumb):
     111        (WebCore::RenderTheme::paintMediaRewindButton):
     112        (WebCore::RenderTheme::paintMediaReturnToRealtimeButton):
     113        (WebCore::RenderTheme::paintMediaToggleClosedCaptionsButton):
     114        (WebCore::RenderTheme::paintMediaControlsBackground):
     115        (WebCore::RenderTheme::paintMediaCurrentTime):
     116        (WebCore::RenderTheme::paintMediaTimeRemaining):
     117        (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderTrack):
     118        (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderThumb):
     119        (WebCore::RenderTheme::paintSnapshottedPluginOverlay):
     120        (WebCore::RenderTheme::paintImageControlsButton):
     121        * rendering/RenderThemeIOS.h:
     122        * rendering/RenderThemeIOS.mm:
     123        (WebCore::RenderThemeIOS::addRoundedBorderClip):
     124        (WebCore::RenderThemeIOS::paintCheckboxDecorations):
     125        (WebCore::RenderThemeIOS::baselinePosition):
     126        (WebCore::RenderThemeIOS::paintRadioDecorations):
     127        (WebCore::RenderThemeIOS::paintTextFieldDecorations):
     128        (WebCore::RenderThemeIOS::paintTextAreaDecorations):
     129        (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
     130        (WebCore::RenderThemeIOS::paintSliderTrack):
     131        (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
     132        (WebCore::RenderThemeIOS::paintProgressBar):
     133        (WebCore::RenderThemeIOS::paintSearchFieldDecorations):
     134        (WebCore::RenderThemeIOS::paintButtonDecorations):
     135        (WebCore::RenderThemeIOS::paintPushButtonDecorations):
     136        (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
     137        * rendering/RenderThemeMac.h:
     138        (WebCore::RenderThemeMac::updateActiveState):
     139        * rendering/RenderThemeMac.mm:
     140        (WebCore::RenderThemeMac::documentViewFor):
     141        (WebCore::RenderThemeMac::adjustRepaintRect):
     142        (WebCore::RenderThemeMac::convertToPaintingRect):
     143        (WebCore::RenderThemeMac::updateCheckedState):
     144        (WebCore::RenderThemeMac::updateEnabledState):
     145        (WebCore::RenderThemeMac::updateFocusedState):
     146        (WebCore::RenderThemeMac::updatePressedState):
     147        (WebCore::RenderThemeMac::controlSupportsTints):
     148        (WebCore::RenderThemeMac::paintTextField):
     149        (WebCore::RenderThemeMac::paintCapsLockIndicator):
     150        (WebCore::RenderThemeMac::paintTextArea):
     151        (WebCore::RenderThemeMac::paintMenuList):
     152        (WebCore::RenderThemeMac::paintMeter):
     153        (WebCore::RenderThemeMac::progressBarRectForBounds):
     154        (WebCore::RenderThemeMac::paintProgressBar):
     155        (WebCore::RenderThemeMac::paintMenuListButtonGradients):
     156        (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
     157        (WebCore::RenderThemeMac::setPopupButtonCellState):
     158        (WebCore::RenderThemeMac::paintSliderTrack):
     159        (WebCore::RenderThemeMac::paintSliderThumb):
     160        (WebCore::RenderThemeMac::paintSearchField):
     161        (WebCore::RenderThemeMac::setSearchCellState):
     162        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
     163        (WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
     164        (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
     165        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
     166        (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
     167        (WebCore::RenderThemeMac::paintImageControlsButton):
     168        (WebCore::RenderThemeMac::imageControlsButtonSize):
     169
    11702014-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    2171
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r167210 r167755  
    712712        if (!r.isEmpty()) {
    713713            if (obj->style().hasAppearance())
    714                 obj->theme().adjustRepaintRect(obj, r);
     714                obj->theme().adjustRepaintRect(*obj, r);
    715715            result.unite(r);
    716716        }
  • trunk/Source/WebCore/dom/Element.cpp

    r167631 r167755  
    489489        setNeedsStyleRecalc();
    490490
    491     if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(renderer(), ControlStates::PressedState))
     491    if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::PressedState))
    492492        reactsToPress = true;
    493493
     
    555555
    556556    if (renderer()->style().hasAppearance())
    557         renderer()->theme().stateChanged(renderer(), ControlStates::HoverState);
     557        renderer()->theme().stateChanged(*renderer(), ControlStates::HoverState);
    558558}
    559559
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r166457 r167755  
    17501750        if (RenderObject* renderer = element->renderer())
    17511751            if (renderer && renderer->style().hasAppearance())
    1752                 renderer->theme().stateChanged(renderer, ControlStates::FocusState);
     1752                renderer->theme().stateChanged(*renderer, ControlStates::FocusState);
    17531753    }
    17541754#endif
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r166853 r167755  
    156156    didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled);
    157157    if (renderer() && renderer()->style().hasAppearance())
    158         renderer()->theme().stateChanged(renderer(), ControlStates::EnabledState);
     158        renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState);
    159159}
    160160
     
    164164    setNeedsStyleRecalc();
    165165    if (renderer() && renderer()->style().hasAppearance())
    166         renderer()->theme().stateChanged(renderer(), ControlStates::ReadOnlyState);
     166        renderer()->theme().stateChanged(*renderer(), ControlStates::ReadOnlyState);
    167167}
    168168
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r166491 r167755  
    859859            buttons->updateCheckedState(this);
    860860    if (renderer() && renderer()->style().hasAppearance())
    861         renderer()->theme().stateChanged(renderer(), ControlStates::CheckedState);
     861        renderer()->theme().stateChanged(*renderer(), ControlStates::CheckedState);
    862862    setNeedsValidityCheck();
    863863
     
    893893
    894894    if (renderer() && renderer()->style().hasAppearance())
    895         renderer()->theme().stateChanged(renderer(), ControlStates::CheckedState);
     895        renderer()->theme().stateChanged(*renderer(), ControlStates::CheckedState);
    896896}
    897897
  • trunk/Source/WebCore/html/HTMLOptionElement.cpp

    r166422 r167755  
    196196            didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled);
    197197            if (renderer() && renderer()->style().hasAppearance())
    198                 renderer()->theme().stateChanged(renderer(), ControlStates::EnabledState);
     198                renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState);
    199199        }
    200200    } else if (name == selectedAttr) {
  • trunk/Source/WebCore/html/shadow/MediaControlElementTypes.h

    r165676 r167755  
    7676
    7777HTMLMediaElement* parentMediaElement(Node*);
    78 inline HTMLMediaElement* parentMediaElement(RenderObject& renderer) { return parentMediaElement(renderer.node()); }
     78inline HTMLMediaElement* parentMediaElement(const RenderObject& renderer) { return parentMediaElement(renderer.node()); }
    7979
    8080MediaControlElementType mediaControlElementType(Node*);
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp

    r166872 r167755  
    300300}
    301301
    302 void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject* object, FormType type, const IntRect& rect)
     302void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, const RenderObject& object, FormType type, const IntRect& rect)
    303303{
    304304    if (type == SliderVertical || type == SliderHorizontal) {
    305         if (!object->isSlider())
     305        if (!object.isSlider())
    306306            return; // probably have -webkit-appearance: slider..
    307307
    308         RenderSlider* renderSlider = toRenderSlider(object);
     308        const RenderSlider* renderSlider = toRenderSlider(&object);
    309309        HTMLInputElement& input = renderSlider->element();
    310310        double valueRange = input.maximum() - input.minimum();
     
    317317        // sliders, it should always be the same and will not be affected by
    318318        // text direction settings.
    319         if (object->style().direction() == RTL || type == SliderVertical)
     319        if (object.style().direction() == RTL || type == SliderVertical)
    320320            msg->val[0] = 1;
    321321        else
     
    326326#if ENABLE(PROGRESS_ELEMENT)
    327327    } else if (type == ProgressBar) {
    328         RenderProgress* renderProgress = toRenderProgress(object);
     328        const RenderProgress* renderProgress = toRenderProgress(&object);
    329329
    330330        int max = rect.width();
     
    334334        msg->count = 2;
    335335
    336         if (object->style().direction() == RTL)
     336        if (object.style().direction() == RTL)
    337337            msg->val[0] = (1.0 - value) * max;
    338338        else
     
    351351}
    352352
    353 bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const PaintInfo& info, const IntRect& rect)
     353bool RenderThemeEfl::paintThemePart(const RenderObject& object, FormType type, const PaintInfo& info, const IntRect& rect)
    354354{
    355355    loadThemeIfNeeded();
     
    360360        return false;
    361361
    362     bool haveBackgroundColor = isControlStyled(&object->style(), object->style().border(), *object->style().backgroundLayers(), Color::white);
     362    bool haveBackgroundColor = isControlStyled(&object.style(), object.style().border(), *object.style().backgroundLayers(), Color::white);
    363363    ControlStates states(extractControlStatesForRenderer(object));
    364364    applyEdjeStateFromForm(entry->edje(), &states, haveBackgroundColor);
     
    632632}
    633633
    634 bool RenderThemeEfl::controlSupportsTints(const RenderObject* object) const
     634bool RenderThemeEfl::controlSupportsTints(const RenderObject& object) const
    635635{
    636636    return isEnabled(object);
    637637}
    638638
    639 int RenderThemeEfl::baselinePosition(const RenderObject* object) const
    640 {
    641     if (!object->isBox())
     639int RenderThemeEfl::baselinePosition(const RenderObject& object) const
     640{
     641    if (!object.isBox())
    642642        return 0;
    643643
    644     if (object->style().appearance() == CheckboxPart
    645     ||  object->style().appearance() == RadioPart)
    646         return toRenderBox(object)->marginTop() + toRenderBox(object)->height() - 3;
     644    if (object.style().appearance() == CheckboxPart
     645    ||  object.style().appearance() == RadioPart)
     646        return toRenderBox(&object)->marginTop() + toRenderBox(&object)->height() - 3;
    647647
    648648    return RenderTheme::baselinePosition(object);
     
    685685}
    686686
    687 bool RenderThemeEfl::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    688 {
    689     if (object->style().appearance() == SliderHorizontalPart)
     687bool RenderThemeEfl::paintSliderTrack(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
     688{
     689    if (object.style().appearance() == SliderHorizontalPart)
    690690        paintThemePart(object, SliderHorizontal, info, rect);
    691691    else
     
    756756}
    757757
    758 bool RenderThemeEfl::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    759 {
    760     if (object->style().appearance() == SliderThumbHorizontalPart)
     758bool RenderThemeEfl::paintSliderThumb(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
     759{
     760    if (object.style().appearance() == SliderThumbHorizontalPart)
    761761        paintThemePart(object, SliderThumbHorizontal, info, rect);
    762762    else
     
    784784}
    785785
    786 bool RenderThemeEfl::paintCheckbox(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     786bool RenderThemeEfl::paintCheckbox(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    787787{
    788788    return paintThemePart(object, CheckBox, info, rect);
     
    807807}
    808808
    809 bool RenderThemeEfl::paintRadio(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     809bool RenderThemeEfl::paintRadio(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    810810{
    811811    return paintThemePart(object, RadioButton, info, rect);
     
    824824}
    825825
    826 bool RenderThemeEfl::paintButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     826bool RenderThemeEfl::paintButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    827827{
    828828    return paintThemePart(object, Button, info, rect);
     
    842842}
    843843
    844 bool RenderThemeEfl::paintMenuList(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     844bool RenderThemeEfl::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    845845{
    846846    return paintThemePart(object, ComboBox, info, rect);
     
    863863}
    864864
    865 bool RenderThemeEfl::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     865bool RenderThemeEfl::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    866866{
    867867    return paintMenuList(object, info, rect);
     
    878878}
    879879
    880 bool RenderThemeEfl::paintTextField(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     880bool RenderThemeEfl::paintTextField(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    881881{
    882882    return paintThemePart(object, TextField, info, rect);
     
    887887}
    888888
    889 bool RenderThemeEfl::paintTextArea(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     889bool RenderThemeEfl::paintTextArea(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    890890{
    891891    return paintTextField(object, info, rect);
     
    909909}
    910910
    911 bool RenderThemeEfl::paintSearchFieldResultsButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     911bool RenderThemeEfl::paintSearchFieldResultsButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    912912{
    913913    return paintThemePart(object, SearchFieldResultsButton, info, rect);
     
    931931}
    932932
    933 bool RenderThemeEfl::paintSearchFieldResultsDecorationPart(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     933bool RenderThemeEfl::paintSearchFieldResultsDecorationPart(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    934934{
    935935    return paintThemePart(object, SearchFieldResultsDecoration, info, rect);
     
    955955}
    956956
    957 bool RenderThemeEfl::paintSearchFieldCancelButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     957bool RenderThemeEfl::paintSearchFieldCancelButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    958958{
    959959    return paintThemePart(object, SearchFieldCancelButton, info, rect);
     
    971971}
    972972
    973 bool RenderThemeEfl::paintSearchField(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     973bool RenderThemeEfl::paintSearchField(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    974974{
    975975    return paintThemePart(object, SearchField, info, rect);
     
    985985}
    986986
    987 bool RenderThemeEfl::paintInnerSpinButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     987bool RenderThemeEfl::paintInnerSpinButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    988988{
    989989    return paintThemePart(object, Spinner, info, rect);
     
    10231023}
    10241024
    1025 bool RenderThemeEfl::paintProgressBar(RenderObject* object, const PaintInfo& info, const IntRect& rect)
    1026 {
    1027     if (!object->isProgress())
     1025bool RenderThemeEfl::paintProgressBar(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
     1026{
     1027    if (!object.isProgress())
    10281028        return true;
    10291029
  • trunk/Source/WebCore/platform/efl/RenderThemeEfl.h

    r166872 r167755  
    7979
    8080    // A method asking if the control changes its tint when the window has focus or not.
    81     virtual bool controlSupportsTints(const RenderObject*) const;
     81    virtual bool controlSupportsTints(const RenderObject&) const;
    8282
    8383    // A general method asking if any control tinting is supported at all.
     
    9090    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    9191    // controls that need to do this.
    92     virtual int baselinePosition(const RenderObject*) const;
     92    virtual int baselinePosition(const RenderObject&) const;
    9393
    9494    virtual Color platformActiveSelectionBackgroundColor() const;
     
    112112
    113113    virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const;
    114     virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
     114    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
    115115
    116116    virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const;
    117     virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
     117    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
    118118
    119119    virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    120     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
     120    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
    121121
    122122    virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    123     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
     123    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
    124124
    125125    virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
    126     virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
     126    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
    127127
    128128    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
    129     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     129    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
    130130
    131131    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    132     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     132    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
    133133
    134134    virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    135     virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     135    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    136136
    137137    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    138     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
     138    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
    139139
    140140    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    141     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
     141    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
    142142
    143143    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    144     virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
     144    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
    145145
    146146    virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
    147     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     147    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
    148148
    149149    virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
     
    159159    virtual bool supportsDataListUI(const AtomicString&) const override;
    160160
    161     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     161    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
    162162
    163163    virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    164     virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
     164    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&);
    165165
    166166    static void setDefaultFontSize(int fontsize);
     
    168168#if ENABLE(PROGRESS_ELEMENT)
    169169    virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
    170     virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
     170    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&);
    171171    virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
    172172    virtual double animationDurationForProgressBar(RenderProgress*) const;
     
    201201
    202202    void applyEdjeStateFromForm(Evas_Object*, const ControlStates*, bool);
    203     void applyEdjeRTLState(Evas_Object*, RenderObject*, FormType, const IntRect&);
    204     bool paintThemePart(RenderObject*, FormType, const PaintInfo&, const IntRect&);
     203    void applyEdjeRTLState(Evas_Object*, const RenderObject&, FormType, const IntRect&);
     204    bool paintThemePart(const RenderObject&, FormType, const PaintInfo&, const IntRect&);
    205205
    206206    Page* m_page;
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp

    r167170 r167755  
    6666
    6767#if ENABLE(VIDEO)
    68 static HTMLMediaElement* getMediaElementFromRenderObject(RenderObject* o)
    69 {
    70     Node* node = o->node();
     68static HTMLMediaElement* getMediaElementFromRenderObject(const RenderObject& o)
     69{
     70    Node* node = o.node();
    7171    Node* mediaNode = node ? node->shadowHost() : 0;
    7272    if (!mediaNode)
     
    174174}
    175175
    176 bool RenderThemeGtk::controlSupportsTints(const RenderObject* o) const
     176bool RenderThemeGtk::controlSupportsTints(const RenderObject& o) const
    177177{
    178178    return isEnabled(o);
    179179}
    180180
    181 int RenderThemeGtk::baselinePosition(const RenderObject* o) const
    182 {
    183     if (!o->isBox())
     181int RenderThemeGtk::baselinePosition(const RenderObject& o) const
     182{
     183    if (!o.isBox())
    184184        return 0;
    185185
    186186    // FIXME: This strategy is possibly incorrect for the GTK+ port.
    187     if (o->style().appearance() == CheckboxPart
    188         || o->style().appearance() == RadioPart) {
    189         const RenderBox* box = toRenderBox(o);
     187    if (o.style().appearance() == CheckboxPart
     188        || o.style().appearance() == RadioPart) {
     189        const RenderBox* box = toRenderBox(&o);
    190190        return box->marginTop() + box->height() - 2;
    191191    }
     
    209209}
    210210
    211 static GtkStateType gtkIconState(RenderTheme* theme, RenderObject* renderObject)
     211static GtkStateType gtkIconState(RenderTheme* theme, const RenderObject& renderObject)
    212212{
    213213    if (!theme->isEnabled(renderObject))
     
    242242}
    243243
    244 bool RenderThemeGtk::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     244bool RenderThemeGtk::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    245245{
    246246    return paintMenuList(object, info, rect);
    247247}
    248248
    249 bool RenderThemeGtk::paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& r)
     249bool RenderThemeGtk::paintTextArea(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    250250{
    251251    return paintTextField(o, i, r);
     
    299299}
    300300
    301 bool RenderThemeGtk::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     301bool RenderThemeGtk::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& i, const IntRect& rect)
    302302{
    303303    return paintSearchFieldResultsDecorationPart(o, i, rect);
     
    327327}
    328328
    329 static IntRect centerRectVerticallyInParentInputElement(RenderObject* renderObject, const IntRect& rect)
     329static IntRect centerRectVerticallyInParentInputElement(const RenderObject& renderObject, const IntRect& rect)
    330330{
    331331    // Get the renderer of <input> element.
    332     Node* input = renderObject->node()->shadowHost();
     332    Node* input = renderObject.node()->shadowHost();
    333333    if (!input)
    334         input = renderObject->node();
     334        input = renderObject.node();
    335335    if (!input->renderer()->isBox())
    336336        return IntRect();
     
    347347}
    348348
    349 bool RenderThemeGtk::paintSearchFieldResultsDecorationPart(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     349bool RenderThemeGtk::paintSearchFieldResultsDecorationPart(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    350350{
    351351    IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect);
     
    354354
    355355    GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_FIND,
    356                                                         gtkTextDirection(renderObject->style().direction()),
    357                                                         gtkIconState(this, renderObject),
    358                                                         getIconSizeForPixelSize(rect.height()));
     356        gtkTextDirection(renderObject.style().direction()),
     357        gtkIconState(this, renderObject),
     358        getIconSizeForPixelSize(rect.height()));
    359359    paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
    360360    return false;
     
    366366}
    367367
    368 bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     368bool RenderThemeGtk::paintSearchFieldCancelButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    369369{
    370370    IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect);
     
    373373
    374374    GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CLEAR,
    375                                                         gtkTextDirection(renderObject->style().direction()),
    376                                                         gtkIconState(this, renderObject),
    377                                                         getIconSizeForPixelSize(rect.height()));
     375        gtkTextDirection(renderObject.style().direction()),
     376        gtkIconState(this, renderObject),
     377        getIconSizeForPixelSize(rect.height()));
    378378    paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
    379379    return false;
     
    387387}
    388388
    389 bool RenderThemeGtk::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& rect)
     389bool RenderThemeGtk::paintSearchField(const RenderObject& o, const PaintInfo& i, const IntRect& rect)
    390390{
    391391    return paintTextField(o, i, rect);
    392392}
    393393
    394 bool RenderThemeGtk::paintCapsLockIndicator(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     394bool RenderThemeGtk::paintCapsLockIndicator(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    395395{
    396396    // The other paint methods don't need to check whether painting is disabled because RenderTheme already checks it
     
    400400
    401401    int iconSize = std::min(rect.width(), rect.height());
    402     GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING,
    403                                                         gtkTextDirection(renderObject->style().direction()),
    404                                                         0, getIconSizeForPixelSize(iconSize));
     402    GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING, gtkTextDirection(renderObject.style().direction()), 0, getIconSizeForPixelSize(iconSize));
    405403
    406404    // Only re-scale the icon when it's smaller than the minimum icon size.
     
    506504#endif
    507505
    508 bool RenderThemeGtk::paintMediaButton(RenderObject* renderObject, GraphicsContext* context, const IntRect& rect, const char* symbolicIconName, const char* fallbackStockIconName)
     506bool RenderThemeGtk::paintMediaButton(const RenderObject& renderObject, GraphicsContext* context, const IntRect& rect, const char* symbolicIconName, const char* fallbackStockIconName)
    509507{
    510508    IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2,
     
    512510                     m_mediaIconSize, m_mediaIconSize);
    513511    GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, symbolicIconName, fallbackStockIconName,
    514         gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
     512        gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width());
    515513    paintGdkPixbuf(context, icon.get(), iconRect);
    516514    return true;
     
    522520}
    523521
    524 bool RenderThemeGtk::paintMediaFullscreenButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     522bool RenderThemeGtk::paintMediaFullscreenButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    525523{
    526524    return paintMediaButton(renderObject, paintInfo.context, rect, "view-fullscreen-symbolic", GTK_STOCK_FULLSCREEN);
    527525}
    528526
    529 bool RenderThemeGtk::paintMediaMuteButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     527bool RenderThemeGtk::paintMediaMuteButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    530528{
    531529    HTMLMediaElement* mediaElement = getMediaElementFromRenderObject(renderObject);
     
    539537}
    540538
    541 bool RenderThemeGtk::paintMediaPlayButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    542 {
    543     Node* node = renderObject->node();
     539bool RenderThemeGtk::paintMediaPlayButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     540{
     541    Node* node = renderObject.node();
    544542    if (!node)
    545543        return false;
     
    554552}
    555553
    556 bool RenderThemeGtk::paintMediaSeekBackButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     554bool RenderThemeGtk::paintMediaSeekBackButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    557555{
    558556    return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-backward-symbolic", GTK_STOCK_MEDIA_REWIND);
    559557}
    560558
    561 bool RenderThemeGtk::paintMediaSeekForwardButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     559bool RenderThemeGtk::paintMediaSeekForwardButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    562560{
    563561    return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-forward-symbolic", GTK_STOCK_MEDIA_FORWARD);
     
    565563
    566564#if ENABLE(VIDEO_TRACK)
    567 bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     565bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    568566{
    569567    IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2, rect.y() + (rect.height() - m_mediaIconSize) / 2,
    570568        m_mediaIconSize, m_mediaIconSize);
    571569    GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, "media-view-subtitles-symbolic", nullptr,
    572         gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
     570        gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width());
    573571    if (!icon)
    574572        icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, "user-invisible-symbolic", GTK_STOCK_JUSTIFY_FILL,
    575             gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
     573            gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width());
    576574    paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
    577575    return true;
     
    588586}
    589587
    590 bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    591 {
    592     HTMLMediaElement* mediaElement = parentMediaElement(*o);
     588bool RenderThemeGtk::paintMediaSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
     589{
     590    HTMLMediaElement* mediaElement = parentMediaElement(o);
    593591    if (!mediaElement)
    594592        return false;
     
    600598    float mediaDuration = mediaElement->duration();
    601599    float totalTrackWidth = r.width();
    602     RenderStyle* style = &o->style();
     600    RenderStyle* style = &o.style();
    603601    RefPtr<TimeRanges> timeRanges = mediaElement->buffered();
    604602    for (unsigned index = 0; index < timeRanges->length(); ++index) {
     
    621619}
    622620
    623 bool RenderThemeGtk::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    624 {
    625     RenderStyle* style = &o->style();
     621bool RenderThemeGtk::paintMediaSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
     622{
     623    RenderStyle* style = &o.style();
    626624    paintInfo.context->fillRoundedRect(FloatRoundedRect(r, borderRadiiFromStyle(style)), style->visitedDependentColor(CSSPropertyColor), style->colorSpace());
    627625    return false;
    628626}
    629627
    630 bool RenderThemeGtk::paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&)
     628bool RenderThemeGtk::paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&)
    631629{
    632630    return true;
    633631}
    634632
    635 bool RenderThemeGtk::paintMediaVolumeSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    636 {
    637     HTMLMediaElement* mediaElement = parentMediaElement(*renderObject);
     633bool RenderThemeGtk::paintMediaVolumeSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     634{
     635    HTMLMediaElement* mediaElement = parentMediaElement(renderObject);
    638636    if (!mediaElement)
    639637        return true;
     
    649647    int rectHeight = rect.height();
    650648    float trackHeight = rectHeight * volume;
    651     RenderStyle* style = &renderObject->style();
     649    RenderStyle* style = &renderObject.style();
    652650    IntRect volumeRect(rect);
    653651    volumeRect.move(0, rectHeight - trackHeight);
     
    661659}
    662660
    663 bool RenderThemeGtk::paintMediaVolumeSliderThumb(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     661bool RenderThemeGtk::paintMediaVolumeSliderThumb(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    664662{
    665663    return paintMediaSliderThumb(renderObject, paintInfo, rect);
     
    671669}
    672670
    673 bool RenderThemeGtk::paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&)
     671bool RenderThemeGtk::paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&)
    674672{
    675673    return false;
     
    697695}
    698696
    699 IntRect RenderThemeGtk::calculateProgressRect(RenderObject* renderObject, const IntRect& fullBarRect)
     697IntRect RenderThemeGtk::calculateProgressRect(const RenderObject& renderObject, const IntRect& fullBarRect)
    700698{
    701699    IntRect progressRect(fullBarRect);
    702     RenderProgress* renderProgress = toRenderProgress(renderObject);
     700    const RenderProgress* renderProgress = toRenderProgress(&renderObject);
    703701    if (renderProgress->isDeterminate()) {
    704702        int progressWidth = progressRect.width() * renderProgress->position();
    705         if (renderObject->style().direction() == RTL)
     703        if (renderObject.style().direction() == RTL)
    706704            progressRect.setX(progressRect.x() + progressRect.width() - progressWidth);
    707705        progressRect.setWidth(progressWidth);
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h

    r165688 r167755  
    5151
    5252    // A method asking if the control changes its tint when the window has focus or not.
    53     virtual bool controlSupportsTints(const RenderObject*) const;
     53    virtual bool controlSupportsTints(const RenderObject&) const;
    5454
    5555    // A general method asking if any control tinting is supported at all.
    5656    virtual bool supportsControlTints() const { return true; }
    5757
    58     virtual void adjustRepaintRect(const RenderObject*, IntRect&);
     58    virtual void adjustRepaintRect(const RenderObject&, IntRect&);
    5959
    6060    // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
    6161    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    6262    // controls that need to do this.
    63     virtual int baselinePosition(const RenderObject*) const;
     63    virtual int baselinePosition(const RenderObject&) const;
    6464
    6565    // The platform selection color.
     
    115115
    116116protected:
    117     virtual bool paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r);
     117    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
    118118    virtual void setCheckboxSize(RenderStyle* style) const;
    119119
    120     virtual bool paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& r);
     120    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
    121121    virtual void setRadioSize(RenderStyle* style) const;
    122122
    123123    virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    124     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
    125 
    126     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
    127     virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
     124    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
     125
     126    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
     127    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
    128128
    129129    int popupInternalPaddingLeft(RenderStyle*) const;
     
    138138    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
    139139    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    140     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
    141     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     140    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
     141    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
    142142
    143143    virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    144     virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     144    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    145145
    146146    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    147     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
     147    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
    148148
    149149    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    150     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
     150    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
    151151
    152152    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    153     virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
    154 
    155     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     153    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
     154
     155    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
    156156    virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
    157157
    158     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     158    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
    159159    virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
    160160
     
    165165    void initMediaButtons();
    166166    virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const;
    167     virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
    168     virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
    169     virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
    170     virtual bool paintMediaSeekBackButton(RenderObject*, const PaintInfo&, const IntRect&);
    171     virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&);
    172     virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
    173     virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    174     virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
    175     virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
    176     virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    177     virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&);
     167    virtual bool paintMediaFullscreenButton(const RenderObject&, const PaintInfo&, const IntRect&);
     168    virtual bool paintMediaPlayButton(const RenderObject&, const PaintInfo&, const IntRect&);
     169    virtual bool paintMediaMuteButton(const RenderObject&, const PaintInfo&, const IntRect&);
     170    virtual bool paintMediaSeekBackButton(const RenderObject&, const PaintInfo&, const IntRect&);
     171    virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&);
     172    virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
     173    virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
     174    virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&);
     175    virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
     176    virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
     177    virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&);
    178178#if ENABLE(VIDEO_TRACK)
    179     virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&);
     179    virtual bool paintMediaToggleClosedCaptionsButton(const RenderObject&, const PaintInfo&, const IntRect&);
    180180#endif
    181181#endif
     
    185185    virtual double animationDurationForProgressBar(RenderProgress*) const;
    186186    virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
    187     virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
    188 #endif
    189 
    190     virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
     187    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&);
     188#endif
     189
     190    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&);
    191191
    192192    virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    193     virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
     193    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&);
    194194
    195195private:
     
    201201
    202202#if ENABLE(VIDEO)
    203     bool paintMediaButton(RenderObject*, GraphicsContext*, const IntRect&, const char* symbolicIconName, const char* fallbackStockIconName);
     203    bool paintMediaButton(const RenderObject&, GraphicsContext*, const IntRect&, const char* symbolicIconName, const char* fallbackStockIconName);
    204204#endif
    205205
    206206#if ENABLE(PROGRESS_ELEMENT)
    207     static IntRect calculateProgressRect(RenderObject*, const IntRect&);
     207    static IntRect calculateProgressRect(const RenderObject&, const IntRect&);
    208208#endif
    209209
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp

    r165688 r167755  
    111111}
    112112
    113 void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect& rect)
    114 {
    115     ControlPart part = renderObject->style().appearance();
     113void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)
     114{
     115    ControlPart part = renderObject.style().appearance();
    116116    switch (part) {
    117117    case CheckboxPart:
     
    132132}
    133133
    134 static GtkStateType getGtkStateType(RenderThemeGtk* theme, RenderObject* object)
     134static GtkStateType getGtkStateType(RenderThemeGtk* theme, const RenderObject& object)
    135135{
    136136    if (!theme->isEnabled(object) || theme->isReadOnlyControl(object))
     
    157157}
    158158
    159 static void paintToggle(RenderThemeGtk* theme, RenderObject* renderObject, const PaintInfo& info, const IntRect& rect, GtkWidget* widget)
     159static void paintToggle(RenderThemeGtk* theme, const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect, GtkWidget* widget)
    160160{
    161161    // We do not call gtk_toggle_button_set_active here, because some themes begin a series of
     
    164164    // 'active' property) to determine whether or not to draw the check.
    165165    gtk_widget_set_sensitive(widget, theme->isEnabled(renderObject) && !theme->isReadOnlyControl(renderObject));
    166     gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
     166    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
    167167
    168168    bool indeterminate = theme->isIndeterminate(renderObject);
     
    199199}
    200200
    201 bool RenderThemeGtk::paintCheckbox(RenderObject* renderObject, const PaintInfo& info, const IntRect& rect)
     201bool RenderThemeGtk::paintCheckbox(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect)
    202202{
    203203    paintToggle(this, renderObject, info, rect, gtkCheckButton());
     
    210210}
    211211
    212 bool RenderThemeGtk::paintRadio(RenderObject* renderObject, const PaintInfo& info, const IntRect& rect)
     212bool RenderThemeGtk::paintRadio(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect)
    213213{
    214214    paintToggle(this, renderObject, info, rect, gtkRadioButton());
     
    228228}
    229229
    230 bool RenderThemeGtk::paintButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     230bool RenderThemeGtk::paintButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    231231{
    232232    if (info.context->paintingDisabled())
     
    239239    GtkStateType state = getGtkStateType(this, object);
    240240    gtk_widget_set_state(widget, state);
    241     gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
     241    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
    242242
    243243    if (isFocused(object)) {
     
    366366}
    367367
    368 bool RenderThemeGtk::paintMenuList(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     368bool RenderThemeGtk::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    369369{
    370370    if (paintButton(object, info, rect))
     
    379379    int leftBorder = 0, rightBorder = 0, bottomBorder = 0, topBorder = 0;
    380380    getButtonInnerBorder(gtkComboBoxButton(), leftBorder, topBorder, rightBorder, bottomBorder);
    381     RenderStyle* style = &object->style();
     381    RenderStyle* style = &object.style();
    382382    int arrowSize = comboBoxArrowSize(style);
    383383    GtkStyle* buttonStyle = gtk_widget_get_style(gtkComboBoxButton());
     
    423423}
    424424
    425 bool RenderThemeGtk::paintTextField(RenderObject* renderObject, const PaintInfo& info, const IntRect& rect)
     425bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect)
    426426{
    427427    GtkWidget* widget = gtkEntry();
     
    430430    GtkStateType backgroundState = enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
    431431    gtk_widget_set_sensitive(widget, enabled);
    432     gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
     432    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
    433433    setWidgetHasFocus(widget, isFocused(renderObject));
    434434
     
    466466}
    467467
    468 bool RenderThemeGtk::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     468bool RenderThemeGtk::paintSliderTrack(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    469469{
    470470    if (info.context->paintingDisabled())
    471471        return false;
    472472
    473     ControlPart part = object->style().appearance();
     473    ControlPart part = object.style().appearance();
    474474    ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
    475475
     
    484484        troughRect.inflateY(-gtk_widget_get_style(widget)->ythickness);
    485485    }
    486     gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
     486    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
    487487
    488488    WidgetRenderingContext widgetContext(info.context, rect);
     
    494494}
    495495
    496 bool RenderThemeGtk::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
     496bool RenderThemeGtk::paintSliderThumb(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
    497497{
    498498    if (info.context->paintingDisabled())
    499499        return false;
    500500
    501     ControlPart part = object->style().appearance();
     501    ControlPart part = object.style().appearance();
    502502    ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
    503503
     
    514514        orientation = GTK_ORIENTATION_VERTICAL;
    515515    }
    516     gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
     516    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
    517517
    518518    // Only some themes have slider thumbs respond to clicks and some don't. This information is
     
    550550
    551551#if ENABLE(PROGRESS_ELEMENT)
    552 bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     552bool RenderThemeGtk::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    553553{
    554554    GtkWidget* widget = gtkProgressBar();
    555     gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
     555    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
    556556
    557557    WidgetRenderingContext widgetContext(paintInfo.context, rect);
     
    587587}
    588588
    589 bool RenderThemeGtk::paintInnerSpinButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     589bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    590590{
    591591    // We expand the painted area by 2 pixels on the top and bottom and 2 pixels on the right. This
     
    598598    WidgetRenderingContext widgetContext(paintInfo.context, expandedRect);
    599599    GtkWidget* widget = gtkSpinButton();
    600     gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
     600    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
    601601
    602602    IntRect fullSpinButtonRect(IntPoint(), expandedRect.size());
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp

    r165607 r167755  
    158158}
    159159
    160 void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect& rect)
     160void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)
    161161{
    162162    GtkStyleContext* context = 0;
    163163    bool checkInteriorFocus = false;
    164     ControlPart part = renderObject->style().appearance();
     164    ControlPart part = renderObject.style().appearance();
    165165    switch (part) {
    166166    case CheckboxPart:
     
    221221}
    222222
    223 static void paintToggle(const RenderThemeGtk* theme, GType widgetType, RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& fullRect)
     223static void paintToggle(const RenderThemeGtk* theme, GType widgetType, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& fullRect)
    224224{
    225225    GtkStyleContext* context = getStyleContext(widgetType);
     
    243243    }
    244244
    245     gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
     245    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())));
    246246    gtk_style_context_add_class(context, widgetType == GTK_TYPE_CHECK_BUTTON ? GTK_STYLE_CLASS_CHECK : GTK_STYLE_CLASS_RADIO);
    247247
     
    281281}
    282282
    283 bool RenderThemeGtk::paintCheckbox(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     283bool RenderThemeGtk::paintCheckbox(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    284284{
    285285    paintToggle(this, GTK_TYPE_CHECK_BUTTON, renderObject, paintInfo, rect);
     
    292292}
    293293
    294 bool RenderThemeGtk::paintRadio(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     294bool RenderThemeGtk::paintRadio(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    295295{
    296296    paintToggle(this, GTK_TYPE_RADIO_BUTTON, renderObject, paintInfo, rect);
     
    298298}
    299299
    300 static void renderButton(RenderTheme* theme, GtkStyleContext* context, RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     300static void renderButton(RenderTheme* theme, GtkStyleContext* context, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    301301{
    302302    IntRect buttonRect(rect);
     
    364364    }
    365365}
    366 bool RenderThemeGtk::paintButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     366bool RenderThemeGtk::paintButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    367367{
    368368    GtkStyleContext* context = getStyleContext(GTK_TYPE_BUTTON);
    369369    gtk_style_context_save(context);
    370370
    371     gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
     371    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())));
    372372    gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON);
    373373
     
    465465}
    466466
    467 bool RenderThemeGtk::paintMenuList(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     467bool RenderThemeGtk::paintMenuList(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    468468{
    469469    cairo_t* cairoContext = paintInfo.context->platformContext()->cr();
    470     GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction()));
     470    GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()));
    471471
    472472    // Paint the button.
     
    596596}
    597597
    598 bool RenderThemeGtk::paintTextField(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     598bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    599599{
    600600    GtkStyleContext* context = getStyleContext(GTK_TYPE_ENTRY);
    601601    gtk_style_context_save(context);
    602602
    603     gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
     603    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())));
    604604    gtk_style_context_add_class(context, GTK_STYLE_CLASS_ENTRY);
    605605
     
    644644}
    645645
    646 bool RenderThemeGtk::paintSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    647 {
    648     ControlPart part = renderObject->style().appearance();
     646bool RenderThemeGtk::paintSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     647{
     648    ControlPart part = renderObject.style().appearance();
    649649    ASSERT_UNUSED(part, part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
    650650
     
    652652    gtk_style_context_save(context);
    653653
    654     gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style().direction()));
     654    gtk_style_context_set_direction(context, gtkTextDirection(renderObject.style().direction()));
    655655    applySliderStyleContextClasses(context, part);
    656656    gtk_style_context_add_class(context, GTK_STYLE_CLASS_TROUGH);
     
    679679}
    680680
    681 bool RenderThemeGtk::paintSliderThumb(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    682 {
    683     ControlPart part = renderObject->style().appearance();
     681bool RenderThemeGtk::paintSliderThumb(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     682{
     683    ControlPart part = renderObject.style().appearance();
    684684    ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
    685685
     
    687687    gtk_style_context_save(context);
    688688
    689     gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style().direction()));
     689    gtk_style_context_set_direction(context, gtkTextDirection(renderObject.style().direction()));
    690690    applySliderStyleContextClasses(context, part);
    691691    gtk_style_context_add_class(context, GTK_STYLE_CLASS_SLIDER);
     
    730730
    731731#if ENABLE(PROGRESS_ELEMENT)
    732 bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    733 {
    734     if (!renderObject->isProgress())
     732bool RenderThemeGtk::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     733{
     734    if (!renderObject.isProgress())
    735735        return true;
    736736
     
    787787}
    788788
    789 static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect, GtkArrowType arrowType)
     789static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect, GtkArrowType arrowType)
    790790{
    791791    ASSERT(arrowType == GTK_ARROW_UP || arrowType == GTK_ARROW_DOWN);
     
    853853}
    854854
    855 bool RenderThemeGtk::paintInnerSpinButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     855bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    856856{
    857857    GtkStyleContext* context = getStyleContext(GTK_TYPE_SPIN_BUTTON);
    858858    gtk_style_context_save(context);
    859859
    860     GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction()));
     860    GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()));
    861861    gtk_style_context_set_direction(context, direction);
    862862
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r167723 r167755  
    14391439
    14401440    IntRect inflatedRect = pixelSnappedBorderBoxRect();
    1441     theme().adjustRepaintRect(this, inflatedRect);
     1441    theme().adjustRepaintRect(*this, inflatedRect);
    14421442    addVisualOverflow(inflatedRect);
    14431443
     
    42954295        // FIXME: Need to patch form controls to deal with vertical lines.
    42964296        if (style().hasAppearance() && !theme().isControlContainer(style().appearance()))
    4297             return theme().baselinePosition(this);
     4297            return theme().baselinePosition(*this);
    42984298           
    42994299        // CSS2.1 states that the baseline of an inline block is the baseline of the last line box in
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r167727 r167755  
    12281228    }
    12291229
    1230     bool themePainted = style().hasAppearance() && !theme().paint(this, controlStates, paintInfo, snappedPaintRect);
     1230    bool themePainted = style().hasAppearance() && !theme().paint(*this, controlStates, paintInfo, snappedPaintRect);
    12311231
    12321232    if (controlStates && controlStates->needsRepaint())
     
    12401240
    12411241        if (style().hasAppearance())
    1242             theme().paintDecorations(this, paintInfo, snappedPaintRect);
     1242            theme().paintDecorations(*this, paintInfo, snappedPaintRect);
    12431243    }
    12441244    paintBoxShadow(paintInfo, paintRect, style(), Inset);
    12451245
    12461246    // The theme will tell us whether or not we should also paint the CSS border.
    1247     if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(this, paintInfo, snappedPaintRect))) && style().hasBorder())
     1247    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, snappedPaintRect))) && style().hasBorder())
    12481248        paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
    12491249
  • trunk/Source/WebCore/rendering/RenderButton.cpp

    r166489 r167755  
    113113        setupInnerStyle(&m_inner->style());
    114114
    115     if (!m_default && theme().isDefault(this)) {
     115    if (!m_default && theme().isDefault(*this)) {
    116116        if (!m_timer)
    117117            m_timer = std::make_unique<Timer<RenderButton>>(this, &RenderButton::timerFired);
    118118        m_timer->startRepeating(0.03);
    119119        m_default = true;
    120     } else if (m_default && !theme().isDefault(this)) {
     120    } else if (m_default && !theme().isDefault(*this)) {
    121121        m_default = false;
    122122        m_timer = nullptr;
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r164441 r167755  
    183183                IntRect iconRect(iconX, iconY, iconWidth, iconHeight);
    184184                RenderTheme::FileUploadDecorations decorationsType = inputElement().files()->length() == 1 ? RenderTheme::SingleFile : RenderTheme::MultipleFiles;
    185                 theme().paintFileUploadIconDecorations(this, buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType);
     185                theme().paintFileUploadIconDecorations(*this, *buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType);
    186186            }
    187187#else
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r167723 r167755  
    12791279
    12801280        IntRect inflatedRect = pixelSnappedIntRect(borderBox);
    1281         block->theme().adjustRepaintRect(block, inflatedRect);
     1281        block->theme().adjustRepaintRect(*block, inflatedRect);
    12821282
    12831283        region->addVisualOverflowForBox(block, inflatedRect);
  • trunk/Source/WebCore/rendering/RenderMediaControls.cpp

    r160625 r167755  
    7171#if PLATFORM(WIN) && USE(CG)
    7272
    73 static WKMediaControllerThemeState determineState(RenderObject* o)
     73static WKMediaControllerThemeState determineState(const RenderObject& o)
    7474{
    7575    int result = 0;
    76     const RenderTheme& theme = o->theme();
     76    const RenderTheme& theme = o.theme();
    7777    if (!theme.isEnabled(o) || theme.isReadOnlyControl(o))
    7878        result |= WKMediaControllerFlagDisabled;
     
    8585
    8686// Utility to scale when the UI part are not scaled by wkDrawMediaUIPart
    87 static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const PaintInfo& paintInfo, const IntRect &originalRect)
    88 {
    89     float zoomLevel = o->style().effectiveZoom();
     87static FloatRect getUnzoomedRectAndAdjustCurrentContext(const RenderObject& o, const PaintInfo& paintInfo, const IntRect &originalRect)
     88{
     89    float zoomLevel = o.style().effectiveZoom();
    9090    FloatRect unzoomedRect(originalRect);
    9191    if (zoomLevel != 1.0f) {
     
    127127}
    128128
    129 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     129bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    130130{
    131131    GraphicsContextStateSaver stateSaver(*paintInfo.context);
     
    134134    case MediaEnterFullscreenButton:
    135135    case MediaExitFullscreenButton:
    136         if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o->node())) {
     136        if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o.node())) {
    137137            bool enterButton = btn->displayType() == MediaEnterFullscreenButton;
    138138            wkDrawMediaUIPart(enterButton ? WKMediaUIPartFullscreenButton : WKMediaUIPartExitFullscreenButton, paintInfo.context->platformContext(), r, determineState(o));
     
    141141    case MediaShowClosedCaptionsButton:
    142142    case MediaHideClosedCaptionsButton:
    143         if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o->node())) {
     143        if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o.node())) {
    144144            bool captionsVisible = btn->displayType() == MediaHideClosedCaptionsButton;
    145145            wkDrawMediaUIPart(captionsVisible ? WKMediaUIPartHideClosedCaptionsButton : WKMediaUIPartShowClosedCaptionsButton, paintInfo.context->platformContext(), r, determineState(o));
     
    148148    case MediaMuteButton:
    149149    case MediaUnMuteButton:
    150         if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o->node())) {
     150        if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o.node())) {
    151151            bool audioEnabled = btn->displayType() == MediaMuteButton;
    152152            wkDrawMediaUIPart(audioEnabled ? WKMediaUIPartMuteButton : WKMediaUIPartUnMuteButton, paintInfo.context->platformContext(), r, determineState(o));
     
    155155    case MediaPauseButton:
    156156    case MediaPlayButton:
    157         if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) {
     157        if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o.node())) {
    158158            bool canPlay = btn->displayType() == MediaPlayButton;
    159159            wkDrawMediaUIPart(canPlay ? WKMediaUIPartPlayButton : WKMediaUIPartPauseButton, paintInfo.context->platformContext(), r, determineState(o));
     
    173173        break;
    174174    case MediaSlider: {
    175         if (HTMLMediaElement* mediaElement = parentMediaElement(*o)) {
     175        if (HTMLMediaElement* mediaElement = parentMediaElement(o)) {
    176176            FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
    177177            wkDrawMediaSliderTrack(paintInfo.context->platformContext(), unzoomedRect, mediaElement->percentLoaded() * mediaElement->duration(), mediaElement->currentTime(), mediaElement->duration(), determineState(o));
  • trunk/Source/WebCore/rendering/RenderMediaControls.h

    r127300 r167755  
    4646
    4747#if PLATFORM(WIN)
    48     static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
     48    static bool paintMediaControlsPart(MediaControlElementType, const RenderObject&, const PaintInfo&, const IntRect&);
    4949    static void adjustMediaSliderThumbSize(RenderStyle*);
    5050#endif
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r167714 r167755  
    726726
    727727void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, float x1, float y1, float x2, float y2,
    728     BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias)
     728    BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias) const
    729729{
    730730    float deviceScaleFactor = document().deviceScaleFactor();
  • trunk/Source/WebCore/rendering/RenderObject.h

    r167652 r167755  
    880880    RespectImageOrientationEnum shouldRespectImageOrientation() const;
    881881
    882     void drawLineForBoxSide(GraphicsContext*, float x1, float y1, float x2, float y2, BoxSide, Color, EBorderStyle, float adjbw1, float adjbw2, bool antialias = false);
     882    void drawLineForBoxSide(GraphicsContext*, float x1, float y1, float x2, float y2, BoxSide, Color, EBorderStyle, float adjbw1, float adjbw2, bool antialias = false) const;
    883883protected:
    884884    void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*);
  • trunk/Source/WebCore/rendering/RenderProgress.cpp

    r163560 r167755  
    6868    else
    6969        frame.setWidth(computedValues.m_extent);
    70     IntSize frameSize = theme().progressBarRectForBounds(this, pixelSnappedIntRect(frame)).size();
     70    IntSize frameSize = theme().progressBarRectForBounds(*this, pixelSnappedIntRect(frame)).size();
    7171    computedValues.m_extent = isHorizontalWritingMode() ? frameSize.height() : frameSize.width();
    7272}
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r165686 r167755  
    8585        // Convert the rect into the coords used for painting the content
    8686        contentsRect.moveBy(paintOffset + location());
    87         theme().paintCapsLockIndicator(this, paintInfo, pixelSnappedIntRect(contentsRect));
     87        theme().paintCapsLockIndicator(*this, paintInfo, pixelSnappedIntRect(contentsRect));
    8888    }
    8989}
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r166424 r167755  
    264264}
    265265
    266 bool RenderTheme::paint(RenderObject* o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r)
     266bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r)
    267267{
    268268    // If painting is disabled, but we aren't updating control tints, then just bail.
     
    271271    if (paintInfo.context->updatingControlTints()) {
    272272        if (controlSupportsTints(o))
    273             o->repaint();
     273            o.repaint();
    274274        return false;
    275275    }
     
    277277        return false;
    278278
    279     ControlPart part = o->style().appearance();
     279    ControlPart part = o.style().appearance();
    280280
    281281#if USE(NEW_THEME)
     
    289289    case InnerSpinButtonPart:
    290290        updateControlStatesForRenderer(o, controlStates);
    291         m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o->style().effectiveZoom(), &o->view().frameView());
     291        m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o.style().effectiveZoom(), &o.view().frameView());
    292292        return false;
    293293    default:
     
    406406}
    407407
    408 bool RenderTheme::paintBorderOnly(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     408bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    409409{
    410410    if (paintInfo.context->paintingDisabled())
     
    413413#if PLATFORM(IOS)
    414414    UNUSED_PARAM(r);
    415     return o->style().appearance() != NoControlPart;
     415    return o.style().appearance() != NoControlPart;
    416416#else
    417417    // Call the appropriate paint method based off the appearance value.
    418     switch (o->style().appearance()) {
     418    switch (o.style().appearance()) {
    419419    case TextFieldPart:
    420420        return paintTextField(o, paintInfo, r);
     
    464464}
    465465
    466 bool RenderTheme::paintDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
     466bool RenderTheme::paintDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
    467467{
    468468    if (paintInfo.context->paintingDisabled())
     
    470470
    471471    // Call the appropriate paint method based off the appearance value.
    472     switch (renderer->style().appearance()) {
     472    switch (renderer.style().appearance()) {
    473473    case MenulistButtonPart:
    474474        return paintMenuListButtonDecorations(renderer, paintInfo, rect);
     
    667667}
    668668
    669 int RenderTheme::baselinePosition(const RenderObject* o) const
    670 {
    671     if (!o->isBox())
     669int RenderTheme::baselinePosition(const RenderObject& o) const
     670{
     671    if (!o.isBox())
    672672        return 0;
    673673
    674     const RenderBox* box = toRenderBox(o);
     674    const RenderBox& box = *toRenderBox(&o);
    675675
    676676#if USE(NEW_THEME)
    677     return box->height() + box->marginTop() + m_theme->baselinePositionAdjustment(o->style().appearance()) * o->style().effectiveZoom();
     677    return box.height() + box.marginTop() + m_theme->baselinePositionAdjustment(o.style().appearance()) * o.style().effectiveZoom();
    678678#else
    679     return box->height() + box->marginTop();
     679    return box.height() + box.marginTop();
    680680#endif
    681681}
     
    715715}
    716716
    717 void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
     717void RenderTheme::adjustRepaintRect(const RenderObject& o, IntRect& r)
    718718{
    719719#if USE(NEW_THEME)
    720720    ControlStates states(extractControlStatesForRenderer(o));
    721     m_theme->inflateControlPaintRect(o->style().appearance(), &states, r, o->style().effectiveZoom());
     721    m_theme->inflateControlPaintRect(o.style().appearance(), &states, r, o.style().effectiveZoom());
    722722#else
    723723    UNUSED_PARAM(o);
     
    731731}
    732732
    733 bool RenderTheme::stateChanged(RenderObject* o, ControlStates::States state) const
     733bool RenderTheme::stateChanged(const RenderObject& o, ControlStates::States state) const
    734734{
    735735    // Default implementation assumes the controls don't respond to changes in :hover state
    736     if (state == ControlStates::HoverState && !supportsHover(&o->style()))
     736    if (state == ControlStates::HoverState && !supportsHover(&o.style()))
    737737        return false;
    738738
     
    742742
    743743    // Repaint the control.
    744     o->repaint();
     744    o.repaint();
    745745    return true;
    746746}
    747747
    748 void RenderTheme::updateControlStatesForRenderer(const RenderObject* o, ControlStates* controlStates) const
     748void RenderTheme::updateControlStatesForRenderer(const RenderObject& o, ControlStates* controlStates) const
    749749{
    750750    ControlStates newStates = extractControlStatesForRenderer(o);
     
    752752}
    753753
    754 ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderObject* o) const
     754ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderObject& o) const
    755755{
    756756    ControlStates::States states = 0;
     
    765765            states |= ControlStates::SpinUpState;
    766766    }
    767     if (isFocused(o) && o->style().outlineStyleIsAuto())
     767    if (isFocused(o) && o.style().outlineStyleIsAuto())
    768768        states |= ControlStates::FocusState;
    769769    if (isEnabled(o))
     
    782782}
    783783
    784 bool RenderTheme::isActive(const RenderObject* o) const
    785 {
    786     Node* node = o->node();
     784bool RenderTheme::isActive(const RenderObject& o) const
     785{
     786    Node* node = o.node();
    787787    if (!node)
    788788        return false;
     
    799799}
    800800
    801 bool RenderTheme::isChecked(const RenderObject* o) const
    802 {
    803     if (!o->node())
    804         return false;
    805 
    806     HTMLInputElement* inputElement = o->node()->toInputElement();
     801bool RenderTheme::isChecked(const RenderObject& o) const
     802{
     803    if (!o.node())
     804        return false;
     805
     806    HTMLInputElement* inputElement = o.node()->toInputElement();
    807807    if (!inputElement)
    808808        return false;
     
    811811}
    812812
    813 bool RenderTheme::isIndeterminate(const RenderObject* o) const
    814 {
    815     if (!o->node())
    816         return false;
    817 
    818     HTMLInputElement* inputElement = o->node()->toInputElement();
     813bool RenderTheme::isIndeterminate(const RenderObject& o) const
     814{
     815    if (!o.node())
     816        return false;
     817
     818    HTMLInputElement* inputElement = o.node()->toInputElement();
    819819    if (!inputElement)
    820820        return false;
     
    823823}
    824824
    825 bool RenderTheme::isEnabled(const RenderObject* o) const
    826 {
    827     Node* node = o->node();
     825bool RenderTheme::isEnabled(const RenderObject& o) const
     826{
     827    Node* node = o.node();
    828828    if (!node || !node->isElementNode())
    829829        return true;
     
    831831}
    832832
    833 bool RenderTheme::isFocused(const RenderObject* o) const
    834 {
    835     Node* node = o->node();
     833bool RenderTheme::isFocused(const RenderObject& o) const
     834{
     835    Node* node = o.node();
    836836    if (!node || !node->isElementNode())
    837837        return false;
     
    843843}
    844844
    845 bool RenderTheme::isPressed(const RenderObject* o) const
    846 {
    847     if (!o->node() || !o->node()->isElementNode())
    848         return false;
    849     return toElement(o->node())->active();
    850 }
    851 
    852 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const
    853 {
    854     Node* node = o->node();
     845bool RenderTheme::isPressed(const RenderObject& o) const
     846{
     847    if (!o.node() || !o.node()->isElementNode())
     848        return false;
     849    return toElement(o.node())->active();
     850}
     851
     852bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject& o) const
     853{
     854    Node* node = o.node();
    855855    if (!node || !node->isElementNode())
    856856        return false;
     
    861861}
    862862
    863 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const
    864 {
    865     Node* node = o->node();
     863bool RenderTheme::isReadOnlyControl(const RenderObject& o) const
     864{
     865    Node* node = o.node();
    866866    if (!node || !node->isElementNode())
    867867        return false;
     
    869869}
    870870
    871 bool RenderTheme::isHovered(const RenderObject* o) const
    872 {
    873     Node* node = o->node();
     871bool RenderTheme::isHovered(const RenderObject& o) const
     872{
     873    Node* node = o.node();
    874874    if (!node || !node->isElementNode())
    875875        return false;
     
    880880}
    881881
    882 bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject* o) const
    883 {
    884     Node* node = o->node();
     882bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject& o) const
     883{
     884    Node* node = o.node();
    885885    if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement())
    886886        return false;
     
    889889}
    890890
    891 bool RenderTheme::isDefault(const RenderObject* o) const
     891bool RenderTheme::isDefault(const RenderObject& o) const
    892892{
    893893    // A button should only have the default appearance if the page is active
     
    895895        return false;
    896896
    897     if (!o->frame().settings().applicationChromeMode())
     897    if (!o.frame().settings().applicationChromeMode())
    898898        return false;
    899899   
    900     return o->style().appearance() == DefaultButtonPart;
     900    return o.style().appearance() == DefaultButtonPart;
    901901}
    902902
     
    968968}
    969969
    970 bool RenderTheme::paintInputFieldSpeechButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
     970bool RenderTheme::paintInputFieldSpeechButton(const RenderObject& object, const PaintInfo& paintInfo, const IntRect& rect)
    971971{
    972972    return RenderInputSpeech::paintInputFieldSpeechButton(object, paintInfo, rect);
     
    990990}
    991991
    992 bool RenderTheme::paintMeter(RenderObject*, const PaintInfo&, const IntRect&)
     992bool RenderTheme::paintMeter(const RenderObject&, const PaintInfo&, const IntRect&)
    993993{
    994994    return true;
     
    10031003}
    10041004
    1005 void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect)
    1006 {
    1007     Node* node = o->node();
     1005void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& rect)
     1006{
     1007    Node* node = o.node();
    10081008    if (!node)
    10091009        return;
     
    10191019    double min = input->minimum();
    10201020    double max = input->maximum();
    1021     ControlPart part = o->style().appearance();
     1021    ControlPart part = o.style().appearance();
    10221022    // We don't support ticks on alternate sliders like MediaVolumeSliders.
    10231023    if (part !=  SliderHorizontalPart && part != SliderVerticalPart)
     
    10261026
    10271027    IntSize thumbSize;
    1028     RenderObject* thumbRenderer = input->sliderThumbElement()->renderer();
     1028    const RenderObject* thumbRenderer = input->sliderThumbElement()->renderer();
    10291029    if (thumbRenderer) {
    10301030        const RenderStyle& thumbStyle = thumbRenderer->style();
     
    10361036
    10371037    IntSize tickSize = sliderTickSize();
    1038     float zoomFactor = o->style().effectiveZoom();
     1038    float zoomFactor = o.style().effectiveZoom();
    10391039    FloatRect tickRect;
    10401040    int tickRegionSideMargin = 0;
     
    10451045    if (trackRenderer)
    10461046        trackBounds = trackRenderer->absoluteBoundingBoxRectIgnoringTransforms();
    1047     IntRect sliderBounds = o->absoluteBoundingBoxRectIgnoringTransforms();
     1047    IntRect sliderBounds = o.absoluteBoundingBoxRectIgnoringTransforms();
    10481048
    10491049    // Make position relative to the transformed ancestor element.
     
    10661066    RefPtr<HTMLCollection> options = dataList->options();
    10671067    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    1068     paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     1068    paintInfo.context->setFillColor(o.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
    10691069    for (unsigned i = 0; Node* node = options->item(i); i++) {
    10701070        ASSERT(isHTMLOptionElement(node));
     
    10751075        double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(value));
    10761076        double tickFraction = (parsedValue - min) / (max - min);
    1077         double tickRatio = isHorizontal && o->style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
     1077        double tickRatio = isHorizontal && o.style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
    10781078        double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tickRatio);
    10791079        if (isHorizontal)
     
    11011101}
    11021102
    1103 IntRect RenderTheme::progressBarRectForBounds(const RenderObject*, const IntRect& bounds) const
     1103IntRect RenderTheme::progressBarRectForBounds(const RenderObject&, const IntRect& bounds) const
    11041104{
    11051105    return bounds;
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r166422 r167755  
    8080    // text of a button, is always rendered by the engine itself.  The boolean return value indicates
    8181    // whether the CSS border/background should also be painted.
    82     bool paint(RenderObject*, ControlStates*, const PaintInfo&, const IntRect&);
    83     bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&);
    84     bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     82    bool paint(const RenderObject&, ControlStates*, const PaintInfo&, const IntRect&);
     83    bool paintBorderOnly(const RenderObject&, const PaintInfo&, const IntRect&);
     84    bool paintDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
    8585
    8686    // The remaining methods should be implemented by the platform-specific portion of the theme, e.g.,
     
    107107    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    108108    // controls that need to do this.
    109     virtual int baselinePosition(const RenderObject*) const;
     109    virtual int baselinePosition(const RenderObject&) const;
    110110
    111111    // A method for asking if a control is a container or not.  Leaf controls have to have some special behavior (like
     
    114114
    115115    // A method asking if the control changes its tint when the window has focus or not.
    116     virtual bool controlSupportsTints(const RenderObject*) const { return false; }
     116    virtual bool controlSupportsTints(const RenderObject&) const { return false; }
    117117
    118118    // Whether or not the control has been styled enough by the author to disable the native appearance.
     
    124124    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
    125125    // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
    126     virtual void adjustRepaintRect(const RenderObject*, IntRect&);
     126    virtual void adjustRepaintRect(const RenderObject&, IntRect&);
    127127
    128128    // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed
    129129    // or a control becomes disabled.
    130     virtual bool stateChanged(RenderObject*, ControlStates::States) const;
     130    virtual bool stateChanged(const RenderObject&, ControlStates::States) const;
    131131
    132132    // This method is called whenever the theme changes on the system in order to flush cached resources from the
     
    189189
    190190    // Method for painting the caps lock indicator
    191     virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) { return 0; };
     191    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) { return 0; };
    192192
    193193#if ENABLE(PROGRESS_ELEMENT)
     
    196196    // Returns the duration of the animation for the progress bar.
    197197    virtual double animationDurationForProgressBar(RenderProgress*) const;
    198     virtual IntRect progressBarRectForBounds(const RenderObject*, const IntRect&) const;
     198    virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const;
    199199#endif
    200200
     
    229229    // Returns the distance of slider tick origin from the slider track center.
    230230    virtual int sliderTickOffsetFromTrackCenter() const = 0;
    231     void paintSliderTicks(RenderObject*, const PaintInfo&, const IntRect&);
     231    void paintSliderTicks(const RenderObject&, const PaintInfo&, const IntRect&);
    232232#endif
    233233
     
    244244
    245245    enum FileUploadDecorations { SingleFile, MultipleFiles };
    246     virtual bool paintFileUploadIconDecorations(RenderObject* /*inputRenderer*/, RenderObject* /*buttonRenderer*/, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) { return true; }
     246    virtual bool paintFileUploadIconDecorations(const RenderObject& /*inputRenderer*/, const RenderObject& /*buttonRenderer*/, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) { return true; }
    247247
    248248#if ENABLE(IMAGE_CONTROLS)
    249     virtual IntSize imageControlsButtonSize(const RenderObject*) const { return IntSize(); }
     249    virtual IntSize imageControlsButtonSize(const RenderObject&) const { return IntSize(); }
    250250#endif
    251251
     
    268268    // Methods for each appearance value.
    269269    virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const;
    270     virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     270    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    271271    virtual void setCheckboxSize(RenderStyle*) const { }
    272272
    273273    virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const;
    274     virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     274    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    275275    virtual void setRadioSize(RenderStyle*) const { }
    276276
    277277    virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    278     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     278    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    279279    virtual void setButtonSize(RenderStyle*) const { }
    280280
    281281    virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    282     virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    283 #endif
    284 
    285     virtual bool paintCheckboxDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    286     virtual bool paintRadioDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    287     virtual bool paintButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     282    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     283#endif
     284
     285    virtual bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     286    virtual bool paintRadioDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     287    virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    288288
    289289    virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    290     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    291     virtual bool paintTextFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     290    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     291    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    292292
    293293    virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
    294     virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    295     virtual bool paintTextAreaDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     294    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     295    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    296296
    297297    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
    298     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    299     virtual bool paintMenuListDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     298    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     299    virtual bool paintMenuListDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    300300
    301301    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    302     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    303 
    304     virtual bool paintPushButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    305     virtual bool paintSquareButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     302    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     303
     304    virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     305    virtual bool paintSquareButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    306306
    307307#if ENABLE(METER_ELEMENT)
    308308    virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const;
    309     virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);
     309    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&);
    310310#endif
    311311
    312312#if ENABLE(PROGRESS_ELEMENT)
    313313    virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
    314     virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     314    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    315315#endif
    316316
    317317#if ENABLE(INPUT_SPEECH)
    318318    virtual void adjustInputFieldSpeechButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    319     virtual bool paintInputFieldSpeechButton(RenderObject*, const PaintInfo&, const IntRect&);
     319    virtual bool paintInputFieldSpeechButton(const RenderObject&, const PaintInfo&, const IntRect&);
    320320#endif
    321321
    322322    virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
    323     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     323    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    324324
    325325    virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
    326     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    327     virtual bool paintSliderThumbDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     326    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     327    virtual bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    328328
    329329    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    330     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    331     virtual bool paintSearchFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     330    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     331    virtual bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    332332
    333333    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    334     virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     334    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    335335
    336336    virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    337     virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     337    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    338338
    339339    virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    340     virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     340    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    341341
    342342    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    343     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     343    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    344344
    345345    virtual void adjustMediaControlStyle(StyleResolver*, RenderStyle*, Element*) const;
    346     virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    347     virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    348     virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    349     virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    350     virtual bool paintMediaSeekBackButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    351     virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    352     virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    353     virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    354     virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    355     virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    356     virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    357     virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    358     virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    359     virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    360     virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    361     virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    362     virtual bool paintMediaTimeRemaining(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    363     virtual bool paintMediaFullScreenVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    364     virtual bool paintMediaFullScreenVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    365 
    366     virtual bool paintSnapshottedPluginOverlay(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     346    virtual bool paintMediaFullscreenButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     347    virtual bool paintMediaPlayButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     348    virtual bool paintMediaOverlayPlayButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     349    virtual bool paintMediaMuteButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     350    virtual bool paintMediaSeekBackButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     351    virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     352    virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     353    virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     354    virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     355    virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     356    virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     357    virtual bool paintMediaRewindButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     358    virtual bool paintMediaReturnToRealtimeButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     359    virtual bool paintMediaToggleClosedCaptionsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     360    virtual bool paintMediaControlsBackground(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     361    virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     362    virtual bool paintMediaTimeRemaining(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     363    virtual bool paintMediaFullScreenVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     364    virtual bool paintMediaFullScreenVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     365
     366    virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    367367
    368368#if ENABLE(IMAGE_CONTROLS)
    369     virtual bool paintImageControlsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
     369    virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
    370370#endif
    371371
    372372public:
    373     void updateControlStatesForRenderer(const RenderObject*, ControlStates*) const;
    374     ControlStates::States extractControlStatesForRenderer(const RenderObject*) const;
    375     bool isActive(const RenderObject*) const;
    376     bool isChecked(const RenderObject*) const;
    377     bool isIndeterminate(const RenderObject*) const;
    378     bool isEnabled(const RenderObject*) const;
    379     bool isFocused(const RenderObject*) const;
    380     bool isPressed(const RenderObject*) const;
    381     bool isSpinUpButtonPartPressed(const RenderObject*) const;
    382     bool isHovered(const RenderObject*) const;
    383     bool isSpinUpButtonPartHovered(const RenderObject*) const;
    384     bool isReadOnlyControl(const RenderObject*) const;
    385     bool isDefault(const RenderObject*) const;
     373    void updateControlStatesForRenderer(const RenderObject&, ControlStates*) const;
     374    ControlStates::States extractControlStatesForRenderer(const RenderObject&) const;
     375    bool isActive(const RenderObject&) const;
     376    bool isChecked(const RenderObject&) const;
     377    bool isIndeterminate(const RenderObject&) const;
     378    bool isEnabled(const RenderObject&) const;
     379    bool isFocused(const RenderObject&) const;
     380    bool isPressed(const RenderObject&) const;
     381    bool isSpinUpButtonPartPressed(const RenderObject&) const;
     382    bool isHovered(const RenderObject&) const;
     383    bool isSpinUpButtonPartHovered(const RenderObject&) const;
     384    bool isReadOnlyControl(const RenderObject&) const;
     385    bool isDefault(const RenderObject&) const;
    386386
    387387private:
  • trunk/Source/WebCore/rendering/RenderThemeIOS.h

    r166676 r167755  
    4949
    5050protected:
    51     virtual int baselinePosition(const RenderObject*) const override;
     51    virtual int baselinePosition(const RenderObject&) const override;
    5252
    5353    virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer& background, const Color& backgroundColor) const override;
     
    5555    // Methods for each appearance value.
    5656    virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const override;
    57     virtual bool paintCheckboxDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     57    virtual bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    5858
    5959    virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const override;
    60     virtual bool paintRadioDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     60    virtual bool paintRadioDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    6161
    6262    virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
    63     virtual bool paintButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
    64     virtual bool paintPushButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     63    virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
     64    virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    6565    virtual void setButtonSize(RenderStyle*) const override;
    6666
    67     virtual bool paintFileUploadIconDecorations(RenderObject* inputRenderer, RenderObject* buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override;
     67    virtual bool paintFileUploadIconDecorations(const RenderObject& inputRenderer, const RenderObject& buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override;
    6868
    69     virtual bool paintTextFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
    70     virtual bool paintTextAreaDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     69    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
     70    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    7171
    7272    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
    73     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     73    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    7474
    7575    virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const override;
    76     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) override;
     76    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override;
    7777
    7878    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const override;
    79     virtual bool paintSliderThumbDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     79    virtual bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    8080
    8181#if ENABLE(PROGRESS_ELEMENT)
     
    8585    virtual double animationDurationForProgressBar(RenderProgress*) const override;
    8686
    87     virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) override;
     87    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) override;
    8888#endif
    8989
     
    9494
    9595    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const override;
    96     virtual bool paintSearchFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
     96    virtual bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
    9797
    9898    virtual Color platformActiveSelectionBackgroundColor() const override;
     
    116116
    117117    const Color& shadowColor() const;
    118     FloatRect addRoundedBorderClip(RenderObject* box, GraphicsContext*, const IntRect&);
     118    FloatRect addRoundedBorderClip(const RenderObject& box, GraphicsContext*, const IntRect&);
    119119
    120120    String m_mediaControlsScript;
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r167596 r167755  
    317317}
    318318
    319 FloatRect RenderThemeIOS::addRoundedBorderClip(RenderObject* box, GraphicsContext* context, const IntRect& rect)
     319FloatRect RenderThemeIOS::addRoundedBorderClip(const RenderObject& box, GraphicsContext* context, const IntRect& rect)
    320320{
    321321    // To fix inner border bleeding issues <rdar://problem/9812507>, we clip to the outer border and assert that
    322322    // the border is opaque or transparent, unless we're checked because checked radio/checkboxes show no bleeding.
    323     RenderStyle& style = box->style();
     323    RenderStyle& style = box.style();
    324324    RoundedRect border = isChecked(box) ? style.getRoundedInnerBorderFor(rect) : style.getRoundedBorderFor(rect);
    325325
     
    358358}
    359359
    360 bool RenderThemeIOS::paintCheckboxDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     360bool RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    361361{
    362362    GraphicsContextStateSaver stateSaver(*paintInfo.context);
     
    409409}
    410410
    411 int RenderThemeIOS::baselinePosition(const RenderObject* renderer) const
    412 {
    413     if (!renderer->isBox())
     411int RenderThemeIOS::baselinePosition(const RenderObject& renderer) const
     412{
     413    if (!renderer.isBox())
    414414        return 0;
    415415
    416     const RenderBox* box = toRenderBox(renderer);
    417 
    418     if (box->style().appearance() == CheckboxPart || box->style().appearance() == RadioPart)
    419         return box->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
    420     if (box->style().appearance() == MenulistPart)
    421         return box->marginTop() + box->height() - 5; // This is to match AppKit. There might be a better way to calculate this though.
     416    const RenderBox& box = *toRenderBox(&renderer);
     417
     418    if (box.style().appearance() == CheckboxPart || box.style().appearance() == RadioPart)
     419        return box.marginTop() + box.height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
     420    if (box.style().appearance() == MenulistPart)
     421        return box.marginTop() + box.height() - 5; // This is to match AppKit. There might be a better way to calculate this though.
    422422    return RenderTheme::baselinePosition(box);
    423423}
     
    446446}
    447447
    448 bool RenderThemeIOS::paintRadioDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     448bool RenderThemeIOS::paintRadioDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    449449{
    450450    GraphicsContextStateSaver stateSaver(*paintInfo.context);
     
    474474}
    475475
    476 bool RenderThemeIOS::paintTextFieldDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
    477 {
    478     RenderStyle& style = box->style();
     476bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
     477{
     478    RenderStyle& style = box.style();
    479479    IntPoint point(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth());
    480480
     
    486486    // Do not draw the gradient if there is no visible top border.
    487487    bool topBorderIsInvisible = !style.hasBorder() || !style.borderTopWidth() || style.borderTopIsTransparent();
    488     if (!box->view().printing() && !topBorderIsInvisible)
     488    if (!box.view().printing() && !topBorderIsInvisible)
    489489        drawAxialGradient(paintInfo.context->platformContext(), gradientWithName(InsetGradient), point, FloatPoint(CGPointMake(point.x(), point.y() + 3.0f)), LinearInterpolation);
    490490    return false;
    491491}
    492492
    493 bool RenderThemeIOS::paintTextAreaDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
    494 {
    495     return paintTextFieldDecorations(renderer, paintInfo, rect);
     493bool RenderThemeIOS::paintTextAreaDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
     494{
     495    return paintTextFieldDecorations(box, paintInfo, rect);
    496496}
    497497
     
    583583}
    584584
    585 bool RenderThemeIOS::paintMenuListButtonDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
    586 {
    587     RenderStyle& style = box->style();
     585bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
     586{
     587    RenderStyle& style = box.style();
    588588    float borderTopWidth = style.borderTopWidth();
    589589    FloatRect clip(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth(), rect.width() - style.borderLeftWidth() - style.borderRightWidth(), rect.height() - style.borderTopWidth() - style.borderBottomWidth());
     
    613613    float separator = clip.maxX() - MenuListButtonPaddingRight;
    614614
    615     box->drawLineForBoxSide(paintInfo.context, separator - borderTopWidth, clip.y(), separator, clip.maxY(), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);
     615    box.drawLineForBoxSide(paintInfo.context, separator - borderTopWidth, clip.y(), separator, clip.maxY(), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);
    616616
    617617    FloatRect buttonClip(separator - adjustTop, clip.y() - adjustTop, MenuListButtonPaddingRight + adjustTop + adjustRight, clip.height() + adjustTop + adjustBottom);
     
    632632    // Paint Indicators.
    633633
    634     if (box->isMenuList() && toHTMLSelectElement(box->node())->multiple()) {
     634    if (box.isMenuList() && toHTMLSelectElement(box.node())->multiple()) {
    635635        int size = 2;
    636636        int count = 3;
     
    685685}
    686686
    687 bool RenderThemeIOS::paintSliderTrack(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     687bool RenderThemeIOS::paintSliderTrack(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    688688{
    689689    IntRect trackClip = rect;
    690     RenderStyle& style = box->style();
     690    RenderStyle& style = box.style();
    691691
    692692    bool isHorizontal = true;
     
    780780}
    781781
    782 bool RenderThemeIOS::paintSliderThumbDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     782bool RenderThemeIOS::paintSliderThumbDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    783783{
    784784    GraphicsContextStateSaver stateSaver(*paintInfo.context);
     
    808808}
    809809
    810 bool RenderThemeIOS::paintProgressBar(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
    811 {
    812     if (!renderer->isProgress())
     810bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
     811{
     812    if (!renderer.isProgress())
    813813        return true;
    814814
     
    837837    context->setStrokeGradient(strokeGradient.release());
    838838
    839     ColorSpace colorSpace = renderer->style().colorSpace();
     839    ColorSpace colorSpace = renderer.style().colorSpace();
    840840    context->setFillColor(Color(255, 255, 255), colorSpace);
    841841
     
    858858    context->fillRect(FloatRect(rect.x(), verticalRenderingPosition, rect.width(), upperGradientHeight));
    859859
    860     RenderProgress* renderProgress = toRenderProgress(renderer);
    861     if (renderProgress->isDeterminate()) {
     860    const RenderProgress& renderProgress = *toRenderProgress(&renderer);
     861    if (renderProgress.isDeterminate()) {
    862862        // 2) Draw the progress bar.
    863         double position = clampTo(renderProgress->position(), 0.0, 1.0);
     863        double position = clampTo(renderProgress.position(), 0.0, 1.0);
    864864        double barWidth = position * rect.width();
    865865        RefPtr<Gradient> barGradient = Gradient::create(FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1));
     
    880880        Path barPath;
    881881        int left = rect.x();
    882         if (!renderProgress->style().isLeftToRightDirection())
     882        if (!renderProgress.style().isLeftToRightDirection())
    883883            left = rect.maxX() - barWidth;
    884884        FloatRect barRect(left + 0.25, verticalRenderingPosition + 0.25, std::max(barWidth - 0.5, 0.0), progressBarHeight - 0.5);
     
    922922}
    923923
    924 bool RenderThemeIOS::paintSearchFieldDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     924bool RenderThemeIOS::paintSearchFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    925925{
    926926    return paintTextFieldDecorations(box, paintInfo, rect);
     
    948948}
    949949
    950 bool RenderThemeIOS::paintButtonDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     950bool RenderThemeIOS::paintButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    951951{
    952952    return paintPushButtonDecorations(box, paintInfo, rect);
    953953}
    954954
    955 bool RenderThemeIOS::paintPushButtonDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
     955bool RenderThemeIOS::paintPushButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    956956{
    957957    GraphicsContextStateSaver stateSaver(*paintInfo.context);
     
    959959
    960960    CGContextRef cgContext = paintInfo.context->platformContext();
    961     if (box->style().visitedDependentColor(CSSPropertyBackgroundColor).isDark())
     961    if (box.style().visitedDependentColor(CSSPropertyBackgroundColor).isDark())
    962962        drawAxialGradient(cgContext, gradientWithName(ConvexGradient), clip.location(), FloatPoint(clip.x(), clip.maxY()), LinearInterpolation);
    963963    else {
     
    983983const int kMultipleThumbnailShrinkSize = 2;
    984984
    985 bool RenderThemeIOS::paintFileUploadIconDecorations(RenderObject*, RenderObject* buttonRenderer, const PaintInfo& paintInfo, const IntRect& rect, Icon* icon, FileUploadDecorations fileUploadDecorations)
     985bool RenderThemeIOS::paintFileUploadIconDecorations(const RenderObject&, const RenderObject& buttonRenderer, const PaintInfo& paintInfo, const IntRect& rect, Icon* icon, FileUploadDecorations fileUploadDecorations)
    986986{
    987987    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    988988
    989989    IntSize cornerSize(kThumbnailBorderCornerRadius, kThumbnailBorderCornerRadius);
    990     Color pictureFrameColor = buttonRenderer ? buttonRenderer->style().visitedDependentColor(CSSPropertyBorderTopColor) : Color(76.0f, 76.0f, 76.0f);
     990    Color pictureFrameColor = buttonRenderer.style().visitedDependentColor(CSSPropertyBorderTopColor);
    991991
    992992    IntRect thumbnailPictureFrameRect = rect;
     
    10011001
    10021002        // Background picture frame and simple background icon with a gradient matching the button.
    1003         Color backgroundImageColor = buttonRenderer ? Color(buttonRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : Color(206.0f, 206.0f, 206.0f);
     1003        Color backgroundImageColor = Color(buttonRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor).rgb());
    10041004        paintInfo.context->fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor, ColorSpaceDeviceRGB);
    10051005        paintInfo.context->fillRect(thumbnailRect, backgroundImageColor, ColorSpaceDeviceRGB);
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r166676 r167755  
    4545
    4646    // A method asking if the control changes its tint when the window has focus or not.
    47     virtual bool controlSupportsTints(const RenderObject*) const;
     47    virtual bool controlSupportsTints(const RenderObject&) const;
    4848
    4949    // A general method asking if any control tinting is supported at all.
    5050    virtual bool supportsControlTints() const { return true; }
    5151
    52     virtual void adjustRepaintRect(const RenderObject*, IntRect&) override;
     52    virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;
    5353
    5454    virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const;
     
    8383    virtual int popupInternalPaddingBottom(RenderStyle*) const;
    8484
    85     virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) override;
     85    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) override;
    8686
    8787    virtual bool popsMenuByArrowKeys() const override { return true; }
     
    8989#if ENABLE(METER_ELEMENT)
    9090    virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const override;
    91     virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);
     91    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&);
    9292    virtual bool supportsMeter(ControlPart) const;
    9393#endif
     
    9898    // Returns the duration of the animation for the progress bar.
    9999    virtual double animationDurationForProgressBar(RenderProgress*) const;
    100     virtual IntRect progressBarRectForBounds(const RenderObject*, const IntRect&) const override;
     100    virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override;
    101101#endif
    102102
     
    105105    virtual bool usesTestModeFocusRingColor() const;
    106106    // A view associated to the contained document. Subclasses may not have such a view and return a fake.
    107     NSView* documentViewFor(RenderObject*) const;
     107    NSView* documentViewFor(const RenderObject&) const;
    108108
    109109
     
    124124    virtual bool supportsSelectionForegroundColors() const { return false; }
    125125
    126     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
     126    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
    127127    virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    128128
    129     virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
     129    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
    130130    virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
    131131
    132     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     132    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
    133133    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
    134134
    135     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     135    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
    136136    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    137137
    138138#if ENABLE(PROGRESS_ELEMENT)
    139139    virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
    140     virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
    141 #endif
    142 
    143     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     140    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&);
     141#endif
     142
     143    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
    144144    virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
    145145
    146     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     146    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
    147147    virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
    148148
    149     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
     149    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
    150150    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    151151
    152152    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    153     virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
     153    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
    154154
    155155    virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    156     virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     156    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    157157
    158158    virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    159     virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     159    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    160160
    161161    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    162     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
     162    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
    163163
    164164#if ENABLE(VIDEO)
     
    168168    virtual bool shouldShowPlaceholderWhenFocused() const;
    169169
    170     virtual bool paintSnapshottedPluginOverlay(RenderObject*, const PaintInfo&, const IntRect&);
     170    virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&);
    171171
    172172private:
     
    175175    IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
    176176
    177     FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect&) const;
     177    FloatRect convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect&) const;
    178178
    179179    // Get the control size based off the font. Used by some of the controls (like buttons).
     
    186186    void setFontFromControlSize(StyleResolver*, RenderStyle*, NSControlSize) const;
    187187
    188     void updateCheckedState(NSCell*, const RenderObject*);
    189     void updateEnabledState(NSCell*, const RenderObject*);
    190     void updateFocusedState(NSCell*, const RenderObject*);
    191     void updatePressedState(NSCell*, const RenderObject*);
     188    void updateCheckedState(NSCell*, const RenderObject&);
     189    void updateEnabledState(NSCell*, const RenderObject&);
     190    void updateFocusedState(NSCell*, const RenderObject&);
     191    void updatePressedState(NSCell*, const RenderObject&);
    192192    // An optional hook for subclasses to update the control tint of NSCell.
    193     virtual void updateActiveState(NSCell*, const RenderObject*) { }
     193    virtual void updateActiveState(NSCell*, const RenderObject&) { }
    194194
    195195    // Helpers for adjusting appearance and for painting
    196196
    197     void setPopupButtonCellState(const RenderObject*, const IntRect&);
     197    void setPopupButtonCellState(const RenderObject&, const IntRect&);
    198198    const IntSize* popupButtonSizes() const;
    199199    const int* popupButtonMargins() const;
    200200    const int* popupButtonPadding(NSControlSize) const;
    201     void paintMenuListButtonGradients(RenderObject*, const PaintInfo&, const IntRect&);
     201    void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&);
    202202    const IntSize* menuListSizes() const;
    203203
     
    205205    const IntSize* cancelButtonSizes() const;
    206206    const IntSize* resultsButtonSizes() const;
    207     void setSearchCellState(RenderObject*, const IntRect&);
     207    void setSearchCellState(const RenderObject&, const IntRect&);
    208208    void setSearchFieldSize(RenderStyle*) const;
    209209
     
    227227
    228228#if ENABLE(IMAGE_CONTROLS)
    229     virtual bool paintImageControlsButton(RenderObject*, const PaintInfo&, const IntRect&) override;
    230     virtual IntSize imageControlsButtonSize(const RenderObject*) const override;
     229    virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) override;
     230    virtual IntSize imageControlsButtonSize(const const RenderObject&) const override;
    231231    NSServicesRolloverButtonCell *servicesRolloverButtonCell() const;
    232232#endif
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r167497 r167755  
    218218}
    219219
    220 NSView* RenderThemeMac::documentViewFor(RenderObject* o) const
     220NSView* RenderThemeMac::documentViewFor(const RenderObject& o) const
    221221{
    222222    ControlStates states(extractControlStatesForRenderer(o));
    223     return ThemeMac::ensuredView(&o->view().frameView(), &states);
     223    return ThemeMac::ensuredView(&o.view().frameView(), &states);
    224224}
    225225
     
    603603}
    604604
    605 void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
    606 {
    607     ControlPart part = o->style().appearance();
     605void RenderThemeMac::adjustRepaintRect(const RenderObject& o, IntRect& r)
     606{
     607    ControlPart part = o.style().appearance();
    608608
    609609#if USE(NEW_THEME)
     
    622622#endif
    623623
    624     float zoomLevel = o->style().effectiveZoom();
     624    float zoomLevel = o.style().effectiveZoom();
    625625
    626626    if (part == MenulistPart) {
     
    651651}
    652652
    653 FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const
     653FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect& r) const
    654654{
    655655    FloatRect partRect(inputRect);
     
    657657    // Compute an offset between the part renderer and the input renderer
    658658    FloatSize offsetFromInputRenderer;
    659     const RenderObject* renderer = partRenderer;
    660     while (renderer && renderer != inputRenderer) {
     659    const RenderObject* renderer = &partRenderer;
     660    while (renderer && renderer != &inputRenderer) {
    661661        RenderElement* containingRenderer = renderer->container();
    662662        offsetFromInputRenderer -= roundedIntSize(renderer->offsetFromContainer(containingRenderer, LayoutPoint()));
     
    664664    }
    665665    // If the input renderer was not a container, something went wrong
    666     ASSERT(renderer == inputRenderer);
     666    ASSERT(renderer == &inputRenderer);
    667667    // Move the rect into partRenderer's coords
    668668    partRect.move(offsetFromInputRenderer);
     
    673673}
    674674
    675 void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject* o)
     675void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject& o)
    676676{
    677677    bool oldIndeterminate = [cell state] == NSMixedState;
     
    689689}
    690690
    691 void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject* o)
     691void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject& o)
    692692{
    693693    bool oldEnabled = [cell isEnabled];
     
    697697}
    698698
    699 void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject* o)
     699void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject& o)
    700700{
    701701    bool oldFocused = [cell showsFirstResponder];
    702     bool focused = isFocused(o) && o->style().outlineStyleIsAuto();
     702    bool focused = isFocused(o) && o.style().outlineStyleIsAuto();
    703703    if (focused != oldFocused)
    704704        [cell setShowsFirstResponder:focused];
    705705}
    706706
    707 void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject* o)
     707void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject& o)
    708708{
    709709    bool oldPressed = [cell isHighlighted];
    710     bool pressed = o->node() && o->node()->isElementNode() && toElement(o->node())->active();
     710    bool pressed = o.node() && o.node()->isElementNode() && toElement(o.node())->active();
    711711    if (pressed != oldPressed)
    712712        [cell setHighlighted:pressed];
    713713}
    714714
    715 bool RenderThemeMac::controlSupportsTints(const RenderObject* o) const
     715bool RenderThemeMac::controlSupportsTints(const RenderObject& o) const
    716716{
    717717    // An alternate way to implement this would be to get the appropriate cell object
     
    724724
    725725    // Checkboxes only have tint when checked.
    726     if (o->style().appearance() == CheckboxPart)
     726    if (o.style().appearance() == CheckboxPart)
    727727        return isChecked(o);
    728728
     
    812812}
    813813
    814 bool RenderThemeMac::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     814bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    815815{
    816816    LocalCurrentGraphicsContext localContext(paintInfo.context);
     
    832832}
    833833
    834 bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const IntRect& r)
     834bool RenderThemeMac::paintCapsLockIndicator(const RenderObject&, const PaintInfo& paintInfo, const IntRect& r)
    835835{
    836836    if (paintInfo.context->paintingDisabled())
     
    843843}
    844844
    845 bool RenderThemeMac::paintTextArea(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     845bool RenderThemeMac::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    846846{
    847847    LocalCurrentGraphicsContext localContext(paintInfo.context);
     
    882882}
    883883
    884 bool RenderThemeMac::paintMenuList(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     884bool RenderThemeMac::paintMenuList(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    885885{
    886886    LocalCurrentGraphicsContext localContext(paintInfo.context);
     
    889889    NSPopUpButtonCell* popupButton = this->popupButton();
    890890
    891     float zoomLevel = o->style().effectiveZoom();
     891    float zoomLevel = o.style().effectiveZoom();
    892892    IntSize size = popupButtonSizes()[[popupButton controlSize]];
    893893    size.setHeight(size.height() * zoomLevel);
     
    896896    // Now inflate it to account for the shadow.
    897897    IntRect inflatedRect = r;
    898     if (r.width() >= minimumMenuListSize(&o->style()))
     898    if (r.width() >= minimumMenuListSize(&o.style()))
    899899        inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
    900900
     
    914914    NSView *view = documentViewFor(o);
    915915    [popupButton drawWithFrame:inflatedRect inView:view];
    916     if (isFocused(o) && o->style().outlineStyleIsAuto())
     916    if (isFocused(o) && o.style().outlineStyleIsAuto())
    917917        [popupButton _web_drawFocusRingWithFrame:inflatedRect inView:view];
    918918    [popupButton setControlView:nil];
     
    935935}
    936936
    937 bool RenderThemeMac::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    938 {
    939     if (!renderObject->isMeter())
     937bool RenderThemeMac::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     938{
     939    if (!renderObject.isMeter())
    940940        return true;
    941941
    942942    LocalCurrentGraphicsContext localContext(paintInfo.context);
    943943
    944     NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter(renderObject));
     944    NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter(&renderObject));
    945945    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    946946
     
    10431043}
    10441044
    1045 IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject* renderObject, const IntRect& bounds) const
     1045IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject& renderObject, const IntRect& bounds) const
    10461046{
    10471047    // Workaround until <rdar://problem/15855086> is fixed.
    10481048    int maxDimension = static_cast<int>(std::numeric_limits<ushort>::max());
    10491049    IntRect progressBarBounds(bounds.x(), bounds.y(), std::min(bounds.width(), maxDimension), std::min(bounds.height(), maxDimension));
    1050     if (NoControlPart == renderObject->style().appearance())
     1050    if (NoControlPart == renderObject.style().appearance())
    10511051        return progressBarBounds;
    10521052
    1053     float zoomLevel = renderObject->style().effectiveZoom();
    1054     NSControlSize controlSize = controlSizeForFont(&renderObject->style());
     1053    float zoomLevel = renderObject.style().effectiveZoom();
     1054    NSControlSize controlSize = controlSizeForFont(&renderObject.style());
    10551055    IntSize size = progressBarSizes()[controlSize];
    10561056    size.setHeight(size.height() * zoomLevel);
     
    10591059    // Now inflate it to account for the shadow.
    10601060    IntRect inflatedRect = progressBarBounds;
    1061     if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject->style()))
     1061    if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject.style()))
    10621062        inflatedRect = inflateRect(inflatedRect, size, progressBarMargins(controlSize), zoomLevel);
    10631063
     
    10841084}
    10851085
    1086 bool RenderThemeMac::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    1087 {
    1088     if (!renderObject->isProgress())
     1086bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     1087{
     1088    if (!renderObject.isProgress())
    10891089        return true;
    10901090
    10911091    IntRect inflatedRect = progressBarRectForBounds(renderObject, rect);
    1092     NSControlSize controlSize = controlSizeForFont(&renderObject->style());
    1093 
    1094     RenderProgress* renderProgress = toRenderProgress(renderObject);
     1092    NSControlSize controlSize = controlSizeForFont(&renderObject.style());
     1093
     1094    const RenderProgress& renderProgress = *toRenderProgress(&renderObject);
    10951095    HIThemeTrackDrawInfo trackInfo;
    10961096    trackInfo.version = 0;
    10971097    if (controlSize == NSRegularControlSize)
    1098         trackInfo.kind = renderProgress->position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
     1098        trackInfo.kind = renderProgress.position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
    10991099    else
    1100         trackInfo.kind = renderProgress->position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
    1101 
    1102     float deviceScaleFactor = renderObject->document().deviceScaleFactor();
     1100        trackInfo.kind = renderProgress.position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
     1101
     1102    float deviceScaleFactor = renderObject.document().deviceScaleFactor();
    11031103    trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size());
    11041104    trackInfo.min = 0;
    11051105    trackInfo.max = std::numeric_limits<SInt32>::max();
    1106     trackInfo.value = lround(renderProgress->position() * nextafter(trackInfo.max, 0));
    1107     trackInfo.trackInfo.progress.phase = lround(renderProgress->animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);
     1106    trackInfo.value = lround(renderProgress.position() * nextafter(trackInfo.max, 0));
     1107    trackInfo.trackInfo.progress.phase = lround(renderProgress.animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);
    11081108    trackInfo.attributes = kThemeTrackHorizontal;
    11091109    trackInfo.enableState = isActive(renderObject) ? kThemeTrackActive : kThemeTrackInactive;
     
    11211121    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    11221122
    1123     if (!renderProgress->style().isLeftToRightDirection()) {
     1123    if (!renderProgress.style().isLeftToRightDirection()) {
    11241124        paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width(), 0);
    11251125        paintInfo.context->scale(FloatSize(-1, 1));
     
    11831183}
    11841184
    1185 void RenderThemeMac::paintMenuListButtonGradients(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     1185void RenderThemeMac::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    11861186{
    11871187    if (r.isEmpty())
     
    11931193    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    11941194
    1195     FloatRoundedRect border = FloatRoundedRect(o->style().getRoundedBorderFor(r, &o->view()));
     1195    FloatRoundedRect border = FloatRoundedRect(o.style().getRoundedBorderFor(r, &o.view()));
    11961196    int radius = border.radii().topLeft().width();
    11971197
     
    12501250}
    12511251
    1252 bool RenderThemeMac::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
    1253 {
    1254     IntRect bounds = IntRect(rect.x() + renderer->style().borderLeftWidth(),
    1255                              rect.y() + renderer->style().borderTopWidth(),
    1256                              rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),
    1257                              rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());
     1252bool RenderThemeMac::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
     1253{
     1254    IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(),
     1255        rect.y() + renderer.style().borderTopWidth(),
     1256        rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(),
     1257        rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth());
    12581258    // Draw the gradients to give the styled popup menu a button appearance
    12591259    paintMenuListButtonGradients(renderer, paintInfo, bounds);
    12601260
    12611261    // Since we actually know the size of the control here, we restrict the font scale to make sure the arrows will fit vertically in the bounds
    1262     float fontScale = std::min(renderer->style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
     1262    float fontScale = std::min(renderer.style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
    12631263    float centerY = bounds.y() + bounds.height() / 2.0f;
    12641264    float arrowHeight = baseArrowHeight * fontScale;
    12651265    float arrowWidth = baseArrowWidth * fontScale;
    1266     float leftEdge = bounds.maxX() - arrowPaddingRight * renderer->style().effectiveZoom() - arrowWidth;
     1266    float leftEdge = bounds.maxX() - arrowPaddingRight * renderer.style().effectiveZoom() - arrowWidth;
    12671267    float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
    12681268
    1269     if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer->style().effectiveZoom())
     1269    if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer.style().effectiveZoom())
    12701270        return false;
    12711271
    12721272    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    12731273
    1274     paintInfo.context->setFillColor(renderer->style().visitedDependentColor(CSSPropertyColor), renderer->style().colorSpace());
     1274    paintInfo.context->setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), renderer.style().colorSpace());
    12751275    paintInfo.context->setStrokeStyle(NoStroke);
    12761276
     
    12961296    // FIXME: Should the separator thickness and space be scaled up by fontScale?
    12971297    int separatorSpace = 2; // Deliberately ignores zoom since it looks nicer if it stays thin.
    1298     int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer->style().effectiveZoom()); // FIXME: Round?
     1298    int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer.style().effectiveZoom()); // FIXME: Round?
    12991299
    13001300    // Draw the separator to the left of the arrows
     
    13971397}
    13981398
    1399 void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const IntRect& r)
     1399void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntRect& r)
    14001400{
    14011401    NSPopUpButtonCell* popupButton = this->popupButton();
    14021402
    14031403    // Set the control size based off the rectangle we're painting into.
    1404     setControlSize(popupButton, popupButtonSizes(), r.size(), o->style().effectiveZoom());
     1404    setControlSize(popupButton, popupButtonSizes(), r.size(), o.style().effectiveZoom());
    14051405
    14061406    // Update the various states we respond to.
     
    14301430}
    14311431
    1432 bool RenderThemeMac::paintSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     1432bool RenderThemeMac::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    14331433{
    14341434    IntRect bounds = r;
    1435     float zoomLevel = o->style().effectiveZoom();
     1435    float zoomLevel = o.style().effectiveZoom();
    14361436    float zoomedTrackWidth = trackWidth * zoomLevel;
    14371437
    1438     if (o->style().appearance() ==  SliderHorizontalPart || o->style().appearance() ==  MediaSliderPart) {
     1438    if (o.style().appearance() ==  SliderHorizontalPart || o.style().appearance() ==  MediaSliderPart) {
    14391439        bounds.setHeight(zoomedTrackWidth);
    14401440        bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2);
    1441     } else if (o->style().appearance() == SliderVerticalPart) {
     1441    } else if (o.style().appearance() == SliderVerticalPart) {
    14421442        bounds.setWidth(zoomedTrackWidth);
    14431443        bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2);
     
    14581458    RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
    14591459    RetainPtr<CGShadingRef> mainShading;
    1460     if (o->style().appearance() == SliderVerticalPart)
     1460    if (o.style().appearance() == SliderVerticalPart)
    14611461        mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(),  bounds.maxY()), CGPointMake(bounds.maxX(), bounds.maxY()), mainFunction.get(), false, false));
    14621462    else
     
    14791479const float verticalSliderHeightPadding = 0.1f;
    14801480
    1481 bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    1482 {
    1483     NSSliderCell* sliderThumbCell = o->style().appearance() == SliderThumbVerticalPart
     1481bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
     1482{
     1483    NSSliderCell* sliderThumbCell = o.style().appearance() == SliderThumbVerticalPart
    14841484        ? sliderThumbVertical()
    14851485        : sliderThumbHorizontal();
     
    14901490    updateActiveState(sliderThumbCell, o);
    14911491    updateEnabledState(sliderThumbCell, o);
    1492     Element* focusDelegate = (o->node() && o->node()->isElementNode()) ? toElement(o->node())->focusDelegate() : 0;
    1493     updateFocusedState(sliderThumbCell, focusDelegate ? focusDelegate->renderer() : 0);
     1492        Element* focusDelegate = (o.node() && o.node()->isElementNode()) ? toElement(o.node())->focusDelegate() : 0;
     1493    if (focusDelegate)
     1494        updateFocusedState(sliderThumbCell, *focusDelegate->renderer());
    14941495
    14951496    // Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it.
    14961497    bool oldPressed;
    1497     if (o->style().appearance() == SliderThumbVerticalPart)
     1498    if (o.style().appearance() == SliderThumbVerticalPart)
    14981499        oldPressed = m_isSliderThumbVerticalPressed;
    14991500    else
     
    15021503    bool pressed = isPressed(o);
    15031504
    1504     if (o->style().appearance() == SliderThumbVerticalPart)
     1505    if (o.style().appearance() == SliderThumbVerticalPart)
    15051506        m_isSliderThumbVerticalPressed = pressed;
    15061507    else
     
    15161517    FloatRect bounds = r;
    15171518    // Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider.
    1518     if (o->style().appearance() == SliderThumbVerticalPart)
    1519         bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style().effectiveZoom());
     1519    if (o.style().appearance() == SliderThumbVerticalPart)
     1520        bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o.style().effectiveZoom());
    15201521
    15211522    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    1522     float zoomLevel = o->style().effectiveZoom();
     1523    float zoomLevel = o.style().effectiveZoom();
    15231524
    15241525    FloatRect unzoomedRect = bounds;
     
    15371538}
    15381539
    1539 bool RenderThemeMac::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     1540bool RenderThemeMac::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    15401541{
    15411542    LocalCurrentGraphicsContext localContext(paintInfo.context);
     
    15461547    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    15471548
    1548     float zoomLevel = o->style().effectiveZoom();
     1549    float zoomLevel = o.style().effectiveZoom();
    15491550
    15501551    IntRect unzoomedRect = r;
     
    15691570}
    15701571
    1571 void RenderThemeMac::setSearchCellState(RenderObject* o, const IntRect&)
     1572void RenderThemeMac::setSearchCellState(const RenderObject& o, const IntRect&)
    15721573{
    15731574    NSSearchFieldCell* search = this->search();
    15741575
    1575     [search setControlSize:controlSizeForFont(&o->style())];
     1576    [search setControlSize:controlSizeForFont(&o.style())];
    15761577
    15771578    // Update the various states we respond to.
     
    16281629}
    16291630
    1630 bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    1631 {
    1632     Element* input = o->node()->shadowHost();
     1631bool RenderThemeMac::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
     1632{
     1633    Element* input = o.node()->shadowHost();
    16331634    if (!input)
    1634         input = toElement(o->node());
     1635        input = toElement(o.node());
    16351636
    16361637    if (!input->renderer()->isBox())
     
    16381639
    16391640    LocalCurrentGraphicsContext localContext(paintInfo.context);
    1640     setSearchCellState(input->renderer(), r);
     1641    setSearchCellState(*input->renderer(), r);
    16411642
    16421643    NSSearchFieldCell* search = this->search();
     
    16511652    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    16521653
    1653     float zoomLevel = o->style().effectiveZoom();
     1654    float zoomLevel = o.style().effectiveZoom();
    16541655
    16551656    FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
     
    16641665#endif
    16651666
    1666     localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
     1667    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
    16671668
    16681669    FloatRect unzoomedRect(localBounds);
     
    17091710}
    17101711
    1711 bool RenderThemeMac::paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&)
     1712bool RenderThemeMac::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&)
    17121713{
    17131714    return false;
     
    17221723}
    17231724
    1724 bool RenderThemeMac::paintSearchFieldResultsDecorationPart(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    1725 {
    1726     Node* input = o->node()->shadowHost();
     1725bool RenderThemeMac::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
     1726{
     1727    Node* input = o.node()->shadowHost();
    17271728    if (!input)
    1728         input = o->node();
     1729        input = o.node();
    17291730    if (!input->renderer()->isBox())
    17301731        return false;
    17311732
    17321733    LocalCurrentGraphicsContext localContext(paintInfo.context);
    1733     setSearchCellState(input->renderer(), r);
     1734    setSearchCellState(*input->renderer(), r);
    17341735
    17351736    NSSearchFieldCell* search = this->search();
     
    17411742
    17421743    FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
    1743     localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
     1744    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
    17441745
    17451746    [[search searchButtonCell] drawWithFrame:localBounds inView:documentViewFor(o)];
     
    17571758}
    17581759
    1759 bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    1760 {
    1761     Node* input = o->node()->shadowHost();
     1760bool RenderThemeMac::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
     1761{
     1762    Node* input = o.node()->shadowHost();
    17621763    if (!input)
    1763         input = o->node();
     1764        input = o.node();
    17641765    if (!input->renderer()->isBox())
    17651766        return false;
    17661767
    17671768    LocalCurrentGraphicsContext localContext(paintInfo.context);
    1768     setSearchCellState(input->renderer(), r);
     1769    setSearchCellState(*input->renderer(), r);
    17691770
    17701771    NSSearchFieldCell* search = this->search();
     
    17761777
    17771778    GraphicsContextStateSaver stateSaver(*paintInfo.context);
    1778     float zoomLevel = o->style().effectiveZoom();
     1779    float zoomLevel = o.style().effectiveZoom();
    17791780
    17801781    FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
    1781     localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
     1782    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
    17821783
    17831784    IntRect unzoomedRect(localBounds);
     
    17961797}
    17971798
    1798 bool RenderThemeMac::paintSnapshottedPluginOverlay(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
     1799bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
    17991800{
    18001801    if (paintInfo.phase != PaintPhaseBlockBackground)
    18011802        return true;
    18021803
    1803     if (!o->isRenderBlock())
     1804    if (!o.isRenderBlock())
    18041805        return true;
    18051806
    1806     RenderBlock* renderBlock = toRenderBlock(o);
    1807 
    1808     LayoutUnit contentWidth = renderBlock->contentWidth();
    1809     LayoutUnit contentHeight = renderBlock->contentHeight();
     1807    const RenderBlock& renderBlock = *toRenderBlock(&o);
     1808
     1809    LayoutUnit contentWidth = renderBlock.contentWidth();
     1810    LayoutUnit contentHeight = renderBlock.contentHeight();
    18101811    if (!contentWidth || !contentHeight)
    18111812        return true;
     
    18141815
    18151816    LayoutSize contentSize(contentWidth, contentHeight);
    1816     LayoutPoint contentLocation = renderBlock->location();
    1817     contentLocation.move(renderBlock->borderLeft() + renderBlock->paddingLeft(), renderBlock->borderTop() + renderBlock->paddingTop());
     1817    LayoutPoint contentLocation = renderBlock.location();
     1818    contentLocation.move(renderBlock.borderLeft() + renderBlock.paddingLeft(), renderBlock.borderTop() + renderBlock.paddingTop());
    18181819
    18191820    LayoutRect rect(contentLocation, contentSize);
     
    18261827    // plugin itself by asking for the shadow root parent, and then its parent.
    18271828
    1828     if (!renderBlock->element()->isHTMLElement())
     1829    if (!renderBlock.element()->isHTMLElement())
    18291830        return true;
    18301831
    1831     HTMLElement* plugInOverlay = toHTMLElement(renderBlock->element());
     1832    HTMLElement* plugInOverlay = toHTMLElement(renderBlock.element());
    18321833    Element* parent = plugInOverlay->parentOrShadowHostElement();
    18331834    while (parent && !parent->isPluginElement())
     
    18531854    // We could draw the snapshot with that coordinates, but we need to make sure there
    18541855    // isn't a composited layer between us and the plugInRenderer.
    1855     RenderBox* renderBox = toRenderBox(o);
     1856    const RenderBox* renderBox = toRenderBox(&o);
    18561857    while (renderBox != plugInRenderer) {
    18571858        if (renderBox->hasLayer() && renderBox->layer() && renderBox->layer()->isComposited()) {
     
    20052006}
    20062007
    2007 bool RenderThemeMac::paintImageControlsButton(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
     2008bool RenderThemeMac::paintImageControlsButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
    20082009{
    20092010    if (paintInfo.phase != PaintPhaseBlockBackground)
     
    20302031}
    20312032
    2032 IntSize RenderThemeMac::imageControlsButtonSize(const RenderObject*) const
     2033IntSize RenderThemeMac::imageControlsButtonSize(const RenderObject&) const
    20332034{
    20342035#if HAVE(APPKIT_IMAGE_CONTROLS_SUPPORT)
  • trunk/Source/WebCore/rendering/RenderThemeSafari.cpp

    r166782 r167755  
    116116}
    117117
    118 ThemeControlState RenderThemeSafari::determineState(RenderObject* o) const
     118ThemeControlState RenderThemeSafari::determineState(const RenderObject& o) const
    119119{
    120120    ThemeControlState result = 0;
     
    265265}
    266266
    267 void RenderThemeSafari::adjustRepaintRect(const RenderObject* o, IntRect& r)
    268 {
    269     NSControlSize controlSize = controlSizeForFont(&o->style());
    270 
    271     switch (o->style().appearance()) {
     267void RenderThemeSafari::adjustRepaintRect(const RenderObject& o, IntRect& r)
     268{
     269    NSControlSize controlSize = controlSizeForFont(&o.style());
     270
     271    switch (o.style().appearance()) {
    272272        case CheckboxPart: {
    273273            // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
     
    318318}
    319319
    320 int RenderThemeSafari::baselinePosition(const RenderObject* o) const
    321 {
    322     if (!o->isBox())
     320int RenderThemeSafari::baselinePosition(const RenderObject& o) const
     321{
     322    if (!o.isBox())
    323323        return 0;
    324324
    325     if (o->style().appearance() == CheckboxPart || o->style().appearance() == RadioPart) {
    326         const RenderBox* box = toRenderBox(o);
     325    if (o.style().appearance() == CheckboxPart || o.style().appearance() == RadioPart) {
     326        const RenderBox* box = toRenderBox(&o);
    327327        return box->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
    328328    }
     
    331331}
    332332
    333 bool RenderThemeSafari::controlSupportsTints(const RenderObject* o) const
     333bool RenderThemeSafari::controlSupportsTints(const RenderObject& o) const
    334334{
    335335    if (!isEnabled(o))
     
    337337
    338338    // Checkboxes only have tint when checked.
    339     if (o->style().appearance() == CheckboxPart)
     339    if (o.style().appearance() == CheckboxPart)
    340340        return isChecked(o);
    341341
     
    417417}
    418418
    419 bool RenderThemeSafari::paintCheckbox(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     419bool RenderThemeSafari::paintCheckbox(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    420420{
    421421    ASSERT(SafariThemeLibrary());
    422422
    423     NSControlSize controlSize = controlSizeForFont(&o->style());
     423    NSControlSize controlSize = controlSizeForFont(&o.style());
    424424
    425425    IntRect inflatedRect = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize)); 
     
    456456}
    457457
    458 bool RenderThemeSafari::paintRadio(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     458bool RenderThemeSafari::paintRadio(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    459459{
    460460    ASSERT(SafariThemeLibrary());
    461461
    462     NSControlSize controlSize = controlSizeForFont(&o->style());
     462    NSControlSize controlSize = controlSizeForFont(&o.style());
    463463 
    464464    IntRect inflatedRect = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize));   
     
    580580}
    581581
    582 bool RenderThemeSafari::paintButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     582bool RenderThemeSafari::paintButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    583583{
    584584    ASSERT(SafariThemeLibrary());
     
    613613}
    614614
    615 bool RenderThemeSafari::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     615bool RenderThemeSafari::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    616616{
    617617    ASSERT(SafariThemeLibrary());
     
    625625}
    626626
    627 bool RenderThemeSafari::paintCapsLockIndicator(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     627bool RenderThemeSafari::paintCapsLockIndicator(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    628628{   
    629629#if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 1
     
    641641}
    642642
    643 bool RenderThemeSafari::paintTextArea(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     643bool RenderThemeSafari::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    644644{
    645645    ASSERT(SafariThemeLibrary());
     
    681681}
    682682
    683 bool RenderThemeSafari::paintMenuList(RenderObject* o, const PaintInfo& info, const IntRect& r)
     683bool RenderThemeSafari::paintMenuList(const RenderObject& o, const PaintInfo& info, const IntRect& r)
    684684{
    685685    ASSERT(SafariThemeLibrary());
     
    691691
    692692    // Now inflate it to account for the shadow.
    693     if (r.width() >= minimumMenuListSize(&o->style()))
     693    if (r.width() >= minimumMenuListSize(&o.style()))
    694694        inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(controlSize));
    695695
     
    750750}
    751751
    752 void RenderThemeSafari::paintMenuListButtonGradients(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     752void RenderThemeSafari::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    753753{
    754754    if (r.isEmpty())
     
    759759    paintInfo.context->save();
    760760
    761     FloatRoundedRect bound = FloatRoundedRect(o->style().getRoundedBorderFor(r));
     761    FloatRoundedRect bound = FloatRoundedRect(o.style().getRoundedBorderFor(r));
    762762    int radius = bound.radii().topLeft().width();
    763763
     
    811811}
    812812
    813 bool RenderThemeSafari::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
    814 {
    815     IntRect bounds = IntRect(rect.x() + renderer->style().borderLeftWidth(),
    816                              rect.y() + renderer->style().borderTopWidth(),
    817                              rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),
    818                              rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());
     813bool RenderThemeSafari::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
     814{
     815    IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(),
     816        rect.y() + renderer.style().borderTopWidth(),
     817        rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(),
     818        rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth());
    819819    // Draw the gradients to give the styled popup menu a button appearance
    820820    paintMenuListButtonGradients(renderer, paintInfo, bounds);
    821821
    822822    // Since we actually know the size of the control here, we restrict the font scale to make sure the arrow will fit vertically in the bounds
    823     float fontScale = min(renderer->style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
     823    float fontScale = min(renderer.style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
    824824    float centerY = bounds.y() + bounds.height() / 2.0f;
    825825    float arrowHeight = baseArrowHeight * fontScale;
     
    832832    paintInfo.context->save();
    833833
    834     paintInfo.context->setFillColor(renderer->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     834    paintInfo.context->setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
    835835    paintInfo.context->setStrokeColor(NoStroke, ColorSpaceDeviceRGB);
    836836
     
    957957const int trackRadius = 2;
    958958
    959 bool RenderThemeSafari::paintSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     959bool RenderThemeSafari::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    960960{
    961961    IntSize radius(trackRadius, trackRadius);
    962962    FloatRoundedRect bounds(r, radius, radius, radius, radius);
    963963
    964     if (o->style().appearance() ==  SliderHorizontalPart)
    965         bounds.setRect(IntRect(r.x(),
    966                                r.y() + r.height() / 2 - trackWidth / 2,
    967                                r.width(),
    968                                trackWidth));
    969     else if (o->style().appearance() == SliderVerticalPart)
    970         bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2,
    971                                r.y(),
    972                                trackWidth,
    973                                r.height()));
     964    if (o.style().appearance() ==  SliderHorizontalPart)
     965        bounds.setRect(IntRect(r.x(), r.y() + r.height() / 2 - trackWidth / 2, r.width(), trackWidth));
     966    else if (o.style().appearance() == SliderVerticalPart)
     967        bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2, r.y(), trackWidth, r.height()));
    974968
    975969    CGContextRef context = paintInfo.context->platformContext();
     
    982976    RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
    983977    RetainPtr<CGShadingRef> mainShading;
    984     if (o->style().appearance() == SliderVerticalPart)
     978    if (o.style().appearance() == SliderVerticalPart)
    985979        mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(),  bounds.rect().maxY()), CGPointMake(bounds.rect().maxX(), bounds.rect().maxY()), mainFunction.get(), false, false));
    986980    else
     
    1002996const float verticalSliderHeightPadding = 0.1f;
    1003997
    1004 bool RenderThemeSafari::paintSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     998bool RenderThemeSafari::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    1005999{
    10061000    ASSERT(SafariThemeLibrary());
     
    10241018}
    10251019
    1026 bool RenderThemeSafari::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     1020bool RenderThemeSafari::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    10271021{
    10281022    ASSERT(SafariThemeLibrary());
     
    10771071}
    10781072
    1079 bool RenderThemeSafari::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
     1073bool RenderThemeSafari::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
    10801074{
    10811075    ASSERT(SafariThemeLibrary());
    10821076
    1083     Node* input = o->node()->shadowHost();
     1077    Node* input = o.node()->shadowHost();
    10841078    if (!input)
    1085         input = o->node();
     1079        input = o.node();
    10861080    RenderObject* renderer = input->renderer();
    10871081    ASSERT(renderer);
     
    11201114}
    11211115
    1122 bool RenderThemeSafari::paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&)
     1116bool RenderThemeSafari::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&)
    11231117{
    11241118    return false;
     
    11321126}
    11331127
    1134 bool RenderThemeSafari::paintSearchFieldResultsDecorationPart(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
     1128bool RenderThemeSafari::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
    11351129{
    11361130    ASSERT(SafariThemeLibrary());
    11371131
    1138     Node* input = o->node()->shadowHost();
     1132    Node* input = o.node()->shadowHost();
    11391133    if (!input)
    1140         input = o->node();
     1134        input = o.node();
    11411135    RenderObject* renderer = input->renderer();
    11421136    ASSERT(renderer);
     
    11561150}
    11571151
    1158 bool RenderThemeSafari::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
     1152bool RenderThemeSafari::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
    11591153{
    11601154    ASSERT(SafariThemeLibrary());
    11611155
    1162     Node* input = o->node()->shadowHost();
     1156    Node* input = o.node()->shadowHost();
    11631157    if (!input)
    1164         input = o->node();
     1158        input = o.node();
    11651159    RenderObject* renderer = input->renderer();
    11661160    ASSERT(renderer);
     
    12171211}
    12181212
    1219 bool RenderThemeSafari::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     1213bool RenderThemeSafari::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    12201214{
    12211215    // NOTE: This routine is for testing only. It should be fleshed out with a real CG-based implementation.
    12221216    // Right now it uses a slider, with the thumb positioned at the meter point.
    1223     if (!renderObject->isMeter())
     1217    if (!renderObject.isMeter())
    12241218        return true;
    12251219
    1226     HTMLMeterElement* element = toRenderMeter(renderObject)->meterElement();
     1220    HTMLMeterElement* element = toRenderMeter(&renderObject)->meterElement();
    12271221
    12281222    int remaining = static_cast<int>((1.0 - element->valueRatio()) * static_cast<double>(rect.size().width()));
  • trunk/Source/WebCore/rendering/RenderThemeSafari.h

    r166782 r167755  
    5353    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    5454    // controls that need to do this.
    55     virtual int baselinePosition(const RenderObject*) const;
     55    virtual int baselinePosition(const RenderObject&) const;
    5656
    5757    // A method asking if the control changes its tint when the window has focus or not.
    58     virtual bool controlSupportsTints(const RenderObject*) const;
     58    virtual bool controlSupportsTints(const RenderObject&) const;
    5959
    6060    // A general method asking if any control tinting is supported at all.
    6161    virtual bool supportsControlTints() const { return true; }
    6262
    63     virtual void adjustRepaintRect(const RenderObject*, IntRect&);
     63    virtual void adjustRepaintRect(const RenderObject&, IntRect&);
    6464
    6565    virtual bool isControlStyled(const RenderStyle*, const BorderData&,
     
    8787protected:
    8888    // Methods for each appearance value.
    89     virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
     89    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
    9090    virtual void setCheckboxSize(RenderStyle*) const;
    9191
    92     virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
     92    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
    9393    virtual void setRadioSize(RenderStyle*) const;
    9494
    9595    virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, WebCore::Element*) const;
    96     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
     96    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
    9797    virtual void setButtonSize(RenderStyle*) const;
    9898
    99     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
     99    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
    100100    virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    101101
    102     virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
     102    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
    103103    virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
    104104
    105     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     105    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
    106106    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
    107107
    108     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     108    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
    109109    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    110110
    111     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
    112     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
     111    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
     112    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
    113113
    114     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
     114    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
    115115    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    116116
    117117    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    118     virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
     118    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
    119119
    120120    virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    121     virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     121    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    122122
    123123    virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    124     virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     124    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    125125
    126126    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    127     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
     127    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
    128128 
    129     virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
     129    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&);
    130130
    131131#if ENABLE(VIDEO)
     
    138138    virtual bool supportsMeter(ControlPart) const override;
    139139    virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const override;
    140     virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) override;
     140    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
    141141#endif
    142142
     
    173173    const int* popupButtonMargins(NSControlSize) const;
    174174    const int* popupButtonPadding(NSControlSize) const;
    175     void paintMenuListButtonGradients(RenderObject*, const PaintInfo&, const IntRect&);
     175    void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&);
    176176    const IntSize* menuListSizes() const;
    177177
     
    181181    void setSearchFieldSize(RenderStyle*) const;
    182182
    183     ThemeControlState determineState(RenderObject*) const;
     183    ThemeControlState determineState(const RenderObject&) const;
    184184
    185185    String m_mediaControlsScript;
  • trunk/Source/WebCore/rendering/RenderThemeWin.cpp

    r167145 r167755  
    435435}
    436436
    437 unsigned RenderThemeWin::determineClassicState(RenderObject* o, ControlSubPart subPart)
     437unsigned RenderThemeWin::determineClassicState(const RenderObject& o, ControlSubPart subPart)
    438438{
    439439    unsigned state = 0;
    440     switch (o->style().appearance()) {
     440    switch (o.style().appearance()) {
    441441        case PushButtonPart:
    442442        case ButtonPart:
     
    450450        case RadioPart:
    451451        case CheckboxPart:
    452             state = (o->style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
     452            state = (o.style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
    453453            if (isChecked(o))
    454454                state |= DFCS_CHECKED;
     
    482482}
    483483
    484 unsigned RenderThemeWin::determineState(RenderObject* o)
     484unsigned RenderThemeWin::determineState(const RenderObject& o)
    485485{
    486486    unsigned result = TS_NORMAL;
    487     ControlPart appearance = o->style().appearance();
     487    ControlPart appearance = o.style().appearance();
    488488    if (!isEnabled(o))
    489489        result = TS_DISABLED;
     
    503503}
    504504
    505 unsigned RenderThemeWin::determineSliderThumbState(RenderObject* o)
     505unsigned RenderThemeWin::determineSliderThumbState(const RenderObject& o)
    506506{
    507507    unsigned result = TUS_NORMAL;
    508508    if (!isEnabled(o))
    509509        result = TUS_DISABLED;
    510     else if (supportsFocus(o->style().appearance()) && isFocused(o))
     510    else if (supportsFocus(o.style().appearance()) && isFocused(o))
    511511        result = TUS_FOCUSED;
    512512    else if (isPressed(o))
     
    517517}
    518518
    519 unsigned RenderThemeWin::determineButtonState(RenderObject* o)
     519unsigned RenderThemeWin::determineButtonState(const RenderObject& o)
    520520{
    521521    unsigned result = PBS_NORMAL;
     
    524524    else if (isPressed(o))
    525525        result = PBS_PRESSED;
    526     else if (supportsFocus(o->style().appearance()) && isFocused(o))
     526    else if (supportsFocus(o.style().appearance()) && isFocused(o))
    527527        result = PBS_DEFAULTED;
    528528    else if (isHovered(o))
     
    533533}
    534534
    535 unsigned RenderThemeWin::determineSpinButtonState(RenderObject* o, ControlSubPart subPart)
     535unsigned RenderThemeWin::determineSpinButtonState(const RenderObject& o, ControlSubPart subPart)
    536536{
    537537    bool isUpButton = subPart == SpinButtonUp;
     
    546546}
    547547
    548 ThemeData RenderThemeWin::getClassicThemeData(RenderObject* o, ControlSubPart subPart)
     548ThemeData RenderThemeWin::getClassicThemeData(const RenderObject& o, ControlSubPart subPart)
    549549{
    550550    ThemeData result;
    551     switch (o->style().appearance()) {
     551    switch (o.style().appearance()) {
    552552        case PushButtonPart:
    553553        case ButtonPart:
     
    598598}
    599599
    600 ThemeData RenderThemeWin::getThemeData(RenderObject* o, ControlSubPart subPart)
     600ThemeData RenderThemeWin::getThemeData(const RenderObject& o, ControlSubPart subPart)
    601601{
    602602    if (!haveTheme)
     
    604604
    605605    ThemeData result;
    606     switch (o->style().appearance()) {
     606    switch (o.style().appearance()) {
    607607        case PushButtonPart:
    608608        case ButtonPart:
     
    619619            const bool isVistaOrLater = (windowsVersion() >= WindowsVista);
    620620            result.m_part = isVistaOrLater ? CP_DROPDOWNBUTTONRIGHT : CP_DROPDOWNBUTTON;
    621             if (isVistaOrLater && o->frame().settings().applicationChromeMode()) {
     621            if (isVistaOrLater && o.frame().settings().applicationChromeMode()) {
    622622                // The "readonly" look we use in application chrome mode
    623623                // only uses a "normal" look for the drop down button.
     
    666666}
    667667
    668 static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme, const ThemeData& themeData, const IntRect& r)
     668static void drawControl(GraphicsContext* context, const RenderObject& o, HANDLE theme, const ThemeData& themeData, const IntRect& r)
    669669{
    670670    bool alphaBlend = false;
     
    686686            ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
    687687            ::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH));
    688         } else if ((o->style().appearance() == SliderThumbHorizontalPart ||
    689                     o->style().appearance() == SliderThumbVerticalPart) &&
    690                    (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP ||
    691                     themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
     688        } else if ((o.style().appearance() == SliderThumbHorizontalPart
     689        || o.style().appearance() == SliderThumbVerticalPart)
     690        && (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP
     691        || themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
    692692            ::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
    693693            if (themeData.m_state == TUS_DISABLED) {
     
    711711        } else {
    712712            // Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists.
    713             if (o->style().appearance() == DefaultButtonPart) {
     713            if (o.style().appearance() == DefaultButtonPart) {
    714714                HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW);
    715715                ::FrameRect(hdc, &widgetRect, brush);
     
    725725}
    726726
    727 bool RenderThemeWin::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
     727bool RenderThemeWin::paintButton(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    728728
    729729    drawControl(i.context,  o, buttonTheme(), getThemeData(o), r);
     
    740740}
    741741
    742 bool RenderThemeWin::paintInnerSpinButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
     742bool RenderThemeWin::paintInnerSpinButton(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    743743{
    744744    // We split the specified rectangle into two vertically. We can't draw a
     
    772772}
    773773
    774 bool RenderThemeWin::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& r)
     774bool RenderThemeWin::paintTextField(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    775775{
    776776    drawControl(i.context,  o, textFieldTheme(), getThemeData(o), r);
     
    778778}
    779779
    780 bool RenderThemeWin::paintMenuList(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
     780bool RenderThemeWin::paintMenuList(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
    781781{
    782782    HANDLE theme;
     
    784784    if (haveTheme && (windowsVersion() >= WindowsVista)) {
    785785        theme = menuListTheme();
    786         if (renderer->frame().settings().applicationChromeMode())
     786        if (renderer.frame().settings().applicationChromeMode())
    787787            part = CP_READONLY;
    788788        else
     
    793793    }
    794794
    795     drawControl(paintInfo.context,  renderer, theme, ThemeData(part, determineState(renderer)), rect);
     795    drawControl(paintInfo.context, renderer, theme, ThemeData(part, determineState(renderer)), rect);
    796796   
    797797    return paintMenuListButtonDecorations(renderer, paintInfo, rect);
     
    835835}
    836836
    837 bool RenderThemeWin::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
     837bool RenderThemeWin::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
    838838{
    839839    // FIXME: Don't make hardcoded assumptions about the thickness of the textfield border.
     
    844844    IntRect buttonRect(rect);
    845845    buttonRect.inflate(-borderThickness);
    846     if (renderer->style().direction() == LTR)
     846    if (renderer.style().direction() == LTR)
    847847        buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
    848848    buttonRect.setWidth(dropDownButtonWidth);
     
    862862const int trackWidth = 4;
    863863
    864 bool RenderThemeWin::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r)
     864bool RenderThemeWin::paintSliderTrack(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    865865{
    866866    IntRect bounds = r;
    867867   
    868     if (o->style().appearance() ==  SliderHorizontalPart) {
     868    if (o.style().appearance() ==  SliderHorizontalPart) {
    869869        bounds.setHeight(trackWidth);
    870870        bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
    871     } else if (o->style().appearance() == SliderVerticalPart) {
     871    } else if (o.style().appearance() == SliderVerticalPart) {
    872872        bounds.setWidth(trackWidth);
    873873        bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
     
    878878}
    879879
    880 bool RenderThemeWin::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r)
     880bool RenderThemeWin::paintSliderThumb(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    881881{   
    882882    drawControl(i.context,  o, sliderTheme(), getThemeData(o), r);
     
    903903}
    904904
    905 bool RenderThemeWin::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& r)
     905bool RenderThemeWin::paintSearchField(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    906906{
    907907    return paintTextField(o, i, r);
     
    920920}
    921921
    922 bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     922bool RenderThemeWin::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    923923{
    924924    IntRect bounds = r;
    925     ASSERT(o->parent());
    926     if (!o->parent() || !o->parent()->isBox())
     925    ASSERT(o.parent());
     926    if (!o.parent() || !o.parent()->isBox())
    927927        return false;
    928928   
    929     RenderBox* parentRenderBox = toRenderBox(o->parent());
     929    RenderBox* parentRenderBox = toRenderBox(o.parent());
    930930
    931931    IntRect parentBox = parentRenderBox->absoluteContentBox();
     
    941941    static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
    942942    static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
    943     paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o->style().colorSpace(), bounds);
     943    paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o.style().colorSpace(), bounds);
    944944    return false;
    945945}
     
    971971}
    972972
    973 bool RenderThemeWin::paintSearchFieldResultsDecorationPart(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     973bool RenderThemeWin::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    974974{
    975975    IntRect bounds = r;
    976     ASSERT(o->parent());
    977     if (!o->parent() || !o->parent()->isBox())
     976    ASSERT(o.parent());
     977    if (!o.parent() || !o.parent()->isBox())
    978978        return false;
    979979   
    980     RenderBox* parentRenderBox = toRenderBox(o->parent());
     980    RenderBox* parentRenderBox = toRenderBox(o.parent());
    981981    IntRect parentBox = parentRenderBox->absoluteContentBox();
    982982   
     
    990990   
    991991    static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
    992     paintInfo.context->drawImage(magnifierImage, o->style().colorSpace(), bounds);
     992    paintInfo.context->drawImage(magnifierImage, o.style().colorSpace(), bounds);
    993993    return false;
    994994}
     
    10051005}
    10061006
    1007 bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     1007bool RenderThemeWin::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
    10081008{
    10091009    IntRect bounds = r;
    1010     ASSERT(o->parent());
    1011     if (!o->parent())
     1010    ASSERT(o.parent());
     1011    if (!o.parent())
    10121012        return false;
    1013     if (!o->parent() || !o->parent()->isBox())
     1013    if (!o.parent() || !o.parent()->isBox())
    10141014        return false;
    10151015   
    1016     RenderBox* parentRenderBox = toRenderBox(o->parent());
     1016    RenderBox* parentRenderBox = toRenderBox(o.parent());
    10171017    IntRect parentBox = parentRenderBox->absoluteContentBox();
    10181018   
     
    10261026
    10271027    static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
    1028     paintInfo.context->drawImage(magnifierImage, o->style().colorSpace(), bounds);
     1028    paintInfo.context->drawImage(magnifierImage, o.style().colorSpace(), bounds);
    10291029    return false;
    10301030}
     
    11781178}
    11791179
    1180 bool RenderThemeWin::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
    1181 {
    1182     if (!renderObject->isMeter())
     1180bool RenderThemeWin::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
     1181{
     1182    if (!renderObject.isMeter())
    11831183        return true;
    11841184
    1185     HTMLMeterElement* element = toRenderMeter(renderObject)->meterElement();
     1185    HTMLMeterElement* element = toRenderMeter(&renderObject)->meterElement();
    11861186
    11871187    ThemeData theme = getThemeData(renderObject);
  • trunk/Source/WebCore/rendering/RenderThemeWin.h

    r166782 r167755  
    6767    virtual Color systemColor(CSSValueID) const;
    6868
    69     virtual bool paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r)
     69    virtual bool paintCheckbox(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    7070    { return paintButton(o, i, r); }
    7171    virtual void setCheckboxSize(RenderStyle*) const;
    7272
    73     virtual bool paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& r)
     73    virtual bool paintRadio(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    7474    { return paintButton(o, i, r); }
    7575    virtual void setRadioSize(RenderStyle* style) const
    7676    { return setCheckboxSize(style); }
    7777
    78     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
     78    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
    7979
    8080    virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    81     virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
     81    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&);
    8282
    83     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
     83    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
    8484
    85     virtual bool paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& r)
     85    virtual bool paintTextArea(const RenderObject& o, const PaintInfo& i, const IntRect& r)
    8686    { return paintTextField(o, i, r); }
    8787
    8888    virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
    89     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     89    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
    9090    virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    9191
    92     virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     92    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
    9393
    94     virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
    95     virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
     94    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
     95    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
    9696    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
    9797
     
    9999
    100100    virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
    101     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
     101    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
    102102
    103103    virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    104     virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
     104    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
    105105
    106106    virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    107     virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&) { return false; }
     107    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return false; }
    108108
    109109    virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
    110     virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
     110    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
    111111
    112112    virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
    113     virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
     113    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
    114114
    115115    virtual void themeChanged();
     
    134134    virtual bool supportsMeter(ControlPart) const override;
    135135    virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const override;
    136     virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) override;
     136    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
    137137#endif
    138138
     
    152152    void close();
    153153
    154     unsigned determineState(RenderObject*);
    155     unsigned determineClassicState(RenderObject*, ControlSubPart = None);
    156     unsigned determineSliderThumbState(RenderObject*);
    157     unsigned determineButtonState(RenderObject*);
    158     unsigned determineSpinButtonState(RenderObject*, ControlSubPart = None);
     154    unsigned determineState(const RenderObject&);
     155    unsigned determineClassicState(const RenderObject&, ControlSubPart = None);
     156    unsigned determineSliderThumbState(const RenderObject&);
     157    unsigned determineButtonState(const RenderObject&);
     158    unsigned determineSpinButtonState(const RenderObject&, ControlSubPart = None);
    159159
    160160    bool supportsFocus(ControlPart) const;
    161161
    162     ThemeData getThemeData(RenderObject*, ControlSubPart = None);
    163     ThemeData getClassicThemeData(RenderObject* o, ControlSubPart = None);
     162    ThemeData getThemeData(const RenderObject&, ControlSubPart = None);
     163    ThemeData getClassicThemeData(const RenderObject&, ControlSubPart = None);
    164164
    165165    HANDLE buttonTheme() const;
Note: See TracChangeset for help on using the changeset viewer.