Transition RenderTheme API from RenderObject* to const RenderObject&
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 14:27:54 +0000 (14:27 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 14:27:54 +0000 (14:27 +0000)
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):

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

35 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/shadow/MediaControlElementTypes.h
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/efl/RenderThemeEfl.h
Source/WebCore/platform/gtk/RenderThemeGtk.cpp
Source/WebCore/platform/gtk/RenderThemeGtk.h
Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMediaControls.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderProgress.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeSafari.h
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/RenderThemeWin.h

index 55684dd..103b114 100644 (file)
@@ -1,3 +1,172 @@
+2014-04-24  Zalan Bujtas  <zalan@apple.com>
+
+        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):
+
 2014-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] HTML Media capture attribute is a boolean since r163958
index 61f74c9..b8d7207 100644 (file)
@@ -711,7 +711,7 @@ IntRect AccessibilityObject::boundingBoxForQuads(RenderObject* obj, const Vector
         IntRect r = quad.enclosingBoundingBox();
         if (!r.isEmpty()) {
             if (obj->style().hasAppearance())
-                obj->theme().adjustRepaintRect(obj, r);
+                obj->theme().adjustRepaintRect(*obj, r);
             result.unite(r);
         }
     }
index 1bb898f..acdd360 100644 (file)
@@ -488,7 +488,7 @@ void Element::setActive(bool flag, bool pause)
     if (reactsToPress)
         setNeedsStyleRecalc();
 
-    if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(renderer(), ControlStates::PressedState))
+    if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::PressedState))
         reactsToPress = true;
 
     // The rest of this function implements a feature that only works if the
@@ -554,7 +554,7 @@ void Element::setHovered(bool flag)
         setNeedsStyleRecalc();
 
     if (renderer()->style().hasAppearance())
-        renderer()->theme().stateChanged(renderer(), ControlStates::HoverState);
+        renderer()->theme().stateChanged(*renderer(), ControlStates::HoverState);
 }
 
 void Element::scrollIntoView(bool alignToTop) 
index 47b6be6..bac2df9 100644 (file)
@@ -1749,7 +1749,7 @@ void FrameSelection::focusedOrActiveStateChanged()
         element->setNeedsStyleRecalc();
         if (RenderObject* renderer = element->renderer())
             if (renderer && renderer->style().hasAppearance())
-                renderer->theme().stateChanged(renderer, ControlStates::FocusState);
+                renderer->theme().stateChanged(*renderer, ControlStates::FocusState);
     }
 #endif
 }
index e0b85d5..810cbad 100644 (file)
@@ -155,7 +155,7 @@ void HTMLFormControlElement::disabledStateChanged()
     setNeedsWillValidateCheck();
     didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled);
     if (renderer() && renderer()->style().hasAppearance())
-        renderer()->theme().stateChanged(renderer(), ControlStates::EnabledState);
+        renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState);
 }
 
 void HTMLFormControlElement::readOnlyAttributeChanged()
@@ -163,7 +163,7 @@ void HTMLFormControlElement::readOnlyAttributeChanged()
     setNeedsWillValidateCheck();
     setNeedsStyleRecalc();
     if (renderer() && renderer()->style().hasAppearance())
-        renderer()->theme().stateChanged(renderer(), ControlStates::ReadOnlyState);
+        renderer()->theme().stateChanged(*renderer(), ControlStates::ReadOnlyState);
 }
 
 void HTMLFormControlElement::requiredAttributeChanged()
index 700028b..7cb6c23 100644 (file)
@@ -858,7 +858,7 @@ void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
     if (CheckedRadioButtons* buttons = checkedRadioButtons())
             buttons->updateCheckedState(this);
     if (renderer() && renderer()->style().hasAppearance())
-        renderer()->theme().stateChanged(renderer(), ControlStates::CheckedState);
+        renderer()->theme().stateChanged(*renderer(), ControlStates::CheckedState);
     setNeedsValidityCheck();
 
     // Ideally we'd do this from the render tree (matching
@@ -892,7 +892,7 @@ void HTMLInputElement::setIndeterminate(bool newValue)
     didAffectSelector(AffectedSelectorIndeterminate);
 
     if (renderer() && renderer()->style().hasAppearance())
-        renderer()->theme().stateChanged(renderer(), ControlStates::CheckedState);
+        renderer()->theme().stateChanged(*renderer(), ControlStates::CheckedState);
 }
 
 int HTMLInputElement::size() const
index 49f48bf..219f3a2 100644 (file)
@@ -195,7 +195,7 @@ void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt
         if (oldDisabled != m_disabled) {
             didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled);
             if (renderer() && renderer()->style().hasAppearance())
-                renderer()->theme().stateChanged(renderer(), ControlStates::EnabledState);
+                renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState);
         }
     } else if (name == selectedAttr) {
         // FIXME: This doesn't match what the HTML specification says.
index 42bf6ac..5cce669 100644 (file)
@@ -75,7 +75,7 @@ enum MediaControlElementType {
 };
 
 HTMLMediaElement* parentMediaElement(Node*);
-inline HTMLMediaElement* parentMediaElement(RenderObject& renderer) { return parentMediaElement(renderer.node()); }
+inline HTMLMediaElement* parentMediaElement(const RenderObject& renderer) { return parentMediaElement(renderer.node()); }
 
 MediaControlElementType mediaControlElementType(Node*);
 
index 6fc463e..8e045eb 100755 (executable)
@@ -299,13 +299,13 @@ void RenderThemeEfl::applyEdjeStateFromForm(Evas_Object* object, const ControlSt
         edje_object_signal_emit(object, "styled", "");
 }
 
-void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject* object, FormType type, const IntRect& rect)
+void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, const RenderObject& object, FormType type, const IntRect& rect)
 {
     if (type == SliderVertical || type == SliderHorizontal) {
-        if (!object->isSlider())
+        if (!object.isSlider())
             return; // probably have -webkit-appearance: slider..
 
-        RenderSlider* renderSlider = toRenderSlider(object);
+        const RenderSlider* renderSlider = toRenderSlider(&object);
         HTMLInputElement& input = renderSlider->element();
         double valueRange = input.maximum() - input.minimum();
 
@@ -316,7 +316,7 @@ void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject* object,
         // grows from the end of the slider or from the beginning. On vertical
         // sliders, it should always be the same and will not be affected by
         // text direction settings.
-        if (object->style().direction() == RTL || type == SliderVertical)
+        if (object.style().direction() == RTL || type == SliderVertical)
             msg->val[0] = 1;
         else
             msg->val[0] = 0;
@@ -325,7 +325,7 @@ void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject* object,
         edje_object_message_send(edje, EDJE_MESSAGE_FLOAT_SET, 0, msg.get());
 #if ENABLE(PROGRESS_ELEMENT)
     } else if (type == ProgressBar) {
-        RenderProgress* renderProgress = toRenderProgress(object);
+        const RenderProgress* renderProgress = toRenderProgress(&object);
 
         int max = rect.width();
         double value = renderProgress->position();
@@ -333,7 +333,7 @@ void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject* object,
         OwnPtr<Edje_Message_Float_Set> msg = adoptPtr(static_cast<Edje_Message_Float_Set*>(::operator new (sizeof(Edje_Message_Float_Set) + sizeof(double))));
         msg->count = 2;
 
-        if (object->style().direction() == RTL)
+        if (object.style().direction() == RTL)
             msg->val[0] = (1.0 - value) * max;
         else
             msg->val[0] = 0;
@@ -350,7 +350,7 @@ bool RenderThemeEfl::isControlStyled(const RenderStyle* style, const BorderData&
     return RenderTheme::isControlStyled(style, border, background, backgroundColor) || style->appearance() == MenulistButtonPart;
 }
 
-bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintThemePart(const RenderObject& object, FormType type, const PaintInfo& info, const IntRect& rect)
 {
     loadThemeIfNeeded();
     _ASSERT_ON_RELEASE_RETURN_VAL(edje(), false, "Could not paint native HTML part due to missing theme.");
@@ -359,7 +359,7 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P
     if (!entry)
         return false;
 
-    bool haveBackgroundColor = isControlStyled(&object->style(), object->style().border(), *object->style().backgroundLayers(), Color::white);
+    bool haveBackgroundColor = isControlStyled(&object.style(), object.style().border(), *object.style().backgroundLayers(), Color::white);
     ControlStates states(extractControlStatesForRenderer(object));
     applyEdjeStateFromForm(entry->edje(), &states, haveBackgroundColor);
 
@@ -631,19 +631,19 @@ bool RenderThemeEfl::supportsFocusRing(const RenderStyle* style) const
     return supportsFocus(style->appearance());
 }
 
-bool RenderThemeEfl::controlSupportsTints(const RenderObject* object) const
+bool RenderThemeEfl::controlSupportsTints(const RenderObject& object) const
 {
     return isEnabled(object);
 }
 
-int RenderThemeEfl::baselinePosition(const RenderObject* object) const
+int RenderThemeEfl::baselinePosition(const RenderObject& object) const
 {
-    if (!object->isBox())
+    if (!object.isBox())
         return 0;
 
-    if (object->style().appearance() == CheckboxPart
-    ||  object->style().appearance() == RadioPart)
-        return toRenderBox(object)->marginTop() + toRenderBox(object)->height() - 3;
+    if (object.style().appearance() == CheckboxPart
+    ||  object.style().appearance() == RadioPart)
+        return toRenderBox(&object)->marginTop() + toRenderBox(&object)->height() - 3;
 
     return RenderTheme::baselinePosition(object);
 }
@@ -684,9 +684,9 @@ bool RenderThemeEfl::supportsSelectionForegroundColors() const
     return m_supportsSelectionForegroundColor;
 }
 
-bool RenderThemeEfl::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintSliderTrack(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
-    if (object->style().appearance() == SliderHorizontalPart)
+    if (object.style().appearance() == SliderHorizontalPart)
         paintThemePart(object, SliderHorizontal, info, rect);
     else
         paintThemePart(object, SliderVertical, info, rect);
@@ -755,9 +755,9 @@ bool RenderThemeEfl::supportsDataListUI(const AtomicString& type) const
 #endif
 }
 
-bool RenderThemeEfl::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintSliderThumb(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
-    if (object->style().appearance() == SliderThumbHorizontalPart)
+    if (object.style().appearance() == SliderThumbHorizontalPart)
         paintThemePart(object, SliderThumbHorizontal, info, rect);
     else
         paintThemePart(object, SliderThumbVertical, info, rect);
@@ -783,7 +783,7 @@ void RenderThemeEfl::adjustCheckboxStyle(StyleResolver* styleResolver, RenderSty
         style->setHeight(desc->min.height());
 }
 
-bool RenderThemeEfl::paintCheckbox(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintCheckbox(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, CheckBox, info, rect);
 }
@@ -806,7 +806,7 @@ void RenderThemeEfl::adjustRadioStyle(StyleResolver* styleResolver, RenderStyle*
         style->setHeight(desc->min.height());
 }
 
-bool RenderThemeEfl::paintRadio(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintRadio(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, RadioButton, info, rect);
 }
@@ -823,7 +823,7 @@ void RenderThemeEfl::adjustButtonStyle(StyleResolver* styleResolver, RenderStyle
         adjustSizeConstraints(style, Button);
 }
 
-bool RenderThemeEfl::paintButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, Button, info, rect);
 }
@@ -841,7 +841,7 @@ void RenderThemeEfl::adjustMenuListStyle(StyleResolver* styleResolver, RenderSty
     style->setLineHeight(RenderStyle::initialLineHeight());
 }
 
-bool RenderThemeEfl::paintMenuList(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, ComboBox, info, rect);
 }
@@ -862,7 +862,7 @@ void RenderThemeEfl::adjustMenuListButtonStyle(StyleResolver* styleResolver, Ren
     adjustMenuListStyle(styleResolver, style, element);
 }
 
-bool RenderThemeEfl::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintMenuList(object, info, rect);
 }
@@ -877,7 +877,7 @@ void RenderThemeEfl::adjustTextFieldStyle(StyleResolver* styleResolver, RenderSt
     style->resetBorder();
 }
 
-bool RenderThemeEfl::paintTextField(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintTextField(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, TextField, info, rect);
 }
@@ -886,7 +886,7 @@ void RenderThemeEfl::adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*)
 {
 }
 
-bool RenderThemeEfl::paintTextArea(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintTextArea(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintTextField(object, info, rect);
 }
@@ -908,7 +908,7 @@ void RenderThemeEfl::adjustSearchFieldResultsButtonStyle(StyleResolver* styleRes
     style->setHeight(Length(decorationSize, Fixed));
 }
 
-bool RenderThemeEfl::paintSearchFieldResultsButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintSearchFieldResultsButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, SearchFieldResultsButton, info, rect);
 }
@@ -930,7 +930,7 @@ void RenderThemeEfl::adjustSearchFieldResultsDecorationPartStyle(StyleResolver*
     style->setHeight(Length(decorationSize, Fixed));
 }
 
-bool RenderThemeEfl::paintSearchFieldResultsDecorationPart(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintSearchFieldResultsDecorationPart(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, SearchFieldResultsDecoration, info, rect);
 }
@@ -954,7 +954,7 @@ void RenderThemeEfl::adjustSearchFieldCancelButtonStyle(StyleResolver* styleReso
     style->setHeight(Length(cancelButtonSize, Fixed));
 }
 
-bool RenderThemeEfl::paintSearchFieldCancelButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintSearchFieldCancelButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, SearchFieldCancelButton, info, rect);
 }
@@ -970,7 +970,7 @@ void RenderThemeEfl::adjustSearchFieldStyle(StyleResolver* styleResolver, Render
     style->setWhiteSpace(PRE);
 }
 
-bool RenderThemeEfl::paintSearchField(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintSearchField(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, SearchField, info, rect);
 }
@@ -984,7 +984,7 @@ void RenderThemeEfl::adjustInnerSpinButtonStyle(StyleResolver* styleResolver, Re
     adjustSizeConstraints(style, Spinner);
 }
 
-bool RenderThemeEfl::paintInnerSpinButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintInnerSpinButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintThemePart(object, Spinner, info, rect);
 }
@@ -1022,9 +1022,9 @@ double RenderThemeEfl::animationDurationForProgressBar(RenderProgress*) const
     return progressAnimationInterval * progressAnimationFrames * 2; // "2" for back and forth;
 }
 
-bool RenderThemeEfl::paintProgressBar(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintProgressBar(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
-    if (!object->isProgress())
+    if (!object.isProgress())
         return true;
 
     return paintThemePart(object, ProgressBar, info, rect);
index 9ba66ce..d3ec757 100644 (file)
@@ -78,7 +78,7 @@ public:
     virtual bool supportsFocusRing(const RenderStyle*) const;
 
     // A method asking if the control changes its tint when the window has focus or not.
-    virtual bool controlSupportsTints(const RenderObject*) const;
+    virtual bool controlSupportsTints(const RenderObject&) const;
 
     // A general method asking if any control tinting is supported at all.
     virtual bool supportsControlTints() const { return true; }
@@ -89,7 +89,7 @@ public:
     // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline
     // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
     // controls that need to do this.
-    virtual int baselinePosition(const RenderObject*) const;
+    virtual int baselinePosition(const RenderObject&) const;
 
     virtual Color platformActiveSelectionBackgroundColor() const;
     virtual Color platformInactiveSelectionBackgroundColor() const;
@@ -111,40 +111,40 @@ public:
     virtual void systemFont(CSSValueID, FontDescription&) const;
 
     virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
 
@@ -158,16 +158,16 @@ public:
 
     virtual bool supportsDataListUI(const AtomicString&) const override;
 
-    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     static void setDefaultFontSize(int fontsize);
 
 #if ENABLE(PROGRESS_ELEMENT)
     virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
     virtual double animationDurationForProgressBar(RenderProgress*) const;
 #endif
@@ -200,8 +200,8 @@ private:
     void applyPartDescriptionsFrom(const String& themePath);
 
     void applyEdjeStateFromForm(Evas_Object*, const ControlStates*, bool);
-    void applyEdjeRTLState(Evas_Object*, RenderObject*, FormType, const IntRect&);
-    bool paintThemePart(RenderObject*, FormType, const PaintInfo&, const IntRect&);
+    void applyEdjeRTLState(Evas_Object*, const RenderObject&, FormType, const IntRect&);
+    bool paintThemePart(const RenderObject&, FormType, const PaintInfo&, const IntRect&);
 
     Page* m_page;
     Color m_activeSelectionBackgroundColor;
index 8d069b5..020fe4a 100644 (file)
@@ -65,9 +65,9 @@ extern GRefPtr<GdkPixbuf> getStockIconForWidgetType(GType, const char* iconName,
 extern GRefPtr<GdkPixbuf> getStockSymbolicIconForWidgetType(GType widgetType, const char* symbolicIconName, const char* fallbackStockIconName, gint direction, gint state, gint iconSize);
 
 #if ENABLE(VIDEO)
-static HTMLMediaElement* getMediaElementFromRenderObject(RenderObject* o)
+static HTMLMediaElement* getMediaElementFromRenderObject(const RenderObject& o)
 {
-    Node* node = o->node();
+    Node* node = o.node();
     Node* mediaNode = node ? node->shadowHost() : 0;
     if (!mediaNode)
         mediaNode = node;
@@ -173,20 +173,20 @@ bool RenderThemeGtk::supportsFocusRing(const RenderStyle* style) const
     return supportsFocus(style->appearance());
 }
 
-bool RenderThemeGtk::controlSupportsTints(const RenderObject* o) const
+bool RenderThemeGtk::controlSupportsTints(const RenderObject& o) const
 {
     return isEnabled(o);
 }
 
-int RenderThemeGtk::baselinePosition(const RenderObject* o) const
+int RenderThemeGtk::baselinePosition(const RenderObject& o) const
 {
-    if (!o->isBox())
+    if (!o.isBox())
         return 0;
 
     // FIXME: This strategy is possibly incorrect for the GTK+ port.
-    if (o->style().appearance() == CheckboxPart
-        || o->style().appearance() == RadioPart) {
-        const RenderBox* box = toRenderBox(o);
+    if (o.style().appearance() == CheckboxPart
+        || o.style().appearance() == RadioPart) {
+        const RenderBox* box = toRenderBox(&o);
         return box->marginTop() + box->height() - 2;
     }
 
@@ -208,7 +208,7 @@ GtkTextDirection gtkTextDirection(TextDirection direction)
     }
 }
 
-static GtkStateType gtkIconState(RenderTheme* theme, RenderObject* renderObject)
+static GtkStateType gtkIconState(RenderTheme* theme, const RenderObject& renderObject)
 {
     if (!theme->isEnabled(renderObject))
         return GTK_STATE_INSENSITIVE;
@@ -241,12 +241,12 @@ void RenderThemeGtk::adjustMenuListButtonStyle(StyleResolver* styleResolver, Ren
     adjustMenuListStyle(styleResolver, style, e);
 }
 
-bool RenderThemeGtk::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     return paintMenuList(object, info, rect);
 }
 
-bool RenderThemeGtk::paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeGtk::paintTextArea(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {
     return paintTextField(o, i, r);
 }
@@ -298,7 +298,7 @@ void RenderThemeGtk::adjustSearchFieldResultsButtonStyle(StyleResolver* styleRes
     adjustSearchFieldCancelButtonStyle(styleResolver, style, e);
 }
 
-bool RenderThemeGtk::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
+bool RenderThemeGtk::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& i, const IntRect& rect)
 {
     return paintSearchFieldResultsDecorationPart(o, i, rect);
 }
@@ -326,12 +326,12 @@ void RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle(StyleResolver*,
     adjustSearchFieldIconStyle(style);
 }
 
-static IntRect centerRectVerticallyInParentInputElement(RenderObject* renderObject, const IntRect& rect)
+static IntRect centerRectVerticallyInParentInputElement(const RenderObject& renderObject, const IntRect& rect)
 {
     // Get the renderer of <input> element.
-    Node* input = renderObject->node()->shadowHost();
+    Node* input = renderObject.node()->shadowHost();
     if (!input)
-        input = renderObject->node();
+        input = renderObject.node();
     if (!input->renderer()->isBox())
         return IntRect();
 
@@ -346,16 +346,16 @@ static IntRect centerRectVerticallyInParentInputElement(RenderObject* renderObje
     return scaledRect;
 }
 
-bool RenderThemeGtk::paintSearchFieldResultsDecorationPart(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintSearchFieldResultsDecorationPart(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect);
     if (iconRect.isEmpty())
         return false;
 
     GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_FIND,
-                                                        gtkTextDirection(renderObject->style().direction()),
-                                                        gtkIconState(this, renderObject),
-                                                        getIconSizeForPixelSize(rect.height()));
+        gtkTextDirection(renderObject.style().direction()),
+        gtkIconState(this, renderObject),
+        getIconSizeForPixelSize(rect.height()));
     paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
     return false;
 }
@@ -365,16 +365,16 @@ void RenderThemeGtk::adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderSt
     adjustSearchFieldIconStyle(style);
 }
 
-bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintSearchFieldCancelButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect);
     if (iconRect.isEmpty())
         return false;
 
     GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CLEAR,
-                                                        gtkTextDirection(renderObject->style().direction()),
-                                                        gtkIconState(this, renderObject),
-                                                        getIconSizeForPixelSize(rect.height()));
+        gtkTextDirection(renderObject.style().direction()),
+        gtkIconState(this, renderObject),
+        getIconSizeForPixelSize(rect.height()));
     paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
     return false;
 }
@@ -386,12 +386,12 @@ void RenderThemeGtk::adjustSearchFieldStyle(StyleResolver*, RenderStyle* style,
     style->setLineHeight(RenderStyle::initialLineHeight());
 }
 
-bool RenderThemeGtk::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& rect)
+bool RenderThemeGtk::paintSearchField(const RenderObject& o, const PaintInfo& i, const IntRect& rect)
 {
     return paintTextField(o, i, rect);
 }
 
-bool RenderThemeGtk::paintCapsLockIndicator(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintCapsLockIndicator(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     // The other paint methods don't need to check whether painting is disabled because RenderTheme already checks it
     // before calling them, but paintCapsLockIndicator() is called by RenderTextControlSingleLine which doesn't check it.
@@ -399,9 +399,7 @@ bool RenderThemeGtk::paintCapsLockIndicator(RenderObject* renderObject, const Pa
         return true;
 
     int iconSize = std::min(rect.width(), rect.height());
-    GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING,
-                                                        gtkTextDirection(renderObject->style().direction()),
-                                                        0, getIconSizeForPixelSize(iconSize));
+    GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING, gtkTextDirection(renderObject.style().direction()), 0, getIconSizeForPixelSize(iconSize));
 
     // Only re-scale the icon when it's smaller than the minimum icon size.
     if (iconSize >= gtkIconSizeMenu)
@@ -505,13 +503,13 @@ String RenderThemeGtk::extraFullScreenStyleSheet()
 }
 #endif
 
-bool RenderThemeGtk::paintMediaButton(RenderObject* renderObject, GraphicsContext* context, const IntRect& rect, const char* symbolicIconName, const char* fallbackStockIconName)
+bool RenderThemeGtk::paintMediaButton(const RenderObject& renderObject, GraphicsContext* context, const IntRect& rect, const char* symbolicIconName, const char* fallbackStockIconName)
 {
     IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2,
                      rect.y() + (rect.height() - m_mediaIconSize) / 2,
                      m_mediaIconSize, m_mediaIconSize);
     GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, symbolicIconName, fallbackStockIconName,
-        gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
+        gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width());
     paintGdkPixbuf(context, icon.get(), iconRect);
     return true;
 }
@@ -521,12 +519,12 @@ bool RenderThemeGtk::hasOwnDisabledStateHandlingFor(ControlPart part) const
     return (part != MediaMuteButtonPart);
 }
 
-bool RenderThemeGtk::paintMediaFullscreenButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaFullscreenButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return paintMediaButton(renderObject, paintInfo.context, rect, "view-fullscreen-symbolic", GTK_STOCK_FULLSCREEN);
 }
 
-bool RenderThemeGtk::paintMediaMuteButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaMuteButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     HTMLMediaElement* mediaElement = getMediaElementFromRenderObject(renderObject);
     if (!mediaElement)
@@ -538,9 +536,9 @@ bool RenderThemeGtk::paintMediaMuteButton(RenderObject* renderObject, const Pain
         muted ? "audio-volume-muted" : "audio-volume-high");
 }
 
-bool RenderThemeGtk::paintMediaPlayButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaPlayButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    Node* node = renderObject->node();
+    Node* node = renderObject.node();
     if (!node)
         return false;
 
@@ -553,26 +551,26 @@ bool RenderThemeGtk::paintMediaPlayButton(RenderObject* renderObject, const Pain
         showPlayButton ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE);
 }
 
-bool RenderThemeGtk::paintMediaSeekBackButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaSeekBackButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-backward-symbolic", GTK_STOCK_MEDIA_REWIND);
 }
 
-bool RenderThemeGtk::paintMediaSeekForwardButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaSeekForwardButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-forward-symbolic", GTK_STOCK_MEDIA_FORWARD);
 }
 
 #if ENABLE(VIDEO_TRACK)
-bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2, rect.y() + (rect.height() - m_mediaIconSize) / 2,
         m_mediaIconSize, m_mediaIconSize);
     GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, "media-view-subtitles-symbolic", nullptr,
-        gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
+        gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width());
     if (!icon)
         icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, "user-invisible-symbolic", GTK_STOCK_JUSTIFY_FILL,
-            gtkTextDirection(renderObject->style().direction()), gtkIconState(this, renderObject), iconRect.width());
+            gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width());
     paintGdkPixbuf(paintInfo.context, icon.get(), iconRect);
     return true;
 }
@@ -587,9 +585,9 @@ static FloatRoundedRect::Radii borderRadiiFromStyle(RenderStyle* style)
         IntSize(style->borderBottomRightRadius().width().intValue(), style->borderBottomRightRadius().height().intValue()));
 }
 
-bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeGtk::paintMediaSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    HTMLMediaElement* mediaElement = parentMediaElement(*o);
+    HTMLMediaElement* mediaElement = parentMediaElement(o);
     if (!mediaElement)
         return false;
 
@@ -599,7 +597,7 @@ bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& pai
 
     float mediaDuration = mediaElement->duration();
     float totalTrackWidth = r.width();
-    RenderStyle* style = &o->style();
+    RenderStyle* style = &o.style();
     RefPtr<TimeRanges> timeRanges = mediaElement->buffered();
     for (unsigned index = 0; index < timeRanges->length(); ++index) {
         float start = timeRanges->start(index, IGNORE_EXCEPTION);
@@ -620,21 +618,21 @@ bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& pai
     return false;
 }
 
-bool RenderThemeGtk::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeGtk::paintMediaSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    RenderStyle* style = &o->style();
+    RenderStyle* style = &o.style();
     paintInfo.context->fillRoundedRect(FloatRoundedRect(r, borderRadiiFromStyle(style)), style->visitedDependentColor(CSSPropertyColor), style->colorSpace());
     return false;
 }
 
-bool RenderThemeGtk::paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&)
+bool RenderThemeGtk::paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&)
 {
     return true;
 }
 
-bool RenderThemeGtk::paintMediaVolumeSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaVolumeSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    HTMLMediaElement* mediaElement = parentMediaElement(*renderObject);
+    HTMLMediaElement* mediaElement = parentMediaElement(renderObject);
     if (!mediaElement)
         return true;
 
@@ -648,7 +646,7 @@ bool RenderThemeGtk::paintMediaVolumeSliderTrack(RenderObject* renderObject, con
 
     int rectHeight = rect.height();
     float trackHeight = rectHeight * volume;
-    RenderStyle* style = &renderObject->style();
+    RenderStyle* style = &renderObject.style();
     IntRect volumeRect(rect);
     volumeRect.move(0, rectHeight - trackHeight);
     volumeRect.setHeight(ceil(trackHeight));
@@ -660,7 +658,7 @@ bool RenderThemeGtk::paintMediaVolumeSliderTrack(RenderObject* renderObject, con
     return false;
 }
 
-bool RenderThemeGtk::paintMediaVolumeSliderThumb(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMediaVolumeSliderThumb(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return paintMediaSliderThumb(renderObject, paintInfo, rect);
 }
@@ -670,7 +668,7 @@ String RenderThemeGtk::formatMediaControlsCurrentTime(float currentTime, float d
     return formatMediaControlsTime(currentTime) + " / " + formatMediaControlsTime(duration);
 }
 
-bool RenderThemeGtk::paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&)
+bool RenderThemeGtk::paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&)
 {
     return false;
 }
@@ -696,13 +694,13 @@ double RenderThemeGtk::animationDurationForProgressBar(RenderProgress*) const
     return progressAnimationInterval * progressAnimationFrames * 2; // "2" for back and forth;
 }
 
-IntRect RenderThemeGtk::calculateProgressRect(RenderObject* renderObject, const IntRect& fullBarRect)
+IntRect RenderThemeGtk::calculateProgressRect(const RenderObject& renderObject, const IntRect& fullBarRect)
 {
     IntRect progressRect(fullBarRect);
-    RenderProgress* renderProgress = toRenderProgress(renderObject);
+    const RenderProgress* renderProgress = toRenderProgress(&renderObject);
     if (renderProgress->isDeterminate()) {
         int progressWidth = progressRect.width() * renderProgress->position();
-        if (renderObject->style().direction() == RTL)
+        if (renderObject.style().direction() == RTL)
             progressRect.setX(progressRect.x() + progressRect.width() - progressWidth);
         progressRect.setWidth(progressWidth);
         return progressRect;
index b1707f4..1ca5020 100644 (file)
@@ -50,17 +50,17 @@ public:
     virtual bool supportsFocusRing(const RenderStyle*) const;
 
     // A method asking if the control changes its tint when the window has focus or not.
-    virtual bool controlSupportsTints(const RenderObject*) const;
+    virtual bool controlSupportsTints(const RenderObject&) const;
 
     // A general method asking if any control tinting is supported at all.
     virtual bool supportsControlTints() const { return true; }
 
-    virtual void adjustRepaintRect(const RenderObject*, IntRect&);
+    virtual void adjustRepaintRect(const RenderObject&, IntRect&);
 
     // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
     // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
     // controls that need to do this.
-    virtual int baselinePosition(const RenderObject*) const;
+    virtual int baselinePosition(const RenderObject&) const;
 
     // The platform selection color.
     virtual Color platformActiveSelectionBackgroundColor() const;
@@ -114,17 +114,17 @@ public:
 #endif
 
 protected:
-    virtual bool paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r);
+    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void setCheckboxSize(RenderStyle* style) const;
 
-    virtual bool paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& r);
+    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void setRadioSize(RenderStyle* style) const;
 
     virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
-    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
 
     int popupInternalPaddingLeft(RenderStyle*) const;
     int popupInternalPaddingRight(RenderStyle*) const;
@@ -137,25 +137,25 @@ protected:
     // we don't maintain this differentiation.
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
-    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
 
     virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
@@ -164,19 +164,19 @@ protected:
     void initMediaColors();
     void initMediaButtons();
     virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const;
-    virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaSeekBackButton(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaFullscreenButton(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaPlayButton(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaMuteButton(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaSeekBackButton(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&);
 #if ENABLE(VIDEO_TRACK)
-    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMediaToggleClosedCaptionsButton(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 #endif
 
@@ -184,13 +184,13 @@ protected:
     virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
     virtual double animationDurationForProgressBar(RenderProgress*) const;
     virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 
-    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
 private:
     virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const override;
@@ -200,11 +200,11 @@ private:
     static double getScreenDPI();
 
 #if ENABLE(VIDEO)
-    bool paintMediaButton(RenderObject*, GraphicsContext*, const IntRect&, const char* symbolicIconName, const char* fallbackStockIconName);
+    bool paintMediaButton(const RenderObject&, GraphicsContext*, const IntRect&, const char* symbolicIconName, const char* fallbackStockIconName);
 #endif
 
 #if ENABLE(PROGRESS_ELEMENT)
-    static IntRect calculateProgressRect(RenderObject*, const IntRect&);
+    static IntRect calculateProgressRect(const RenderObject&, const IntRect&);
 #endif
 
     mutable Color m_panelColor;
index a9b388c..f2cb202 100644 (file)
@@ -110,9 +110,9 @@ static void adjustRectForFocus(GtkWidget* widget, IntRect& rect, bool ignoreInte
     rect.inflate(focusWidth + focusPad);
 }
 
-void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect& rect)
+void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)
 {
-    ControlPart part = renderObject->style().appearance();
+    ControlPart part = renderObject.style().appearance();
     switch (part) {
     case CheckboxPart:
     case RadioPart: {
@@ -131,7 +131,7 @@ void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect
     }
 }
 
-static GtkStateType getGtkStateType(RenderThemeGtk* theme, RenderObject* object)
+static GtkStateType getGtkStateType(RenderThemeGtk* theme, const RenderObject& object)
 {
     if (!theme->isEnabled(object) || theme->isReadOnlyControl(object))
         return GTK_STATE_INSENSITIVE;
@@ -156,14 +156,14 @@ static void setToggleSize(const RenderThemeGtk*, RenderStyle* style, GtkWidget*
         style->setHeight(Length(indicatorSize, Fixed));
 }
 
-static void paintToggle(RenderThemeGtk* theme, RenderObject* renderObject, const PaintInfo& info, const IntRect& rect, GtkWidget* widget)
+static void paintToggle(RenderThemeGtk* theme, const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect, GtkWidget* widget)
 {
     // We do not call gtk_toggle_button_set_active here, because some themes begin a series of
     // animation frames in a "toggled" signal handler. This puts some checkboxes in a half-way
     // checked state. Every GTK+ theme I tested merely looks at the shadow type (and not the
     // 'active' property) to determine whether or not to draw the check.
     gtk_widget_set_sensitive(widget, theme->isEnabled(renderObject) && !theme->isReadOnlyControl(renderObject));
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
 
     bool indeterminate = theme->isIndeterminate(renderObject);
     gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(widget), indeterminate);
@@ -198,7 +198,7 @@ void RenderThemeGtk::setCheckboxSize(RenderStyle* style) const
     setToggleSize(this, style, gtkCheckButton());
 }
 
-bool RenderThemeGtk::paintCheckbox(RenderObject* renderObject, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintCheckbox(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect)
 {
     paintToggle(this, renderObject, info, rect, gtkCheckButton());
     return false;
@@ -209,7 +209,7 @@ void RenderThemeGtk::setRadioSize(RenderStyle* style) const
     setToggleSize(this, style, gtkRadioButton());
 }
 
-bool RenderThemeGtk::paintRadio(RenderObject* renderObject, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintRadio(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect)
 {
     paintToggle(this, renderObject, info, rect, gtkRadioButton());
     return false;
@@ -227,7 +227,7 @@ static void setWidgetHasFocus(GtkWidget* widget, gboolean hasFocus)
         GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_FOCUS);
 }
 
-bool RenderThemeGtk::paintButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     if (info.context->paintingDisabled())
         return false;
@@ -238,7 +238,7 @@ bool RenderThemeGtk::paintButton(RenderObject* object, const PaintInfo& info, co
 
     GtkStateType state = getGtkStateType(this, object);
     gtk_widget_set_state(widget, state);
-    gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
 
     if (isFocused(object)) {
         setWidgetHasFocus(widget, TRUE);
@@ -365,7 +365,7 @@ int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle* style) const
     return bottom;
 }
 
-bool RenderThemeGtk::paintMenuList(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     if (paintButton(object, info, rect))
         return true;
@@ -378,7 +378,7 @@ bool RenderThemeGtk::paintMenuList(RenderObject* object, const PaintInfo& info,
 
     int leftBorder = 0, rightBorder = 0, bottomBorder = 0, topBorder = 0;
     getButtonInnerBorder(gtkComboBoxButton(), leftBorder, topBorder, rightBorder, bottomBorder);
-    RenderStyle* style = &object->style();
+    RenderStyle* style = &object.style();
     int arrowSize = comboBoxArrowSize(style);
     GtkStyle* buttonStyle = gtk_widget_get_style(gtkComboBoxButton());
 
@@ -422,14 +422,14 @@ bool RenderThemeGtk::paintMenuList(RenderObject* object, const PaintInfo& info,
     return false;
 }
 
-bool RenderThemeGtk::paintTextField(RenderObject* renderObject, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect)
 {
     GtkWidget* widget = gtkEntry();
 
     bool enabled = isEnabled(renderObject) && !isReadOnlyControl(renderObject);
     GtkStateType backgroundState = enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE;
     gtk_widget_set_sensitive(widget, enabled);
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
     setWidgetHasFocus(widget, isFocused(renderObject));
 
     WidgetRenderingContext widgetContext(info.context, rect);
@@ -465,12 +465,12 @@ bool RenderThemeGtk::paintTextField(RenderObject* renderObject, const PaintInfo&
     return false;
 }
 
-bool RenderThemeGtk::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintSliderTrack(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     if (info.context->paintingDisabled())
         return false;
 
-    ControlPart part = object->style().appearance();
+    ControlPart part = object.style().appearance();
     ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
 
     // We shrink the trough rect slightly to make room for the focus indicator.
@@ -483,7 +483,7 @@ bool RenderThemeGtk::paintSliderTrack(RenderObject* object, const PaintInfo& inf
         widget = gtkVScale();
         troughRect.inflateY(-gtk_widget_get_style(widget)->ythickness);
     }
-    gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
 
     WidgetRenderingContext widgetContext(info.context, rect);
     widgetContext.gtkPaintBox(troughRect, widget, GTK_STATE_ACTIVE, GTK_SHADOW_OUT, "trough");
@@ -493,12 +493,12 @@ bool RenderThemeGtk::paintSliderTrack(RenderObject* object, const PaintInfo& inf
     return false;
 }
 
-bool RenderThemeGtk::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintSliderThumb(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
 {
     if (info.context->paintingDisabled())
         return false;
 
-    ControlPart part = object->style().appearance();
+    ControlPart part = object.style().appearance();
     ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
 
     GtkWidget* widget = 0;
@@ -513,7 +513,7 @@ bool RenderThemeGtk::paintSliderThumb(RenderObject* object, const PaintInfo& inf
         detail = "vscale";
         orientation = GTK_ORIENTATION_VERTICAL;
     }
-    gtk_widget_set_direction(widget, gtkTextDirection(object->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction()));
 
     // Only some themes have slider thumbs respond to clicks and some don't. This information is
     // gathered via the 'activate-slider' property, but it's deprecated in GTK+ 2.22 and removed in
@@ -549,10 +549,10 @@ void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style, Element*) const
 }
 
 #if ENABLE(PROGRESS_ELEMENT)
-bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GtkWidget* widget = gtkProgressBar();
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
 
     WidgetRenderingContext widgetContext(paintInfo.context, rect);
     IntRect fullProgressBarRect(IntPoint(), rect.size());
@@ -586,7 +586,7 @@ void RenderThemeGtk::adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle* sty
     style->setMinWidth(Length(width, Fixed));
 }
 
-bool RenderThemeGtk::paintInnerSpinButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     // We expand the painted area by 2 pixels on the top and bottom and 2 pixels on the right. This
     // is because GTK+ themes want to draw over the text box borders, but WebCore renders the inner
@@ -597,7 +597,7 @@ bool RenderThemeGtk::paintInnerSpinButton(RenderObject* renderObject, const Pain
 
     WidgetRenderingContext widgetContext(paintInfo.context, expandedRect);
     GtkWidget* widget = gtkSpinButton();
-    gtk_widget_set_direction(widget, gtkTextDirection(renderObject->style().direction()));
+    gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction()));
 
     IntRect fullSpinButtonRect(IntPoint(), expandedRect.size());
     widgetContext.gtkPaintBox(fullSpinButtonRect, widget, GTK_STATE_NORMAL, GTK_SHADOW_IN, "spinbutton");
index d73f6c4..e4a36e2 100644 (file)
@@ -157,11 +157,11 @@ static void adjustRectForFocus(GtkStyleContext* context, IntRect& rect)
     rect.inflate(focusWidth + focusPad);
 }
 
-void RenderThemeGtk::adjustRepaintRect(const RenderObject* renderObject, IntRect& rect)
+void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)
 {
     GtkStyleContext* context = 0;
     bool checkInteriorFocus = false;
-    ControlPart part = renderObject->style().appearance();
+    ControlPart part = renderObject.style().appearance();
     switch (part) {
     case CheckboxPart:
     case RadioPart:
@@ -220,7 +220,7 @@ static void setToggleSize(GtkStyleContext* context, RenderStyle* style)
         style->setHeight(Length(indicatorSize, Fixed));
 }
 
-static void paintToggle(const RenderThemeGtk* theme, GType widgetType, RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& fullRect)
+static void paintToggle(const RenderThemeGtk* theme, GType widgetType, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& fullRect)
 {
     GtkStyleContext* context = getStyleContext(widgetType);
     gtk_style_context_save(context);
@@ -242,7 +242,7 @@ static void paintToggle(const RenderThemeGtk* theme, GType widgetType, RenderObj
         rect.setHeight(indicatorSize); // In case rect.height() was equal to indicatorSize + 1.
     }
 
-    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
+    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())));
     gtk_style_context_add_class(context, widgetType == GTK_TYPE_CHECK_BUTTON ? GTK_STYLE_CLASS_CHECK : GTK_STYLE_CLASS_RADIO);
 
     guint flags = 0;
@@ -280,7 +280,7 @@ void RenderThemeGtk::setCheckboxSize(RenderStyle* style) const
     setToggleSize(getStyleContext(GTK_TYPE_CHECK_BUTTON), style);
 }
 
-bool RenderThemeGtk::paintCheckbox(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintCheckbox(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     paintToggle(this, GTK_TYPE_CHECK_BUTTON, renderObject, paintInfo, rect);
     return false;
@@ -291,13 +291,13 @@ void RenderThemeGtk::setRadioSize(RenderStyle* style) const
     setToggleSize(getStyleContext(GTK_TYPE_RADIO_BUTTON), style);
 }
 
-bool RenderThemeGtk::paintRadio(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintRadio(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     paintToggle(this, GTK_TYPE_RADIO_BUTTON, renderObject, paintInfo, rect);
     return false;
 }
 
-static void renderButton(RenderTheme* theme, GtkStyleContext* context, RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+static void renderButton(RenderTheme* theme, GtkStyleContext* context, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     IntRect buttonRect(rect);
 
@@ -363,12 +363,12 @@ static void renderButton(RenderTheme* theme, GtkStyleContext* context, RenderObj
         gtk_render_focus(context, paintInfo.context->platformContext()->cr(), buttonRect.x(), buttonRect.y(), buttonRect.width(), buttonRect.height());
     }
 }
-bool RenderThemeGtk::paintButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GtkStyleContext* context = getStyleContext(GTK_TYPE_BUTTON);
     gtk_style_context_save(context);
 
-    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
+    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())));
     gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON);
 
     renderButton(this, context, renderObject, paintInfo, rect);
@@ -464,10 +464,10 @@ int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle* style) const
     return borderWidth.bottom + focusWidth;
 }
 
-bool RenderThemeGtk::paintMenuList(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintMenuList(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     cairo_t* cairoContext = paintInfo.context->platformContext()->cr();
-    GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction()));
+    GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()));
 
     // Paint the button.
     GtkStyleContext* buttonStyleContext = getStyleContext(GTK_TYPE_BUTTON);
@@ -595,12 +595,12 @@ bool RenderThemeGtk::paintMenuList(RenderObject* renderObject, const PaintInfo&
     return false;
 }
 
-bool RenderThemeGtk::paintTextField(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GtkStyleContext* context = getStyleContext(GTK_TYPE_ENTRY);
     gtk_style_context_save(context);
 
-    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction())));
+    gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())));
     gtk_style_context_add_class(context, GTK_STYLE_CLASS_ENTRY);
 
     guint flags = 0;
@@ -643,15 +643,15 @@ static void applySliderStyleContextClasses(GtkStyleContext* context, ControlPart
         gtk_style_context_add_class(context, GTK_STYLE_CLASS_VERTICAL);
 }
 
-bool RenderThemeGtk::paintSliderTrack(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    ControlPart part = renderObject->style().appearance();
+    ControlPart part = renderObject.style().appearance();
     ASSERT_UNUSED(part, part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart);
 
     GtkStyleContext* context = getStyleContext(GTK_TYPE_SCALE);
     gtk_style_context_save(context);
 
-    gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style().direction()));
+    gtk_style_context_set_direction(context, gtkTextDirection(renderObject.style().direction()));
     applySliderStyleContextClasses(context, part);
     gtk_style_context_add_class(context, GTK_STYLE_CLASS_TROUGH);
 
@@ -678,15 +678,15 @@ bool RenderThemeGtk::paintSliderTrack(RenderObject* renderObject, const PaintInf
     return false;
 }
 
-bool RenderThemeGtk::paintSliderThumb(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintSliderThumb(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    ControlPart part = renderObject->style().appearance();
+    ControlPart part = renderObject.style().appearance();
     ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart);
 
     GtkStyleContext* context = getStyleContext(GTK_TYPE_SCALE);
     gtk_style_context_save(context);
 
-    gtk_style_context_set_direction(context, gtkTextDirection(renderObject->style().direction()));
+    gtk_style_context_set_direction(context, gtkTextDirection(renderObject.style().direction()));
     applySliderStyleContextClasses(context, part);
     gtk_style_context_add_class(context, GTK_STYLE_CLASS_SLIDER);
 
@@ -729,9 +729,9 @@ void RenderThemeGtk::adjustSliderThumbSize(RenderStyle* style, Element*) const
 }
 
 #if ENABLE(PROGRESS_ELEMENT)
-bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    if (!renderObject->isProgress())
+    if (!renderObject.isProgress())
         return true;
 
     GtkStyleContext* context = getStyleContext(GTK_TYPE_PROGRESS_BAR);
@@ -786,7 +786,7 @@ void RenderThemeGtk::adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle* sty
     style->setMinWidth(Length(width, Fixed));
 }
 
-static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect, GtkArrowType arrowType)
+static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect, GtkArrowType arrowType)
 {
     ASSERT(arrowType == GTK_ARROW_UP || arrowType == GTK_ARROW_DOWN);
 
@@ -852,12 +852,12 @@ static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, R
     gtk_style_context_restore(context);
 }
 
-bool RenderThemeGtk::paintInnerSpinButton(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GtkStyleContext* context = getStyleContext(GTK_TYPE_SPIN_BUTTON);
     gtk_style_context_save(context);
 
-    GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject->style().direction()));
+    GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()));
     gtk_style_context_set_direction(context, direction);
 
     guint flags = 0;
index 00b4591..cf6220c 100644 (file)
@@ -1438,7 +1438,7 @@ void RenderBlock::addVisualOverflowFromTheme()
         return;
 
     IntRect inflatedRect = pixelSnappedBorderBoxRect();
-    theme().adjustRepaintRect(this, inflatedRect);
+    theme().adjustRepaintRect(*this, inflatedRect);
     addVisualOverflow(inflatedRect);
 
     if (RenderFlowThread* flowThread = flowThreadContainingBlock())
@@ -4294,7 +4294,7 @@ int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, Lin
         // is turned off, checkboxes/radios will still have decent baselines.
         // FIXME: Need to patch form controls to deal with vertical lines.
         if (style().hasAppearance() && !theme().isControlContainer(style().appearance()))
-            return theme().baselinePosition(this);
+            return theme().baselinePosition(*this);
             
         // CSS2.1 states that the baseline of an inline block is the baseline of the last line box in
         // the normal flow.  We make an exception for marquees, since their baselines are meaningless
index 3b8c249..cb368a7 100644 (file)
@@ -1227,7 +1227,7 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
         }
     }
 
-    bool themePainted = style().hasAppearance() && !theme().paint(this, controlStates, paintInfo, snappedPaintRect);
+    bool themePainted = style().hasAppearance() && !theme().paint(*this, controlStates, paintInfo, snappedPaintRect);
 
     if (controlStates && controlStates->needsRepaint())
         m_repaintTimer.startOneShot(0);
@@ -1239,12 +1239,12 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
         paintBackground(paintInfo, paintRect, bleedAvoidance);
 
         if (style().hasAppearance())
-            theme().paintDecorations(this, paintInfo, snappedPaintRect);
+            theme().paintDecorations(*this, paintInfo, snappedPaintRect);
     }
     paintBoxShadow(paintInfo, paintRect, style(), Inset);
 
     // The theme will tell us whether or not we should also paint the CSS border.
-    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(this, paintInfo, snappedPaintRect))) && style().hasBorder())
+    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, snappedPaintRect))) && style().hasBorder())
         paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
 
     if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
index 7372dd0..8fc8330 100644 (file)
@@ -112,12 +112,12 @@ void RenderButton::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
     if (m_inner) // RenderBlock handled updating the anonymous block's style.
         setupInnerStyle(&m_inner->style());
 
-    if (!m_default && theme().isDefault(this)) {
+    if (!m_default && theme().isDefault(*this)) {
         if (!m_timer)
             m_timer = std::make_unique<Timer<RenderButton>>(this, &RenderButton::timerFired);
         m_timer->startRepeating(0.03);
         m_default = true;
-    } else if (m_default && !theme().isDefault(this)) {
+    } else if (m_default && !theme().isDefault(*this)) {
         m_default = false;
         m_timer = nullptr;
     }
index 768d189..e3e9a9e 100644 (file)
@@ -182,7 +182,7 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin
                 // Draw the file icon and decorations.
                 IntRect iconRect(iconX, iconY, iconWidth, iconHeight);
                 RenderTheme::FileUploadDecorations decorationsType = inputElement().files()->length() == 1 ? RenderTheme::SingleFile : RenderTheme::MultipleFiles;
-                theme().paintFileUploadIconDecorations(this, buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType);
+                theme().paintFileUploadIconDecorations(*this, *buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType);
             }
 #else
             // Draw the file icon
index a1eeb7d..5043eea 100644 (file)
@@ -1278,7 +1278,7 @@ void RenderFlowThread::addRegionsVisualOverflowFromTheme(const RenderBlock* bloc
         borderBox = region->rectFlowPortionForBox(block, borderBox);
 
         IntRect inflatedRect = pixelSnappedIntRect(borderBox);
-        block->theme().adjustRepaintRect(block, inflatedRect);
+        block->theme().adjustRepaintRect(*block, inflatedRect);
 
         region->addVisualOverflowForBox(block, inflatedRect);
         if (region == endRegion)
index cafd0c0..c0c2d39 100644 (file)
@@ -70,10 +70,10 @@ namespace WebCore {
 
 #if PLATFORM(WIN) && USE(CG)
 
-static WKMediaControllerThemeState determineState(RenderObject* o)
+static WKMediaControllerThemeState determineState(const RenderObject& o)
 {
     int result = 0;
-    const RenderTheme& theme = o->theme();
+    const RenderTheme& theme = o.theme();
     if (!theme.isEnabled(o) || theme.isReadOnlyControl(o))
         result |= WKMediaControllerFlagDisabled;
     if (theme.isPressed(o))
@@ -84,9 +84,9 @@ static WKMediaControllerThemeState determineState(RenderObject* o)
 }
 
 // Utility to scale when the UI part are not scaled by wkDrawMediaUIPart
-static FloatRect getUnzoomedRectAndAdjustCurrentContext(RenderObject* o, const PaintInfo& paintInfo, const IntRect &originalRect)
+static FloatRect getUnzoomedRectAndAdjustCurrentContext(const RenderObject& o, const PaintInfo& paintInfo, const IntRect &originalRect)
 {
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
     FloatRect unzoomedRect(originalRect);
     if (zoomLevel != 1.0f) {
         unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
@@ -126,35 +126,35 @@ void RenderMediaControls::adjustMediaSliderThumbSize(RenderStyle* style)
     style->setHeight(Length(static_cast<int>(size.height * zoomLevel), Fixed));
 }
 
-bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
     switch (part) {
     case MediaEnterFullscreenButton:
     case MediaExitFullscreenButton:
-        if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o->node())) {
+        if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o.node())) {
             bool enterButton = btn->displayType() == MediaEnterFullscreenButton;
             wkDrawMediaUIPart(enterButton ? WKMediaUIPartFullscreenButton : WKMediaUIPartExitFullscreenButton, paintInfo.context->platformContext(), r, determineState(o));
         }
         break;
     case MediaShowClosedCaptionsButton:
     case MediaHideClosedCaptionsButton:
-        if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o->node())) {
+        if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o.node())) {
             bool captionsVisible = btn->displayType() == MediaHideClosedCaptionsButton;
             wkDrawMediaUIPart(captionsVisible ? WKMediaUIPartHideClosedCaptionsButton : WKMediaUIPartShowClosedCaptionsButton, paintInfo.context->platformContext(), r, determineState(o));
         }
         break;
     case MediaMuteButton:
     case MediaUnMuteButton:
-        if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o->node())) {
+        if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o.node())) {
             bool audioEnabled = btn->displayType() == MediaMuteButton;
             wkDrawMediaUIPart(audioEnabled ? WKMediaUIPartMuteButton : WKMediaUIPartUnMuteButton, paintInfo.context->platformContext(), r, determineState(o));
         }
         break;
     case MediaPauseButton:
     case MediaPlayButton:
-        if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o->node())) {
+        if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o.node())) {
             bool canPlay = btn->displayType() == MediaPlayButton;
             wkDrawMediaUIPart(canPlay ? WKMediaUIPartPlayButton : WKMediaUIPartPauseButton, paintInfo.context->platformContext(), r, determineState(o));
         }
@@ -172,7 +172,7 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
         wkDrawMediaUIPart(WKMediaUIPartSeekForwardButton, paintInfo.context->platformContext(), r, determineState(o));
         break;
     case MediaSlider: {
-        if (HTMLMediaElement* mediaElement = parentMediaElement(*o)) {
+        if (HTMLMediaElement* mediaElement = parentMediaElement(o)) {
             FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r);
             wkDrawMediaSliderTrack(paintInfo.context->platformContext(), unzoomedRect, mediaElement->percentLoaded() * mediaElement->duration(), mediaElement->currentTime(), mediaElement->duration(), determineState(o));
         }
index 8a16c2f..de02f2a 100644 (file)
@@ -45,7 +45,7 @@ class RenderMediaControls {
 public:
 
 #if PLATFORM(WIN)
-    static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
+    static bool paintMediaControlsPart(MediaControlElementType, const RenderObject&, const PaintInfo&, const IntRect&);
     static void adjustMediaSliderThumbSize(RenderStyle*);
 #endif
     static IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&);
index d7b6f68..cfbac56 100644 (file)
@@ -725,7 +725,7 @@ RenderBlock* RenderObject::containingBlock() const
 }
 
 void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, float x1, float y1, float x2, float y2,
-    BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias)
+    BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias) const
 {
     float deviceScaleFactor = document().deviceScaleFactor();
     float thickness;
index ca8a6de..e5803e0 100644 (file)
@@ -879,7 +879,7 @@ public:
 
     RespectImageOrientationEnum shouldRespectImageOrientation() const;
 
-    void drawLineForBoxSide(GraphicsContext*, float x1, float y1, float x2, float y2, BoxSide, Color, EBorderStyle, float adjbw1, float adjbw2, bool antialias = false);
+    void drawLineForBoxSide(GraphicsContext*, float x1, float y1, float x2, float y2, BoxSide, Color, EBorderStyle, float adjbw1, float adjbw2, bool antialias = false) const;
 protected:
     void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*);
     void paintOutline(PaintInfo&, const LayoutRect&);
index 4139d25..8432f60 100644 (file)
@@ -67,7 +67,7 @@ void RenderProgress::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit l
         frame.setHeight(computedValues.m_extent);
     else
         frame.setWidth(computedValues.m_extent);
-    IntSize frameSize = theme().progressBarRectForBounds(this, pixelSnappedIntRect(frame)).size();
+    IntSize frameSize = theme().progressBarRectForBounds(*this, pixelSnappedIntRect(frame)).size();
     computedValues.m_extent = isHorizontalWritingMode() ? frameSize.height() : frameSize.width();
 }
 
index 4abe796..c77c721 100644 (file)
@@ -84,7 +84,7 @@ void RenderTextControlSingleLine::paint(PaintInfo& paintInfo, const LayoutPoint&
 
         // Convert the rect into the coords used for painting the content
         contentsRect.moveBy(paintOffset + location());
-        theme().paintCapsLockIndicator(this, paintInfo, pixelSnappedIntRect(contentsRect));
+        theme().paintCapsLockIndicator(*this, paintInfo, pixelSnappedIntRect(contentsRect));
     }
 }
 
index c79dbcb..c01dd43 100644 (file)
@@ -263,20 +263,20 @@ void RenderTheme::adjustStyle(StyleResolver& styleResolver, RenderStyle& style,
     }
 }
 
-bool RenderTheme::paint(RenderObject* o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r)
 {
     // If painting is disabled, but we aren't updating control tints, then just bail.
     // If we are updating control tints, just schedule a repaint if the theme supports tinting
     // for that control.
     if (paintInfo.context->updatingControlTints()) {
         if (controlSupportsTints(o))
-            o->repaint();
+            o.repaint();
         return false;
     }
     if (paintInfo.context->paintingDisabled())
         return false;
 
-    ControlPart part = o->style().appearance();
+    ControlPart part = o.style().appearance();
 
 #if USE(NEW_THEME)
     switch (part) {
@@ -288,7 +288,7 @@ bool RenderTheme::paint(RenderObject* o, ControlStates* controlStates, const Pai
     case ButtonPart:
     case InnerSpinButtonPart:
         updateControlStatesForRenderer(o, controlStates);
-        m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o->style().effectiveZoom(), &o->view().frameView());
+        m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o.style().effectiveZoom(), &o.view().frameView());
         return false;
     default:
         break;
@@ -405,17 +405,17 @@ bool RenderTheme::paint(RenderObject* o, ControlStates* controlStates, const Pai
     return true; // We don't support the appearance, so let the normal background/border paint.
 }
 
-bool RenderTheme::paintBorderOnly(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     if (paintInfo.context->paintingDisabled())
         return false;
 
 #if PLATFORM(IOS)
     UNUSED_PARAM(r);
-    return o->style().appearance() != NoControlPart;
+    return o.style().appearance() != NoControlPart;
 #else
     // Call the appropriate paint method based off the appearance value.
-    switch (o->style().appearance()) {
+    switch (o.style().appearance()) {
     case TextFieldPart:
         return paintTextField(o, paintInfo, r);
     case ListboxPart:
@@ -463,13 +463,13 @@ bool RenderTheme::paintBorderOnly(RenderObject* o, const PaintInfo& paintInfo, c
 #endif
 }
 
-bool RenderTheme::paintDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderTheme::paintDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     if (paintInfo.context->paintingDisabled())
         return false;
 
     // Call the appropriate paint method based off the appearance value.
-    switch (renderer->style().appearance()) {
+    switch (renderer.style().appearance()) {
     case MenulistButtonPart:
         return paintMenuListButtonDecorations(renderer, paintInfo, rect);
     case TextFieldPart:
@@ -666,17 +666,17 @@ Color RenderTheme::platformInactiveListBoxSelectionForegroundColor() const
     return platformInactiveSelectionForegroundColor();
 }
 
-int RenderTheme::baselinePosition(const RenderObject* o) const
+int RenderTheme::baselinePosition(const RenderObject& o) const
 {
-    if (!o->isBox())
+    if (!o.isBox())
         return 0;
 
-    const RenderBox* box = toRenderBox(o);
+    const RenderBox& box = *toRenderBox(&o);
 
 #if USE(NEW_THEME)
-    return box->height() + box->marginTop() + m_theme->baselinePositionAdjustment(o->style().appearance()) * o->style().effectiveZoom();
+    return box.height() + box.marginTop() + m_theme->baselinePositionAdjustment(o.style().appearance()) * o.style().effectiveZoom();
 #else
-    return box->height() + box->marginTop();
+    return box.height() + box.marginTop();
 #endif
 }
 
@@ -714,11 +714,11 @@ bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& bo
     }
 }
 
-void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
+void RenderTheme::adjustRepaintRect(const RenderObject& o, IntRect& r)
 {
 #if USE(NEW_THEME)
     ControlStates states(extractControlStatesForRenderer(o));
-    m_theme->inflateControlPaintRect(o->style().appearance(), &states, r, o->style().effectiveZoom());
+    m_theme->inflateControlPaintRect(o.style().appearance(), &states, r, o.style().effectiveZoom());
 #else
     UNUSED_PARAM(o);
     UNUSED_PARAM(r);
@@ -730,10 +730,10 @@ bool RenderTheme::supportsFocusRing(const RenderStyle* style) const
     return (style->hasAppearance() && style->appearance() != TextFieldPart && style->appearance() != TextAreaPart && style->appearance() != MenulistButtonPart && style->appearance() != ListboxPart);
 }
 
-bool RenderTheme::stateChanged(RenderObject* o, ControlStates::States state) const
+bool RenderTheme::stateChanged(const RenderObject& o, ControlStates::States state) const
 {
     // Default implementation assumes the controls don't respond to changes in :hover state
-    if (state == ControlStates::HoverState && !supportsHover(&o->style()))
+    if (state == ControlStates::HoverState && !supportsHover(&o.style()))
         return false;
 
     // Assume pressed state is only responded to if the control is enabled.
@@ -741,17 +741,17 @@ bool RenderTheme::stateChanged(RenderObject* o, ControlStates::States state) con
         return false;
 
     // Repaint the control.
-    o->repaint();
+    o.repaint();
     return true;
 }
 
-void RenderTheme::updateControlStatesForRenderer(const RenderObject* o, ControlStates* controlStates) const
+void RenderTheme::updateControlStatesForRenderer(const RenderObject& o, ControlStates* controlStates) const
 {
     ControlStates newStates = extractControlStatesForRenderer(o);
     controlStates->setStates(newStates.states());
 }
 
-ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderObject* o) const
+ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderObject& o) const
 {
     ControlStates::States states = 0;
     if (isHovered(o)) {
@@ -764,7 +764,7 @@ ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderO
         if (isSpinUpButtonPartPressed(o))
             states |= ControlStates::SpinUpState;
     }
-    if (isFocused(o) && o->style().outlineStyleIsAuto())
+    if (isFocused(o) && o.style().outlineStyleIsAuto())
         states |= ControlStates::FocusState;
     if (isEnabled(o))
         states |= ControlStates::EnabledState;
@@ -781,9 +781,9 @@ ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderO
     return states;
 }
 
-bool RenderTheme::isActive(const RenderObject* o) const
+bool RenderTheme::isActive(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node)
         return false;
 
@@ -798,41 +798,41 @@ bool RenderTheme::isActive(const RenderObject* o) const
     return page->focusController().isActive();
 }
 
-bool RenderTheme::isChecked(const RenderObject* o) const
+bool RenderTheme::isChecked(const RenderObject& o) const
 {
-    if (!o->node())
+    if (!o.node())
         return false;
 
-    HTMLInputElement* inputElement = o->node()->toInputElement();
+    HTMLInputElement* inputElement = o.node()->toInputElement();
     if (!inputElement)
         return false;
 
     return inputElement->shouldAppearChecked();
 }
 
-bool RenderTheme::isIndeterminate(const RenderObject* o) const
+bool RenderTheme::isIndeterminate(const RenderObject& o) const
 {
-    if (!o->node())
+    if (!o.node())
         return false;
 
-    HTMLInputElement* inputElement = o->node()->toInputElement();
+    HTMLInputElement* inputElement = o.node()->toInputElement();
     if (!inputElement)
         return false;
 
     return inputElement->shouldAppearIndeterminate();
 }
 
-bool RenderTheme::isEnabled(const RenderObject* o) const
+bool RenderTheme::isEnabled(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node || !node->isElementNode())
         return true;
     return !toElement(node)->isDisabledFormControl();
 }
 
-bool RenderTheme::isFocused(const RenderObject* o) const
+bool RenderTheme::isFocused(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node || !node->isElementNode())
         return false;
 
@@ -842,16 +842,16 @@ bool RenderTheme::isFocused(const RenderObject* o) const
     return focusDelegate == document.focusedElement() && frame && frame->selection().isFocusedAndActive();
 }
 
-bool RenderTheme::isPressed(const RenderObject* o) const
+bool RenderTheme::isPressed(const RenderObject& o) const
 {
-    if (!o->node() || !o->node()->isElementNode())
+    if (!o.node() || !o.node()->isElementNode())
         return false;
-    return toElement(o->node())->active();
+    return toElement(o.node())->active();
 }
 
-bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const
+bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node || !node->isElementNode())
         return false;
     Element* element = toElement(node);
@@ -860,17 +860,17 @@ bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const
     return static_cast<SpinButtonElement*>(element)->upDownState() == SpinButtonElement::Up;
 }
 
-bool RenderTheme::isReadOnlyControl(const RenderObject* o) const
+bool RenderTheme::isReadOnlyControl(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node || !node->isElementNode())
         return false;
     return toElement(node)->matchesReadOnlyPseudoClass();
 }
 
-bool RenderTheme::isHovered(const RenderObject* o) const
+bool RenderTheme::isHovered(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node || !node->isElementNode())
         return false;
     if (!toElement(node)->isSpinButtonElement())
@@ -879,25 +879,25 @@ bool RenderTheme::isHovered(const RenderObject* o) const
     return element->hovered() && element->upDownState() != SpinButtonElement::Indeterminate;
 }
 
-bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject* o) const
+bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject& o) const
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement())
         return false;
     SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
     return element->upDownState() == SpinButtonElement::Up;
 }
 
-bool RenderTheme::isDefault(const RenderObject* o) const
+bool RenderTheme::isDefault(const RenderObject& o) const
 {
     // A button should only have the default appearance if the page is active
     if (!isActive(o))
         return false;
 
-    if (!o->frame().settings().applicationChromeMode())
+    if (!o.frame().settings().applicationChromeMode())
         return false;
     
-    return o->style().appearance() == DefaultButtonPart;
+    return o.style().appearance() == DefaultButtonPart;
 }
 
 #if !USE(NEW_THEME)
@@ -967,7 +967,7 @@ void RenderTheme::adjustInputFieldSpeechButtonStyle(StyleResolver* styleResolver
     RenderInputSpeech::adjustInputFieldSpeechButtonStyle(styleResolver, style, element);
 }
 
-bool RenderTheme::paintInputFieldSpeechButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderTheme::paintInputFieldSpeechButton(const RenderObject& object, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return RenderInputSpeech::paintInputFieldSpeechButton(object, paintInfo, rect);
 }
@@ -989,7 +989,7 @@ bool RenderTheme::supportsMeter(ControlPart) const
     return false;
 }
 
-bool RenderTheme::paintMeter(RenderObject*, const PaintInfo&, const IntRect&)
+bool RenderTheme::paintMeter(const RenderObject&, const PaintInfo&, const IntRect&)
 {
     return true;
 }
@@ -1002,9 +1002,9 @@ LayoutUnit RenderTheme::sliderTickSnappingThreshold() const
     return 0;
 }
 
-void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect)
+void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    Node* node = o->node();
+    Node* node = o.node();
     if (!node)
         return;
 
@@ -1018,14 +1018,14 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
 
     double min = input->minimum();
     double max = input->maximum();
-    ControlPart part = o->style().appearance();
+    ControlPart part = o.style().appearance();
     // We don't support ticks on alternate sliders like MediaVolumeSliders.
     if (part !=  SliderHorizontalPart && part != SliderVerticalPart)
         return;
     bool isHorizontal = part ==  SliderHorizontalPart;
 
     IntSize thumbSize;
-    RenderObject* thumbRenderer = input->sliderThumbElement()->renderer();
+    const RenderObject* thumbRenderer = input->sliderThumbElement()->renderer();
     if (thumbRenderer) {
         const RenderStyle& thumbStyle = thumbRenderer->style();
         int thumbWidth = thumbStyle.width().intValue();
@@ -1035,7 +1035,7 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
     }
 
     IntSize tickSize = sliderTickSize();
-    float zoomFactor = o->style().effectiveZoom();
+    float zoomFactor = o.style().effectiveZoom();
     FloatRect tickRect;
     int tickRegionSideMargin = 0;
     int tickRegionWidth = 0;
@@ -1044,7 +1044,7 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
     // We can ignoring transforms because transform is handled by the graphics context.
     if (trackRenderer)
         trackBounds = trackRenderer->absoluteBoundingBoxRectIgnoringTransforms();
-    IntRect sliderBounds = o->absoluteBoundingBoxRectIgnoringTransforms();
+    IntRect sliderBounds = o.absoluteBoundingBoxRectIgnoringTransforms();
 
     // Make position relative to the transformed ancestor element.
     trackBounds.setX(trackBounds.x() - sliderBounds.x() + rect.x());
@@ -1065,7 +1065,7 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
     }
     RefPtr<HTMLCollection> options = dataList->options();
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
-    paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    paintInfo.context->setFillColor(o.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     for (unsigned i = 0; Node* node = options->item(i); i++) {
         ASSERT(isHTMLOptionElement(node));
         HTMLOptionElement* optionElement = toHTMLOptionElement(node);
@@ -1074,7 +1074,7 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
             continue;
         double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(value));
         double tickFraction = (parsedValue - min) / (max - min);
-        double tickRatio = isHorizontal && o->style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
+        double tickRatio = isHorizontal && o.style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
         double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tickRatio);
         if (isHorizontal)
             tickRect.setX(tickPosition);
@@ -1100,7 +1100,7 @@ void RenderTheme::adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*)
 {
 }
 
-IntRect RenderTheme::progressBarRectForBounds(const RenderObject*, const IntRect& bounds) const
+IntRect RenderTheme::progressBarRectForBounds(const RenderObject&, const IntRect& bounds) const
 {
     return bounds;
 }
index 9bd80e9..c7de2d5 100644 (file)
@@ -79,9 +79,9 @@ public:
     // This method is called to paint the widget as a background of the RenderObject.  A widget's foreground, e.g., the
     // text of a button, is always rendered by the engine itself.  The boolean return value indicates
     // whether the CSS border/background should also be painted.
-    bool paint(RenderObject*, ControlStates*, const PaintInfo&, const IntRect&);
-    bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&);
-    bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&);
+    bool paint(const RenderObject&, ControlStates*, const PaintInfo&, const IntRect&);
+    bool paintBorderOnly(const RenderObject&, const PaintInfo&, const IntRect&);
+    bool paintDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
 
     // The remaining methods should be implemented by the platform-specific portion of the theme, e.g.,
     // RenderThemeMac.cpp for Mac OS X.
@@ -106,14 +106,14 @@ public:
     // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
     // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
     // controls that need to do this.
-    virtual int baselinePosition(const RenderObject*) const;
+    virtual int baselinePosition(const RenderObject&) const;
 
     // A method for asking if a control is a container or not.  Leaf controls have to have some special behavior (like
     // the baseline position API above).
     bool isControlContainer(ControlPart) const;
 
     // A method asking if the control changes its tint when the window has focus or not.
-    virtual bool controlSupportsTints(const RenderObject*) const { return false; }
+    virtual bool controlSupportsTints(const RenderObject&) const { return false; }
 
     // Whether or not the control has been styled enough by the author to disable the native appearance.
     virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const;
@@ -123,11 +123,11 @@ public:
 
     // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
     // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
-    virtual void adjustRepaintRect(const RenderObject*, IntRect&);
+    virtual void adjustRepaintRect(const RenderObject&, IntRect&);
 
     // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed
     // or a control becomes disabled.
-    virtual bool stateChanged(RenderObject*, ControlStates::States) const;
+    virtual bool stateChanged(const RenderObject&, ControlStates::States) const;
 
     // This method is called whenever the theme changes on the system in order to flush cached resources from the
     // old theme.
@@ -188,14 +188,14 @@ public:
     virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return RegularScrollbar; }
 
     // Method for painting the caps lock indicator
-    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) { return 0; };
+    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) { return 0; };
 
 #if ENABLE(PROGRESS_ELEMENT)
     // Returns the repeat interval of the animation for the progress bar.
     virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
     // Returns the duration of the animation for the progress bar.
     virtual double animationDurationForProgressBar(RenderProgress*) const;
-    virtual IntRect progressBarRectForBounds(const RenderObject*, const IntRect&) const;
+    virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const;
 #endif
 
 #if ENABLE(VIDEO)
@@ -228,7 +228,7 @@ public:
     virtual IntSize sliderTickSize() const = 0;
     // Returns the distance of slider tick origin from the slider track center.
     virtual int sliderTickOffsetFromTrackCenter() const = 0;
-    void paintSliderTicks(RenderObject*, const PaintInfo&, const IntRect&);
+    void paintSliderTicks(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 
     virtual bool shouldShowPlaceholderWhenFocused() const { return false; }
@@ -243,10 +243,10 @@ public:
     virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const;
 
     enum FileUploadDecorations { SingleFile, MultipleFiles };
-    virtual bool paintFileUploadIconDecorations(RenderObject* /*inputRenderer*/, RenderObject* /*buttonRenderer*/, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) { return true; }
+    virtual bool paintFileUploadIconDecorations(const RenderObject& /*inputRenderer*/, const RenderObject& /*buttonRenderer*/, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) { return true; }
 
 #if ENABLE(IMAGE_CONTROLS)
-    virtual IntSize imageControlsButtonSize(const RenderObject*) const { return IntSize(); }
+    virtual IntSize imageControlsButtonSize(const RenderObject&) const { return IntSize(); }
 #endif
 
 protected:
@@ -267,122 +267,122 @@ protected:
 #if !USE(NEW_THEME)
     // Methods for each appearance value.
     virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     virtual void setCheckboxSize(RenderStyle*) const { }
 
     virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     virtual void setRadioSize(RenderStyle*) const { }
 
     virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
     virtual void setButtonSize(RenderStyle*) const { }
 
     virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 #endif
 
-    virtual bool paintCheckboxDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintRadioDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintRadioDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintTextFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintTextAreaDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMenuListDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMenuListDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
-    virtual bool paintPushButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintSquareButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSquareButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
 #if ENABLE(METER_ELEMENT)
     virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 
 #if ENABLE(PROGRESS_ELEMENT)
     virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 #endif
 
 #if ENABLE(INPUT_SPEECH)
     virtual void adjustInputFieldSpeechButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintInputFieldSpeechButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintInputFieldSpeechButton(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 
     virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintSliderThumbDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintSearchFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustMediaControlStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaSeekBackButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaSeekForwardButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaTimeRemaining(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaFullScreenVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintMediaFullScreenVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-
-    virtual bool paintSnapshottedPluginOverlay(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaFullscreenButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaPlayButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaOverlayPlayButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaMuteButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaSeekBackButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaRewindButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaReturnToRealtimeButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaToggleClosedCaptionsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaControlsBackground(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaTimeRemaining(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaFullScreenVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMediaFullScreenVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+
+    virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
 #if ENABLE(IMAGE_CONTROLS)
-    virtual bool paintImageControlsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 #endif
 
 public:
-    void updateControlStatesForRenderer(const RenderObject*, ControlStates*) const;
-    ControlStates::States extractControlStatesForRenderer(const RenderObject*) const;
-    bool isActive(const RenderObject*) const;
-    bool isChecked(const RenderObject*) const;
-    bool isIndeterminate(const RenderObject*) const;
-    bool isEnabled(const RenderObject*) const;
-    bool isFocused(const RenderObject*) const;
-    bool isPressed(const RenderObject*) const;
-    bool isSpinUpButtonPartPressed(const RenderObject*) const;
-    bool isHovered(const RenderObject*) const;
-    bool isSpinUpButtonPartHovered(const RenderObject*) const;
-    bool isReadOnlyControl(const RenderObject*) const;
-    bool isDefault(const RenderObject*) const;
+    void updateControlStatesForRenderer(const RenderObject&, ControlStates*) const;
+    ControlStates::States extractControlStatesForRenderer(const RenderObject&) const;
+    bool isActive(const RenderObject&) const;
+    bool isChecked(const RenderObject&) const;
+    bool isIndeterminate(const RenderObject&) const;
+    bool isEnabled(const RenderObject&) const;
+    bool isFocused(const RenderObject&) const;
+    bool isPressed(const RenderObject&) const;
+    bool isSpinUpButtonPartPressed(const RenderObject&) const;
+    bool isHovered(const RenderObject&) const;
+    bool isSpinUpButtonPartHovered(const RenderObject&) const;
+    bool isReadOnlyControl(const RenderObject&) const;
+    bool isDefault(const RenderObject&) const;
 
 private:
     mutable Color m_activeSelectionBackgroundColor;
index 5b9d815..f37f3f8 100644 (file)
@@ -48,35 +48,35 @@ public:
     static CFStringRef contentSizeCategory();
 
 protected:
-    virtual int baselinePosition(const RenderObject*) const override;
+    virtual int baselinePosition(const RenderObject&) const override;
 
     virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer& background, const Color& backgroundColor) const override;
 
     // Methods for each appearance value.
     virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintCheckboxDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintRadioDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintRadioDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
-    virtual bool paintPushButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
+    virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
     virtual void setButtonSize(RenderStyle*) const override;
 
-    virtual bool paintFileUploadIconDecorations(RenderObject* inputRenderer, RenderObject* buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override;
+    virtual bool paintFileUploadIconDecorations(const RenderObject& inputRenderer, const RenderObject& buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override;
 
-    virtual bool paintTextFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
-    virtual bool paintTextAreaDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
+    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual void adjustSliderThumbSize(RenderStyle*, Element*) const override;
-    virtual bool paintSliderThumbDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
 #if ENABLE(PROGRESS_ELEMENT)
     // Returns the repeat interval of the animation for the progress bar.
@@ -84,7 +84,7 @@ protected:
     // Returns the duration of the animation for the progress bar.
     virtual double animationDurationForProgressBar(RenderProgress*) const override;
 
-    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
 #if ENABLE(DATALIST_ELEMENT)
@@ -93,7 +93,7 @@ protected:
 #endif
 
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintSearchFieldDecorations(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual Color platformActiveSelectionBackgroundColor() const override;
     virtual Color platformInactiveSelectionBackgroundColor() const override;
@@ -115,7 +115,7 @@ private:
     virtual ~RenderThemeIOS() { }
 
     const Color& shadowColor() const;
-    FloatRect addRoundedBorderClip(RenderObject* box, GraphicsContext*, const IntRect&);
+    FloatRect addRoundedBorderClip(const RenderObject& box, GraphicsContext*, const IntRect&);
 
     String m_mediaControlsScript;
     String m_mediaControlsStyleSheet;
index 26f2f54..e9ec2ba 100644 (file)
@@ -316,11 +316,11 @@ const Color& RenderThemeIOS::shadowColor() const
     return color;
 }
 
-FloatRect RenderThemeIOS::addRoundedBorderClip(RenderObject* box, GraphicsContext* context, const IntRect& rect)
+FloatRect RenderThemeIOS::addRoundedBorderClip(const RenderObject& box, GraphicsContext* context, const IntRect& rect)
 {
     // To fix inner border bleeding issues <rdar://problem/9812507>, we clip to the outer border and assert that
     // the border is opaque or transparent, unless we're checked because checked radio/checkboxes show no bleeding.
-    RenderStyle& style = box->style();
+    RenderStyle& style = box.style();
     RoundedRect border = isChecked(box) ? style.getRoundedInnerBorderFor(rect) : style.getRoundedBorderFor(rect);
 
     if (border.isRounded())
@@ -357,7 +357,7 @@ static CGPoint shortened(CGPoint start, CGPoint end, float width)
     return CGPointMake(start.x + x * ratio, start.y + y * ratio);
 }
 
-bool RenderThemeIOS::paintCheckboxDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
     FloatRect clip = addRoundedBorderClip(box, paintInfo.context, rect);
@@ -408,17 +408,17 @@ bool RenderThemeIOS::paintCheckboxDecorations(RenderObject* box, const PaintInfo
     return false;
 }
 
-int RenderThemeIOS::baselinePosition(const RenderObject* renderer) const
+int RenderThemeIOS::baselinePosition(const RenderObject& renderer) const
 {
-    if (!renderer->isBox())
+    if (!renderer.isBox())
         return 0;
 
-    const RenderBox* box = toRenderBox(renderer);
+    const RenderBox& box = *toRenderBox(&renderer);
 
-    if (box->style().appearance() == CheckboxPart || box->style().appearance() == RadioPart)
-        return box->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
-    if (box->style().appearance() == MenulistPart)
-        return box->marginTop() + box->height() - 5; // This is to match AppKit. There might be a better way to calculate this though.
+    if (box.style().appearance() == CheckboxPart || box.style().appearance() == RadioPart)
+        return box.marginTop() + box.height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
+    if (box.style().appearance() == MenulistPart)
+        return box.marginTop() + box.height() - 5; // This is to match AppKit. There might be a better way to calculate this though.
     return RenderTheme::baselinePosition(box);
 }
 
@@ -445,7 +445,7 @@ void RenderThemeIOS::adjustRadioStyle(StyleResolver*, RenderStyle* style, Elemen
     style->setBorderRadius(IntSize(length.value() / 2.0f, length.value() / 2.0f));
 }
 
-bool RenderThemeIOS::paintRadioDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintRadioDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
     FloatRect clip = addRoundedBorderClip(box, paintInfo.context, rect);
@@ -473,9 +473,9 @@ bool RenderThemeIOS::paintRadioDecorations(RenderObject* box, const PaintInfo& p
     return false;
 }
 
-bool RenderThemeIOS::paintTextFieldDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    RenderStyle& style = box->style();
+    RenderStyle& style = box.style();
     IntPoint point(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth());
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
@@ -485,14 +485,14 @@ bool RenderThemeIOS::paintTextFieldDecorations(RenderObject* box, const PaintInf
     // This gradient gets drawn black when printing.
     // Do not draw the gradient if there is no visible top border.
     bool topBorderIsInvisible = !style.hasBorder() || !style.borderTopWidth() || style.borderTopIsTransparent();
-    if (!box->view().printing() && !topBorderIsInvisible)
+    if (!box.view().printing() && !topBorderIsInvisible)
         drawAxialGradient(paintInfo.context->platformContext(), gradientWithName(InsetGradient), point, FloatPoint(CGPointMake(point.x(), point.y() + 3.0f)), LinearInterpolation);
     return false;
 }
 
-bool RenderThemeIOS::paintTextAreaDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintTextAreaDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    return paintTextFieldDecorations(renderer, paintInfo, rect);
+    return paintTextFieldDecorations(box, paintInfo, rect);
 }
 
 const int MenuListMinHeight = 15;
@@ -582,9 +582,9 @@ void RenderThemeIOS::adjustMenuListButtonStyle(StyleResolver*, RenderStyle* styl
     }
 }
 
-bool RenderThemeIOS::paintMenuListButtonDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    RenderStyle& style = box->style();
+    RenderStyle& style = box.style();
     float borderTopWidth = style.borderTopWidth();
     FloatRect clip(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth(), rect.width() - style.borderLeftWidth() - style.borderRightWidth(), rect.height() - style.borderTopWidth() - style.borderBottomWidth());
     CGContextRef cgContext = paintInfo.context->platformContext();
@@ -612,7 +612,7 @@ bool RenderThemeIOS::paintMenuListButtonDecorations(RenderObject* box, const Pai
 
     float separator = clip.maxX() - MenuListButtonPaddingRight;
 
-    box->drawLineForBoxSide(paintInfo.context, separator - borderTopWidth, clip.y(), separator, clip.maxY(), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);
+    box.drawLineForBoxSide(paintInfo.context, separator - borderTopWidth, clip.y(), separator, clip.maxY(), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);
 
     FloatRect buttonClip(separator - adjustTop, clip.y() - adjustTop, MenuListButtonPaddingRight + adjustTop + adjustRight, clip.height() + adjustTop + adjustBottom);
 
@@ -631,7 +631,7 @@ bool RenderThemeIOS::paintMenuListButtonDecorations(RenderObject* box, const Pai
 
     // Paint Indicators.
 
-    if (box->isMenuList() && toHTMLSelectElement(box->node())->multiple()) {
+    if (box.isMenuList() && toHTMLSelectElement(box.node())->multiple()) {
         int size = 2;
         int count = 3;
         int padding = 3;
@@ -684,10 +684,10 @@ void RenderThemeIOS::adjustSliderTrackStyle(StyleResolver* selector, RenderStyle
     style->setBorderRadius(LengthSize(radiusWidth, radiusHeight));
 }
 
-bool RenderThemeIOS::paintSliderTrack(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintSliderTrack(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     IntRect trackClip = rect;
-    RenderStyle& style = box->style();
+    RenderStyle& style = box.style();
 
     bool isHorizontal = true;
     switch (style.appearance()) {
@@ -779,7 +779,7 @@ void RenderThemeIOS::adjustSliderThumbSize(RenderStyle* style, Element*) const
     }
 }
 
-bool RenderThemeIOS::paintSliderThumbDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintSliderThumbDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
     FloatRect clip = addRoundedBorderClip(box, paintInfo.context, rect);
@@ -807,9 +807,9 @@ double RenderThemeIOS::animationDurationForProgressBar(RenderProgress*) const
     return 0;
 }
 
-bool RenderThemeIOS::paintProgressBar(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    if (!renderer->isProgress())
+    if (!renderer.isProgress())
         return true;
 
     const int progressBarHeight = 9;
@@ -836,7 +836,7 @@ bool RenderThemeIOS::paintProgressBar(RenderObject* renderer, const PaintInfo& p
     strokeGradient->addColorStop(1.0, Color(0x8d, 0x8d, 0x8d));
     context->setStrokeGradient(strokeGradient.release());
 
-    ColorSpace colorSpace = renderer->style().colorSpace();
+    ColorSpace colorSpace = renderer.style().colorSpace();
     context->setFillColor(Color(255, 255, 255), colorSpace);
 
     Path trackPath;
@@ -857,10 +857,10 @@ bool RenderThemeIOS::paintProgressBar(RenderObject* renderer, const PaintInfo& p
 
     context->fillRect(FloatRect(rect.x(), verticalRenderingPosition, rect.width(), upperGradientHeight));
 
-    RenderProgress* renderProgress = toRenderProgress(renderer);
-    if (renderProgress->isDeterminate()) {
+    const RenderProgress& renderProgress = *toRenderProgress(&renderer);
+    if (renderProgress.isDeterminate()) {
         // 2) Draw the progress bar.
-        double position = clampTo(renderProgress->position(), 0.0, 1.0);
+        double position = clampTo(renderProgress.position(), 0.0, 1.0);
         double barWidth = position * rect.width();
         RefPtr<Gradient> barGradient = Gradient::create(FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1));
         barGradient->addColorStop(0.0, Color(195, 217, 247));
@@ -879,7 +879,7 @@ bool RenderThemeIOS::paintProgressBar(RenderObject* renderer, const PaintInfo& p
 
         Path barPath;
         int left = rect.x();
-        if (!renderProgress->style().isLeftToRightDirection())
+        if (!renderProgress.style().isLeftToRightDirection())
             left = rect.maxX() - barWidth;
         FloatRect barRect(left + 0.25, verticalRenderingPosition + 0.25, std::max(barWidth - 0.5, 0.0), progressBarHeight - 0.5);
         barPath.addRoundedRect(barRect, roundedCornerRadius);
@@ -921,7 +921,7 @@ void RenderThemeIOS::adjustSearchFieldStyle(StyleResolver* selector, RenderStyle
     adjustRoundBorderRadius(*style, box);
 }
 
-bool RenderThemeIOS::paintSearchFieldDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintSearchFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return paintTextFieldDecorations(box, paintInfo, rect);
 }
@@ -947,18 +947,18 @@ void RenderThemeIOS::adjustButtonStyle(StyleResolver* selector, RenderStyle* sty
     adjustRoundBorderRadius(*style, box);
 }
 
-bool RenderThemeIOS::paintButtonDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     return paintPushButtonDecorations(box, paintInfo, rect);
 }
 
-bool RenderThemeIOS::paintPushButtonDecorations(RenderObject* box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintPushButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
 {
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
     FloatRect clip = addRoundedBorderClip(box, paintInfo.context, rect);
 
     CGContextRef cgContext = paintInfo.context->platformContext();
-    if (box->style().visitedDependentColor(CSSPropertyBackgroundColor).isDark())
+    if (box.style().visitedDependentColor(CSSPropertyBackgroundColor).isDark())
         drawAxialGradient(cgContext, gradientWithName(ConvexGradient), clip.location(), FloatPoint(clip.x(), clip.maxY()), LinearInterpolation);
     else {
         drawAxialGradient(cgContext, gradientWithName(ShadeGradient), clip.location(), FloatPoint(clip.x(), clip.maxY()), LinearInterpolation);
@@ -982,12 +982,12 @@ const int kThumbnailBorderCornerRadius = 1;
 const int kVisibleBackgroundImageWidth = 1;
 const int kMultipleThumbnailShrinkSize = 2;
 
-bool RenderThemeIOS::paintFileUploadIconDecorations(RenderObject*, RenderObject* buttonRenderer, const PaintInfo& paintInfo, const IntRect& rect, Icon* icon, FileUploadDecorations fileUploadDecorations)
+bool RenderThemeIOS::paintFileUploadIconDecorations(const RenderObject&, const RenderObject& buttonRenderer, const PaintInfo& paintInfo, const IntRect& rect, Icon* icon, FileUploadDecorations fileUploadDecorations)
 {
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
     IntSize cornerSize(kThumbnailBorderCornerRadius, kThumbnailBorderCornerRadius);
-    Color pictureFrameColor = buttonRenderer ? buttonRenderer->style().visitedDependentColor(CSSPropertyBorderTopColor) : Color(76.0f, 76.0f, 76.0f);
+    Color pictureFrameColor = buttonRenderer.style().visitedDependentColor(CSSPropertyBorderTopColor);
 
     IntRect thumbnailPictureFrameRect = rect;
     IntRect thumbnailRect = rect;
@@ -1000,7 +1000,7 @@ bool RenderThemeIOS::paintFileUploadIconDecorations(RenderObject*, RenderObject*
         thumbnailRect.contract(kMultipleThumbnailShrinkSize, kMultipleThumbnailShrinkSize);
 
         // Background picture frame and simple background icon with a gradient matching the button.
-        Color backgroundImageColor = buttonRenderer ? Color(buttonRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : Color(206.0f, 206.0f, 206.0f);
+        Color backgroundImageColor = Color(buttonRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor).rgb());
         paintInfo.context->fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor, ColorSpaceDeviceRGB);
         paintInfo.context->fillRect(thumbnailRect, backgroundImageColor, ColorSpaceDeviceRGB);
         {
index 0fbe611..2b19d47 100644 (file)
@@ -44,12 +44,12 @@ public:
     static PassRefPtr<RenderTheme> create();
 
     // A method asking if the control changes its tint when the window has focus or not.
-    virtual bool controlSupportsTints(const RenderObject*) const;
+    virtual bool controlSupportsTints(const RenderObject&) const;
 
     // A general method asking if any control tinting is supported at all.
     virtual bool supportsControlTints() const { return true; }
 
-    virtual void adjustRepaintRect(const RenderObject*, IntRect&) override;
+    virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;
 
     virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const;
 
@@ -82,13 +82,13 @@ public:
     virtual int popupInternalPaddingTop(RenderStyle*) const;
     virtual int popupInternalPaddingBottom(RenderStyle*) const;
 
-    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) override;
 
     virtual bool popsMenuByArrowKeys() const override { return true; }
 
 #if ENABLE(METER_ELEMENT)
     virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const override;
-    virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual bool supportsMeter(ControlPart) const;
 #endif
 
@@ -97,14 +97,14 @@ public:
     virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
     // Returns the duration of the animation for the progress bar.
     virtual double animationDurationForProgressBar(RenderProgress*) const;
-    virtual IntRect progressBarRectForBounds(const RenderObject*, const IntRect&) const override;
+    virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override;
 #endif
 
     virtual Color systemColor(CSSValueID) const;
     // Controls color values returned from platformFocusRingColor(). systemColor() will be used when false.
     virtual bool usesTestModeFocusRingColor() const;
     // A view associated to the contained document. Subclasses may not have such a view and return a fake.
-    NSView* documentViewFor(RenderObject*) const;
+    NSView* documentViewFor(const RenderObject&) const;
 
 
 protected:
@@ -123,43 +123,43 @@ protected:
 
     virtual bool supportsSelectionForegroundColors() const { return false; }
 
-    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
 #if ENABLE(PROGRESS_ELEMENT)
     virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&);
 #endif
 
-    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
 
     virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
 #if ENABLE(VIDEO)
     virtual bool supportsClosedCaptioning() const { return true; }
@@ -167,14 +167,14 @@ protected:
 
     virtual bool shouldShowPlaceholderWhenFocused() const;
 
-    virtual bool paintSnapshottedPluginOverlay(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&);
 
 private:
     virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const override;
 
     IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
 
-    FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect&) const;
+    FloatRect convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect&) const;
 
     // Get the control size based off the font. Used by some of the controls (like buttons).
     NSControlSize controlSizeForFont(RenderStyle*) const;
@@ -185,26 +185,26 @@ private:
     IntSize sizeForSystemFont(RenderStyle*, const IntSize* sizes) const;
     void setFontFromControlSize(StyleResolver*, RenderStyle*, NSControlSize) const;
 
-    void updateCheckedState(NSCell*, const RenderObject*);
-    void updateEnabledState(NSCell*, const RenderObject*);
-    void updateFocusedState(NSCell*, const RenderObject*);
-    void updatePressedState(NSCell*, const RenderObject*);
+    void updateCheckedState(NSCell*, const RenderObject&);
+    void updateEnabledState(NSCell*, const RenderObject&);
+    void updateFocusedState(NSCell*, const RenderObject&);
+    void updatePressedState(NSCell*, const RenderObject&);
     // An optional hook for subclasses to update the control tint of NSCell.
-    virtual void updateActiveState(NSCell*, const RenderObject*) { }
+    virtual void updateActiveState(NSCell*, const RenderObject&) { }
 
     // Helpers for adjusting appearance and for painting
 
-    void setPopupButtonCellState(const RenderObject*, const IntRect&);
+    void setPopupButtonCellState(const RenderObject&, const IntRect&);
     const IntSize* popupButtonSizes() const;
     const int* popupButtonMargins() const;
     const int* popupButtonPadding(NSControlSize) const;
-    void paintMenuListButtonGradients(RenderObject*, const PaintInfo&, const IntRect&);
+    void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&);
     const IntSize* menuListSizes() const;
 
     const IntSize* searchFieldSizes() const;
     const IntSize* cancelButtonSizes() const;
     const IntSize* resultsButtonSizes() const;
-    void setSearchCellState(RenderObject*, const IntRect&);
+    void setSearchCellState(const RenderObject&, const IntRect&);
     void setSearchFieldSize(RenderStyle*) const;
 
     NSPopUpButtonCell *popupButton() const;
@@ -226,8 +226,8 @@ private:
 #endif
 
 #if ENABLE(IMAGE_CONTROLS)
-    virtual bool paintImageControlsButton(RenderObject*, const PaintInfo&, const IntRect&) override;
-    virtual IntSize imageControlsButtonSize(const RenderObject*) const override;
+    virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) override;
+    virtual IntSize imageControlsButtonSize(const const RenderObject&) const override;
     NSServicesRolloverButtonCell *servicesRolloverButtonCell() const;
 #endif
 
index 258c7ae..cd0e791 100644 (file)
@@ -217,10 +217,10 @@ RenderThemeMac::~RenderThemeMac()
     [[NSNotificationCenter defaultCenter] removeObserver:m_notificationObserver.get()];
 }
 
-NSView* RenderThemeMac::documentViewFor(RenderObject* o) const
+NSView* RenderThemeMac::documentViewFor(const RenderObject& o) const
 {
     ControlStates states(extractControlStatesForRenderer(o));
-    return ThemeMac::ensuredView(&o->view().frameView(), &states);
+    return ThemeMac::ensuredView(&o.view().frameView(), &states);
 }
 
 #if ENABLE(VIDEO)
@@ -602,9 +602,9 @@ bool RenderThemeMac::isControlStyled(const RenderStyle* style, const BorderData&
     return RenderTheme::isControlStyled(style, border, background, backgroundColor);
 }
 
-void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
+void RenderThemeMac::adjustRepaintRect(const RenderObject& o, IntRect& r)
 {
-    ControlPart part = o->style().appearance();
+    ControlPart part = o.style().appearance();
 
 #if USE(NEW_THEME)
     switch (part) {
@@ -621,7 +621,7 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
     }
 #endif
 
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
 
     if (part == MenulistPart) {
         setPopupButtonCellState(o, r);
@@ -650,20 +650,20 @@ IntRect RenderThemeMac::inflateRect(const IntRect& r, const IntSize& size, const
     return result;
 }
 
-FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const
+FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect& r) const
 {
     FloatRect partRect(inputRect);
 
     // Compute an offset between the part renderer and the input renderer
     FloatSize offsetFromInputRenderer;
-    const RenderObject* renderer = partRenderer;
-    while (renderer && renderer != inputRenderer) {
+    const RenderObject* renderer = &partRenderer;
+    while (renderer && renderer != &inputRenderer) {
         RenderElement* containingRenderer = renderer->container();
         offsetFromInputRenderer -= roundedIntSize(renderer->offsetFromContainer(containingRenderer, LayoutPoint()));
         renderer = containingRenderer;
     }
     // If the input renderer was not a container, something went wrong
-    ASSERT(renderer == inputRenderer);
+    ASSERT(renderer == &inputRenderer);
     // Move the rect into partRenderer's coords
     partRect.move(offsetFromInputRenderer);
     // Account for the local drawing offset (tx, ty)
@@ -672,7 +672,7 @@ FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject* inputRendere
     return partRect;
 }
 
-void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject* o)
+void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject& o)
 {
     bool oldIndeterminate = [cell state] == NSMixedState;
     bool indeterminate = isIndeterminate(o);
@@ -688,7 +688,7 @@ void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject* o)
         [cell setState:checked ? NSOnState : NSOffState];
 }
 
-void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject* o)
+void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject& o)
 {
     bool oldEnabled = [cell isEnabled];
     bool enabled = isEnabled(o);
@@ -696,23 +696,23 @@ void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject* o)
         [cell setEnabled:enabled];
 }
 
-void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject* o)
+void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject& o)
 {
     bool oldFocused = [cell showsFirstResponder];
-    bool focused = isFocused(o) && o->style().outlineStyleIsAuto();
+    bool focused = isFocused(o) && o.style().outlineStyleIsAuto();
     if (focused != oldFocused)
         [cell setShowsFirstResponder:focused];
 }
 
-void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject* o)
+void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject& o)
 {
     bool oldPressed = [cell isHighlighted];
-    bool pressed = o->node() && o->node()->isElementNode() && toElement(o->node())->active();
+    bool pressed = o.node() && o.node()->isElementNode() && toElement(o.node())->active();
     if (pressed != oldPressed)
         [cell setHighlighted:pressed];
 }
 
-bool RenderThemeMac::controlSupportsTints(const RenderObject* o) const
+bool RenderThemeMac::controlSupportsTints(const RenderObject& o) const
 {
     // An alternate way to implement this would be to get the appropriate cell object
     // and call the private _needRedrawOnWindowChangedKeyState method. An advantage of
@@ -723,7 +723,7 @@ bool RenderThemeMac::controlSupportsTints(const RenderObject* o) const
         return false;
 
     // Checkboxes only have tint when checked.
-    if (o->style().appearance() == CheckboxPart)
+    if (o.style().appearance() == CheckboxPart)
         return isChecked(o);
 
     // For now assume other controls have tint if enabled.
@@ -811,7 +811,7 @@ NSControlSize RenderThemeMac::controlSizeForSystemFont(RenderStyle* style) const
     return NSMiniControlSize;
 }
 
-bool RenderThemeMac::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context);
 
@@ -831,7 +831,7 @@ void RenderThemeMac::adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*
 {
 }
 
-bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintCapsLockIndicator(const RenderObject&, const PaintInfo& paintInfo, const IntRect& r)
 {
     if (paintInfo.context->paintingDisabled())
         return true;
@@ -842,7 +842,7 @@ bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& pain
     return false;
 }
 
-bool RenderThemeMac::paintTextArea(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context);
     wkDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o));
@@ -881,21 +881,21 @@ const int* RenderThemeMac::popupButtonPadding(NSControlSize size) const
     return padding[size];
 }
 
-bool RenderThemeMac::paintMenuList(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintMenuList(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context);
     setPopupButtonCellState(o, r);
 
     NSPopUpButtonCell* popupButton = this->popupButton();
 
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
     IntSize size = popupButtonSizes()[[popupButton controlSize]];
     size.setHeight(size.height() * zoomLevel);
     size.setWidth(r.width());
 
     // Now inflate it to account for the shadow.
     IntRect inflatedRect = r;
-    if (r.width() >= minimumMenuListSize(&o->style()))
+    if (r.width() >= minimumMenuListSize(&o.style()))
         inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
@@ -913,7 +913,7 @@ bool RenderThemeMac::paintMenuList(RenderObject* o, const PaintInfo& paintInfo,
 
     NSView *view = documentViewFor(o);
     [popupButton drawWithFrame:inflatedRect inView:view];
-    if (isFocused(o) && o->style().outlineStyleIsAuto())
+    if (isFocused(o) && o.style().outlineStyleIsAuto())
         [popupButton _web_drawFocusRingWithFrame:inflatedRect inView:view];
     [popupButton setControlView:nil];
 
@@ -934,14 +934,14 @@ IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const
                    bounds.height() < cellSize.height ? cellSize.height : bounds.height());
 }
 
-bool RenderThemeMac::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeMac::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    if (!renderObject->isMeter())
+    if (!renderObject.isMeter())
         return true;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
 
-    NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter(renderObject));
+    NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter(&renderObject));
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
     [cell drawWithFrame:rect inView:documentViewFor(renderObject)];
@@ -1042,23 +1042,23 @@ const int* RenderThemeMac::progressBarMargins(NSControlSize controlSize) const
     return margins[controlSize];
 }
 
-IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject* renderObject, const IntRect& bounds) const
+IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject& renderObject, const IntRect& bounds) const
 {
     // Workaround until <rdar://problem/15855086> is fixed.
     int maxDimension = static_cast<int>(std::numeric_limits<ushort>::max());
     IntRect progressBarBounds(bounds.x(), bounds.y(), std::min(bounds.width(), maxDimension), std::min(bounds.height(), maxDimension));
-    if (NoControlPart == renderObject->style().appearance())
+    if (NoControlPart == renderObject.style().appearance())
         return progressBarBounds;
 
-    float zoomLevel = renderObject->style().effectiveZoom();
-    NSControlSize controlSize = controlSizeForFont(&renderObject->style());
+    float zoomLevel = renderObject.style().effectiveZoom();
+    NSControlSize controlSize = controlSizeForFont(&renderObject.style());
     IntSize size = progressBarSizes()[controlSize];
     size.setHeight(size.height() * zoomLevel);
     size.setWidth(progressBarBounds.width());
 
     // Now inflate it to account for the shadow.
     IntRect inflatedRect = progressBarBounds;
-    if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject->style()))
+    if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject.style()))
         inflatedRect = inflateRect(inflatedRect, size, progressBarMargins(controlSize), zoomLevel);
 
     return inflatedRect;
@@ -1083,28 +1083,28 @@ void RenderThemeMac::adjustProgressBarStyle(StyleResolver*, RenderStyle*, Elemen
 {
 }
 
-bool RenderThemeMac::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    if (!renderObject->isProgress())
+    if (!renderObject.isProgress())
         return true;
 
     IntRect inflatedRect = progressBarRectForBounds(renderObject, rect);
-    NSControlSize controlSize = controlSizeForFont(&renderObject->style());
+    NSControlSize controlSize = controlSizeForFont(&renderObject.style());
 
-    RenderProgress* renderProgress = toRenderProgress(renderObject);
+    const RenderProgress& renderProgress = *toRenderProgress(&renderObject);
     HIThemeTrackDrawInfo trackInfo;
     trackInfo.version = 0;
     if (controlSize == NSRegularControlSize)
-        trackInfo.kind = renderProgress->position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
+        trackInfo.kind = renderProgress.position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;
     else
-        trackInfo.kind = renderProgress->position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
+        trackInfo.kind = renderProgress.position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;
 
-    float deviceScaleFactor = renderObject->document().deviceScaleFactor();
+    float deviceScaleFactor = renderObject.document().deviceScaleFactor();
     trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size());
     trackInfo.min = 0;
     trackInfo.max = std::numeric_limits<SInt32>::max();
-    trackInfo.value = lround(renderProgress->position() * nextafter(trackInfo.max, 0));
-    trackInfo.trackInfo.progress.phase = lround(renderProgress->animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);
+    trackInfo.value = lround(renderProgress.position() * nextafter(trackInfo.max, 0));
+    trackInfo.trackInfo.progress.phase = lround(renderProgress.animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);
     trackInfo.attributes = kThemeTrackHorizontal;
     trackInfo.enableState = isActive(renderObject) ? kThemeTrackActive : kThemeTrackInactive;
     trackInfo.reserved = 0;
@@ -1120,7 +1120,7 @@ bool RenderThemeMac::paintProgressBar(RenderObject* renderObject, const PaintInf
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    if (!renderProgress->style().isLeftToRightDirection()) {
+    if (!renderProgress.style().isLeftToRightDirection()) {
         paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width(), 0);
         paintInfo.context->scale(FloatSize(-1, 1));
     }
@@ -1182,7 +1182,7 @@ static void TrackGradientInterpolate(void*, const CGFloat* inData, CGFloat* outD
         outData[i] = (1.0f - a) * dark[i] + a * light[i];
 }
 
-void RenderThemeMac::paintMenuListButtonGradients(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+void RenderThemeMac::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     if (r.isEmpty())
         return;
@@ -1192,7 +1192,7 @@ void RenderThemeMac::paintMenuListButtonGradients(RenderObject* o, const PaintIn
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    FloatRoundedRect border = FloatRoundedRect(o->style().getRoundedBorderFor(r, &o->view()));
+    FloatRoundedRect border = FloatRoundedRect(o.style().getRoundedBorderFor(r, &o.view()));
     int radius = border.radii().topLeft().width();
 
     CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
@@ -1249,29 +1249,29 @@ void RenderThemeMac::paintMenuListButtonGradients(RenderObject* o, const PaintIn
     }
 }
 
-bool RenderThemeMac::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeMac::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    IntRect bounds = IntRect(rect.x() + renderer->style().borderLeftWidth(),
-                             rect.y() + renderer->style().borderTopWidth(),
-                             rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),
-                             rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());
+    IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(),
+        rect.y() + renderer.style().borderTopWidth(),
+        rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(),
+        rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth());
     // Draw the gradients to give the styled popup menu a button appearance
     paintMenuListButtonGradients(renderer, paintInfo, bounds);
 
     // 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
-    float fontScale = std::min(renderer->style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
+    float fontScale = std::min(renderer.style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
     float centerY = bounds.y() + bounds.height() / 2.0f;
     float arrowHeight = baseArrowHeight * fontScale;
     float arrowWidth = baseArrowWidth * fontScale;
-    float leftEdge = bounds.maxX() - arrowPaddingRight * renderer->style().effectiveZoom() - arrowWidth;
+    float leftEdge = bounds.maxX() - arrowPaddingRight * renderer.style().effectiveZoom() - arrowWidth;
     float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
 
-    if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer->style().effectiveZoom())
+    if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer.style().effectiveZoom())
         return false;
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    paintInfo.context->setFillColor(renderer->style().visitedDependentColor(CSSPropertyColor), renderer->style().colorSpace());
+    paintInfo.context->setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), renderer.style().colorSpace());
     paintInfo.context->setStrokeStyle(NoStroke);
 
     FloatPoint arrow1[3];
@@ -1295,7 +1295,7 @@ bool RenderThemeMac::paintMenuListButtonDecorations(RenderObject* renderer, cons
 
     // FIXME: Should the separator thickness and space be scaled up by fontScale?
     int separatorSpace = 2; // Deliberately ignores zoom since it looks nicer if it stays thin.
-    int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer->style().effectiveZoom()); // FIXME: Round?
+    int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer.style().effectiveZoom()); // FIXME: Round?
 
     // Draw the separator to the left of the arrows
     paintInfo.context->setStrokeThickness(1); // Deliberately ignores zoom since it looks nicer if it stays thin.
@@ -1396,12 +1396,12 @@ void RenderThemeMac::adjustMenuListButtonStyle(StyleResolver*, RenderStyle* styl
     style->setLineHeight(RenderStyle::initialLineHeight());
 }
 
-void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const IntRect& r)
+void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntRect& r)
 {
     NSPopUpButtonCell* popupButton = this->popupButton();
 
     // Set the control size based off the rectangle we're painting into.
-    setControlSize(popupButton, popupButtonSizes(), r.size(), o->style().effectiveZoom());
+    setControlSize(popupButton, popupButtonSizes(), r.size(), o.style().effectiveZoom());
 
     // Update the various states we respond to.
     updateActiveState(popupButton, o);
@@ -1429,16 +1429,16 @@ void RenderThemeMac::adjustSliderTrackStyle(StyleResolver*, RenderStyle* style,
     style->setBoxShadow(nullptr);
 }
 
-bool RenderThemeMac::paintSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     IntRect bounds = r;
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
     float zoomedTrackWidth = trackWidth * zoomLevel;
 
-    if (o->style().appearance() ==  SliderHorizontalPart || o->style().appearance() ==  MediaSliderPart) {
+    if (o.style().appearance() ==  SliderHorizontalPart || o.style().appearance() ==  MediaSliderPart) {
         bounds.setHeight(zoomedTrackWidth);
         bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2);
-    } else if (o->style().appearance() == SliderVerticalPart) {
+    } else if (o.style().appearance() == SliderVerticalPart) {
         bounds.setWidth(zoomedTrackWidth);
         bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2);
     }
@@ -1457,7 +1457,7 @@ bool RenderThemeMac::paintSliderTrack(RenderObject* o, const PaintInfo& paintInf
     struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
     RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
     RetainPtr<CGShadingRef> mainShading;
-    if (o->style().appearance() == SliderVerticalPart)
+    if (o.style().appearance() == SliderVerticalPart)
         mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(),  bounds.maxY()), CGPointMake(bounds.maxX(), bounds.maxY()), mainFunction.get(), false, false));
     else
         mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(),  bounds.y()), CGPointMake(bounds.x(), bounds.maxY()), mainFunction.get(), false, false));
@@ -1478,9 +1478,9 @@ void RenderThemeMac::adjustSliderThumbStyle(StyleResolver* styleResolver, Render
 
 const float verticalSliderHeightPadding = 0.1f;
 
-bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    NSSliderCell* sliderThumbCell = o->style().appearance() == SliderThumbVerticalPart
+    NSSliderCell* sliderThumbCell = o.style().appearance() == SliderThumbVerticalPart
         ? sliderThumbVertical()
         : sliderThumbHorizontal();
 
@@ -1489,19 +1489,20 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInf
     // Update the various states we respond to.
     updateActiveState(sliderThumbCell, o);
     updateEnabledState(sliderThumbCell, o);
-    Element* focusDelegate = (o->node() && o->node()->isElementNode()) ? toElement(o->node())->focusDelegate() : 0;
-    updateFocusedState(sliderThumbCell, focusDelegate ? focusDelegate->renderer() : 0);
+        Element* focusDelegate = (o.node() && o.node()->isElementNode()) ? toElement(o.node())->focusDelegate() : 0;
+    if (focusDelegate)
+        updateFocusedState(sliderThumbCell, *focusDelegate->renderer());
 
     // Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it.
     bool oldPressed;
-    if (o->style().appearance() == SliderThumbVerticalPart)
+    if (o.style().appearance() == SliderThumbVerticalPart)
         oldPressed = m_isSliderThumbVerticalPressed;
     else
         oldPressed = m_isSliderThumbHorizontalPressed;
 
     bool pressed = isPressed(o);
 
-    if (o->style().appearance() == SliderThumbVerticalPart)
+    if (o.style().appearance() == SliderThumbVerticalPart)
         m_isSliderThumbVerticalPressed = pressed;
     else
         m_isSliderThumbHorizontalPressed = pressed;
@@ -1515,11 +1516,11 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInf
 
     FloatRect bounds = r;
     // Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider.
-    if (o->style().appearance() == SliderThumbVerticalPart)
-        bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o->style().effectiveZoom());
+    if (o.style().appearance() == SliderThumbVerticalPart)
+        bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o.style().effectiveZoom());
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
 
     FloatRect unzoomedRect = bounds;
     if (zoomLevel != 1.0f) {
@@ -1536,7 +1537,7 @@ bool RenderThemeMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInf
     return false;
 }
 
-bool RenderThemeMac::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context);
     NSSearchFieldCell* search = this->search();
@@ -1545,7 +1546,7 @@ bool RenderThemeMac::paintSearchField(RenderObject* o, const PaintInfo& paintInf
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
 
     IntRect unzoomedRect = r;
 
@@ -1568,11 +1569,11 @@ bool RenderThemeMac::paintSearchField(RenderObject* o, const PaintInfo& paintInf
     return false;
 }
 
-void RenderThemeMac::setSearchCellState(RenderObject* o, const IntRect&)
+void RenderThemeMac::setSearchCellState(const RenderObject& o, const IntRect&)
 {
     NSSearchFieldCell* search = this->search();
 
-    [search setControlSize:controlSizeForFont(&o->style())];
+    [search setControlSize:controlSizeForFont(&o.style())];
 
     // Update the various states we respond to.
     updateActiveState(search, o);
@@ -1627,17 +1628,17 @@ void RenderThemeMac::adjustSearchFieldStyle(StyleResolver* styleResolver, Render
     style->setBoxShadow(nullptr);
 }
 
-bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    Element* input = o->node()->shadowHost();
+    Element* input = o.node()->shadowHost();
     if (!input)
-        input = toElement(o->node());
+        input = toElement(o.node());
 
     if (!input->renderer()->isBox())
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    setSearchCellState(input->renderer(), r);
+    setSearchCellState(*input->renderer(), r);
 
     NSSearchFieldCell* search = this->search();
 
@@ -1650,7 +1651,7 @@ bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
 
     FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
 
@@ -1663,7 +1664,7 @@ bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
     localBounds.setX(localBounds.x() - spaceToRightOfCancelButton);
 #endif
 
-    localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
+    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
 
     FloatRect unzoomedRect(localBounds);
     if (zoomLevel != 1.0f) {
@@ -1708,7 +1709,7 @@ void RenderThemeMac::adjustSearchFieldDecorationPartStyle(StyleResolver*, Render
     style->setBoxShadow(nullptr);
 }
 
-bool RenderThemeMac::paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&)
+bool RenderThemeMac::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&)
 {
     return false;
 }
@@ -1721,16 +1722,16 @@ void RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle(StyleResolver*,
     style->setBoxShadow(nullptr);
 }
 
-bool RenderThemeMac::paintSearchFieldResultsDecorationPart(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    Node* input = o->node()->shadowHost();
+    Node* input = o.node()->shadowHost();
     if (!input)
-        input = o->node();
+        input = o.node();
     if (!input->renderer()->isBox())
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    setSearchCellState(input->renderer(), r);
+    setSearchCellState(*input->renderer(), r);
 
     NSSearchFieldCell* search = this->search();
 
@@ -1740,7 +1741,7 @@ bool RenderThemeMac::paintSearchFieldResultsDecorationPart(RenderObject* o, cons
     updateActiveState([search searchButtonCell], o);
 
     FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
-    localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
+    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
 
     [[search searchButtonCell] drawWithFrame:localBounds inView:documentViewFor(o)];
     [[search searchButtonCell] setControlView:nil];
@@ -1756,16 +1757,16 @@ void RenderThemeMac::adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderS
     style->setBoxShadow(nullptr);
 }
 
-bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
-    Node* input = o->node()->shadowHost();
+    Node* input = o.node()->shadowHost();
     if (!input)
-        input = o->node();
+        input = o.node();
     if (!input->renderer()->isBox())
         return false;
 
     LocalCurrentGraphicsContext localContext(paintInfo.context);
-    setSearchCellState(input->renderer(), r);
+    setSearchCellState(*input->renderer(), r);
 
     NSSearchFieldCell* search = this->search();
 
@@ -1775,10 +1776,10 @@ bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const PaintI
         [search setSearchMenuTemplate:searchMenuTemplate()];
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
-    float zoomLevel = o->style().effectiveZoom();
+    float zoomLevel = o.style().effectiveZoom();
 
     FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
-    localBounds = convertToPaintingRect(input->renderer(), o, localBounds, r);
+    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
 
     IntRect unzoomedRect(localBounds);
     if (zoomLevel != 1.0f) {
@@ -1795,26 +1796,26 @@ bool RenderThemeMac::paintSearchFieldResultsButton(RenderObject* o, const PaintI
     return false;
 }
 
-bool RenderThemeMac::paintSnapshottedPluginOverlay(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
+bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
 {
     if (paintInfo.phase != PaintPhaseBlockBackground)
         return true;
 
-    if (!o->isRenderBlock())
+    if (!o.isRenderBlock())
         return true;
 
-    RenderBlock* renderBlock = toRenderBlock(o);
+    const RenderBlock& renderBlock = *toRenderBlock(&o);
 
-    LayoutUnit contentWidth = renderBlock->contentWidth();
-    LayoutUnit contentHeight = renderBlock->contentHeight();
+    LayoutUnit contentWidth = renderBlock.contentWidth();
+    LayoutUnit contentHeight = renderBlock.contentHeight();
     if (!contentWidth || !contentHeight)
         return true;
 
     GraphicsContext* context = paintInfo.context;
 
     LayoutSize contentSize(contentWidth, contentHeight);
-    LayoutPoint contentLocation = renderBlock->location();
-    contentLocation.move(renderBlock->borderLeft() + renderBlock->paddingLeft(), renderBlock->borderTop() + renderBlock->paddingTop());
+    LayoutPoint contentLocation = renderBlock.location();
+    contentLocation.move(renderBlock.borderLeft() + renderBlock.paddingLeft(), renderBlock.borderTop() + renderBlock.paddingTop());
 
     LayoutRect rect(contentLocation, contentSize);
     IntRect alignedRect = pixelSnappedIntRect(rect);
@@ -1825,10 +1826,10 @@ bool RenderThemeMac::paintSnapshottedPluginOverlay(RenderObject* o, const PaintI
     // from our node. Assuming this node is the plugin overlay element, we should get to the
     // plugin itself by asking for the shadow root parent, and then its parent.
 
-    if (!renderBlock->element()->isHTMLElement())
+    if (!renderBlock.element()->isHTMLElement())
         return true;
 
-    HTMLElement* plugInOverlay = toHTMLElement(renderBlock->element());
+    HTMLElement* plugInOverlay = toHTMLElement(renderBlock.element());
     Element* parent = plugInOverlay->parentOrShadowHostElement();
     while (parent && !parent->isPluginElement())
         parent = parent->parentOrShadowHostElement();
@@ -1852,7 +1853,7 @@ bool RenderThemeMac::paintSnapshottedPluginOverlay(RenderObject* o, const PaintI
 
     // We could draw the snapshot with that coordinates, but we need to make sure there
     // isn't a composited layer between us and the plugInRenderer.
-    RenderBox* renderBox = toRenderBox(o);
+    const RenderBox* renderBox = toRenderBox(&o);
     while (renderBox != plugInRenderer) {
         if (renderBox->hasLayer() && renderBox->layer() && renderBox->layer()->isComposited()) {
             snapshotAbsPos = -renderBox->location();
@@ -2004,7 +2005,7 @@ NSServicesRolloverButtonCell* RenderThemeMac::servicesRolloverButtonCell() const
 #endif
 }
 
-bool RenderThemeMac::paintImageControlsButton(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeMac::paintImageControlsButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     if (paintInfo.phase != PaintPhaseBlockBackground)
         return true;
@@ -2029,7 +2030,7 @@ bool RenderThemeMac::paintImageControlsButton(RenderObject* renderer, const Pain
     return true;
 }
 
-IntSize RenderThemeMac::imageControlsButtonSize(const RenderObject*) const
+IntSize RenderThemeMac::imageControlsButtonSize(const RenderObject&) const
 {
 #if HAVE(APPKIT_IMAGE_CONTROLS_SUPPORT)
     return IntSize(servicesRolloverButtonCell().cellSize);
index 07aabf7..8329733 100644 (file)
@@ -115,7 +115,7 @@ static RGBA32 makeRGBAFromCGColor(CGColorRef color)
     return makeRGBA(255 * components[0], 255 * components[1], 255 * components[2], 255 * components[3]);
 }
 
-ThemeControlState RenderThemeSafari::determineState(RenderObject* o) const
+ThemeControlState RenderThemeSafari::determineState(const RenderObject& o) const
 {
     ThemeControlState result = 0;
     if (isActive(o))
@@ -264,11 +264,11 @@ bool RenderThemeSafari::isControlStyled(const RenderStyle* style, const BorderDa
     return RenderTheme::isControlStyled(style, border, background, backgroundColor);
 }
 
-void RenderThemeSafari::adjustRepaintRect(const RenderObject* o, IntRect& r)
+void RenderThemeSafari::adjustRepaintRect(const RenderObject& o, IntRect& r)
 {
-    NSControlSize controlSize = controlSizeForFont(&o->style());
+    NSControlSize controlSize = controlSizeForFont(&o.style());
 
-    switch (o->style().appearance()) {
+    switch (o.style().appearance()) {
         case CheckboxPart: {
             // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
             // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
@@ -317,26 +317,26 @@ IntRect RenderThemeSafari::inflateRect(const IntRect& r, const IntSize& size, co
     return result;
 }
 
-int RenderThemeSafari::baselinePosition(const RenderObject* o) const
+int RenderThemeSafari::baselinePosition(const RenderObject& o) const
 {
-    if (!o->isBox())
+    if (!o.isBox())
         return 0;
 
-    if (o->style().appearance() == CheckboxPart || o->style().appearance() == RadioPart) {
-        const RenderBox* box = toRenderBox(o);
+    if (o.style().appearance() == CheckboxPart || o.style().appearance() == RadioPart) {
+        const RenderBox* box = toRenderBox(&o);
         return box->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
     }
 
     return RenderTheme::baselinePosition(o);
 }
 
-bool RenderThemeSafari::controlSupportsTints(const RenderObject* o) const
+bool RenderThemeSafari::controlSupportsTints(const RenderObject& o) const
 {
     if (!isEnabled(o))
         return false;
 
     // Checkboxes only have tint when checked.
-    if (o->style().appearance() == CheckboxPart)
+    if (o.style().appearance() == CheckboxPart)
         return isChecked(o);
 
     // For now assume other controls have tint if enabled.
@@ -416,11 +416,11 @@ NSControlSize RenderThemeSafari::controlSizeForSystemFont(RenderStyle* style) co
     return NSMiniControlSize;
 }
 
-bool RenderThemeSafari::paintCheckbox(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintCheckbox(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
-    NSControlSize controlSize = controlSizeForFont(&o->style());
+    NSControlSize controlSize = controlSizeForFont(&o.style());
 
     IntRect inflatedRect = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize));  
     paintThemePart(SafariTheme::CheckboxPart, paintInfo.context->platformContext(), inflatedRect, controlSize, determineState(o));
@@ -455,11 +455,11 @@ void RenderThemeSafari::setCheckboxSize(RenderStyle* style) const
     setSizeFromFont(style, checkboxSizes());
 }
 
-bool RenderThemeSafari::paintRadio(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintRadio(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
-    NSControlSize controlSize = controlSizeForFont(&o->style());
+    NSControlSize controlSize = controlSizeForFont(&o.style());
  
     IntRect inflatedRect = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize));    
     paintThemePart(RadioButtonPart, paintInfo.context->platformContext(), inflatedRect, controlSize, determineState(o));
@@ -579,7 +579,7 @@ void RenderThemeSafari::setButtonSize(RenderStyle* style) const
     setSizeFromFont(style, buttonSizes());
 }
 
-bool RenderThemeSafari::paintButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
@@ -612,7 +612,7 @@ bool RenderThemeSafari::paintButton(RenderObject* o, const PaintInfo& paintInfo,
     return false;
 }
 
-bool RenderThemeSafari::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
@@ -624,7 +624,7 @@ void RenderThemeSafari::adjustTextFieldStyle(StyleResolver*, RenderStyle*, Eleme
 {
 }
 
-bool RenderThemeSafari::paintCapsLockIndicator(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintCapsLockIndicator(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {    
 #if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 1
     ASSERT(SafariThemeLibrary());
@@ -640,7 +640,7 @@ bool RenderThemeSafari::paintCapsLockIndicator(RenderObject* o, const PaintInfo&
 #endif
 }
 
-bool RenderThemeSafari::paintTextArea(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
@@ -680,7 +680,7 @@ const int* RenderThemeSafari::popupButtonPadding(NSControlSize size) const
     return padding[size];
 }
 
-bool RenderThemeSafari::paintMenuList(RenderObject* o, const PaintInfo& info, const IntRect& r)
+bool RenderThemeSafari::paintMenuList(const RenderObject& o, const PaintInfo& info, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
@@ -690,7 +690,7 @@ bool RenderThemeSafari::paintMenuList(RenderObject* o, const PaintInfo& info, co
     size.setWidth(r.width());
 
     // Now inflate it to account for the shadow.
-    if (r.width() >= minimumMenuListSize(&o->style()))
+    if (r.width() >= minimumMenuListSize(&o.style()))
         inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(controlSize));
 
     paintThemePart(DropDownButtonPart, info.context->platformContext(), inflatedRect, controlSize, determineState(o));
@@ -749,7 +749,7 @@ static void TrackGradientInterpolate(void* info, const CGFloat* inData, CGFloat*
         outData[i] = (1.0f - a) * dark[i] + a * light[i];
 }
 
-void RenderThemeSafari::paintMenuListButtonGradients(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+void RenderThemeSafari::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     if (r.isEmpty())
         return;
@@ -758,7 +758,7 @@ void RenderThemeSafari::paintMenuListButtonGradients(RenderObject* o, const Pain
 
     paintInfo.context->save();
 
-    FloatRoundedRect bound = FloatRoundedRect(o->style().getRoundedBorderFor(r));
+    FloatRoundedRect bound = FloatRoundedRect(o.style().getRoundedBorderFor(r));
     int radius = bound.radii().topLeft().width();
 
     CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
@@ -810,17 +810,17 @@ void RenderThemeSafari::paintMenuListButtonGradients(RenderObject* o, const Pain
     paintInfo.context->restore();
 }
 
-bool RenderThemeSafari::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeSafari::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    IntRect bounds = IntRect(rect.x() + renderer->style().borderLeftWidth(),
-                             rect.y() + renderer->style().borderTopWidth(),
-                             rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),
-                             rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());
+    IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(),
+        rect.y() + renderer.style().borderTopWidth(),
+        rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(),
+        rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth());
     // Draw the gradients to give the styled popup menu a button appearance
     paintMenuListButtonGradients(renderer, paintInfo, bounds);
 
     // 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
-    float fontScale = min(renderer->style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
+    float fontScale = min(renderer.style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
     float centerY = bounds.y() + bounds.height() / 2.0f;
     float arrowHeight = baseArrowHeight * fontScale;
     float arrowWidth = baseArrowWidth * fontScale;
@@ -831,7 +831,7 @@ bool RenderThemeSafari::paintMenuListButtonDecorations(RenderObject* renderer, c
 
     paintInfo.context->save();
 
-    paintInfo.context->setFillColor(renderer->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    paintInfo.context->setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     paintInfo.context->setStrokeColor(NoStroke, ColorSpaceDeviceRGB);
 
     FloatPoint arrow[3];
@@ -956,21 +956,15 @@ int RenderThemeSafari::minimumMenuListSize(RenderStyle* style) const
 const int trackWidth = 5;
 const int trackRadius = 2;
 
-bool RenderThemeSafari::paintSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     IntSize radius(trackRadius, trackRadius);
     FloatRoundedRect bounds(r, radius, radius, radius, radius);
 
-    if (o->style().appearance() ==  SliderHorizontalPart)
-        bounds.setRect(IntRect(r.x(),
-                               r.y() + r.height() / 2 - trackWidth / 2,
-                               r.width(),
-                               trackWidth));
-    else if (o->style().appearance() == SliderVerticalPart)
-        bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2,
-                               r.y(),
-                               trackWidth, 
-                               r.height()));
+    if (o.style().appearance() ==  SliderHorizontalPart)
+        bounds.setRect(IntRect(r.x(), r.y() + r.height() / 2 - trackWidth / 2, r.width(), trackWidth));
+    else if (o.style().appearance() == SliderVerticalPart)
+        bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2, r.y(), trackWidth, r.height()));
 
     CGContextRef context = paintInfo.context->platformContext();
     CGColorSpaceRef cspace = deviceRGBColorSpaceRef();
@@ -981,7 +975,7 @@ bool RenderThemeSafari::paintSliderTrack(RenderObject* o, const PaintInfo& paint
     struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
     RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
     RetainPtr<CGShadingRef> mainShading;
-    if (o->style().appearance() == SliderVerticalPart)
+    if (o.style().appearance() == SliderVerticalPart)
         mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(),  bounds.rect().maxY()), CGPointMake(bounds.rect().maxX(), bounds.rect().maxY()), mainFunction.get(), false, false));
     else
         mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(),  bounds.rect().y()), CGPointMake(bounds.rect().x(), bounds.rect().maxY()), mainFunction.get(), false, false));
@@ -1001,7 +995,7 @@ void RenderThemeSafari::adjustSliderThumbStyle(StyleResolver* styleResolver, Ren
 
 const float verticalSliderHeightPadding = 0.1f;
 
-bool RenderThemeSafari::paintSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
     paintThemePart(SliderThumbPart, paintInfo.context->platformContext(), r, NSSmallControlSize, determineState(o));
@@ -1023,7 +1017,7 @@ void RenderThemeSafari::adjustSliderThumbSize(RenderStyle* style, Element*) cons
 #endif
 }
 
-bool RenderThemeSafari::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     ASSERT(SafariThemeLibrary());
 
@@ -1076,13 +1070,13 @@ void RenderThemeSafari::adjustSearchFieldStyle(StyleResolver* styleResolver, Ren
     setFontFromControlSize(styleResolver, style, controlSize);
 }
 
-bool RenderThemeSafari::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
+bool RenderThemeSafari::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
 {
     ASSERT(SafariThemeLibrary());
 
-    Node* input = o->node()->shadowHost();
+    Node* input = o.node()->shadowHost();
     if (!input)
-        input = o->node();
+        input = o.node();
     RenderObject* renderer = input->renderer();
     ASSERT(renderer);
 
@@ -1119,7 +1113,7 @@ void RenderThemeSafari::adjustSearchFieldDecorationPartStyle(StyleResolver*, Ren
     style->setHeight(Length(size.height(), Fixed));
 }
 
-bool RenderThemeSafari::paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&)
+bool RenderThemeSafari::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&)
 {
     return false;
 }
@@ -1131,13 +1125,13 @@ void RenderThemeSafari::adjustSearchFieldResultsDecorationPartStyle(StyleResolve
     style->setHeight(Length(size.height(), Fixed));
 }
 
-bool RenderThemeSafari::paintSearchFieldResultsDecorationPart(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
+bool RenderThemeSafari::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
 {
     ASSERT(SafariThemeLibrary());
 
-    Node* input = o->node()->shadowHost();
+    Node* input = o.node()->shadowHost();
     if (!input)
-        input = o->node();
+        input = o.node();
     RenderObject* renderer = input->renderer();
     ASSERT(renderer);
 
@@ -1155,13 +1149,13 @@ void RenderThemeSafari::adjustSearchFieldResultsButtonStyle(StyleResolver*, Rend
     style->setHeight(Length(size.height(), Fixed));
 }
 
-bool RenderThemeSafari::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect&)
+bool RenderThemeSafari::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&)
 {
     ASSERT(SafariThemeLibrary());
 
-    Node* input = o->node()->shadowHost();
+    Node* input = o.node()->shadowHost();
     if (!input)
-        input = o->node();
+        input = o.node();
     RenderObject* renderer = input->renderer();
     ASSERT(renderer);
 
@@ -1216,14 +1210,14 @@ IntSize RenderThemeSafari::meterSizeForBounds(const RenderMeter*, const IntRect&
     return bounds.size();
 }
 
-bool RenderThemeSafari::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeSafari::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     // NOTE: This routine is for testing only. It should be fleshed out with a real CG-based implementation.
     // Right now it uses a slider, with the thumb positioned at the meter point.
-    if (!renderObject->isMeter())
+    if (!renderObject.isMeter())
         return true;
 
-    HTMLMeterElement* element = toRenderMeter(renderObject)->meterElement();
+    HTMLMeterElement* element = toRenderMeter(&renderObject)->meterElement();
 
     int remaining = static_cast<int>((1.0 - element->valueRatio()) * static_cast<double>(rect.size().width()));
 
index 290c82c..1e89fd9 100644 (file)
@@ -52,15 +52,15 @@ public:
     // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
     // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
     // controls that need to do this.
-    virtual int baselinePosition(const RenderObject*) const;
+    virtual int baselinePosition(const RenderObject&) const;
 
     // A method asking if the control changes its tint when the window has focus or not.
-    virtual bool controlSupportsTints(const RenderObject*) const;
+    virtual bool controlSupportsTints(const RenderObject&) const;
 
     // A general method asking if any control tinting is supported at all.
     virtual bool supportsControlTints() const { return true; }
 
-    virtual void adjustRepaintRect(const RenderObject*, IntRect&);
+    virtual void adjustRepaintRect(const RenderObject&, IntRect&);
 
     virtual bool isControlStyled(const RenderStyle*, const BorderData&,
                                  const FillLayer&, const Color& backgroundColor) const;
@@ -86,47 +86,47 @@ public:
 
 protected:
     // Methods for each appearance value.
-    virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void setCheckboxSize(RenderStyle*) const;
 
-    virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void setRadioSize(RenderStyle*) const;
 
     virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, WebCore::Element*) const;
-    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void setButtonSize(RenderStyle*) const;
 
-    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
 
-    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
 
     virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
  
-    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&);
 
 #if ENABLE(VIDEO)
     virtual String mediaControlsStyleSheet() override;
@@ -137,7 +137,7 @@ protected:
     virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const override;
     virtual bool supportsMeter(ControlPart) const override;
     virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
     virtual bool shouldShowPlaceholderWhenFocused() const { return true; }
@@ -172,7 +172,7 @@ private:
     const IntSize* popupButtonSizes() const;
     const int* popupButtonMargins(NSControlSize) const;
     const int* popupButtonPadding(NSControlSize) const;
-    void paintMenuListButtonGradients(RenderObject*, const PaintInfo&, const IntRect&);
+    void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&);
     const IntSize* menuListSizes() const;
 
     const IntSize* searchFieldSizes() const;
@@ -180,7 +180,7 @@ private:
     const IntSize* resultsButtonSizes() const;
     void setSearchFieldSize(RenderStyle*) const;
 
-    ThemeControlState determineState(RenderObject*) const;
+    ThemeControlState determineState(const RenderObject&) const;
 
     String m_mediaControlsScript;
     String m_mediaControlsStyleSheet;
index 6e05b49..1b93e02 100644 (file)
@@ -434,10 +434,10 @@ bool RenderThemeWin::supportsFocusRing(const RenderStyle* style) const
     return supportsFocus(style->appearance());
 }
 
-unsigned RenderThemeWin::determineClassicState(RenderObject* o, ControlSubPart subPart)
+unsigned RenderThemeWin::determineClassicState(const RenderObject& o, ControlSubPart subPart)
 {
     unsigned state = 0;
-    switch (o->style().appearance()) {
+    switch (o.style().appearance()) {
         case PushButtonPart:
         case ButtonPart:
         case DefaultButtonPart:
@@ -449,7 +449,7 @@ unsigned RenderThemeWin::determineClassicState(RenderObject* o, ControlSubPart s
             break;
         case RadioPart:
         case CheckboxPart:
-            state = (o->style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
+            state = (o.style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
             if (isChecked(o))
                 state |= DFCS_CHECKED;
             if (!isEnabled(o))
@@ -481,10 +481,10 @@ unsigned RenderThemeWin::determineClassicState(RenderObject* o, ControlSubPart s
     return state;
 }
 
-unsigned RenderThemeWin::determineState(RenderObject* o)
+unsigned RenderThemeWin::determineState(const RenderObject& o)
 {
     unsigned result = TS_NORMAL;
-    ControlPart appearance = o->style().appearance();
+    ControlPart appearance = o.style().appearance();
     if (!isEnabled(o))
         result = TS_DISABLED;
     else if (isReadOnlyControl(o) && (TextFieldPart == appearance || TextAreaPart == appearance || SearchFieldPart == appearance))
@@ -502,12 +502,12 @@ unsigned RenderThemeWin::determineState(RenderObject* o)
     return result;
 }
 
-unsigned RenderThemeWin::determineSliderThumbState(RenderObject* o)
+unsigned RenderThemeWin::determineSliderThumbState(const RenderObject& o)
 {
     unsigned result = TUS_NORMAL;
     if (!isEnabled(o))
         result = TUS_DISABLED;
-    else if (supportsFocus(o->style().appearance()) && isFocused(o))
+    else if (supportsFocus(o.style().appearance()) && isFocused(o))
         result = TUS_FOCUSED;
     else if (isPressed(o))
         result = TUS_PRESSED;
@@ -516,14 +516,14 @@ unsigned RenderThemeWin::determineSliderThumbState(RenderObject* o)
     return result;
 }
 
-unsigned RenderThemeWin::determineButtonState(RenderObject* o)
+unsigned RenderThemeWin::determineButtonState(const RenderObject& o)
 {
     unsigned result = PBS_NORMAL;
     if (!isEnabled(o))
         result = PBS_DISABLED;
     else if (isPressed(o))
         result = PBS_PRESSED;
-    else if (supportsFocus(o->style().appearance()) && isFocused(o))
+    else if (supportsFocus(o.style().appearance()) && isFocused(o))
         result = PBS_DEFAULTED;
     else if (isHovered(o))
         result = PBS_HOT;
@@ -532,7 +532,7 @@ unsigned RenderThemeWin::determineButtonState(RenderObject* o)
     return result;
 }
 
-unsigned RenderThemeWin::determineSpinButtonState(RenderObject* o, ControlSubPart subPart)
+unsigned RenderThemeWin::determineSpinButtonState(const RenderObject& o, ControlSubPart subPart)
 {
     bool isUpButton = subPart == SpinButtonUp;
     unsigned result = isUpButton ? UPS_NORMAL : DNS_NORMAL;
@@ -545,10 +545,10 @@ unsigned RenderThemeWin::determineSpinButtonState(RenderObject* o, ControlSubPar
     return result;
 }
 
-ThemeData RenderThemeWin::getClassicThemeData(RenderObject* o, ControlSubPart subPart)
+ThemeData RenderThemeWin::getClassicThemeData(const RenderObject& o, ControlSubPart subPart)
 {
     ThemeData result;
-    switch (o->style().appearance()) {
+    switch (o.style().appearance()) {
         case PushButtonPart:
         case ButtonPart:
         case DefaultButtonPart:
@@ -597,13 +597,13 @@ ThemeData RenderThemeWin::getClassicThemeData(RenderObject* o, ControlSubPart su
     return result;
 }
 
-ThemeData RenderThemeWin::getThemeData(RenderObject* o, ControlSubPart subPart)
+ThemeData RenderThemeWin::getThemeData(const RenderObject& o, ControlSubPart subPart)
 {
     if (!haveTheme)
         return getClassicThemeData(o, subPart);
 
     ThemeData result;
-    switch (o->style().appearance()) {
+    switch (o.style().appearance()) {
         case PushButtonPart:
         case ButtonPart:
         case DefaultButtonPart:
@@ -618,7 +618,7 @@ ThemeData RenderThemeWin::getThemeData(RenderObject* o, ControlSubPart subPart)
         case MenulistButtonPart: {
             const bool isVistaOrLater = (windowsVersion() >= WindowsVista);
             result.m_part = isVistaOrLater ? CP_DROPDOWNBUTTONRIGHT : CP_DROPDOWNBUTTON;
-            if (isVistaOrLater && o->frame().settings().applicationChromeMode()) {
+            if (isVistaOrLater && o.frame().settings().applicationChromeMode()) {
                 // The "readonly" look we use in application chrome mode
                 // only uses a "normal" look for the drop down button.
                 result.m_state = TS_NORMAL;
@@ -665,7 +665,7 @@ ThemeData RenderThemeWin::getThemeData(RenderObject* o, ControlSubPart subPart)
     return result;
 }
 
-static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme, const ThemeData& themeData, const IntRect& r)
+static void drawControl(GraphicsContext* context, const RenderObject& o, HANDLE theme, const ThemeData& themeData, const IntRect& r)
 {
     bool alphaBlend = false;
     if (theme)
@@ -685,10 +685,10 @@ static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme,
         } else if (themeData.m_part == TKP_TRACK || themeData.m_part == TKP_TRACKVERT) {
             ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
             ::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH));
-        } else if ((o->style().appearance() == SliderThumbHorizontalPart ||
-                    o->style().appearance() == SliderThumbVerticalPart) && 
-                   (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP || 
-                    themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
+        } else if ((o.style().appearance() == SliderThumbHorizontalPart
+        || o.style().appearance() == SliderThumbVerticalPart)
+        && (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP
+        || themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
             ::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
             if (themeData.m_state == TUS_DISABLED) {
                 static WORD patternBits[8] = {0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55};
@@ -710,7 +710,7 @@ static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme,
             }
         } else {
             // Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists.
-            if (o->style().appearance() == DefaultButtonPart) {
+            if (o.style().appearance() == DefaultButtonPart) {
                 HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW);
                 ::FrameRect(hdc, &widgetRect, brush);
                 ::InflateRect(&widgetRect, -1, -1);
@@ -724,7 +724,7 @@ static void drawControl(GraphicsContext* context, RenderObject* o, HANDLE theme,
         DIBPixelData::setRGBABitmapAlpha(windowsContext.hdc(), r, 255);
 }
 
-bool RenderThemeWin::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintButton(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {  
     drawControl(i.context,  o, buttonTheme(), getThemeData(o), r);
     return false;
@@ -739,7 +739,7 @@ void RenderThemeWin::adjustInnerSpinButtonStyle(StyleResolver* styleResolver, Re
     style->setMinWidth(Length(width, Fixed));
 }
 
-bool RenderThemeWin::paintInnerSpinButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintInnerSpinButton(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {
     // We split the specified rectangle into two vertically. We can't draw a
     // spin button of which height is less than 2px.
@@ -771,19 +771,19 @@ void RenderThemeWin::setCheckboxSize(RenderStyle* style) const
         style->setHeight(Length(13, Fixed));
 }
 
-bool RenderThemeWin::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintTextField(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {
     drawControl(i.context,  o, textFieldTheme(), getThemeData(o), r);
     return false;
 }
 
-bool RenderThemeWin::paintMenuList(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeWin::paintMenuList(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     HANDLE theme;
     int part;
     if (haveTheme && (windowsVersion() >= WindowsVista)) {
         theme = menuListTheme();
-        if (renderer->frame().settings().applicationChromeMode())
+        if (renderer.frame().settings().applicationChromeMode())
             part = CP_READONLY;
         else
             part = CP_BORDER;
@@ -792,7 +792,7 @@ bool RenderThemeWin::paintMenuList(RenderObject* renderer, const PaintInfo& pain
         part = TFP_TEXTFIELD;
     }
 
-    drawControl(paintInfo.context,  renderer, theme, ThemeData(part, determineState(renderer)), rect);
+    drawControl(paintInfo.context, renderer, theme, ThemeData(part, determineState(renderer)), rect);
     
     return paintMenuListButtonDecorations(renderer, paintInfo, rect);
 }
@@ -834,7 +834,7 @@ void RenderThemeWin::adjustMenuListButtonStyle(StyleResolver* styleResolver, Ren
     style->setWhiteSpace(PRE);
 }
 
-bool RenderThemeWin::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeWin::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     // FIXME: Don't make hardcoded assumptions about the thickness of the textfield border.
     int borderThickness = haveTheme ? 1 : 2;
@@ -843,7 +843,7 @@ bool RenderThemeWin::paintMenuListButtonDecorations(RenderObject* renderer, cons
     // leaving space for the text field's 1px border
     IntRect buttonRect(rect);
     buttonRect.inflate(-borderThickness);
-    if (renderer->style().direction() == LTR)
+    if (renderer.style().direction() == LTR)
         buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
     buttonRect.setWidth(dropDownButtonWidth);
 
@@ -861,14 +861,14 @@ bool RenderThemeWin::paintMenuListButtonDecorations(RenderObject* renderer, cons
 
 const int trackWidth = 4;
 
-bool RenderThemeWin::paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintSliderTrack(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {
     IntRect bounds = r;
     
-    if (o->style().appearance() ==  SliderHorizontalPart) {
+    if (o.style().appearance() ==  SliderHorizontalPart) {
         bounds.setHeight(trackWidth);
         bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
-    } else if (o->style().appearance() == SliderVerticalPart) {
+    } else if (o.style().appearance() == SliderVerticalPart) {
         bounds.setWidth(trackWidth);
         bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
     }
@@ -877,7 +877,7 @@ bool RenderThemeWin::paintSliderTrack(RenderObject* o, const PaintInfo& i, const
     return false;
 }
 
-bool RenderThemeWin::paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintSliderThumb(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {   
     drawControl(i.context,  o, sliderTheme(), getThemeData(o), r);
     return false;
@@ -902,7 +902,7 @@ void RenderThemeWin::adjustSliderThumbSize(RenderStyle* style, Element*) const
 #endif
 }
 
-bool RenderThemeWin::paintSearchField(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintSearchField(const RenderObject& o, const PaintInfo& i, const IntRect& r)
 {
     return paintTextField(o, i, r);
 }
@@ -919,14 +919,14 @@ void RenderThemeWin::adjustSearchFieldStyle(StyleResolver* styleResolver, Render
         style->setOutlineOffset(-2);
 }
 
-bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWin::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     IntRect bounds = r;
-    ASSERT(o->parent());
-    if (!o->parent() || !o->parent()->isBox())
+    ASSERT(o.parent());
+    if (!o.parent() || !o.parent()->isBox())
         return false;
     
-    RenderBox* parentRenderBox = toRenderBox(o->parent());
+    RenderBox* parentRenderBox = toRenderBox(o.parent());
 
     IntRect parentBox = parentRenderBox->absoluteContentBox();
     
@@ -940,7 +940,7 @@ bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
 
     static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
     static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
-    paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o->style().colorSpace(), bounds);
+    paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o.style().colorSpace(), bounds);
     return false;
 }
 
@@ -970,14 +970,14 @@ void RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle(StyleResolver*,
     style->setHeight(Length(magnifierSize, Fixed));
 }
 
-bool RenderThemeWin::paintSearchFieldResultsDecorationPart(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWin::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     IntRect bounds = r;
-    ASSERT(o->parent());
-    if (!o->parent() || !o->parent()->isBox())
+    ASSERT(o.parent());
+    if (!o.parent() || !o.parent()->isBox())
         return false;
     
-    RenderBox* parentRenderBox = toRenderBox(o->parent());
+    RenderBox* parentRenderBox = toRenderBox(o.parent());
     IntRect parentBox = parentRenderBox->absoluteContentBox();
     
     // Make sure the scaled decoration stays square and will fit in its parent's box
@@ -989,7 +989,7 @@ bool RenderThemeWin::paintSearchFieldResultsDecorationPart(RenderObject* o, cons
     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
     
     static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
-    paintInfo.context->drawImage(magnifierImage, o->style().colorSpace(), bounds);
+    paintInfo.context->drawImage(magnifierImage, o.style().colorSpace(), bounds);
     return false;
 }
 
@@ -1004,16 +1004,16 @@ void RenderThemeWin::adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderS
     style->setHeight(Length(magnifierHeight, Fixed));
 }
 
-bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeWin::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     IntRect bounds = r;
-    ASSERT(o->parent());
-    if (!o->parent())
+    ASSERT(o.parent());
+    if (!o.parent())
         return false;
-    if (!o->parent() || !o->parent()->isBox())
+    if (!o.parent() || !o.parent()->isBox())
         return false;
     
-    RenderBox* parentRenderBox = toRenderBox(o->parent());
+    RenderBox* parentRenderBox = toRenderBox(o.parent());
     IntRect parentBox = parentRenderBox->absoluteContentBox();
     
     // Make sure the scaled decoration will fit in its parent's box
@@ -1025,7 +1025,7 @@ bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintI
     bounds.setY(parentBox.y() + (parentBox.height() - bounds.height() + 1) / 2);
 
     static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
-    paintInfo.context->drawImage(magnifierImage, o->style().colorSpace(), bounds);
+    paintInfo.context->drawImage(magnifierImage, o.style().colorSpace(), bounds);
     return false;
 }
 
@@ -1177,12 +1177,12 @@ IntSize RenderThemeWin::meterSizeForBounds(const RenderMeter*, const IntRect& bo
     return bounds.size();
 }
 
-bool RenderThemeWin::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeWin::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    if (!renderObject->isMeter())
+    if (!renderObject.isMeter())
         return true;
 
-    HTMLMeterElement* element = toRenderMeter(renderObject)->meterElement();
+    HTMLMeterElement* element = toRenderMeter(&renderObject)->meterElement();
 
     ThemeData theme = getThemeData(renderObject);
 
index 179cf30..f51426d 100644 (file)
@@ -66,51 +66,51 @@ public:
     virtual void systemFont(CSSValueID, FontDescription&) const;
     virtual Color systemColor(CSSValueID) const;
 
-    virtual bool paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r)
+    virtual bool paintCheckbox(const RenderObject& o, const PaintInfo& i, const IntRect& r)
     { return paintButton(o, i, r); }
     virtual void setCheckboxSize(RenderStyle*) const;
 
-    virtual bool paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& r)
+    virtual bool paintRadio(const RenderObject& o, const PaintInfo& i, const IntRect& r)
     { return paintButton(o, i, r); }
     virtual void setRadioSize(RenderStyle* style) const
     { return setCheckboxSize(style); }
 
-    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
-    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
 
-    virtual bool paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& r)
+    virtual bool paintTextArea(const RenderObject& o, const PaintInfo& i, const IntRect& r)
     { return paintTextField(o, i, r); }
 
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
 
-    virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
-    virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
+    virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&);
     virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
 
     virtual bool popupOptionSupportsTextIndent() const { return true; }
 
     virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldDecorationPart(RenderObject*, const PaintInfo&, const IntRect&) { return false; }
+    virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return false; }
 
     virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsDecorationPart(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintSearchFieldResultsButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&);
 
     virtual void themeChanged();
 
@@ -133,7 +133,7 @@ public:
     virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const override;
     virtual bool supportsMeter(ControlPart) const override;
     virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const override;
-    virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) override;
+    virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override;
 #endif
 
     virtual bool shouldShowPlaceholderWhenFocused() const { return true; }
@@ -151,16 +151,16 @@ private:
     void addIntrinsicMargins(RenderStyle*) const;
     void close();
 
-    unsigned determineState(RenderObject*);
-    unsigned determineClassicState(RenderObject*, ControlSubPart = None);
-    unsigned determineSliderThumbState(RenderObject*);
-    unsigned determineButtonState(RenderObject*);
-    unsigned determineSpinButtonState(RenderObject*, ControlSubPart = None);
+    unsigned determineState(const RenderObject&);
+    unsigned determineClassicState(const RenderObject&, ControlSubPart = None);
+    unsigned determineSliderThumbState(const RenderObject&);
+    unsigned determineButtonState(const RenderObject&);
+    unsigned determineSpinButtonState(const RenderObject&, ControlSubPart = None);
 
     bool supportsFocus(ControlPart) const;
 
-    ThemeData getThemeData(RenderObject*, ControlSubPart = None);
-    ThemeData getClassicThemeData(RenderObject* o, ControlSubPart = None);
+    ThemeData getThemeData(const RenderObject&, ControlSubPart = None);
+    ThemeData getClassicThemeData(const RenderObject&, ControlSubPart = None);
 
     HANDLE buttonTheme() const;
     HANDLE textFieldTheme() const;