Changeset 167755 in webkit
- Timestamp:
- Apr 24, 2014 7:27:54 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167752 r167755 1 2014-04-24 Zalan Bujtas <zalan@apple.com> 2 3 Transition RenderTheme API from RenderObject* to const RenderObject& 4 https://bugs.webkit.org/show_bug.cgi?id=132037 5 6 Reviewed by Andreas Kling. 7 8 Using const references provides better encapsulation and improve security. 9 10 No change in behavior. 11 12 * accessibility/AccessibilityObject.cpp: 13 (WebCore::AccessibilityObject::boundingBoxForQuads): 14 * dom/Element.cpp: 15 (WebCore::Element::setActive): 16 (WebCore::Element::setHovered): 17 * editing/FrameSelection.cpp: 18 (WebCore::FrameSelection::focusedOrActiveStateChanged): 19 * html/HTMLFormControlElement.cpp: 20 (WebCore::HTMLFormControlElement::disabledStateChanged): 21 (WebCore::HTMLFormControlElement::readOnlyAttributeChanged): 22 * html/HTMLInputElement.cpp: 23 (WebCore::HTMLInputElement::setChecked): 24 (WebCore::HTMLInputElement::setIndeterminate): 25 * html/HTMLOptionElement.cpp: 26 (WebCore::HTMLOptionElement::parseAttribute): 27 * rendering/RenderBlock.cpp: 28 (WebCore::RenderBlock::addVisualOverflowFromTheme): 29 (WebCore::RenderBlock::baselinePosition): 30 * rendering/RenderBox.cpp: 31 (WebCore::RenderBox::paintBoxDecorations): 32 * rendering/RenderButton.cpp: 33 (WebCore::RenderButton::styleDidChange): 34 * rendering/RenderFileUploadControl.cpp: 35 (WebCore::RenderFileUploadControl::paintObject): 36 * rendering/RenderFlowThread.cpp: 37 (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme): 38 * rendering/RenderObject.cpp: 39 (WebCore::RenderObject::drawLineForBoxSide): 40 * rendering/RenderObject.h: 41 * rendering/RenderProgress.cpp: 42 (WebCore::RenderProgress::computeLogicalHeight): 43 * rendering/RenderTextControlSingleLine.cpp: 44 (WebCore::RenderTextControlSingleLine::paint): 45 * rendering/RenderTheme.cpp: 46 (WebCore::RenderTheme::paint): 47 (WebCore::RenderTheme::paintBorderOnly): 48 (WebCore::RenderTheme::paintDecorations): 49 (WebCore::RenderTheme::baselinePosition): 50 (WebCore::RenderTheme::adjustRepaintRect): 51 (WebCore::RenderTheme::stateChanged): 52 (WebCore::RenderTheme::updateControlStatesForRenderer): 53 (WebCore::RenderTheme::extractControlStatesForRenderer): 54 (WebCore::RenderTheme::isActive): 55 (WebCore::RenderTheme::isChecked): 56 (WebCore::RenderTheme::isIndeterminate): 57 (WebCore::RenderTheme::isEnabled): 58 (WebCore::RenderTheme::isFocused): 59 (WebCore::RenderTheme::isPressed): 60 (WebCore::RenderTheme::isSpinUpButtonPartPressed): 61 (WebCore::RenderTheme::isReadOnlyControl): 62 (WebCore::RenderTheme::isHovered): 63 (WebCore::RenderTheme::isSpinUpButtonPartHovered): 64 (WebCore::RenderTheme::isDefault): 65 (WebCore::RenderTheme::paintInputFieldSpeechButton): 66 (WebCore::RenderTheme::paintMeter): 67 (WebCore::RenderTheme::paintSliderTicks): 68 (WebCore::RenderTheme::progressBarRectForBounds): 69 * rendering/RenderTheme.h: 70 (WebCore::RenderTheme::controlSupportsTints): 71 (WebCore::RenderTheme::paintCapsLockIndicator): 72 (WebCore::RenderTheme::paintFileUploadIconDecorations): 73 (WebCore::RenderTheme::imageControlsButtonSize): 74 (WebCore::RenderTheme::paintCheckbox): 75 (WebCore::RenderTheme::paintRadio): 76 (WebCore::RenderTheme::paintButton): 77 (WebCore::RenderTheme::paintInnerSpinButton): 78 (WebCore::RenderTheme::paintCheckboxDecorations): 79 (WebCore::RenderTheme::paintRadioDecorations): 80 (WebCore::RenderTheme::paintButtonDecorations): 81 (WebCore::RenderTheme::paintTextField): 82 (WebCore::RenderTheme::paintTextFieldDecorations): 83 (WebCore::RenderTheme::paintTextArea): 84 (WebCore::RenderTheme::paintTextAreaDecorations): 85 (WebCore::RenderTheme::paintMenuList): 86 (WebCore::RenderTheme::paintMenuListDecorations): 87 (WebCore::RenderTheme::paintMenuListButtonDecorations): 88 (WebCore::RenderTheme::paintPushButtonDecorations): 89 (WebCore::RenderTheme::paintSquareButtonDecorations): 90 (WebCore::RenderTheme::paintProgressBar): 91 (WebCore::RenderTheme::paintSliderTrack): 92 (WebCore::RenderTheme::paintSliderThumb): 93 (WebCore::RenderTheme::paintSliderThumbDecorations): 94 (WebCore::RenderTheme::paintSearchField): 95 (WebCore::RenderTheme::paintSearchFieldDecorations): 96 (WebCore::RenderTheme::paintSearchFieldCancelButton): 97 (WebCore::RenderTheme::paintSearchFieldDecorationPart): 98 (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart): 99 (WebCore::RenderTheme::paintSearchFieldResultsButton): 100 (WebCore::RenderTheme::paintMediaFullscreenButton): 101 (WebCore::RenderTheme::paintMediaPlayButton): 102 (WebCore::RenderTheme::paintMediaOverlayPlayButton): 103 (WebCore::RenderTheme::paintMediaMuteButton): 104 (WebCore::RenderTheme::paintMediaSeekBackButton): 105 (WebCore::RenderTheme::paintMediaSeekForwardButton): 106 (WebCore::RenderTheme::paintMediaSliderTrack): 107 (WebCore::RenderTheme::paintMediaSliderThumb): 108 (WebCore::RenderTheme::paintMediaVolumeSliderContainer): 109 (WebCore::RenderTheme::paintMediaVolumeSliderTrack): 110 (WebCore::RenderTheme::paintMediaVolumeSliderThumb): 111 (WebCore::RenderTheme::paintMediaRewindButton): 112 (WebCore::RenderTheme::paintMediaReturnToRealtimeButton): 113 (WebCore::RenderTheme::paintMediaToggleClosedCaptionsButton): 114 (WebCore::RenderTheme::paintMediaControlsBackground): 115 (WebCore::RenderTheme::paintMediaCurrentTime): 116 (WebCore::RenderTheme::paintMediaTimeRemaining): 117 (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderTrack): 118 (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderThumb): 119 (WebCore::RenderTheme::paintSnapshottedPluginOverlay): 120 (WebCore::RenderTheme::paintImageControlsButton): 121 * rendering/RenderThemeIOS.h: 122 * rendering/RenderThemeIOS.mm: 123 (WebCore::RenderThemeIOS::addRoundedBorderClip): 124 (WebCore::RenderThemeIOS::paintCheckboxDecorations): 125 (WebCore::RenderThemeIOS::baselinePosition): 126 (WebCore::RenderThemeIOS::paintRadioDecorations): 127 (WebCore::RenderThemeIOS::paintTextFieldDecorations): 128 (WebCore::RenderThemeIOS::paintTextAreaDecorations): 129 (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): 130 (WebCore::RenderThemeIOS::paintSliderTrack): 131 (WebCore::RenderThemeIOS::paintSliderThumbDecorations): 132 (WebCore::RenderThemeIOS::paintProgressBar): 133 (WebCore::RenderThemeIOS::paintSearchFieldDecorations): 134 (WebCore::RenderThemeIOS::paintButtonDecorations): 135 (WebCore::RenderThemeIOS::paintPushButtonDecorations): 136 (WebCore::RenderThemeIOS::paintFileUploadIconDecorations): 137 * rendering/RenderThemeMac.h: 138 (WebCore::RenderThemeMac::updateActiveState): 139 * rendering/RenderThemeMac.mm: 140 (WebCore::RenderThemeMac::documentViewFor): 141 (WebCore::RenderThemeMac::adjustRepaintRect): 142 (WebCore::RenderThemeMac::convertToPaintingRect): 143 (WebCore::RenderThemeMac::updateCheckedState): 144 (WebCore::RenderThemeMac::updateEnabledState): 145 (WebCore::RenderThemeMac::updateFocusedState): 146 (WebCore::RenderThemeMac::updatePressedState): 147 (WebCore::RenderThemeMac::controlSupportsTints): 148 (WebCore::RenderThemeMac::paintTextField): 149 (WebCore::RenderThemeMac::paintCapsLockIndicator): 150 (WebCore::RenderThemeMac::paintTextArea): 151 (WebCore::RenderThemeMac::paintMenuList): 152 (WebCore::RenderThemeMac::paintMeter): 153 (WebCore::RenderThemeMac::progressBarRectForBounds): 154 (WebCore::RenderThemeMac::paintProgressBar): 155 (WebCore::RenderThemeMac::paintMenuListButtonGradients): 156 (WebCore::RenderThemeMac::paintMenuListButtonDecorations): 157 (WebCore::RenderThemeMac::setPopupButtonCellState): 158 (WebCore::RenderThemeMac::paintSliderTrack): 159 (WebCore::RenderThemeMac::paintSliderThumb): 160 (WebCore::RenderThemeMac::paintSearchField): 161 (WebCore::RenderThemeMac::setSearchCellState): 162 (WebCore::RenderThemeMac::paintSearchFieldCancelButton): 163 (WebCore::RenderThemeMac::paintSearchFieldDecorationPart): 164 (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart): 165 (WebCore::RenderThemeMac::paintSearchFieldResultsButton): 166 (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay): 167 (WebCore::RenderThemeMac::paintImageControlsButton): 168 (WebCore::RenderThemeMac::imageControlsButtonSize): 169 1 170 2014-04-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 171 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r167210 r167755 712 712 if (!r.isEmpty()) { 713 713 if (obj->style().hasAppearance()) 714 obj->theme().adjustRepaintRect( obj, r);714 obj->theme().adjustRepaintRect(*obj, r); 715 715 result.unite(r); 716 716 } -
trunk/Source/WebCore/dom/Element.cpp
r167631 r167755 489 489 setNeedsStyleRecalc(); 490 490 491 if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged( renderer(), ControlStates::PressedState))491 if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::PressedState)) 492 492 reactsToPress = true; 493 493 … … 555 555 556 556 if (renderer()->style().hasAppearance()) 557 renderer()->theme().stateChanged( renderer(), ControlStates::HoverState);557 renderer()->theme().stateChanged(*renderer(), ControlStates::HoverState); 558 558 } 559 559 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r166457 r167755 1750 1750 if (RenderObject* renderer = element->renderer()) 1751 1751 if (renderer && renderer->style().hasAppearance()) 1752 renderer->theme().stateChanged( renderer, ControlStates::FocusState);1752 renderer->theme().stateChanged(*renderer, ControlStates::FocusState); 1753 1753 } 1754 1754 #endif -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r166853 r167755 156 156 didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled); 157 157 if (renderer() && renderer()->style().hasAppearance()) 158 renderer()->theme().stateChanged( renderer(), ControlStates::EnabledState);158 renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState); 159 159 } 160 160 … … 164 164 setNeedsStyleRecalc(); 165 165 if (renderer() && renderer()->style().hasAppearance()) 166 renderer()->theme().stateChanged( renderer(), ControlStates::ReadOnlyState);166 renderer()->theme().stateChanged(*renderer(), ControlStates::ReadOnlyState); 167 167 } 168 168 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r166491 r167755 859 859 buttons->updateCheckedState(this); 860 860 if (renderer() && renderer()->style().hasAppearance()) 861 renderer()->theme().stateChanged( renderer(), ControlStates::CheckedState);861 renderer()->theme().stateChanged(*renderer(), ControlStates::CheckedState); 862 862 setNeedsValidityCheck(); 863 863 … … 893 893 894 894 if (renderer() && renderer()->style().hasAppearance()) 895 renderer()->theme().stateChanged( renderer(), ControlStates::CheckedState);895 renderer()->theme().stateChanged(*renderer(), ControlStates::CheckedState); 896 896 } 897 897 -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r166422 r167755 196 196 didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled); 197 197 if (renderer() && renderer()->style().hasAppearance()) 198 renderer()->theme().stateChanged( renderer(), ControlStates::EnabledState);198 renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState); 199 199 } 200 200 } else if (name == selectedAttr) { -
trunk/Source/WebCore/html/shadow/MediaControlElementTypes.h
r165676 r167755 76 76 77 77 HTMLMediaElement* parentMediaElement(Node*); 78 inline HTMLMediaElement* parentMediaElement( RenderObject& renderer) { return parentMediaElement(renderer.node()); }78 inline HTMLMediaElement* parentMediaElement(const RenderObject& renderer) { return parentMediaElement(renderer.node()); } 79 79 80 80 MediaControlElementType mediaControlElementType(Node*); -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp
r166872 r167755 300 300 } 301 301 302 void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, RenderObject*object, FormType type, const IntRect& rect)302 void RenderThemeEfl::applyEdjeRTLState(Evas_Object* edje, const RenderObject& object, FormType type, const IntRect& rect) 303 303 { 304 304 if (type == SliderVertical || type == SliderHorizontal) { 305 if (!object ->isSlider())305 if (!object.isSlider()) 306 306 return; // probably have -webkit-appearance: slider.. 307 307 308 RenderSlider* renderSlider = toRenderSlider(object);308 const RenderSlider* renderSlider = toRenderSlider(&object); 309 309 HTMLInputElement& input = renderSlider->element(); 310 310 double valueRange = input.maximum() - input.minimum(); … … 317 317 // sliders, it should always be the same and will not be affected by 318 318 // text direction settings. 319 if (object ->style().direction() == RTL || type == SliderVertical)319 if (object.style().direction() == RTL || type == SliderVertical) 320 320 msg->val[0] = 1; 321 321 else … … 326 326 #if ENABLE(PROGRESS_ELEMENT) 327 327 } else if (type == ProgressBar) { 328 RenderProgress* renderProgress = toRenderProgress(object);328 const RenderProgress* renderProgress = toRenderProgress(&object); 329 329 330 330 int max = rect.width(); … … 334 334 msg->count = 2; 335 335 336 if (object ->style().direction() == RTL)336 if (object.style().direction() == RTL) 337 337 msg->val[0] = (1.0 - value) * max; 338 338 else … … 351 351 } 352 352 353 bool RenderThemeEfl::paintThemePart( RenderObject*object, FormType type, const PaintInfo& info, const IntRect& rect)353 bool RenderThemeEfl::paintThemePart(const RenderObject& object, FormType type, const PaintInfo& info, const IntRect& rect) 354 354 { 355 355 loadThemeIfNeeded(); … … 360 360 return false; 361 361 362 bool haveBackgroundColor = isControlStyled(&object ->style(), object->style().border(), *object->style().backgroundLayers(), Color::white);362 bool haveBackgroundColor = isControlStyled(&object.style(), object.style().border(), *object.style().backgroundLayers(), Color::white); 363 363 ControlStates states(extractControlStatesForRenderer(object)); 364 364 applyEdjeStateFromForm(entry->edje(), &states, haveBackgroundColor); … … 632 632 } 633 633 634 bool RenderThemeEfl::controlSupportsTints(const RenderObject *object) const634 bool RenderThemeEfl::controlSupportsTints(const RenderObject& object) const 635 635 { 636 636 return isEnabled(object); 637 637 } 638 638 639 int RenderThemeEfl::baselinePosition(const RenderObject *object) const640 { 641 if (!object ->isBox())639 int RenderThemeEfl::baselinePosition(const RenderObject& object) const 640 { 641 if (!object.isBox()) 642 642 return 0; 643 643 644 if (object ->style().appearance() == CheckboxPart645 || object ->style().appearance() == RadioPart)646 return toRenderBox( object)->marginTop() + toRenderBox(object)->height() - 3;644 if (object.style().appearance() == CheckboxPart 645 || object.style().appearance() == RadioPart) 646 return toRenderBox(&object)->marginTop() + toRenderBox(&object)->height() - 3; 647 647 648 648 return RenderTheme::baselinePosition(object); … … 685 685 } 686 686 687 bool RenderThemeEfl::paintSliderTrack( RenderObject*object, const PaintInfo& info, const IntRect& rect)688 { 689 if (object ->style().appearance() == SliderHorizontalPart)687 bool RenderThemeEfl::paintSliderTrack(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 688 { 689 if (object.style().appearance() == SliderHorizontalPart) 690 690 paintThemePart(object, SliderHorizontal, info, rect); 691 691 else … … 756 756 } 757 757 758 bool RenderThemeEfl::paintSliderThumb( RenderObject*object, const PaintInfo& info, const IntRect& rect)759 { 760 if (object ->style().appearance() == SliderThumbHorizontalPart)758 bool RenderThemeEfl::paintSliderThumb(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 759 { 760 if (object.style().appearance() == SliderThumbHorizontalPart) 761 761 paintThemePart(object, SliderThumbHorizontal, info, rect); 762 762 else … … 784 784 } 785 785 786 bool RenderThemeEfl::paintCheckbox( RenderObject*object, const PaintInfo& info, const IntRect& rect)786 bool RenderThemeEfl::paintCheckbox(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 787 787 { 788 788 return paintThemePart(object, CheckBox, info, rect); … … 807 807 } 808 808 809 bool RenderThemeEfl::paintRadio( RenderObject*object, const PaintInfo& info, const IntRect& rect)809 bool RenderThemeEfl::paintRadio(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 810 810 { 811 811 return paintThemePart(object, RadioButton, info, rect); … … 824 824 } 825 825 826 bool RenderThemeEfl::paintButton( RenderObject*object, const PaintInfo& info, const IntRect& rect)826 bool RenderThemeEfl::paintButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 827 827 { 828 828 return paintThemePart(object, Button, info, rect); … … 842 842 } 843 843 844 bool RenderThemeEfl::paintMenuList( RenderObject*object, const PaintInfo& info, const IntRect& rect)844 bool RenderThemeEfl::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 845 845 { 846 846 return paintThemePart(object, ComboBox, info, rect); … … 863 863 } 864 864 865 bool RenderThemeEfl::paintMenuListButtonDecorations( RenderObject*object, const PaintInfo& info, const IntRect& rect)865 bool RenderThemeEfl::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 866 866 { 867 867 return paintMenuList(object, info, rect); … … 878 878 } 879 879 880 bool RenderThemeEfl::paintTextField( RenderObject*object, const PaintInfo& info, const IntRect& rect)880 bool RenderThemeEfl::paintTextField(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 881 881 { 882 882 return paintThemePart(object, TextField, info, rect); … … 887 887 } 888 888 889 bool RenderThemeEfl::paintTextArea( RenderObject*object, const PaintInfo& info, const IntRect& rect)889 bool RenderThemeEfl::paintTextArea(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 890 890 { 891 891 return paintTextField(object, info, rect); … … 909 909 } 910 910 911 bool RenderThemeEfl::paintSearchFieldResultsButton( RenderObject*object, const PaintInfo& info, const IntRect& rect)911 bool RenderThemeEfl::paintSearchFieldResultsButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 912 912 { 913 913 return paintThemePart(object, SearchFieldResultsButton, info, rect); … … 931 931 } 932 932 933 bool RenderThemeEfl::paintSearchFieldResultsDecorationPart( RenderObject*object, const PaintInfo& info, const IntRect& rect)933 bool RenderThemeEfl::paintSearchFieldResultsDecorationPart(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 934 934 { 935 935 return paintThemePart(object, SearchFieldResultsDecoration, info, rect); … … 955 955 } 956 956 957 bool RenderThemeEfl::paintSearchFieldCancelButton( RenderObject*object, const PaintInfo& info, const IntRect& rect)957 bool RenderThemeEfl::paintSearchFieldCancelButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 958 958 { 959 959 return paintThemePart(object, SearchFieldCancelButton, info, rect); … … 971 971 } 972 972 973 bool RenderThemeEfl::paintSearchField( RenderObject*object, const PaintInfo& info, const IntRect& rect)973 bool RenderThemeEfl::paintSearchField(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 974 974 { 975 975 return paintThemePart(object, SearchField, info, rect); … … 985 985 } 986 986 987 bool RenderThemeEfl::paintInnerSpinButton( RenderObject*object, const PaintInfo& info, const IntRect& rect)987 bool RenderThemeEfl::paintInnerSpinButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 988 988 { 989 989 return paintThemePart(object, Spinner, info, rect); … … 1023 1023 } 1024 1024 1025 bool RenderThemeEfl::paintProgressBar( RenderObject*object, const PaintInfo& info, const IntRect& rect)1026 { 1027 if (!object ->isProgress())1025 bool RenderThemeEfl::paintProgressBar(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 1026 { 1027 if (!object.isProgress()) 1028 1028 return true; 1029 1029 -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.h
r166872 r167755 79 79 80 80 // A method asking if the control changes its tint when the window has focus or not. 81 virtual bool controlSupportsTints(const RenderObject *) const;81 virtual bool controlSupportsTints(const RenderObject&) const; 82 82 83 83 // A general method asking if any control tinting is supported at all. … … 90 90 // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of 91 91 // controls that need to do this. 92 virtual int baselinePosition(const RenderObject *) const;92 virtual int baselinePosition(const RenderObject&) const; 93 93 94 94 virtual Color platformActiveSelectionBackgroundColor() const; … … 112 112 113 113 virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const; 114 virtual bool paintCheckbox( RenderObject*, const PaintInfo&, const IntRect&);114 virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&); 115 115 116 116 virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const; 117 virtual bool paintRadio( RenderObject*, const PaintInfo&, const IntRect&);117 virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&); 118 118 119 119 virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 120 virtual bool paintButton( RenderObject*, const PaintInfo&, const IntRect&);120 virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&); 121 121 122 122 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 123 virtual bool paintTextField( RenderObject*, const PaintInfo&, const IntRect&);123 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&); 124 124 125 125 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const; 126 virtual bool paintTextArea( RenderObject*, const PaintInfo&, const IntRect&);126 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&); 127 127 128 128 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const; 129 virtual bool paintMenuList( RenderObject*, const PaintInfo&, const IntRect&);129 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&); 130 130 131 131 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 132 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&);132 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&); 133 133 134 134 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 135 virtual bool paintSearchFieldResultsDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);135 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 136 136 137 137 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 138 virtual bool paintSearchField( RenderObject*, const PaintInfo&, const IntRect&);138 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&); 139 139 140 140 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 141 virtual bool paintSearchFieldResultsButton( RenderObject*, const PaintInfo&, const IntRect&);141 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&); 142 142 143 143 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 144 virtual bool paintSearchFieldCancelButton( RenderObject*, const PaintInfo&, const IntRect&);144 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&); 145 145 146 146 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const; 147 virtual bool paintSliderTrack( RenderObject*, const PaintInfo&, const IntRect&);147 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 148 148 149 149 virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const; … … 159 159 virtual bool supportsDataListUI(const AtomicString&) const override; 160 160 161 virtual bool paintSliderThumb( RenderObject*, const PaintInfo&, const IntRect&);161 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 162 162 163 163 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 164 virtual bool paintInnerSpinButton( RenderObject*, const PaintInfo&, const IntRect&);164 virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&); 165 165 166 166 static void setDefaultFontSize(int fontsize); … … 168 168 #if ENABLE(PROGRESS_ELEMENT) 169 169 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const; 170 virtual bool paintProgressBar( RenderObject*, const PaintInfo&, const IntRect&);170 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&); 171 171 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const; 172 172 virtual double animationDurationForProgressBar(RenderProgress*) const; … … 201 201 202 202 void applyEdjeStateFromForm(Evas_Object*, const ControlStates*, bool); 203 void applyEdjeRTLState(Evas_Object*, RenderObject*, FormType, const IntRect&);204 bool paintThemePart( RenderObject*, FormType, const PaintInfo&, const IntRect&);203 void applyEdjeRTLState(Evas_Object*, const RenderObject&, FormType, const IntRect&); 204 bool paintThemePart(const RenderObject&, FormType, const PaintInfo&, const IntRect&); 205 205 206 206 Page* m_page; -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
r167170 r167755 66 66 67 67 #if ENABLE(VIDEO) 68 static HTMLMediaElement* getMediaElementFromRenderObject( RenderObject*o)69 { 70 Node* node = o ->node();68 static HTMLMediaElement* getMediaElementFromRenderObject(const RenderObject& o) 69 { 70 Node* node = o.node(); 71 71 Node* mediaNode = node ? node->shadowHost() : 0; 72 72 if (!mediaNode) … … 174 174 } 175 175 176 bool RenderThemeGtk::controlSupportsTints(const RenderObject *o) const176 bool RenderThemeGtk::controlSupportsTints(const RenderObject& o) const 177 177 { 178 178 return isEnabled(o); 179 179 } 180 180 181 int RenderThemeGtk::baselinePosition(const RenderObject *o) const182 { 183 if (!o ->isBox())181 int RenderThemeGtk::baselinePosition(const RenderObject& o) const 182 { 183 if (!o.isBox()) 184 184 return 0; 185 185 186 186 // FIXME: This strategy is possibly incorrect for the GTK+ port. 187 if (o ->style().appearance() == CheckboxPart188 || o ->style().appearance() == RadioPart) {189 const RenderBox* box = toRenderBox( o);187 if (o.style().appearance() == CheckboxPart 188 || o.style().appearance() == RadioPart) { 189 const RenderBox* box = toRenderBox(&o); 190 190 return box->marginTop() + box->height() - 2; 191 191 } … … 209 209 } 210 210 211 static GtkStateType gtkIconState(RenderTheme* theme, RenderObject*renderObject)211 static GtkStateType gtkIconState(RenderTheme* theme, const RenderObject& renderObject) 212 212 { 213 213 if (!theme->isEnabled(renderObject)) … … 242 242 } 243 243 244 bool RenderThemeGtk::paintMenuListButtonDecorations( RenderObject*object, const PaintInfo& info, const IntRect& rect)244 bool RenderThemeGtk::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 245 245 { 246 246 return paintMenuList(object, info, rect); 247 247 } 248 248 249 bool RenderThemeGtk::paintTextArea( RenderObject*o, const PaintInfo& i, const IntRect& r)249 bool RenderThemeGtk::paintTextArea(const RenderObject& o, const PaintInfo& i, const IntRect& r) 250 250 { 251 251 return paintTextField(o, i, r); … … 299 299 } 300 300 301 bool RenderThemeGtk::paintSearchFieldResultsButton( RenderObject*o, const PaintInfo& i, const IntRect& rect)301 bool RenderThemeGtk::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& i, const IntRect& rect) 302 302 { 303 303 return paintSearchFieldResultsDecorationPart(o, i, rect); … … 327 327 } 328 328 329 static IntRect centerRectVerticallyInParentInputElement( RenderObject*renderObject, const IntRect& rect)329 static IntRect centerRectVerticallyInParentInputElement(const RenderObject& renderObject, const IntRect& rect) 330 330 { 331 331 // Get the renderer of <input> element. 332 Node* input = renderObject ->node()->shadowHost();332 Node* input = renderObject.node()->shadowHost(); 333 333 if (!input) 334 input = renderObject ->node();334 input = renderObject.node(); 335 335 if (!input->renderer()->isBox()) 336 336 return IntRect(); … … 347 347 } 348 348 349 bool RenderThemeGtk::paintSearchFieldResultsDecorationPart( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)349 bool RenderThemeGtk::paintSearchFieldResultsDecorationPart(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 350 350 { 351 351 IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect); … … 354 354 355 355 GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_FIND, 356 gtkTextDirection(renderObject->style().direction()),357 358 356 gtkTextDirection(renderObject.style().direction()), 357 gtkIconState(this, renderObject), 358 getIconSizeForPixelSize(rect.height())); 359 359 paintGdkPixbuf(paintInfo.context, icon.get(), iconRect); 360 360 return false; … … 366 366 } 367 367 368 bool RenderThemeGtk::paintSearchFieldCancelButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)368 bool RenderThemeGtk::paintSearchFieldCancelButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 369 369 { 370 370 IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect); … … 373 373 374 374 GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CLEAR, 375 gtkTextDirection(renderObject->style().direction()),376 377 375 gtkTextDirection(renderObject.style().direction()), 376 gtkIconState(this, renderObject), 377 getIconSizeForPixelSize(rect.height())); 378 378 paintGdkPixbuf(paintInfo.context, icon.get(), iconRect); 379 379 return false; … … 387 387 } 388 388 389 bool RenderThemeGtk::paintSearchField( RenderObject*o, const PaintInfo& i, const IntRect& rect)389 bool RenderThemeGtk::paintSearchField(const RenderObject& o, const PaintInfo& i, const IntRect& rect) 390 390 { 391 391 return paintTextField(o, i, rect); 392 392 } 393 393 394 bool RenderThemeGtk::paintCapsLockIndicator( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)394 bool RenderThemeGtk::paintCapsLockIndicator(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 395 395 { 396 396 // The other paint methods don't need to check whether painting is disabled because RenderTheme already checks it … … 400 400 401 401 int iconSize = std::min(rect.width(), rect.height()); 402 GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING, 403 gtkTextDirection(renderObject->style().direction()), 404 0, getIconSizeForPixelSize(iconSize)); 402 GRefPtr<GdkPixbuf> icon = getStockIconForWidgetType(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING, gtkTextDirection(renderObject.style().direction()), 0, getIconSizeForPixelSize(iconSize)); 405 403 406 404 // Only re-scale the icon when it's smaller than the minimum icon size. … … 506 504 #endif 507 505 508 bool RenderThemeGtk::paintMediaButton( RenderObject*renderObject, GraphicsContext* context, const IntRect& rect, const char* symbolicIconName, const char* fallbackStockIconName)506 bool RenderThemeGtk::paintMediaButton(const RenderObject& renderObject, GraphicsContext* context, const IntRect& rect, const char* symbolicIconName, const char* fallbackStockIconName) 509 507 { 510 508 IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2, … … 512 510 m_mediaIconSize, m_mediaIconSize); 513 511 GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, symbolicIconName, fallbackStockIconName, 514 gtkTextDirection(renderObject ->style().direction()), gtkIconState(this, renderObject), iconRect.width());512 gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width()); 515 513 paintGdkPixbuf(context, icon.get(), iconRect); 516 514 return true; … … 522 520 } 523 521 524 bool RenderThemeGtk::paintMediaFullscreenButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)522 bool RenderThemeGtk::paintMediaFullscreenButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 525 523 { 526 524 return paintMediaButton(renderObject, paintInfo.context, rect, "view-fullscreen-symbolic", GTK_STOCK_FULLSCREEN); 527 525 } 528 526 529 bool RenderThemeGtk::paintMediaMuteButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)527 bool RenderThemeGtk::paintMediaMuteButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 530 528 { 531 529 HTMLMediaElement* mediaElement = getMediaElementFromRenderObject(renderObject); … … 539 537 } 540 538 541 bool RenderThemeGtk::paintMediaPlayButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)542 { 543 Node* node = renderObject ->node();539 bool RenderThemeGtk::paintMediaPlayButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 540 { 541 Node* node = renderObject.node(); 544 542 if (!node) 545 543 return false; … … 554 552 } 555 553 556 bool RenderThemeGtk::paintMediaSeekBackButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)554 bool RenderThemeGtk::paintMediaSeekBackButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 557 555 { 558 556 return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-backward-symbolic", GTK_STOCK_MEDIA_REWIND); 559 557 } 560 558 561 bool RenderThemeGtk::paintMediaSeekForwardButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)559 bool RenderThemeGtk::paintMediaSeekForwardButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 562 560 { 563 561 return paintMediaButton(renderObject, paintInfo.context, rect, "media-seek-forward-symbolic", GTK_STOCK_MEDIA_FORWARD); … … 565 563 566 564 #if ENABLE(VIDEO_TRACK) 567 bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)565 bool RenderThemeGtk::paintMediaToggleClosedCaptionsButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 568 566 { 569 567 IntRect iconRect(rect.x() + (rect.width() - m_mediaIconSize) / 2, rect.y() + (rect.height() - m_mediaIconSize) / 2, 570 568 m_mediaIconSize, m_mediaIconSize); 571 569 GRefPtr<GdkPixbuf> icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, "media-view-subtitles-symbolic", nullptr, 572 gtkTextDirection(renderObject ->style().direction()), gtkIconState(this, renderObject), iconRect.width());570 gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width()); 573 571 if (!icon) 574 572 icon = getStockSymbolicIconForWidgetType(GTK_TYPE_CONTAINER, "user-invisible-symbolic", GTK_STOCK_JUSTIFY_FILL, 575 gtkTextDirection(renderObject ->style().direction()), gtkIconState(this, renderObject), iconRect.width());573 gtkTextDirection(renderObject.style().direction()), gtkIconState(this, renderObject), iconRect.width()); 576 574 paintGdkPixbuf(paintInfo.context, icon.get(), iconRect); 577 575 return true; … … 588 586 } 589 587 590 bool RenderThemeGtk::paintMediaSliderTrack( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)591 { 592 HTMLMediaElement* mediaElement = parentMediaElement( *o);588 bool RenderThemeGtk::paintMediaSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 589 { 590 HTMLMediaElement* mediaElement = parentMediaElement(o); 593 591 if (!mediaElement) 594 592 return false; … … 600 598 float mediaDuration = mediaElement->duration(); 601 599 float totalTrackWidth = r.width(); 602 RenderStyle* style = &o ->style();600 RenderStyle* style = &o.style(); 603 601 RefPtr<TimeRanges> timeRanges = mediaElement->buffered(); 604 602 for (unsigned index = 0; index < timeRanges->length(); ++index) { … … 621 619 } 622 620 623 bool RenderThemeGtk::paintMediaSliderThumb( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)624 { 625 RenderStyle* style = &o ->style();621 bool RenderThemeGtk::paintMediaSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 622 { 623 RenderStyle* style = &o.style(); 626 624 paintInfo.context->fillRoundedRect(FloatRoundedRect(r, borderRadiiFromStyle(style)), style->visitedDependentColor(CSSPropertyColor), style->colorSpace()); 627 625 return false; 628 626 } 629 627 630 bool RenderThemeGtk::paintMediaVolumeSliderContainer( RenderObject*, const PaintInfo&, const IntRect&)628 bool RenderThemeGtk::paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&) 631 629 { 632 630 return true; 633 631 } 634 632 635 bool RenderThemeGtk::paintMediaVolumeSliderTrack( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)636 { 637 HTMLMediaElement* mediaElement = parentMediaElement( *renderObject);633 bool RenderThemeGtk::paintMediaVolumeSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 634 { 635 HTMLMediaElement* mediaElement = parentMediaElement(renderObject); 638 636 if (!mediaElement) 639 637 return true; … … 649 647 int rectHeight = rect.height(); 650 648 float trackHeight = rectHeight * volume; 651 RenderStyle* style = &renderObject ->style();649 RenderStyle* style = &renderObject.style(); 652 650 IntRect volumeRect(rect); 653 651 volumeRect.move(0, rectHeight - trackHeight); … … 661 659 } 662 660 663 bool RenderThemeGtk::paintMediaVolumeSliderThumb( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)661 bool RenderThemeGtk::paintMediaVolumeSliderThumb(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 664 662 { 665 663 return paintMediaSliderThumb(renderObject, paintInfo, rect); … … 671 669 } 672 670 673 bool RenderThemeGtk::paintMediaCurrentTime( RenderObject*, const PaintInfo&, const IntRect&)671 bool RenderThemeGtk::paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&) 674 672 { 675 673 return false; … … 697 695 } 698 696 699 IntRect RenderThemeGtk::calculateProgressRect( RenderObject*renderObject, const IntRect& fullBarRect)697 IntRect RenderThemeGtk::calculateProgressRect(const RenderObject& renderObject, const IntRect& fullBarRect) 700 698 { 701 699 IntRect progressRect(fullBarRect); 702 RenderProgress* renderProgress = toRenderProgress(renderObject);700 const RenderProgress* renderProgress = toRenderProgress(&renderObject); 703 701 if (renderProgress->isDeterminate()) { 704 702 int progressWidth = progressRect.width() * renderProgress->position(); 705 if (renderObject ->style().direction() == RTL)703 if (renderObject.style().direction() == RTL) 706 704 progressRect.setX(progressRect.x() + progressRect.width() - progressWidth); 707 705 progressRect.setWidth(progressWidth); -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h
r165688 r167755 51 51 52 52 // A method asking if the control changes its tint when the window has focus or not. 53 virtual bool controlSupportsTints(const RenderObject *) const;53 virtual bool controlSupportsTints(const RenderObject&) const; 54 54 55 55 // A general method asking if any control tinting is supported at all. 56 56 virtual bool supportsControlTints() const { return true; } 57 57 58 virtual void adjustRepaintRect(const RenderObject *, IntRect&);58 virtual void adjustRepaintRect(const RenderObject&, IntRect&); 59 59 60 60 // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline 61 61 // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of 62 62 // controls that need to do this. 63 virtual int baselinePosition(const RenderObject *) const;63 virtual int baselinePosition(const RenderObject&) const; 64 64 65 65 // The platform selection color. … … 115 115 116 116 protected: 117 virtual bool paintCheckbox( RenderObject* o, const PaintInfo& i, const IntRect& r);117 virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&); 118 118 virtual void setCheckboxSize(RenderStyle* style) const; 119 119 120 virtual bool paintRadio( RenderObject* o, const PaintInfo& i, const IntRect& r);120 virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&); 121 121 virtual void setRadioSize(RenderStyle* style) const; 122 122 123 123 virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 124 virtual bool paintButton( RenderObject*, const PaintInfo&, const IntRect&);125 126 virtual bool paintTextField( RenderObject*, const PaintInfo&, const IntRect&);127 virtual bool paintTextArea( RenderObject*, const PaintInfo&, const IntRect&);124 virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&); 125 126 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&); 127 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&); 128 128 129 129 int popupInternalPaddingLeft(RenderStyle*) const; … … 138 138 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const; 139 139 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 140 virtual bool paintMenuList( RenderObject*, const PaintInfo&, const IntRect&);141 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&);140 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&); 141 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&); 142 142 143 143 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 144 virtual bool paintSearchFieldResultsDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);144 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 145 145 146 146 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 147 virtual bool paintSearchField( RenderObject*, const PaintInfo&, const IntRect&);147 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&); 148 148 149 149 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 150 virtual bool paintSearchFieldResultsButton( RenderObject*, const PaintInfo&, const IntRect&);150 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&); 151 151 152 152 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 153 virtual bool paintSearchFieldCancelButton( RenderObject*, const PaintInfo&, const IntRect&);154 155 virtual bool paintSliderTrack( RenderObject*, const PaintInfo&, const IntRect&);153 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&); 154 155 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 156 156 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const; 157 157 158 virtual bool paintSliderThumb( RenderObject*, const PaintInfo&, const IntRect&);158 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 159 159 virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const; 160 160 … … 165 165 void initMediaButtons(); 166 166 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const; 167 virtual bool paintMediaFullscreenButton( RenderObject*, const PaintInfo&, const IntRect&);168 virtual bool paintMediaPlayButton( RenderObject*, const PaintInfo&, const IntRect&);169 virtual bool paintMediaMuteButton( RenderObject*, const PaintInfo&, const IntRect&);170 virtual bool paintMediaSeekBackButton( RenderObject*, const PaintInfo&, const IntRect&);171 virtual bool paintMediaSeekForwardButton( RenderObject*, const PaintInfo&, const IntRect&);172 virtual bool paintMediaSliderTrack( RenderObject*, const PaintInfo&, const IntRect&);173 virtual bool paintMediaSliderThumb( RenderObject*, const PaintInfo&, const IntRect&);174 virtual bool paintMediaVolumeSliderContainer( RenderObject*, const PaintInfo&, const IntRect&);175 virtual bool paintMediaVolumeSliderTrack( RenderObject*, const PaintInfo&, const IntRect&);176 virtual bool paintMediaVolumeSliderThumb( RenderObject*, const PaintInfo&, const IntRect&);177 virtual bool paintMediaCurrentTime( RenderObject*, const PaintInfo&, const IntRect&);167 virtual bool paintMediaFullscreenButton(const RenderObject&, const PaintInfo&, const IntRect&); 168 virtual bool paintMediaPlayButton(const RenderObject&, const PaintInfo&, const IntRect&); 169 virtual bool paintMediaMuteButton(const RenderObject&, const PaintInfo&, const IntRect&); 170 virtual bool paintMediaSeekBackButton(const RenderObject&, const PaintInfo&, const IntRect&); 171 virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&); 172 virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 173 virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 174 virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&); 175 virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 176 virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 177 virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&); 178 178 #if ENABLE(VIDEO_TRACK) 179 virtual bool paintMediaToggleClosedCaptionsButton( RenderObject*, const PaintInfo&, const IntRect&);179 virtual bool paintMediaToggleClosedCaptionsButton(const RenderObject&, const PaintInfo&, const IntRect&); 180 180 #endif 181 181 #endif … … 185 185 virtual double animationDurationForProgressBar(RenderProgress*) const; 186 186 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const; 187 virtual bool paintProgressBar( RenderObject*, const PaintInfo&, const IntRect&);188 #endif 189 190 virtual bool paintCapsLockIndicator( RenderObject*, const PaintInfo&, const IntRect&);187 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&); 188 #endif 189 190 virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&); 191 191 192 192 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 193 virtual bool paintInnerSpinButton( RenderObject*, const PaintInfo&, const IntRect&);193 virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&); 194 194 195 195 private: … … 201 201 202 202 #if ENABLE(VIDEO) 203 bool paintMediaButton( RenderObject*, GraphicsContext*, const IntRect&, const char* symbolicIconName, const char* fallbackStockIconName);203 bool paintMediaButton(const RenderObject&, GraphicsContext*, const IntRect&, const char* symbolicIconName, const char* fallbackStockIconName); 204 204 #endif 205 205 206 206 #if ENABLE(PROGRESS_ELEMENT) 207 static IntRect calculateProgressRect( RenderObject*, const IntRect&);207 static IntRect calculateProgressRect(const RenderObject&, const IntRect&); 208 208 #endif 209 209 -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
r165688 r167755 111 111 } 112 112 113 void RenderThemeGtk::adjustRepaintRect(const RenderObject *renderObject, IntRect& rect)114 { 115 ControlPart part = renderObject ->style().appearance();113 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect) 114 { 115 ControlPart part = renderObject.style().appearance(); 116 116 switch (part) { 117 117 case CheckboxPart: … … 132 132 } 133 133 134 static GtkStateType getGtkStateType(RenderThemeGtk* theme, RenderObject*object)134 static GtkStateType getGtkStateType(RenderThemeGtk* theme, const RenderObject& object) 135 135 { 136 136 if (!theme->isEnabled(object) || theme->isReadOnlyControl(object)) … … 157 157 } 158 158 159 static void paintToggle(RenderThemeGtk* theme, RenderObject*renderObject, const PaintInfo& info, const IntRect& rect, GtkWidget* widget)159 static void paintToggle(RenderThemeGtk* theme, const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect, GtkWidget* widget) 160 160 { 161 161 // We do not call gtk_toggle_button_set_active here, because some themes begin a series of … … 164 164 // 'active' property) to determine whether or not to draw the check. 165 165 gtk_widget_set_sensitive(widget, theme->isEnabled(renderObject) && !theme->isReadOnlyControl(renderObject)); 166 gtk_widget_set_direction(widget, gtkTextDirection(renderObject ->style().direction()));166 gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction())); 167 167 168 168 bool indeterminate = theme->isIndeterminate(renderObject); … … 199 199 } 200 200 201 bool RenderThemeGtk::paintCheckbox( RenderObject*renderObject, const PaintInfo& info, const IntRect& rect)201 bool RenderThemeGtk::paintCheckbox(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect) 202 202 { 203 203 paintToggle(this, renderObject, info, rect, gtkCheckButton()); … … 210 210 } 211 211 212 bool RenderThemeGtk::paintRadio( RenderObject*renderObject, const PaintInfo& info, const IntRect& rect)212 bool RenderThemeGtk::paintRadio(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect) 213 213 { 214 214 paintToggle(this, renderObject, info, rect, gtkRadioButton()); … … 228 228 } 229 229 230 bool RenderThemeGtk::paintButton( RenderObject*object, const PaintInfo& info, const IntRect& rect)230 bool RenderThemeGtk::paintButton(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 231 231 { 232 232 if (info.context->paintingDisabled()) … … 239 239 GtkStateType state = getGtkStateType(this, object); 240 240 gtk_widget_set_state(widget, state); 241 gtk_widget_set_direction(widget, gtkTextDirection(object ->style().direction()));241 gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction())); 242 242 243 243 if (isFocused(object)) { … … 366 366 } 367 367 368 bool RenderThemeGtk::paintMenuList( RenderObject*object, const PaintInfo& info, const IntRect& rect)368 bool RenderThemeGtk::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 369 369 { 370 370 if (paintButton(object, info, rect)) … … 379 379 int leftBorder = 0, rightBorder = 0, bottomBorder = 0, topBorder = 0; 380 380 getButtonInnerBorder(gtkComboBoxButton(), leftBorder, topBorder, rightBorder, bottomBorder); 381 RenderStyle* style = &object ->style();381 RenderStyle* style = &object.style(); 382 382 int arrowSize = comboBoxArrowSize(style); 383 383 GtkStyle* buttonStyle = gtk_widget_get_style(gtkComboBoxButton()); … … 423 423 } 424 424 425 bool RenderThemeGtk::paintTextField( RenderObject*renderObject, const PaintInfo& info, const IntRect& rect)425 bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& info, const IntRect& rect) 426 426 { 427 427 GtkWidget* widget = gtkEntry(); … … 430 430 GtkStateType backgroundState = enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE; 431 431 gtk_widget_set_sensitive(widget, enabled); 432 gtk_widget_set_direction(widget, gtkTextDirection(renderObject ->style().direction()));432 gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction())); 433 433 setWidgetHasFocus(widget, isFocused(renderObject)); 434 434 … … 466 466 } 467 467 468 bool RenderThemeGtk::paintSliderTrack( RenderObject*object, const PaintInfo& info, const IntRect& rect)468 bool RenderThemeGtk::paintSliderTrack(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 469 469 { 470 470 if (info.context->paintingDisabled()) 471 471 return false; 472 472 473 ControlPart part = object ->style().appearance();473 ControlPart part = object.style().appearance(); 474 474 ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart); 475 475 … … 484 484 troughRect.inflateY(-gtk_widget_get_style(widget)->ythickness); 485 485 } 486 gtk_widget_set_direction(widget, gtkTextDirection(object ->style().direction()));486 gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction())); 487 487 488 488 WidgetRenderingContext widgetContext(info.context, rect); … … 494 494 } 495 495 496 bool RenderThemeGtk::paintSliderThumb( RenderObject*object, const PaintInfo& info, const IntRect& rect)496 bool RenderThemeGtk::paintSliderThumb(const RenderObject& object, const PaintInfo& info, const IntRect& rect) 497 497 { 498 498 if (info.context->paintingDisabled()) 499 499 return false; 500 500 501 ControlPart part = object ->style().appearance();501 ControlPart part = object.style().appearance(); 502 502 ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart); 503 503 … … 514 514 orientation = GTK_ORIENTATION_VERTICAL; 515 515 } 516 gtk_widget_set_direction(widget, gtkTextDirection(object ->style().direction()));516 gtk_widget_set_direction(widget, gtkTextDirection(object.style().direction())); 517 517 518 518 // Only some themes have slider thumbs respond to clicks and some don't. This information is … … 550 550 551 551 #if ENABLE(PROGRESS_ELEMENT) 552 bool RenderThemeGtk::paintProgressBar( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)552 bool RenderThemeGtk::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 553 553 { 554 554 GtkWidget* widget = gtkProgressBar(); 555 gtk_widget_set_direction(widget, gtkTextDirection(renderObject ->style().direction()));555 gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction())); 556 556 557 557 WidgetRenderingContext widgetContext(paintInfo.context, rect); … … 587 587 } 588 588 589 bool RenderThemeGtk::paintInnerSpinButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)589 bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 590 590 { 591 591 // We expand the painted area by 2 pixels on the top and bottom and 2 pixels on the right. This … … 598 598 WidgetRenderingContext widgetContext(paintInfo.context, expandedRect); 599 599 GtkWidget* widget = gtkSpinButton(); 600 gtk_widget_set_direction(widget, gtkTextDirection(renderObject ->style().direction()));600 gtk_widget_set_direction(widget, gtkTextDirection(renderObject.style().direction())); 601 601 602 602 IntRect fullSpinButtonRect(IntPoint(), expandedRect.size()); -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
r165607 r167755 158 158 } 159 159 160 void RenderThemeGtk::adjustRepaintRect(const RenderObject *renderObject, IntRect& rect)160 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect) 161 161 { 162 162 GtkStyleContext* context = 0; 163 163 bool checkInteriorFocus = false; 164 ControlPart part = renderObject ->style().appearance();164 ControlPart part = renderObject.style().appearance(); 165 165 switch (part) { 166 166 case CheckboxPart: … … 221 221 } 222 222 223 static void paintToggle(const RenderThemeGtk* theme, GType widgetType, RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& fullRect)223 static void paintToggle(const RenderThemeGtk* theme, GType widgetType, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& fullRect) 224 224 { 225 225 GtkStyleContext* context = getStyleContext(widgetType); … … 243 243 } 244 244 245 gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject ->style().direction())));245 gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()))); 246 246 gtk_style_context_add_class(context, widgetType == GTK_TYPE_CHECK_BUTTON ? GTK_STYLE_CLASS_CHECK : GTK_STYLE_CLASS_RADIO); 247 247 … … 281 281 } 282 282 283 bool RenderThemeGtk::paintCheckbox( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)283 bool RenderThemeGtk::paintCheckbox(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 284 284 { 285 285 paintToggle(this, GTK_TYPE_CHECK_BUTTON, renderObject, paintInfo, rect); … … 292 292 } 293 293 294 bool RenderThemeGtk::paintRadio( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)294 bool RenderThemeGtk::paintRadio(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 295 295 { 296 296 paintToggle(this, GTK_TYPE_RADIO_BUTTON, renderObject, paintInfo, rect); … … 298 298 } 299 299 300 static void renderButton(RenderTheme* theme, GtkStyleContext* context, RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)300 static void renderButton(RenderTheme* theme, GtkStyleContext* context, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 301 301 { 302 302 IntRect buttonRect(rect); … … 364 364 } 365 365 } 366 bool RenderThemeGtk::paintButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)366 bool RenderThemeGtk::paintButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 367 367 { 368 368 GtkStyleContext* context = getStyleContext(GTK_TYPE_BUTTON); 369 369 gtk_style_context_save(context); 370 370 371 gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject ->style().direction())));371 gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()))); 372 372 gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); 373 373 … … 465 465 } 466 466 467 bool RenderThemeGtk::paintMenuList( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)467 bool RenderThemeGtk::paintMenuList(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 468 468 { 469 469 cairo_t* cairoContext = paintInfo.context->platformContext()->cr(); 470 GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject ->style().direction()));470 GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())); 471 471 472 472 // Paint the button. … … 596 596 } 597 597 598 bool RenderThemeGtk::paintTextField( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)598 bool RenderThemeGtk::paintTextField(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 599 599 { 600 600 GtkStyleContext* context = getStyleContext(GTK_TYPE_ENTRY); 601 601 gtk_style_context_save(context); 602 602 603 gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject ->style().direction())));603 gtk_style_context_set_direction(context, static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()))); 604 604 gtk_style_context_add_class(context, GTK_STYLE_CLASS_ENTRY); 605 605 … … 644 644 } 645 645 646 bool RenderThemeGtk::paintSliderTrack( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)647 { 648 ControlPart part = renderObject ->style().appearance();646 bool RenderThemeGtk::paintSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 647 { 648 ControlPart part = renderObject.style().appearance(); 649 649 ASSERT_UNUSED(part, part == SliderHorizontalPart || part == SliderVerticalPart || part == MediaVolumeSliderPart); 650 650 … … 652 652 gtk_style_context_save(context); 653 653 654 gtk_style_context_set_direction(context, gtkTextDirection(renderObject ->style().direction()));654 gtk_style_context_set_direction(context, gtkTextDirection(renderObject.style().direction())); 655 655 applySliderStyleContextClasses(context, part); 656 656 gtk_style_context_add_class(context, GTK_STYLE_CLASS_TROUGH); … … 679 679 } 680 680 681 bool RenderThemeGtk::paintSliderThumb( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)682 { 683 ControlPart part = renderObject ->style().appearance();681 bool RenderThemeGtk::paintSliderThumb(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 682 { 683 ControlPart part = renderObject.style().appearance(); 684 684 ASSERT(part == SliderThumbHorizontalPart || part == SliderThumbVerticalPart || part == MediaVolumeSliderThumbPart); 685 685 … … 687 687 gtk_style_context_save(context); 688 688 689 gtk_style_context_set_direction(context, gtkTextDirection(renderObject ->style().direction()));689 gtk_style_context_set_direction(context, gtkTextDirection(renderObject.style().direction())); 690 690 applySliderStyleContextClasses(context, part); 691 691 gtk_style_context_add_class(context, GTK_STYLE_CLASS_SLIDER); … … 730 730 731 731 #if ENABLE(PROGRESS_ELEMENT) 732 bool RenderThemeGtk::paintProgressBar( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)733 { 734 if (!renderObject ->isProgress())732 bool RenderThemeGtk::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 733 { 734 if (!renderObject.isProgress()) 735 735 return true; 736 736 … … 787 787 } 788 788 789 static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect, GtkArrowType arrowType)789 static void paintSpinArrowButton(RenderTheme* theme, GtkStyleContext* context, const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect, GtkArrowType arrowType) 790 790 { 791 791 ASSERT(arrowType == GTK_ARROW_UP || arrowType == GTK_ARROW_DOWN); … … 853 853 } 854 854 855 bool RenderThemeGtk::paintInnerSpinButton( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)855 bool RenderThemeGtk::paintInnerSpinButton(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 856 856 { 857 857 GtkStyleContext* context = getStyleContext(GTK_TYPE_SPIN_BUTTON); 858 858 gtk_style_context_save(context); 859 859 860 GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject ->style().direction()));860 GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction())); 861 861 gtk_style_context_set_direction(context, direction); 862 862 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r167723 r167755 1439 1439 1440 1440 IntRect inflatedRect = pixelSnappedBorderBoxRect(); 1441 theme().adjustRepaintRect( this, inflatedRect);1441 theme().adjustRepaintRect(*this, inflatedRect); 1442 1442 addVisualOverflow(inflatedRect); 1443 1443 … … 4295 4295 // FIXME: Need to patch form controls to deal with vertical lines. 4296 4296 if (style().hasAppearance() && !theme().isControlContainer(style().appearance())) 4297 return theme().baselinePosition( this);4297 return theme().baselinePosition(*this); 4298 4298 4299 4299 // CSS2.1 states that the baseline of an inline block is the baseline of the last line box in -
trunk/Source/WebCore/rendering/RenderBox.cpp
r167727 r167755 1228 1228 } 1229 1229 1230 bool themePainted = style().hasAppearance() && !theme().paint( this, controlStates, paintInfo, snappedPaintRect);1230 bool themePainted = style().hasAppearance() && !theme().paint(*this, controlStates, paintInfo, snappedPaintRect); 1231 1231 1232 1232 if (controlStates && controlStates->needsRepaint()) … … 1240 1240 1241 1241 if (style().hasAppearance()) 1242 theme().paintDecorations( this, paintInfo, snappedPaintRect);1242 theme().paintDecorations(*this, paintInfo, snappedPaintRect); 1243 1243 } 1244 1244 paintBoxShadow(paintInfo, paintRect, style(), Inset); 1245 1245 1246 1246 // The theme will tell us whether or not we should also paint the CSS border. 1247 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly( this, paintInfo, snappedPaintRect))) && style().hasBorder())1247 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, snappedPaintRect))) && style().hasBorder()) 1248 1248 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); 1249 1249 -
trunk/Source/WebCore/rendering/RenderButton.cpp
r166489 r167755 113 113 setupInnerStyle(&m_inner->style()); 114 114 115 if (!m_default && theme().isDefault( this)) {115 if (!m_default && theme().isDefault(*this)) { 116 116 if (!m_timer) 117 117 m_timer = std::make_unique<Timer<RenderButton>>(this, &RenderButton::timerFired); 118 118 m_timer->startRepeating(0.03); 119 119 m_default = true; 120 } else if (m_default && !theme().isDefault( this)) {120 } else if (m_default && !theme().isDefault(*this)) { 121 121 m_default = false; 122 122 m_timer = nullptr; -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r164441 r167755 183 183 IntRect iconRect(iconX, iconY, iconWidth, iconHeight); 184 184 RenderTheme::FileUploadDecorations decorationsType = inputElement().files()->length() == 1 ? RenderTheme::SingleFile : RenderTheme::MultipleFiles; 185 theme().paintFileUploadIconDecorations( this,buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType);185 theme().paintFileUploadIconDecorations(*this, *buttonRenderer, paintInfo, iconRect, inputElement().icon(), decorationsType); 186 186 } 187 187 #else -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r167723 r167755 1279 1279 1280 1280 IntRect inflatedRect = pixelSnappedIntRect(borderBox); 1281 block->theme().adjustRepaintRect( block, inflatedRect);1281 block->theme().adjustRepaintRect(*block, inflatedRect); 1282 1282 1283 1283 region->addVisualOverflowForBox(block, inflatedRect); -
trunk/Source/WebCore/rendering/RenderMediaControls.cpp
r160625 r167755 71 71 #if PLATFORM(WIN) && USE(CG) 72 72 73 static WKMediaControllerThemeState determineState( RenderObject*o)73 static WKMediaControllerThemeState determineState(const RenderObject& o) 74 74 { 75 75 int result = 0; 76 const RenderTheme& theme = o ->theme();76 const RenderTheme& theme = o.theme(); 77 77 if (!theme.isEnabled(o) || theme.isReadOnlyControl(o)) 78 78 result |= WKMediaControllerFlagDisabled; … … 85 85 86 86 // Utility to scale when the UI part are not scaled by wkDrawMediaUIPart 87 static FloatRect getUnzoomedRectAndAdjustCurrentContext( RenderObject*o, const PaintInfo& paintInfo, const IntRect &originalRect)88 { 89 float zoomLevel = o ->style().effectiveZoom();87 static FloatRect getUnzoomedRectAndAdjustCurrentContext(const RenderObject& o, const PaintInfo& paintInfo, const IntRect &originalRect) 88 { 89 float zoomLevel = o.style().effectiveZoom(); 90 90 FloatRect unzoomedRect(originalRect); 91 91 if (zoomLevel != 1.0f) { … … 127 127 } 128 128 129 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)129 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 130 130 { 131 131 GraphicsContextStateSaver stateSaver(*paintInfo.context); … … 134 134 case MediaEnterFullscreenButton: 135 135 case MediaExitFullscreenButton: 136 if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o ->node())) {136 if (MediaControlFullscreenButtonElement* btn = static_cast<MediaControlFullscreenButtonElement*>(o.node())) { 137 137 bool enterButton = btn->displayType() == MediaEnterFullscreenButton; 138 138 wkDrawMediaUIPart(enterButton ? WKMediaUIPartFullscreenButton : WKMediaUIPartExitFullscreenButton, paintInfo.context->platformContext(), r, determineState(o)); … … 141 141 case MediaShowClosedCaptionsButton: 142 142 case MediaHideClosedCaptionsButton: 143 if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o ->node())) {143 if (MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaControlToggleClosedCaptionsButtonElement*>(o.node())) { 144 144 bool captionsVisible = btn->displayType() == MediaHideClosedCaptionsButton; 145 145 wkDrawMediaUIPart(captionsVisible ? WKMediaUIPartHideClosedCaptionsButton : WKMediaUIPartShowClosedCaptionsButton, paintInfo.context->platformContext(), r, determineState(o)); … … 148 148 case MediaMuteButton: 149 149 case MediaUnMuteButton: 150 if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o ->node())) {150 if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonElement*>(o.node())) { 151 151 bool audioEnabled = btn->displayType() == MediaMuteButton; 152 152 wkDrawMediaUIPart(audioEnabled ? WKMediaUIPartMuteButton : WKMediaUIPartUnMuteButton, paintInfo.context->platformContext(), r, determineState(o)); … … 155 155 case MediaPauseButton: 156 156 case MediaPlayButton: 157 if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o ->node())) {157 if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonElement*>(o.node())) { 158 158 bool canPlay = btn->displayType() == MediaPlayButton; 159 159 wkDrawMediaUIPart(canPlay ? WKMediaUIPartPlayButton : WKMediaUIPartPauseButton, paintInfo.context->platformContext(), r, determineState(o)); … … 173 173 break; 174 174 case MediaSlider: { 175 if (HTMLMediaElement* mediaElement = parentMediaElement( *o)) {175 if (HTMLMediaElement* mediaElement = parentMediaElement(o)) { 176 176 FloatRect unzoomedRect = getUnzoomedRectAndAdjustCurrentContext(o, paintInfo, r); 177 177 wkDrawMediaSliderTrack(paintInfo.context->platformContext(), unzoomedRect, mediaElement->percentLoaded() * mediaElement->duration(), mediaElement->currentTime(), mediaElement->duration(), determineState(o)); -
trunk/Source/WebCore/rendering/RenderMediaControls.h
r127300 r167755 46 46 47 47 #if PLATFORM(WIN) 48 static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);48 static bool paintMediaControlsPart(MediaControlElementType, const RenderObject&, const PaintInfo&, const IntRect&); 49 49 static void adjustMediaSliderThumbSize(RenderStyle*); 50 50 #endif -
trunk/Source/WebCore/rendering/RenderObject.cpp
r167714 r167755 726 726 727 727 void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, float x1, float y1, float x2, float y2, 728 BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias) 728 BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias) const 729 729 { 730 730 float deviceScaleFactor = document().deviceScaleFactor(); -
trunk/Source/WebCore/rendering/RenderObject.h
r167652 r167755 880 880 RespectImageOrientationEnum shouldRespectImageOrientation() const; 881 881 882 void drawLineForBoxSide(GraphicsContext*, float x1, float y1, float x2, float y2, BoxSide, Color, EBorderStyle, float adjbw1, float adjbw2, bool antialias = false) ;882 void drawLineForBoxSide(GraphicsContext*, float x1, float y1, float x2, float y2, BoxSide, Color, EBorderStyle, float adjbw1, float adjbw2, bool antialias = false) const; 883 883 protected: 884 884 void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*); -
trunk/Source/WebCore/rendering/RenderProgress.cpp
r163560 r167755 68 68 else 69 69 frame.setWidth(computedValues.m_extent); 70 IntSize frameSize = theme().progressBarRectForBounds( this, pixelSnappedIntRect(frame)).size();70 IntSize frameSize = theme().progressBarRectForBounds(*this, pixelSnappedIntRect(frame)).size(); 71 71 computedValues.m_extent = isHorizontalWritingMode() ? frameSize.height() : frameSize.width(); 72 72 } -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r165686 r167755 85 85 // Convert the rect into the coords used for painting the content 86 86 contentsRect.moveBy(paintOffset + location()); 87 theme().paintCapsLockIndicator( this, paintInfo, pixelSnappedIntRect(contentsRect));87 theme().paintCapsLockIndicator(*this, paintInfo, pixelSnappedIntRect(contentsRect)); 88 88 } 89 89 } -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r166424 r167755 264 264 } 265 265 266 bool RenderTheme::paint( RenderObject*o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r)266 bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r) 267 267 { 268 268 // If painting is disabled, but we aren't updating control tints, then just bail. … … 271 271 if (paintInfo.context->updatingControlTints()) { 272 272 if (controlSupportsTints(o)) 273 o ->repaint();273 o.repaint(); 274 274 return false; 275 275 } … … 277 277 return false; 278 278 279 ControlPart part = o ->style().appearance();279 ControlPart part = o.style().appearance(); 280 280 281 281 #if USE(NEW_THEME) … … 289 289 case InnerSpinButtonPart: 290 290 updateControlStatesForRenderer(o, controlStates); 291 m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o ->style().effectiveZoom(), &o->view().frameView());291 m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o.style().effectiveZoom(), &o.view().frameView()); 292 292 return false; 293 293 default: … … 406 406 } 407 407 408 bool RenderTheme::paintBorderOnly( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)408 bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 409 409 { 410 410 if (paintInfo.context->paintingDisabled()) … … 413 413 #if PLATFORM(IOS) 414 414 UNUSED_PARAM(r); 415 return o ->style().appearance() != NoControlPart;415 return o.style().appearance() != NoControlPart; 416 416 #else 417 417 // Call the appropriate paint method based off the appearance value. 418 switch (o ->style().appearance()) {418 switch (o.style().appearance()) { 419 419 case TextFieldPart: 420 420 return paintTextField(o, paintInfo, r); … … 464 464 } 465 465 466 bool RenderTheme::paintDecorations( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)466 bool RenderTheme::paintDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 467 467 { 468 468 if (paintInfo.context->paintingDisabled()) … … 470 470 471 471 // Call the appropriate paint method based off the appearance value. 472 switch (renderer ->style().appearance()) {472 switch (renderer.style().appearance()) { 473 473 case MenulistButtonPart: 474 474 return paintMenuListButtonDecorations(renderer, paintInfo, rect); … … 667 667 } 668 668 669 int RenderTheme::baselinePosition(const RenderObject *o) const670 { 671 if (!o ->isBox())669 int RenderTheme::baselinePosition(const RenderObject& o) const 670 { 671 if (!o.isBox()) 672 672 return 0; 673 673 674 const RenderBox * box = toRenderBox(o);674 const RenderBox& box = *toRenderBox(&o); 675 675 676 676 #if USE(NEW_THEME) 677 return box ->height() + box->marginTop() + m_theme->baselinePositionAdjustment(o->style().appearance()) * o->style().effectiveZoom();677 return box.height() + box.marginTop() + m_theme->baselinePositionAdjustment(o.style().appearance()) * o.style().effectiveZoom(); 678 678 #else 679 return box ->height() + box->marginTop();679 return box.height() + box.marginTop(); 680 680 #endif 681 681 } … … 715 715 } 716 716 717 void RenderTheme::adjustRepaintRect(const RenderObject *o, IntRect& r)717 void RenderTheme::adjustRepaintRect(const RenderObject& o, IntRect& r) 718 718 { 719 719 #if USE(NEW_THEME) 720 720 ControlStates states(extractControlStatesForRenderer(o)); 721 m_theme->inflateControlPaintRect(o ->style().appearance(), &states, r, o->style().effectiveZoom());721 m_theme->inflateControlPaintRect(o.style().appearance(), &states, r, o.style().effectiveZoom()); 722 722 #else 723 723 UNUSED_PARAM(o); … … 731 731 } 732 732 733 bool RenderTheme::stateChanged( RenderObject*o, ControlStates::States state) const733 bool RenderTheme::stateChanged(const RenderObject& o, ControlStates::States state) const 734 734 { 735 735 // Default implementation assumes the controls don't respond to changes in :hover state 736 if (state == ControlStates::HoverState && !supportsHover(&o ->style()))736 if (state == ControlStates::HoverState && !supportsHover(&o.style())) 737 737 return false; 738 738 … … 742 742 743 743 // Repaint the control. 744 o ->repaint();744 o.repaint(); 745 745 return true; 746 746 } 747 747 748 void RenderTheme::updateControlStatesForRenderer(const RenderObject *o, ControlStates* controlStates) const748 void RenderTheme::updateControlStatesForRenderer(const RenderObject& o, ControlStates* controlStates) const 749 749 { 750 750 ControlStates newStates = extractControlStatesForRenderer(o); … … 752 752 } 753 753 754 ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderObject *o) const754 ControlStates::States RenderTheme::extractControlStatesForRenderer(const RenderObject& o) const 755 755 { 756 756 ControlStates::States states = 0; … … 765 765 states |= ControlStates::SpinUpState; 766 766 } 767 if (isFocused(o) && o ->style().outlineStyleIsAuto())767 if (isFocused(o) && o.style().outlineStyleIsAuto()) 768 768 states |= ControlStates::FocusState; 769 769 if (isEnabled(o)) … … 782 782 } 783 783 784 bool RenderTheme::isActive(const RenderObject *o) const785 { 786 Node* node = o ->node();784 bool RenderTheme::isActive(const RenderObject& o) const 785 { 786 Node* node = o.node(); 787 787 if (!node) 788 788 return false; … … 799 799 } 800 800 801 bool RenderTheme::isChecked(const RenderObject *o) const802 { 803 if (!o ->node())804 return false; 805 806 HTMLInputElement* inputElement = o ->node()->toInputElement();801 bool RenderTheme::isChecked(const RenderObject& o) const 802 { 803 if (!o.node()) 804 return false; 805 806 HTMLInputElement* inputElement = o.node()->toInputElement(); 807 807 if (!inputElement) 808 808 return false; … … 811 811 } 812 812 813 bool RenderTheme::isIndeterminate(const RenderObject *o) const814 { 815 if (!o ->node())816 return false; 817 818 HTMLInputElement* inputElement = o ->node()->toInputElement();813 bool RenderTheme::isIndeterminate(const RenderObject& o) const 814 { 815 if (!o.node()) 816 return false; 817 818 HTMLInputElement* inputElement = o.node()->toInputElement(); 819 819 if (!inputElement) 820 820 return false; … … 823 823 } 824 824 825 bool RenderTheme::isEnabled(const RenderObject *o) const826 { 827 Node* node = o ->node();825 bool RenderTheme::isEnabled(const RenderObject& o) const 826 { 827 Node* node = o.node(); 828 828 if (!node || !node->isElementNode()) 829 829 return true; … … 831 831 } 832 832 833 bool RenderTheme::isFocused(const RenderObject *o) const834 { 835 Node* node = o ->node();833 bool RenderTheme::isFocused(const RenderObject& o) const 834 { 835 Node* node = o.node(); 836 836 if (!node || !node->isElementNode()) 837 837 return false; … … 843 843 } 844 844 845 bool RenderTheme::isPressed(const RenderObject *o) const846 { 847 if (!o ->node() || !o->node()->isElementNode())848 return false; 849 return toElement(o ->node())->active();850 } 851 852 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject *o) const853 { 854 Node* node = o ->node();845 bool RenderTheme::isPressed(const RenderObject& o) const 846 { 847 if (!o.node() || !o.node()->isElementNode()) 848 return false; 849 return toElement(o.node())->active(); 850 } 851 852 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject& o) const 853 { 854 Node* node = o.node(); 855 855 if (!node || !node->isElementNode()) 856 856 return false; … … 861 861 } 862 862 863 bool RenderTheme::isReadOnlyControl(const RenderObject *o) const864 { 865 Node* node = o ->node();863 bool RenderTheme::isReadOnlyControl(const RenderObject& o) const 864 { 865 Node* node = o.node(); 866 866 if (!node || !node->isElementNode()) 867 867 return false; … … 869 869 } 870 870 871 bool RenderTheme::isHovered(const RenderObject *o) const872 { 873 Node* node = o ->node();871 bool RenderTheme::isHovered(const RenderObject& o) const 872 { 873 Node* node = o.node(); 874 874 if (!node || !node->isElementNode()) 875 875 return false; … … 880 880 } 881 881 882 bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject *o) const883 { 884 Node* node = o ->node();882 bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject& o) const 883 { 884 Node* node = o.node(); 885 885 if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement()) 886 886 return false; … … 889 889 } 890 890 891 bool RenderTheme::isDefault(const RenderObject *o) const891 bool RenderTheme::isDefault(const RenderObject& o) const 892 892 { 893 893 // A button should only have the default appearance if the page is active … … 895 895 return false; 896 896 897 if (!o ->frame().settings().applicationChromeMode())897 if (!o.frame().settings().applicationChromeMode()) 898 898 return false; 899 899 900 return o ->style().appearance() == DefaultButtonPart;900 return o.style().appearance() == DefaultButtonPart; 901 901 } 902 902 … … 968 968 } 969 969 970 bool RenderTheme::paintInputFieldSpeechButton( RenderObject*object, const PaintInfo& paintInfo, const IntRect& rect)970 bool RenderTheme::paintInputFieldSpeechButton(const RenderObject& object, const PaintInfo& paintInfo, const IntRect& rect) 971 971 { 972 972 return RenderInputSpeech::paintInputFieldSpeechButton(object, paintInfo, rect); … … 990 990 } 991 991 992 bool RenderTheme::paintMeter( RenderObject*, const PaintInfo&, const IntRect&)992 bool RenderTheme::paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) 993 993 { 994 994 return true; … … 1003 1003 } 1004 1004 1005 void RenderTheme::paintSliderTicks( RenderObject*o, const PaintInfo& paintInfo, const IntRect& rect)1006 { 1007 Node* node = o ->node();1005 void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& rect) 1006 { 1007 Node* node = o.node(); 1008 1008 if (!node) 1009 1009 return; … … 1019 1019 double min = input->minimum(); 1020 1020 double max = input->maximum(); 1021 ControlPart part = o ->style().appearance();1021 ControlPart part = o.style().appearance(); 1022 1022 // We don't support ticks on alternate sliders like MediaVolumeSliders. 1023 1023 if (part != SliderHorizontalPart && part != SliderVerticalPart) … … 1026 1026 1027 1027 IntSize thumbSize; 1028 RenderObject* thumbRenderer = input->sliderThumbElement()->renderer();1028 const RenderObject* thumbRenderer = input->sliderThumbElement()->renderer(); 1029 1029 if (thumbRenderer) { 1030 1030 const RenderStyle& thumbStyle = thumbRenderer->style(); … … 1036 1036 1037 1037 IntSize tickSize = sliderTickSize(); 1038 float zoomFactor = o ->style().effectiveZoom();1038 float zoomFactor = o.style().effectiveZoom(); 1039 1039 FloatRect tickRect; 1040 1040 int tickRegionSideMargin = 0; … … 1045 1045 if (trackRenderer) 1046 1046 trackBounds = trackRenderer->absoluteBoundingBoxRectIgnoringTransforms(); 1047 IntRect sliderBounds = o ->absoluteBoundingBoxRectIgnoringTransforms();1047 IntRect sliderBounds = o.absoluteBoundingBoxRectIgnoringTransforms(); 1048 1048 1049 1049 // Make position relative to the transformed ancestor element. … … 1066 1066 RefPtr<HTMLCollection> options = dataList->options(); 1067 1067 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1068 paintInfo.context->setFillColor(o ->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);1068 paintInfo.context->setFillColor(o.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB); 1069 1069 for (unsigned i = 0; Node* node = options->item(i); i++) { 1070 1070 ASSERT(isHTMLOptionElement(node)); … … 1075 1075 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(value)); 1076 1076 double tickFraction = (parsedValue - min) / (max - min); 1077 double tickRatio = isHorizontal && o ->style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;1077 double tickRatio = isHorizontal && o.style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction; 1078 1078 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tickRatio); 1079 1079 if (isHorizontal) … … 1101 1101 } 1102 1102 1103 IntRect RenderTheme::progressBarRectForBounds(const RenderObject *, const IntRect& bounds) const1103 IntRect RenderTheme::progressBarRectForBounds(const RenderObject&, const IntRect& bounds) const 1104 1104 { 1105 1105 return bounds; -
trunk/Source/WebCore/rendering/RenderTheme.h
r166422 r167755 80 80 // text of a button, is always rendered by the engine itself. The boolean return value indicates 81 81 // whether the CSS border/background should also be painted. 82 bool paint( RenderObject*, ControlStates*, const PaintInfo&, const IntRect&);83 bool paintBorderOnly( RenderObject*, const PaintInfo&, const IntRect&);84 bool paintDecorations( RenderObject*, const PaintInfo&, const IntRect&);82 bool paint(const RenderObject&, ControlStates*, const PaintInfo&, const IntRect&); 83 bool paintBorderOnly(const RenderObject&, const PaintInfo&, const IntRect&); 84 bool paintDecorations(const RenderObject&, const PaintInfo&, const IntRect&); 85 85 86 86 // The remaining methods should be implemented by the platform-specific portion of the theme, e.g., … … 107 107 // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of 108 108 // controls that need to do this. 109 virtual int baselinePosition(const RenderObject *) const;109 virtual int baselinePosition(const RenderObject&) const; 110 110 111 111 // A method for asking if a control is a container or not. Leaf controls have to have some special behavior (like … … 114 114 115 115 // A method asking if the control changes its tint when the window has focus or not. 116 virtual bool controlSupportsTints(const RenderObject *) const { return false; }116 virtual bool controlSupportsTints(const RenderObject&) const { return false; } 117 117 118 118 // Whether or not the control has been styled enough by the author to disable the native appearance. … … 124 124 // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint, 125 125 // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control. 126 virtual void adjustRepaintRect(const RenderObject *, IntRect&);126 virtual void adjustRepaintRect(const RenderObject&, IntRect&); 127 127 128 128 // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed 129 129 // or a control becomes disabled. 130 virtual bool stateChanged( RenderObject*, ControlStates::States) const;130 virtual bool stateChanged(const RenderObject&, ControlStates::States) const; 131 131 132 132 // This method is called whenever the theme changes on the system in order to flush cached resources from the … … 189 189 190 190 // Method for painting the caps lock indicator 191 virtual bool paintCapsLockIndicator( RenderObject*, const PaintInfo&, const IntRect&) { return 0; };191 virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) { return 0; }; 192 192 193 193 #if ENABLE(PROGRESS_ELEMENT) … … 196 196 // Returns the duration of the animation for the progress bar. 197 197 virtual double animationDurationForProgressBar(RenderProgress*) const; 198 virtual IntRect progressBarRectForBounds(const RenderObject *, const IntRect&) const;198 virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const; 199 199 #endif 200 200 … … 229 229 // Returns the distance of slider tick origin from the slider track center. 230 230 virtual int sliderTickOffsetFromTrackCenter() const = 0; 231 void paintSliderTicks( RenderObject*, const PaintInfo&, const IntRect&);231 void paintSliderTicks(const RenderObject&, const PaintInfo&, const IntRect&); 232 232 #endif 233 233 … … 244 244 245 245 enum FileUploadDecorations { SingleFile, MultipleFiles }; 246 virtual bool paintFileUploadIconDecorations( RenderObject* /*inputRenderer*/, RenderObject*/*buttonRenderer*/, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) { return true; }246 virtual bool paintFileUploadIconDecorations(const RenderObject& /*inputRenderer*/, const RenderObject& /*buttonRenderer*/, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) { return true; } 247 247 248 248 #if ENABLE(IMAGE_CONTROLS) 249 virtual IntSize imageControlsButtonSize(const RenderObject *) const { return IntSize(); }249 virtual IntSize imageControlsButtonSize(const RenderObject&) const { return IntSize(); } 250 250 #endif 251 251 … … 268 268 // Methods for each appearance value. 269 269 virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const; 270 virtual bool paintCheckbox( RenderObject*, const PaintInfo&, const IntRect&) { return true; }270 virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 271 271 virtual void setCheckboxSize(RenderStyle*) const { } 272 272 273 273 virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const; 274 virtual bool paintRadio( RenderObject*, const PaintInfo&, const IntRect&) { return true; }274 virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 275 275 virtual void setRadioSize(RenderStyle*) const { } 276 276 277 277 virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 278 virtual bool paintButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }278 virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 279 279 virtual void setButtonSize(RenderStyle*) const { } 280 280 281 281 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 282 virtual bool paintInnerSpinButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }283 #endif 284 285 virtual bool paintCheckboxDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }286 virtual bool paintRadioDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }287 virtual bool paintButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }282 virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 283 #endif 284 285 virtual bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 286 virtual bool paintRadioDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 287 virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 288 288 289 289 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 290 virtual bool paintTextField( RenderObject*, const PaintInfo&, const IntRect&) { return true; }291 virtual bool paintTextFieldDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }290 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 291 virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 292 292 293 293 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const; 294 virtual bool paintTextArea( RenderObject*, const PaintInfo&, const IntRect&) { return true; }295 virtual bool paintTextAreaDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }294 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 295 virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 296 296 297 297 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const; 298 virtual bool paintMenuList( RenderObject*, const PaintInfo&, const IntRect&) { return true; }299 virtual bool paintMenuListDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }298 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 299 virtual bool paintMenuListDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 300 300 301 301 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 302 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }303 304 virtual bool paintPushButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }305 virtual bool paintSquareButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }302 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 303 304 virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 305 virtual bool paintSquareButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 306 306 307 307 #if ENABLE(METER_ELEMENT) 308 308 virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const; 309 virtual bool paintMeter( RenderObject*, const PaintInfo&, const IntRect&);309 virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&); 310 310 #endif 311 311 312 312 #if ENABLE(PROGRESS_ELEMENT) 313 313 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const; 314 virtual bool paintProgressBar( RenderObject*, const PaintInfo&, const IntRect&) { return true; }314 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 315 315 #endif 316 316 317 317 #if ENABLE(INPUT_SPEECH) 318 318 virtual void adjustInputFieldSpeechButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 319 virtual bool paintInputFieldSpeechButton( RenderObject*, const PaintInfo&, const IntRect&);319 virtual bool paintInputFieldSpeechButton(const RenderObject&, const PaintInfo&, const IntRect&); 320 320 #endif 321 321 322 322 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const; 323 virtual bool paintSliderTrack( RenderObject*, const PaintInfo&, const IntRect&) { return true; }323 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 324 324 325 325 virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const; 326 virtual bool paintSliderThumb( RenderObject*, const PaintInfo&, const IntRect&) { return true; }327 virtual bool paintSliderThumbDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }326 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 327 virtual bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 328 328 329 329 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 330 virtual bool paintSearchField( RenderObject*, const PaintInfo&, const IntRect&) { return true; }331 virtual bool paintSearchFieldDecorations( RenderObject*, const PaintInfo&, const IntRect&) { return true; }330 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 331 virtual bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 332 332 333 333 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 334 virtual bool paintSearchFieldCancelButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }334 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 335 335 336 336 virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 337 virtual bool paintSearchFieldDecorationPart( RenderObject*, const PaintInfo&, const IntRect&) { return true; }337 virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 338 338 339 339 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 340 virtual bool paintSearchFieldResultsDecorationPart( RenderObject*, const PaintInfo&, const IntRect&) { return true; }340 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 341 341 342 342 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 343 virtual bool paintSearchFieldResultsButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }343 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 344 344 345 345 virtual void adjustMediaControlStyle(StyleResolver*, RenderStyle*, Element*) const; 346 virtual bool paintMediaFullscreenButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }347 virtual bool paintMediaPlayButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }348 virtual bool paintMediaOverlayPlayButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }349 virtual bool paintMediaMuteButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }350 virtual bool paintMediaSeekBackButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }351 virtual bool paintMediaSeekForwardButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }352 virtual bool paintMediaSliderTrack( RenderObject*, const PaintInfo&, const IntRect&) { return true; }353 virtual bool paintMediaSliderThumb( RenderObject*, const PaintInfo&, const IntRect&) { return true; }354 virtual bool paintMediaVolumeSliderContainer( RenderObject*, const PaintInfo&, const IntRect&) { return true; }355 virtual bool paintMediaVolumeSliderTrack( RenderObject*, const PaintInfo&, const IntRect&) { return true; }356 virtual bool paintMediaVolumeSliderThumb( RenderObject*, const PaintInfo&, const IntRect&) { return true; }357 virtual bool paintMediaRewindButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }358 virtual bool paintMediaReturnToRealtimeButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }359 virtual bool paintMediaToggleClosedCaptionsButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }360 virtual bool paintMediaControlsBackground( RenderObject*, const PaintInfo&, const IntRect&) { return true; }361 virtual bool paintMediaCurrentTime( RenderObject*, const PaintInfo&, const IntRect&) { return true; }362 virtual bool paintMediaTimeRemaining( RenderObject*, const PaintInfo&, const IntRect&) { return true; }363 virtual bool paintMediaFullScreenVolumeSliderTrack( RenderObject*, const PaintInfo&, const IntRect&) { return true; }364 virtual bool paintMediaFullScreenVolumeSliderThumb( RenderObject*, const PaintInfo&, const IntRect&) { return true; }365 366 virtual bool paintSnapshottedPluginOverlay( RenderObject*, const PaintInfo&, const IntRect&) { return true; }346 virtual bool paintMediaFullscreenButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 347 virtual bool paintMediaPlayButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 348 virtual bool paintMediaOverlayPlayButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 349 virtual bool paintMediaMuteButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 350 virtual bool paintMediaSeekBackButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 351 virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 352 virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 353 virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 354 virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 355 virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 356 virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 357 virtual bool paintMediaRewindButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 358 virtual bool paintMediaReturnToRealtimeButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 359 virtual bool paintMediaToggleClosedCaptionsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 360 virtual bool paintMediaControlsBackground(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 361 virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 362 virtual bool paintMediaTimeRemaining(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 363 virtual bool paintMediaFullScreenVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 364 virtual bool paintMediaFullScreenVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 365 366 virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 367 367 368 368 #if ENABLE(IMAGE_CONTROLS) 369 virtual bool paintImageControlsButton( RenderObject*, const PaintInfo&, const IntRect&) { return true; }369 virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; } 370 370 #endif 371 371 372 372 public: 373 void updateControlStatesForRenderer(const RenderObject *, ControlStates*) const;374 ControlStates::States extractControlStatesForRenderer(const RenderObject *) const;375 bool isActive(const RenderObject *) const;376 bool isChecked(const RenderObject *) const;377 bool isIndeterminate(const RenderObject *) const;378 bool isEnabled(const RenderObject *) const;379 bool isFocused(const RenderObject *) const;380 bool isPressed(const RenderObject *) const;381 bool isSpinUpButtonPartPressed(const RenderObject *) const;382 bool isHovered(const RenderObject *) const;383 bool isSpinUpButtonPartHovered(const RenderObject *) const;384 bool isReadOnlyControl(const RenderObject *) const;385 bool isDefault(const RenderObject *) const;373 void updateControlStatesForRenderer(const RenderObject&, ControlStates*) const; 374 ControlStates::States extractControlStatesForRenderer(const RenderObject&) const; 375 bool isActive(const RenderObject&) const; 376 bool isChecked(const RenderObject&) const; 377 bool isIndeterminate(const RenderObject&) const; 378 bool isEnabled(const RenderObject&) const; 379 bool isFocused(const RenderObject&) const; 380 bool isPressed(const RenderObject&) const; 381 bool isSpinUpButtonPartPressed(const RenderObject&) const; 382 bool isHovered(const RenderObject&) const; 383 bool isSpinUpButtonPartHovered(const RenderObject&) const; 384 bool isReadOnlyControl(const RenderObject&) const; 385 bool isDefault(const RenderObject&) const; 386 386 387 387 private: -
trunk/Source/WebCore/rendering/RenderThemeIOS.h
r166676 r167755 49 49 50 50 protected: 51 virtual int baselinePosition(const RenderObject *) const override;51 virtual int baselinePosition(const RenderObject&) const override; 52 52 53 53 virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer& background, const Color& backgroundColor) const override; … … 55 55 // Methods for each appearance value. 56 56 virtual void adjustCheckboxStyle(StyleResolver*, RenderStyle*, Element*) const override; 57 virtual bool paintCheckboxDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;57 virtual bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 58 58 59 59 virtual void adjustRadioStyle(StyleResolver*, RenderStyle*, Element*) const override; 60 virtual bool paintRadioDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;60 virtual bool paintRadioDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 61 61 62 62 virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, Element*) const override; 63 virtual bool paintButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;64 virtual bool paintPushButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;63 virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 64 virtual bool paintPushButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 65 65 virtual void setButtonSize(RenderStyle*) const override; 66 66 67 virtual bool paintFileUploadIconDecorations( RenderObject* inputRenderer, RenderObject*buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override;67 virtual bool paintFileUploadIconDecorations(const RenderObject& inputRenderer, const RenderObject& buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override; 68 68 69 virtual bool paintTextFieldDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;70 virtual bool paintTextAreaDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;69 virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 70 virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 71 71 72 72 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override; 73 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;73 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 74 74 75 75 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const override; 76 virtual bool paintSliderTrack( RenderObject*, const PaintInfo&, const IntRect&) override;76 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override; 77 77 78 78 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const override; 79 virtual bool paintSliderThumbDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;79 virtual bool paintSliderThumbDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 80 80 81 81 #if ENABLE(PROGRESS_ELEMENT) … … 85 85 virtual double animationDurationForProgressBar(RenderProgress*) const override; 86 86 87 virtual bool paintProgressBar( RenderObject*, const PaintInfo&, const IntRect&) override;87 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) override; 88 88 #endif 89 89 … … 94 94 95 95 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const override; 96 virtual bool paintSearchFieldDecorations( RenderObject*, const PaintInfo&, const IntRect&) override;96 virtual bool paintSearchFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; 97 97 98 98 virtual Color platformActiveSelectionBackgroundColor() const override; … … 116 116 117 117 const Color& shadowColor() const; 118 FloatRect addRoundedBorderClip( RenderObject*box, GraphicsContext*, const IntRect&);118 FloatRect addRoundedBorderClip(const RenderObject& box, GraphicsContext*, const IntRect&); 119 119 120 120 String m_mediaControlsScript; -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r167596 r167755 317 317 } 318 318 319 FloatRect RenderThemeIOS::addRoundedBorderClip( RenderObject*box, GraphicsContext* context, const IntRect& rect)319 FloatRect RenderThemeIOS::addRoundedBorderClip(const RenderObject& box, GraphicsContext* context, const IntRect& rect) 320 320 { 321 321 // To fix inner border bleeding issues <rdar://problem/9812507>, we clip to the outer border and assert that 322 322 // the border is opaque or transparent, unless we're checked because checked radio/checkboxes show no bleeding. 323 RenderStyle& style = box ->style();323 RenderStyle& style = box.style(); 324 324 RoundedRect border = isChecked(box) ? style.getRoundedInnerBorderFor(rect) : style.getRoundedBorderFor(rect); 325 325 … … 358 358 } 359 359 360 bool RenderThemeIOS::paintCheckboxDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)360 bool RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 361 361 { 362 362 GraphicsContextStateSaver stateSaver(*paintInfo.context); … … 409 409 } 410 410 411 int RenderThemeIOS::baselinePosition(const RenderObject *renderer) const412 { 413 if (!renderer ->isBox())411 int RenderThemeIOS::baselinePosition(const RenderObject& renderer) const 412 { 413 if (!renderer.isBox()) 414 414 return 0; 415 415 416 const RenderBox * box = toRenderBox(renderer);417 418 if (box ->style().appearance() == CheckboxPart || box->style().appearance() == RadioPart)419 return box ->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.420 if (box ->style().appearance() == MenulistPart)421 return box ->marginTop() + box->height() - 5; // This is to match AppKit. There might be a better way to calculate this though.416 const RenderBox& box = *toRenderBox(&renderer); 417 418 if (box.style().appearance() == CheckboxPart || box.style().appearance() == RadioPart) 419 return box.marginTop() + box.height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit. 420 if (box.style().appearance() == MenulistPart) 421 return box.marginTop() + box.height() - 5; // This is to match AppKit. There might be a better way to calculate this though. 422 422 return RenderTheme::baselinePosition(box); 423 423 } … … 446 446 } 447 447 448 bool RenderThemeIOS::paintRadioDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)448 bool RenderThemeIOS::paintRadioDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 449 449 { 450 450 GraphicsContextStateSaver stateSaver(*paintInfo.context); … … 474 474 } 475 475 476 bool RenderThemeIOS::paintTextFieldDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)477 { 478 RenderStyle& style = box ->style();476 bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 477 { 478 RenderStyle& style = box.style(); 479 479 IntPoint point(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth()); 480 480 … … 486 486 // Do not draw the gradient if there is no visible top border. 487 487 bool topBorderIsInvisible = !style.hasBorder() || !style.borderTopWidth() || style.borderTopIsTransparent(); 488 if (!box ->view().printing() && !topBorderIsInvisible)488 if (!box.view().printing() && !topBorderIsInvisible) 489 489 drawAxialGradient(paintInfo.context->platformContext(), gradientWithName(InsetGradient), point, FloatPoint(CGPointMake(point.x(), point.y() + 3.0f)), LinearInterpolation); 490 490 return false; 491 491 } 492 492 493 bool RenderThemeIOS::paintTextAreaDecorations( RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)494 { 495 return paintTextFieldDecorations( renderer, paintInfo, rect);493 bool RenderThemeIOS::paintTextAreaDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 494 { 495 return paintTextFieldDecorations(box, paintInfo, rect); 496 496 } 497 497 … … 583 583 } 584 584 585 bool RenderThemeIOS::paintMenuListButtonDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)586 { 587 RenderStyle& style = box ->style();585 bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 586 { 587 RenderStyle& style = box.style(); 588 588 float borderTopWidth = style.borderTopWidth(); 589 589 FloatRect clip(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth(), rect.width() - style.borderLeftWidth() - style.borderRightWidth(), rect.height() - style.borderTopWidth() - style.borderBottomWidth()); … … 613 613 float separator = clip.maxX() - MenuListButtonPaddingRight; 614 614 615 box ->drawLineForBoxSide(paintInfo.context, separator - borderTopWidth, clip.y(), separator, clip.maxY(), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);615 box.drawLineForBoxSide(paintInfo.context, separator - borderTopWidth, clip.y(), separator, clip.maxY(), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0); 616 616 617 617 FloatRect buttonClip(separator - adjustTop, clip.y() - adjustTop, MenuListButtonPaddingRight + adjustTop + adjustRight, clip.height() + adjustTop + adjustBottom); … … 632 632 // Paint Indicators. 633 633 634 if (box ->isMenuList() && toHTMLSelectElement(box->node())->multiple()) {634 if (box.isMenuList() && toHTMLSelectElement(box.node())->multiple()) { 635 635 int size = 2; 636 636 int count = 3; … … 685 685 } 686 686 687 bool RenderThemeIOS::paintSliderTrack( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)687 bool RenderThemeIOS::paintSliderTrack(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 688 688 { 689 689 IntRect trackClip = rect; 690 RenderStyle& style = box ->style();690 RenderStyle& style = box.style(); 691 691 692 692 bool isHorizontal = true; … … 780 780 } 781 781 782 bool RenderThemeIOS::paintSliderThumbDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)782 bool RenderThemeIOS::paintSliderThumbDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 783 783 { 784 784 GraphicsContextStateSaver stateSaver(*paintInfo.context); … … 808 808 } 809 809 810 bool RenderThemeIOS::paintProgressBar( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)811 { 812 if (!renderer ->isProgress())810 bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 811 { 812 if (!renderer.isProgress()) 813 813 return true; 814 814 … … 837 837 context->setStrokeGradient(strokeGradient.release()); 838 838 839 ColorSpace colorSpace = renderer ->style().colorSpace();839 ColorSpace colorSpace = renderer.style().colorSpace(); 840 840 context->setFillColor(Color(255, 255, 255), colorSpace); 841 841 … … 858 858 context->fillRect(FloatRect(rect.x(), verticalRenderingPosition, rect.width(), upperGradientHeight)); 859 859 860 RenderProgress* renderProgress = toRenderProgress(renderer);861 if (renderProgress ->isDeterminate()) {860 const RenderProgress& renderProgress = *toRenderProgress(&renderer); 861 if (renderProgress.isDeterminate()) { 862 862 // 2) Draw the progress bar. 863 double position = clampTo(renderProgress ->position(), 0.0, 1.0);863 double position = clampTo(renderProgress.position(), 0.0, 1.0); 864 864 double barWidth = position * rect.width(); 865 865 RefPtr<Gradient> barGradient = Gradient::create(FloatPoint(rect.x(), verticalRenderingPosition + 0.5), FloatPoint(rect.x(), verticalRenderingPosition + progressBarHeight - 1)); … … 880 880 Path barPath; 881 881 int left = rect.x(); 882 if (!renderProgress ->style().isLeftToRightDirection())882 if (!renderProgress.style().isLeftToRightDirection()) 883 883 left = rect.maxX() - barWidth; 884 884 FloatRect barRect(left + 0.25, verticalRenderingPosition + 0.25, std::max(barWidth - 0.5, 0.0), progressBarHeight - 0.5); … … 922 922 } 923 923 924 bool RenderThemeIOS::paintSearchFieldDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)924 bool RenderThemeIOS::paintSearchFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 925 925 { 926 926 return paintTextFieldDecorations(box, paintInfo, rect); … … 948 948 } 949 949 950 bool RenderThemeIOS::paintButtonDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)950 bool RenderThemeIOS::paintButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 951 951 { 952 952 return paintPushButtonDecorations(box, paintInfo, rect); 953 953 } 954 954 955 bool RenderThemeIOS::paintPushButtonDecorations( RenderObject*box, const PaintInfo& paintInfo, const IntRect& rect)955 bool RenderThemeIOS::paintPushButtonDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) 956 956 { 957 957 GraphicsContextStateSaver stateSaver(*paintInfo.context); … … 959 959 960 960 CGContextRef cgContext = paintInfo.context->platformContext(); 961 if (box ->style().visitedDependentColor(CSSPropertyBackgroundColor).isDark())961 if (box.style().visitedDependentColor(CSSPropertyBackgroundColor).isDark()) 962 962 drawAxialGradient(cgContext, gradientWithName(ConvexGradient), clip.location(), FloatPoint(clip.x(), clip.maxY()), LinearInterpolation); 963 963 else { … … 983 983 const int kMultipleThumbnailShrinkSize = 2; 984 984 985 bool RenderThemeIOS::paintFileUploadIconDecorations( RenderObject*, RenderObject*buttonRenderer, const PaintInfo& paintInfo, const IntRect& rect, Icon* icon, FileUploadDecorations fileUploadDecorations)985 bool RenderThemeIOS::paintFileUploadIconDecorations(const RenderObject&, const RenderObject& buttonRenderer, const PaintInfo& paintInfo, const IntRect& rect, Icon* icon, FileUploadDecorations fileUploadDecorations) 986 986 { 987 987 GraphicsContextStateSaver stateSaver(*paintInfo.context); 988 988 989 989 IntSize cornerSize(kThumbnailBorderCornerRadius, kThumbnailBorderCornerRadius); 990 Color pictureFrameColor = buttonRenderer ? buttonRenderer->style().visitedDependentColor(CSSPropertyBorderTopColor) : Color(76.0f, 76.0f, 76.0f);990 Color pictureFrameColor = buttonRenderer.style().visitedDependentColor(CSSPropertyBorderTopColor); 991 991 992 992 IntRect thumbnailPictureFrameRect = rect; … … 1001 1001 1002 1002 // Background picture frame and simple background icon with a gradient matching the button. 1003 Color backgroundImageColor = buttonRenderer ? Color(buttonRenderer->style().visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : Color(206.0f, 206.0f, 206.0f);1003 Color backgroundImageColor = Color(buttonRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor).rgb()); 1004 1004 paintInfo.context->fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor, ColorSpaceDeviceRGB); 1005 1005 paintInfo.context->fillRect(thumbnailRect, backgroundImageColor, ColorSpaceDeviceRGB); -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r166676 r167755 45 45 46 46 // A method asking if the control changes its tint when the window has focus or not. 47 virtual bool controlSupportsTints(const RenderObject *) const;47 virtual bool controlSupportsTints(const RenderObject&) const; 48 48 49 49 // A general method asking if any control tinting is supported at all. 50 50 virtual bool supportsControlTints() const { return true; } 51 51 52 virtual void adjustRepaintRect(const RenderObject *, IntRect&) override;52 virtual void adjustRepaintRect(const RenderObject&, IntRect&) override; 53 53 54 54 virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const; … … 83 83 virtual int popupInternalPaddingBottom(RenderStyle*) const; 84 84 85 virtual bool paintCapsLockIndicator( RenderObject*, const PaintInfo&, const IntRect&) override;85 virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) override; 86 86 87 87 virtual bool popsMenuByArrowKeys() const override { return true; } … … 89 89 #if ENABLE(METER_ELEMENT) 90 90 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const override; 91 virtual bool paintMeter( RenderObject*, const PaintInfo&, const IntRect&);91 virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&); 92 92 virtual bool supportsMeter(ControlPart) const; 93 93 #endif … … 98 98 // Returns the duration of the animation for the progress bar. 99 99 virtual double animationDurationForProgressBar(RenderProgress*) const; 100 virtual IntRect progressBarRectForBounds(const RenderObject *, const IntRect&) const override;100 virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override; 101 101 #endif 102 102 … … 105 105 virtual bool usesTestModeFocusRingColor() const; 106 106 // A view associated to the contained document. Subclasses may not have such a view and return a fake. 107 NSView* documentViewFor( RenderObject*) const;107 NSView* documentViewFor(const RenderObject&) const; 108 108 109 109 … … 124 124 virtual bool supportsSelectionForegroundColors() const { return false; } 125 125 126 virtual bool paintTextField( RenderObject*, const PaintInfo&, const IntRect&);126 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&); 127 127 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 128 128 129 virtual bool paintTextArea( RenderObject*, const PaintInfo&, const IntRect&);129 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&); 130 130 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const; 131 131 132 virtual bool paintMenuList( RenderObject*, const PaintInfo&, const IntRect&);132 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&); 133 133 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const; 134 134 135 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&);135 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&); 136 136 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 137 137 138 138 #if ENABLE(PROGRESS_ELEMENT) 139 139 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const; 140 virtual bool paintProgressBar( RenderObject*, const PaintInfo&, const IntRect&);141 #endif 142 143 virtual bool paintSliderTrack( RenderObject*, const PaintInfo&, const IntRect&);140 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&); 141 #endif 142 143 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 144 144 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const; 145 145 146 virtual bool paintSliderThumb( RenderObject*, const PaintInfo&, const IntRect&);146 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 147 147 virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const; 148 148 149 virtual bool paintSearchField( RenderObject*, const PaintInfo&, const IntRect&);149 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&); 150 150 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 151 151 152 152 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 153 virtual bool paintSearchFieldCancelButton( RenderObject*, const PaintInfo&, const IntRect&);153 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&); 154 154 155 155 virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 156 virtual bool paintSearchFieldDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);156 virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 157 157 158 158 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 159 virtual bool paintSearchFieldResultsDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);159 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 160 160 161 161 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 162 virtual bool paintSearchFieldResultsButton( RenderObject*, const PaintInfo&, const IntRect&);162 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&); 163 163 164 164 #if ENABLE(VIDEO) … … 168 168 virtual bool shouldShowPlaceholderWhenFocused() const; 169 169 170 virtual bool paintSnapshottedPluginOverlay( RenderObject*, const PaintInfo&, const IntRect&);170 virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&); 171 171 172 172 private: … … 175 175 IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const; 176 176 177 FloatRect convertToPaintingRect(const RenderObject * inputRenderer, const RenderObject*partRenderer, const FloatRect& inputRect, const IntRect&) const;177 FloatRect convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect&) const; 178 178 179 179 // Get the control size based off the font. Used by some of the controls (like buttons). … … 186 186 void setFontFromControlSize(StyleResolver*, RenderStyle*, NSControlSize) const; 187 187 188 void updateCheckedState(NSCell*, const RenderObject *);189 void updateEnabledState(NSCell*, const RenderObject *);190 void updateFocusedState(NSCell*, const RenderObject *);191 void updatePressedState(NSCell*, const RenderObject *);188 void updateCheckedState(NSCell*, const RenderObject&); 189 void updateEnabledState(NSCell*, const RenderObject&); 190 void updateFocusedState(NSCell*, const RenderObject&); 191 void updatePressedState(NSCell*, const RenderObject&); 192 192 // An optional hook for subclasses to update the control tint of NSCell. 193 virtual void updateActiveState(NSCell*, const RenderObject *) { }193 virtual void updateActiveState(NSCell*, const RenderObject&) { } 194 194 195 195 // Helpers for adjusting appearance and for painting 196 196 197 void setPopupButtonCellState(const RenderObject *, const IntRect&);197 void setPopupButtonCellState(const RenderObject&, const IntRect&); 198 198 const IntSize* popupButtonSizes() const; 199 199 const int* popupButtonMargins() const; 200 200 const int* popupButtonPadding(NSControlSize) const; 201 void paintMenuListButtonGradients( RenderObject*, const PaintInfo&, const IntRect&);201 void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&); 202 202 const IntSize* menuListSizes() const; 203 203 … … 205 205 const IntSize* cancelButtonSizes() const; 206 206 const IntSize* resultsButtonSizes() const; 207 void setSearchCellState( RenderObject*, const IntRect&);207 void setSearchCellState(const RenderObject&, const IntRect&); 208 208 void setSearchFieldSize(RenderStyle*) const; 209 209 … … 227 227 228 228 #if ENABLE(IMAGE_CONTROLS) 229 virtual bool paintImageControlsButton( RenderObject*, const PaintInfo&, const IntRect&) override;230 virtual IntSize imageControlsButtonSize(const RenderObject*) const override;229 virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) override; 230 virtual IntSize imageControlsButtonSize(const const RenderObject&) const override; 231 231 NSServicesRolloverButtonCell *servicesRolloverButtonCell() const; 232 232 #endif -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r167497 r167755 218 218 } 219 219 220 NSView* RenderThemeMac::documentViewFor( RenderObject*o) const220 NSView* RenderThemeMac::documentViewFor(const RenderObject& o) const 221 221 { 222 222 ControlStates states(extractControlStatesForRenderer(o)); 223 return ThemeMac::ensuredView(&o ->view().frameView(), &states);223 return ThemeMac::ensuredView(&o.view().frameView(), &states); 224 224 } 225 225 … … 603 603 } 604 604 605 void RenderThemeMac::adjustRepaintRect(const RenderObject *o, IntRect& r)606 { 607 ControlPart part = o ->style().appearance();605 void RenderThemeMac::adjustRepaintRect(const RenderObject& o, IntRect& r) 606 { 607 ControlPart part = o.style().appearance(); 608 608 609 609 #if USE(NEW_THEME) … … 622 622 #endif 623 623 624 float zoomLevel = o ->style().effectiveZoom();624 float zoomLevel = o.style().effectiveZoom(); 625 625 626 626 if (part == MenulistPart) { … … 651 651 } 652 652 653 FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject * inputRenderer, const RenderObject*partRenderer, const FloatRect& inputRect, const IntRect& r) const653 FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect& r) const 654 654 { 655 655 FloatRect partRect(inputRect); … … 657 657 // Compute an offset between the part renderer and the input renderer 658 658 FloatSize offsetFromInputRenderer; 659 const RenderObject* renderer = partRenderer;660 while (renderer && renderer != inputRenderer) {659 const RenderObject* renderer = &partRenderer; 660 while (renderer && renderer != &inputRenderer) { 661 661 RenderElement* containingRenderer = renderer->container(); 662 662 offsetFromInputRenderer -= roundedIntSize(renderer->offsetFromContainer(containingRenderer, LayoutPoint())); … … 664 664 } 665 665 // If the input renderer was not a container, something went wrong 666 ASSERT(renderer == inputRenderer);666 ASSERT(renderer == &inputRenderer); 667 667 // Move the rect into partRenderer's coords 668 668 partRect.move(offsetFromInputRenderer); … … 673 673 } 674 674 675 void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject *o)675 void RenderThemeMac::updateCheckedState(NSCell* cell, const RenderObject& o) 676 676 { 677 677 bool oldIndeterminate = [cell state] == NSMixedState; … … 689 689 } 690 690 691 void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject *o)691 void RenderThemeMac::updateEnabledState(NSCell* cell, const RenderObject& o) 692 692 { 693 693 bool oldEnabled = [cell isEnabled]; … … 697 697 } 698 698 699 void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject *o)699 void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject& o) 700 700 { 701 701 bool oldFocused = [cell showsFirstResponder]; 702 bool focused = isFocused(o) && o ->style().outlineStyleIsAuto();702 bool focused = isFocused(o) && o.style().outlineStyleIsAuto(); 703 703 if (focused != oldFocused) 704 704 [cell setShowsFirstResponder:focused]; 705 705 } 706 706 707 void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject *o)707 void RenderThemeMac::updatePressedState(NSCell* cell, const RenderObject& o) 708 708 { 709 709 bool oldPressed = [cell isHighlighted]; 710 bool pressed = o ->node() && o->node()->isElementNode() && toElement(o->node())->active();710 bool pressed = o.node() && o.node()->isElementNode() && toElement(o.node())->active(); 711 711 if (pressed != oldPressed) 712 712 [cell setHighlighted:pressed]; 713 713 } 714 714 715 bool RenderThemeMac::controlSupportsTints(const RenderObject *o) const715 bool RenderThemeMac::controlSupportsTints(const RenderObject& o) const 716 716 { 717 717 // An alternate way to implement this would be to get the appropriate cell object … … 724 724 725 725 // Checkboxes only have tint when checked. 726 if (o ->style().appearance() == CheckboxPart)726 if (o.style().appearance() == CheckboxPart) 727 727 return isChecked(o); 728 728 … … 812 812 } 813 813 814 bool RenderThemeMac::paintTextField( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)814 bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 815 815 { 816 816 LocalCurrentGraphicsContext localContext(paintInfo.context); … … 832 832 } 833 833 834 bool RenderThemeMac::paintCapsLockIndicator( RenderObject*, const PaintInfo& paintInfo, const IntRect& r)834 bool RenderThemeMac::paintCapsLockIndicator(const RenderObject&, const PaintInfo& paintInfo, const IntRect& r) 835 835 { 836 836 if (paintInfo.context->paintingDisabled()) … … 843 843 } 844 844 845 bool RenderThemeMac::paintTextArea( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)845 bool RenderThemeMac::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 846 846 { 847 847 LocalCurrentGraphicsContext localContext(paintInfo.context); … … 882 882 } 883 883 884 bool RenderThemeMac::paintMenuList( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)884 bool RenderThemeMac::paintMenuList(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 885 885 { 886 886 LocalCurrentGraphicsContext localContext(paintInfo.context); … … 889 889 NSPopUpButtonCell* popupButton = this->popupButton(); 890 890 891 float zoomLevel = o ->style().effectiveZoom();891 float zoomLevel = o.style().effectiveZoom(); 892 892 IntSize size = popupButtonSizes()[[popupButton controlSize]]; 893 893 size.setHeight(size.height() * zoomLevel); … … 896 896 // Now inflate it to account for the shadow. 897 897 IntRect inflatedRect = r; 898 if (r.width() >= minimumMenuListSize(&o ->style()))898 if (r.width() >= minimumMenuListSize(&o.style())) 899 899 inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel); 900 900 … … 914 914 NSView *view = documentViewFor(o); 915 915 [popupButton drawWithFrame:inflatedRect inView:view]; 916 if (isFocused(o) && o ->style().outlineStyleIsAuto())916 if (isFocused(o) && o.style().outlineStyleIsAuto()) 917 917 [popupButton _web_drawFocusRingWithFrame:inflatedRect inView:view]; 918 918 [popupButton setControlView:nil]; … … 935 935 } 936 936 937 bool RenderThemeMac::paintMeter( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)938 { 939 if (!renderObject ->isMeter())937 bool RenderThemeMac::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 938 { 939 if (!renderObject.isMeter()) 940 940 return true; 941 941 942 942 LocalCurrentGraphicsContext localContext(paintInfo.context); 943 943 944 NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter( renderObject));944 NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter(&renderObject)); 945 945 GraphicsContextStateSaver stateSaver(*paintInfo.context); 946 946 … … 1043 1043 } 1044 1044 1045 IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject *renderObject, const IntRect& bounds) const1045 IntRect RenderThemeMac::progressBarRectForBounds(const RenderObject& renderObject, const IntRect& bounds) const 1046 1046 { 1047 1047 // Workaround until <rdar://problem/15855086> is fixed. 1048 1048 int maxDimension = static_cast<int>(std::numeric_limits<ushort>::max()); 1049 1049 IntRect progressBarBounds(bounds.x(), bounds.y(), std::min(bounds.width(), maxDimension), std::min(bounds.height(), maxDimension)); 1050 if (NoControlPart == renderObject ->style().appearance())1050 if (NoControlPart == renderObject.style().appearance()) 1051 1051 return progressBarBounds; 1052 1052 1053 float zoomLevel = renderObject ->style().effectiveZoom();1054 NSControlSize controlSize = controlSizeForFont(&renderObject ->style());1053 float zoomLevel = renderObject.style().effectiveZoom(); 1054 NSControlSize controlSize = controlSizeForFont(&renderObject.style()); 1055 1055 IntSize size = progressBarSizes()[controlSize]; 1056 1056 size.setHeight(size.height() * zoomLevel); … … 1059 1059 // Now inflate it to account for the shadow. 1060 1060 IntRect inflatedRect = progressBarBounds; 1061 if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject ->style()))1061 if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject.style())) 1062 1062 inflatedRect = inflateRect(inflatedRect, size, progressBarMargins(controlSize), zoomLevel); 1063 1063 … … 1084 1084 } 1085 1085 1086 bool RenderThemeMac::paintProgressBar( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)1087 { 1088 if (!renderObject ->isProgress())1086 bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 1087 { 1088 if (!renderObject.isProgress()) 1089 1089 return true; 1090 1090 1091 1091 IntRect inflatedRect = progressBarRectForBounds(renderObject, rect); 1092 NSControlSize controlSize = controlSizeForFont(&renderObject ->style());1093 1094 RenderProgress* renderProgress = toRenderProgress(renderObject);1092 NSControlSize controlSize = controlSizeForFont(&renderObject.style()); 1093 1094 const RenderProgress& renderProgress = *toRenderProgress(&renderObject); 1095 1095 HIThemeTrackDrawInfo trackInfo; 1096 1096 trackInfo.version = 0; 1097 1097 if (controlSize == NSRegularControlSize) 1098 trackInfo.kind = renderProgress ->position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar;1098 trackInfo.kind = renderProgress.position() < 0 ? kThemeLargeIndeterminateBar : kThemeLargeProgressBar; 1099 1099 else 1100 trackInfo.kind = renderProgress ->position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar;1101 1102 float deviceScaleFactor = renderObject ->document().deviceScaleFactor();1100 trackInfo.kind = renderProgress.position() < 0 ? kThemeMediumIndeterminateBar : kThemeMediumProgressBar; 1101 1102 float deviceScaleFactor = renderObject.document().deviceScaleFactor(); 1103 1103 trackInfo.bounds = IntRect(IntPoint(), inflatedRect.size()); 1104 1104 trackInfo.min = 0; 1105 1105 trackInfo.max = std::numeric_limits<SInt32>::max(); 1106 trackInfo.value = lround(renderProgress ->position() * nextafter(trackInfo.max, 0));1107 trackInfo.trackInfo.progress.phase = lround(renderProgress ->animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor);1106 trackInfo.value = lround(renderProgress.position() * nextafter(trackInfo.max, 0)); 1107 trackInfo.trackInfo.progress.phase = lround(renderProgress.animationProgress() * nextafter(progressAnimationNumFrames, 0) * deviceScaleFactor); 1108 1108 trackInfo.attributes = kThemeTrackHorizontal; 1109 1109 trackInfo.enableState = isActive(renderObject) ? kThemeTrackActive : kThemeTrackInactive; … … 1121 1121 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1122 1122 1123 if (!renderProgress ->style().isLeftToRightDirection()) {1123 if (!renderProgress.style().isLeftToRightDirection()) { 1124 1124 paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width(), 0); 1125 1125 paintInfo.context->scale(FloatSize(-1, 1)); … … 1183 1183 } 1184 1184 1185 void RenderThemeMac::paintMenuListButtonGradients( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1185 void RenderThemeMac::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1186 1186 { 1187 1187 if (r.isEmpty()) … … 1193 1193 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1194 1194 1195 FloatRoundedRect border = FloatRoundedRect(o ->style().getRoundedBorderFor(r, &o->view()));1195 FloatRoundedRect border = FloatRoundedRect(o.style().getRoundedBorderFor(r, &o.view())); 1196 1196 int radius = border.radii().topLeft().width(); 1197 1197 … … 1250 1250 } 1251 1251 1252 bool RenderThemeMac::paintMenuListButtonDecorations( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)1253 { 1254 IntRect bounds = IntRect(rect.x() + renderer ->style().borderLeftWidth(),1255 rect.y() + renderer->style().borderTopWidth(),1256 rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),1257 rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());1252 bool RenderThemeMac::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 1253 { 1254 IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(), 1255 rect.y() + renderer.style().borderTopWidth(), 1256 rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(), 1257 rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth()); 1258 1258 // Draw the gradients to give the styled popup menu a button appearance 1259 1259 paintMenuListButtonGradients(renderer, paintInfo, bounds); 1260 1260 1261 1261 // Since we actually know the size of the control here, we restrict the font scale to make sure the arrows will fit vertically in the bounds 1262 float fontScale = std::min(renderer ->style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));1262 float fontScale = std::min(renderer.style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows)); 1263 1263 float centerY = bounds.y() + bounds.height() / 2.0f; 1264 1264 float arrowHeight = baseArrowHeight * fontScale; 1265 1265 float arrowWidth = baseArrowWidth * fontScale; 1266 float leftEdge = bounds.maxX() - arrowPaddingRight * renderer ->style().effectiveZoom() - arrowWidth;1266 float leftEdge = bounds.maxX() - arrowPaddingRight * renderer.style().effectiveZoom() - arrowWidth; 1267 1267 float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale; 1268 1268 1269 if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer ->style().effectiveZoom())1269 if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer.style().effectiveZoom()) 1270 1270 return false; 1271 1271 1272 1272 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1273 1273 1274 paintInfo.context->setFillColor(renderer ->style().visitedDependentColor(CSSPropertyColor), renderer->style().colorSpace());1274 paintInfo.context->setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), renderer.style().colorSpace()); 1275 1275 paintInfo.context->setStrokeStyle(NoStroke); 1276 1276 … … 1296 1296 // FIXME: Should the separator thickness and space be scaled up by fontScale? 1297 1297 int separatorSpace = 2; // Deliberately ignores zoom since it looks nicer if it stays thin. 1298 int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer ->style().effectiveZoom()); // FIXME: Round?1298 int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer.style().effectiveZoom()); // FIXME: Round? 1299 1299 1300 1300 // Draw the separator to the left of the arrows … … 1397 1397 } 1398 1398 1399 void RenderThemeMac::setPopupButtonCellState(const RenderObject *o, const IntRect& r)1399 void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntRect& r) 1400 1400 { 1401 1401 NSPopUpButtonCell* popupButton = this->popupButton(); 1402 1402 1403 1403 // Set the control size based off the rectangle we're painting into. 1404 setControlSize(popupButton, popupButtonSizes(), r.size(), o ->style().effectiveZoom());1404 setControlSize(popupButton, popupButtonSizes(), r.size(), o.style().effectiveZoom()); 1405 1405 1406 1406 // Update the various states we respond to. … … 1430 1430 } 1431 1431 1432 bool RenderThemeMac::paintSliderTrack( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1432 bool RenderThemeMac::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1433 1433 { 1434 1434 IntRect bounds = r; 1435 float zoomLevel = o ->style().effectiveZoom();1435 float zoomLevel = o.style().effectiveZoom(); 1436 1436 float zoomedTrackWidth = trackWidth * zoomLevel; 1437 1437 1438 if (o ->style().appearance() == SliderHorizontalPart || o->style().appearance() == MediaSliderPart) {1438 if (o.style().appearance() == SliderHorizontalPart || o.style().appearance() == MediaSliderPart) { 1439 1439 bounds.setHeight(zoomedTrackWidth); 1440 1440 bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2); 1441 } else if (o ->style().appearance() == SliderVerticalPart) {1441 } else if (o.style().appearance() == SliderVerticalPart) { 1442 1442 bounds.setWidth(zoomedTrackWidth); 1443 1443 bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2); … … 1458 1458 RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks)); 1459 1459 RetainPtr<CGShadingRef> mainShading; 1460 if (o ->style().appearance() == SliderVerticalPart)1460 if (o.style().appearance() == SliderVerticalPart) 1461 1461 mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(), bounds.maxY()), CGPointMake(bounds.maxX(), bounds.maxY()), mainFunction.get(), false, false)); 1462 1462 else … … 1479 1479 const float verticalSliderHeightPadding = 0.1f; 1480 1480 1481 bool RenderThemeMac::paintSliderThumb( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1482 { 1483 NSSliderCell* sliderThumbCell = o ->style().appearance() == SliderThumbVerticalPart1481 bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1482 { 1483 NSSliderCell* sliderThumbCell = o.style().appearance() == SliderThumbVerticalPart 1484 1484 ? sliderThumbVertical() 1485 1485 : sliderThumbHorizontal(); … … 1490 1490 updateActiveState(sliderThumbCell, o); 1491 1491 updateEnabledState(sliderThumbCell, o); 1492 Element* focusDelegate = (o->node() && o->node()->isElementNode()) ? toElement(o->node())->focusDelegate() : 0; 1493 updateFocusedState(sliderThumbCell, focusDelegate ? focusDelegate->renderer() : 0); 1492 Element* focusDelegate = (o.node() && o.node()->isElementNode()) ? toElement(o.node())->focusDelegate() : 0; 1493 if (focusDelegate) 1494 updateFocusedState(sliderThumbCell, *focusDelegate->renderer()); 1494 1495 1495 1496 // Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it. 1496 1497 bool oldPressed; 1497 if (o ->style().appearance() == SliderThumbVerticalPart)1498 if (o.style().appearance() == SliderThumbVerticalPart) 1498 1499 oldPressed = m_isSliderThumbVerticalPressed; 1499 1500 else … … 1502 1503 bool pressed = isPressed(o); 1503 1504 1504 if (o ->style().appearance() == SliderThumbVerticalPart)1505 if (o.style().appearance() == SliderThumbVerticalPart) 1505 1506 m_isSliderThumbVerticalPressed = pressed; 1506 1507 else … … 1516 1517 FloatRect bounds = r; 1517 1518 // Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider. 1518 if (o ->style().appearance() == SliderThumbVerticalPart)1519 bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o ->style().effectiveZoom());1519 if (o.style().appearance() == SliderThumbVerticalPart) 1520 bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o.style().effectiveZoom()); 1520 1521 1521 1522 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1522 float zoomLevel = o ->style().effectiveZoom();1523 float zoomLevel = o.style().effectiveZoom(); 1523 1524 1524 1525 FloatRect unzoomedRect = bounds; … … 1537 1538 } 1538 1539 1539 bool RenderThemeMac::paintSearchField( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1540 bool RenderThemeMac::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1540 1541 { 1541 1542 LocalCurrentGraphicsContext localContext(paintInfo.context); … … 1546 1547 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1547 1548 1548 float zoomLevel = o ->style().effectiveZoom();1549 float zoomLevel = o.style().effectiveZoom(); 1549 1550 1550 1551 IntRect unzoomedRect = r; … … 1569 1570 } 1570 1571 1571 void RenderThemeMac::setSearchCellState( RenderObject*o, const IntRect&)1572 void RenderThemeMac::setSearchCellState(const RenderObject& o, const IntRect&) 1572 1573 { 1573 1574 NSSearchFieldCell* search = this->search(); 1574 1575 1575 [search setControlSize:controlSizeForFont(&o ->style())];1576 [search setControlSize:controlSizeForFont(&o.style())]; 1576 1577 1577 1578 // Update the various states we respond to. … … 1628 1629 } 1629 1630 1630 bool RenderThemeMac::paintSearchFieldCancelButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1631 { 1632 Element* input = o ->node()->shadowHost();1631 bool RenderThemeMac::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1632 { 1633 Element* input = o.node()->shadowHost(); 1633 1634 if (!input) 1634 input = toElement(o ->node());1635 input = toElement(o.node()); 1635 1636 1636 1637 if (!input->renderer()->isBox()) … … 1638 1639 1639 1640 LocalCurrentGraphicsContext localContext(paintInfo.context); 1640 setSearchCellState( input->renderer(), r);1641 setSearchCellState(*input->renderer(), r); 1641 1642 1642 1643 NSSearchFieldCell* search = this->search(); … … 1651 1652 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1652 1653 1653 float zoomLevel = o ->style().effectiveZoom();1654 float zoomLevel = o.style().effectiveZoom(); 1654 1655 1655 1656 FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())]; … … 1664 1665 #endif 1665 1666 1666 localBounds = convertToPaintingRect( input->renderer(), o, localBounds, r);1667 localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r); 1667 1668 1668 1669 FloatRect unzoomedRect(localBounds); … … 1709 1710 } 1710 1711 1711 bool RenderThemeMac::paintSearchFieldDecorationPart( RenderObject*, const PaintInfo&, const IntRect&)1712 bool RenderThemeMac::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) 1712 1713 { 1713 1714 return false; … … 1722 1723 } 1723 1724 1724 bool RenderThemeMac::paintSearchFieldResultsDecorationPart( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1725 { 1726 Node* input = o ->node()->shadowHost();1725 bool RenderThemeMac::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1726 { 1727 Node* input = o.node()->shadowHost(); 1727 1728 if (!input) 1728 input = o ->node();1729 input = o.node(); 1729 1730 if (!input->renderer()->isBox()) 1730 1731 return false; 1731 1732 1732 1733 LocalCurrentGraphicsContext localContext(paintInfo.context); 1733 setSearchCellState( input->renderer(), r);1734 setSearchCellState(*input->renderer(), r); 1734 1735 1735 1736 NSSearchFieldCell* search = this->search(); … … 1741 1742 1742 1743 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())]; 1743 localBounds = convertToPaintingRect( input->renderer(), o, localBounds, r);1744 localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r); 1744 1745 1745 1746 [[search searchButtonCell] drawWithFrame:localBounds inView:documentViewFor(o)]; … … 1757 1758 } 1758 1759 1759 bool RenderThemeMac::paintSearchFieldResultsButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1760 { 1761 Node* input = o ->node()->shadowHost();1760 bool RenderThemeMac::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1761 { 1762 Node* input = o.node()->shadowHost(); 1762 1763 if (!input) 1763 input = o ->node();1764 input = o.node(); 1764 1765 if (!input->renderer()->isBox()) 1765 1766 return false; 1766 1767 1767 1768 LocalCurrentGraphicsContext localContext(paintInfo.context); 1768 setSearchCellState( input->renderer(), r);1769 setSearchCellState(*input->renderer(), r); 1769 1770 1770 1771 NSSearchFieldCell* search = this->search(); … … 1776 1777 1777 1778 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1778 float zoomLevel = o ->style().effectiveZoom();1779 float zoomLevel = o.style().effectiveZoom(); 1779 1780 1780 1781 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())]; 1781 localBounds = convertToPaintingRect( input->renderer(), o, localBounds, r);1782 localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r); 1782 1783 1783 1784 IntRect unzoomedRect(localBounds); … … 1796 1797 } 1797 1798 1798 bool RenderThemeMac::paintSnapshottedPluginOverlay( RenderObject*o, const PaintInfo& paintInfo, const IntRect&)1799 bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&) 1799 1800 { 1800 1801 if (paintInfo.phase != PaintPhaseBlockBackground) 1801 1802 return true; 1802 1803 1803 if (!o ->isRenderBlock())1804 if (!o.isRenderBlock()) 1804 1805 return true; 1805 1806 1806 RenderBlock* renderBlock = toRenderBlock(o);1807 1808 LayoutUnit contentWidth = renderBlock ->contentWidth();1809 LayoutUnit contentHeight = renderBlock ->contentHeight();1807 const RenderBlock& renderBlock = *toRenderBlock(&o); 1808 1809 LayoutUnit contentWidth = renderBlock.contentWidth(); 1810 LayoutUnit contentHeight = renderBlock.contentHeight(); 1810 1811 if (!contentWidth || !contentHeight) 1811 1812 return true; … … 1814 1815 1815 1816 LayoutSize contentSize(contentWidth, contentHeight); 1816 LayoutPoint contentLocation = renderBlock ->location();1817 contentLocation.move(renderBlock ->borderLeft() + renderBlock->paddingLeft(), renderBlock->borderTop() + renderBlock->paddingTop());1817 LayoutPoint contentLocation = renderBlock.location(); 1818 contentLocation.move(renderBlock.borderLeft() + renderBlock.paddingLeft(), renderBlock.borderTop() + renderBlock.paddingTop()); 1818 1819 1819 1820 LayoutRect rect(contentLocation, contentSize); … … 1826 1827 // plugin itself by asking for the shadow root parent, and then its parent. 1827 1828 1828 if (!renderBlock ->element()->isHTMLElement())1829 if (!renderBlock.element()->isHTMLElement()) 1829 1830 return true; 1830 1831 1831 HTMLElement* plugInOverlay = toHTMLElement(renderBlock ->element());1832 HTMLElement* plugInOverlay = toHTMLElement(renderBlock.element()); 1832 1833 Element* parent = plugInOverlay->parentOrShadowHostElement(); 1833 1834 while (parent && !parent->isPluginElement()) … … 1853 1854 // We could draw the snapshot with that coordinates, but we need to make sure there 1854 1855 // isn't a composited layer between us and the plugInRenderer. 1855 RenderBox* renderBox = toRenderBox(o);1856 const RenderBox* renderBox = toRenderBox(&o); 1856 1857 while (renderBox != plugInRenderer) { 1857 1858 if (renderBox->hasLayer() && renderBox->layer() && renderBox->layer()->isComposited()) { … … 2005 2006 } 2006 2007 2007 bool RenderThemeMac::paintImageControlsButton( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)2008 bool RenderThemeMac::paintImageControlsButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 2008 2009 { 2009 2010 if (paintInfo.phase != PaintPhaseBlockBackground) … … 2030 2031 } 2031 2032 2032 IntSize RenderThemeMac::imageControlsButtonSize(const RenderObject *) const2033 IntSize RenderThemeMac::imageControlsButtonSize(const RenderObject&) const 2033 2034 { 2034 2035 #if HAVE(APPKIT_IMAGE_CONTROLS_SUPPORT) -
trunk/Source/WebCore/rendering/RenderThemeSafari.cpp
r166782 r167755 116 116 } 117 117 118 ThemeControlState RenderThemeSafari::determineState( RenderObject*o) const118 ThemeControlState RenderThemeSafari::determineState(const RenderObject& o) const 119 119 { 120 120 ThemeControlState result = 0; … … 265 265 } 266 266 267 void RenderThemeSafari::adjustRepaintRect(const RenderObject *o, IntRect& r)268 { 269 NSControlSize controlSize = controlSizeForFont(&o ->style());270 271 switch (o ->style().appearance()) {267 void RenderThemeSafari::adjustRepaintRect(const RenderObject& o, IntRect& r) 268 { 269 NSControlSize controlSize = controlSizeForFont(&o.style()); 270 271 switch (o.style().appearance()) { 272 272 case CheckboxPart: { 273 273 // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox … … 318 318 } 319 319 320 int RenderThemeSafari::baselinePosition(const RenderObject *o) const321 { 322 if (!o ->isBox())320 int RenderThemeSafari::baselinePosition(const RenderObject& o) const 321 { 322 if (!o.isBox()) 323 323 return 0; 324 324 325 if (o ->style().appearance() == CheckboxPart || o->style().appearance() == RadioPart) {326 const RenderBox* box = toRenderBox( o);325 if (o.style().appearance() == CheckboxPart || o.style().appearance() == RadioPart) { 326 const RenderBox* box = toRenderBox(&o); 327 327 return box->marginTop() + box->height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit. 328 328 } … … 331 331 } 332 332 333 bool RenderThemeSafari::controlSupportsTints(const RenderObject *o) const333 bool RenderThemeSafari::controlSupportsTints(const RenderObject& o) const 334 334 { 335 335 if (!isEnabled(o)) … … 337 337 338 338 // Checkboxes only have tint when checked. 339 if (o ->style().appearance() == CheckboxPart)339 if (o.style().appearance() == CheckboxPart) 340 340 return isChecked(o); 341 341 … … 417 417 } 418 418 419 bool RenderThemeSafari::paintCheckbox( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)419 bool RenderThemeSafari::paintCheckbox(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 420 420 { 421 421 ASSERT(SafariThemeLibrary()); 422 422 423 NSControlSize controlSize = controlSizeForFont(&o ->style());423 NSControlSize controlSize = controlSizeForFont(&o.style()); 424 424 425 425 IntRect inflatedRect = inflateRect(r, checkboxSizes()[controlSize], checkboxMargins(controlSize)); … … 456 456 } 457 457 458 bool RenderThemeSafari::paintRadio( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)458 bool RenderThemeSafari::paintRadio(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 459 459 { 460 460 ASSERT(SafariThemeLibrary()); 461 461 462 NSControlSize controlSize = controlSizeForFont(&o ->style());462 NSControlSize controlSize = controlSizeForFont(&o.style()); 463 463 464 464 IntRect inflatedRect = inflateRect(r, radioSizes()[controlSize], radioMargins(controlSize)); … … 580 580 } 581 581 582 bool RenderThemeSafari::paintButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)582 bool RenderThemeSafari::paintButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 583 583 { 584 584 ASSERT(SafariThemeLibrary()); … … 613 613 } 614 614 615 bool RenderThemeSafari::paintTextField( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)615 bool RenderThemeSafari::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 616 616 { 617 617 ASSERT(SafariThemeLibrary()); … … 625 625 } 626 626 627 bool RenderThemeSafari::paintCapsLockIndicator( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)627 bool RenderThemeSafari::paintCapsLockIndicator(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 628 628 { 629 629 #if defined(SAFARI_THEME_VERSION) && SAFARI_THEME_VERSION >= 1 … … 641 641 } 642 642 643 bool RenderThemeSafari::paintTextArea( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)643 bool RenderThemeSafari::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 644 644 { 645 645 ASSERT(SafariThemeLibrary()); … … 681 681 } 682 682 683 bool RenderThemeSafari::paintMenuList( RenderObject*o, const PaintInfo& info, const IntRect& r)683 bool RenderThemeSafari::paintMenuList(const RenderObject& o, const PaintInfo& info, const IntRect& r) 684 684 { 685 685 ASSERT(SafariThemeLibrary()); … … 691 691 692 692 // Now inflate it to account for the shadow. 693 if (r.width() >= minimumMenuListSize(&o ->style()))693 if (r.width() >= minimumMenuListSize(&o.style())) 694 694 inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(controlSize)); 695 695 … … 750 750 } 751 751 752 void RenderThemeSafari::paintMenuListButtonGradients( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)752 void RenderThemeSafari::paintMenuListButtonGradients(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 753 753 { 754 754 if (r.isEmpty()) … … 759 759 paintInfo.context->save(); 760 760 761 FloatRoundedRect bound = FloatRoundedRect(o ->style().getRoundedBorderFor(r));761 FloatRoundedRect bound = FloatRoundedRect(o.style().getRoundedBorderFor(r)); 762 762 int radius = bound.radii().topLeft().width(); 763 763 … … 811 811 } 812 812 813 bool RenderThemeSafari::paintMenuListButtonDecorations( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)814 { 815 IntRect bounds = IntRect(rect.x() + renderer ->style().borderLeftWidth(),816 rect.y() + renderer->style().borderTopWidth(),817 rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),818 rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());813 bool RenderThemeSafari::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 814 { 815 IntRect bounds = IntRect(rect.x() + renderer.style().borderLeftWidth(), 816 rect.y() + renderer.style().borderTopWidth(), 817 rect.width() - renderer.style().borderLeftWidth() - renderer.style().borderRightWidth(), 818 rect.height() - renderer.style().borderTopWidth() - renderer.style().borderBottomWidth()); 819 819 // Draw the gradients to give the styled popup menu a button appearance 820 820 paintMenuListButtonGradients(renderer, paintInfo, bounds); 821 821 822 822 // Since we actually know the size of the control here, we restrict the font scale to make sure the arrow will fit vertically in the bounds 823 float fontScale = min(renderer ->style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);823 float fontScale = min(renderer.style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight); 824 824 float centerY = bounds.y() + bounds.height() / 2.0f; 825 825 float arrowHeight = baseArrowHeight * fontScale; … … 832 832 paintInfo.context->save(); 833 833 834 paintInfo.context->setFillColor(renderer ->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);834 paintInfo.context->setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB); 835 835 paintInfo.context->setStrokeColor(NoStroke, ColorSpaceDeviceRGB); 836 836 … … 957 957 const int trackRadius = 2; 958 958 959 bool RenderThemeSafari::paintSliderTrack( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)959 bool RenderThemeSafari::paintSliderTrack(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 960 960 { 961 961 IntSize radius(trackRadius, trackRadius); 962 962 FloatRoundedRect bounds(r, radius, radius, radius, radius); 963 963 964 if (o->style().appearance() == SliderHorizontalPart) 965 bounds.setRect(IntRect(r.x(), 966 r.y() + r.height() / 2 - trackWidth / 2, 967 r.width(), 968 trackWidth)); 969 else if (o->style().appearance() == SliderVerticalPart) 970 bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2, 971 r.y(), 972 trackWidth, 973 r.height())); 964 if (o.style().appearance() == SliderHorizontalPart) 965 bounds.setRect(IntRect(r.x(), r.y() + r.height() / 2 - trackWidth / 2, r.width(), trackWidth)); 966 else if (o.style().appearance() == SliderVerticalPart) 967 bounds.setRect(IntRect(r.x() + r.width() / 2 - trackWidth / 2, r.y(), trackWidth, r.height())); 974 968 975 969 CGContextRef context = paintInfo.context->platformContext(); … … 982 976 RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks)); 983 977 RetainPtr<CGShadingRef> mainShading; 984 if (o ->style().appearance() == SliderVerticalPart)978 if (o.style().appearance() == SliderVerticalPart) 985 979 mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.rect().x(), bounds.rect().maxY()), CGPointMake(bounds.rect().maxX(), bounds.rect().maxY()), mainFunction.get(), false, false)); 986 980 else … … 1002 996 const float verticalSliderHeightPadding = 0.1f; 1003 997 1004 bool RenderThemeSafari::paintSliderThumb( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)998 bool RenderThemeSafari::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1005 999 { 1006 1000 ASSERT(SafariThemeLibrary()); … … 1024 1018 } 1025 1019 1026 bool RenderThemeSafari::paintSearchField( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1020 bool RenderThemeSafari::paintSearchField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1027 1021 { 1028 1022 ASSERT(SafariThemeLibrary()); … … 1077 1071 } 1078 1072 1079 bool RenderThemeSafari::paintSearchFieldCancelButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect&)1073 bool RenderThemeSafari::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&) 1080 1074 { 1081 1075 ASSERT(SafariThemeLibrary()); 1082 1076 1083 Node* input = o ->node()->shadowHost();1077 Node* input = o.node()->shadowHost(); 1084 1078 if (!input) 1085 input = o ->node();1079 input = o.node(); 1086 1080 RenderObject* renderer = input->renderer(); 1087 1081 ASSERT(renderer); … … 1120 1114 } 1121 1115 1122 bool RenderThemeSafari::paintSearchFieldDecorationPart( RenderObject*, const PaintInfo&, const IntRect&)1116 bool RenderThemeSafari::paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) 1123 1117 { 1124 1118 return false; … … 1132 1126 } 1133 1127 1134 bool RenderThemeSafari::paintSearchFieldResultsDecorationPart( RenderObject*o, const PaintInfo& paintInfo, const IntRect&)1128 bool RenderThemeSafari::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&) 1135 1129 { 1136 1130 ASSERT(SafariThemeLibrary()); 1137 1131 1138 Node* input = o ->node()->shadowHost();1132 Node* input = o.node()->shadowHost(); 1139 1133 if (!input) 1140 input = o ->node();1134 input = o.node(); 1141 1135 RenderObject* renderer = input->renderer(); 1142 1136 ASSERT(renderer); … … 1156 1150 } 1157 1151 1158 bool RenderThemeSafari::paintSearchFieldResultsButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect&)1152 bool RenderThemeSafari::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect&) 1159 1153 { 1160 1154 ASSERT(SafariThemeLibrary()); 1161 1155 1162 Node* input = o ->node()->shadowHost();1156 Node* input = o.node()->shadowHost(); 1163 1157 if (!input) 1164 input = o ->node();1158 input = o.node(); 1165 1159 RenderObject* renderer = input->renderer(); 1166 1160 ASSERT(renderer); … … 1217 1211 } 1218 1212 1219 bool RenderThemeSafari::paintMeter( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)1213 bool RenderThemeSafari::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 1220 1214 { 1221 1215 // NOTE: This routine is for testing only. It should be fleshed out with a real CG-based implementation. 1222 1216 // Right now it uses a slider, with the thumb positioned at the meter point. 1223 if (!renderObject ->isMeter())1217 if (!renderObject.isMeter()) 1224 1218 return true; 1225 1219 1226 HTMLMeterElement* element = toRenderMeter( renderObject)->meterElement();1220 HTMLMeterElement* element = toRenderMeter(&renderObject)->meterElement(); 1227 1221 1228 1222 int remaining = static_cast<int>((1.0 - element->valueRatio()) * static_cast<double>(rect.size().width())); -
trunk/Source/WebCore/rendering/RenderThemeSafari.h
r166782 r167755 53 53 // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of 54 54 // controls that need to do this. 55 virtual int baselinePosition(const RenderObject *) const;55 virtual int baselinePosition(const RenderObject&) const; 56 56 57 57 // A method asking if the control changes its tint when the window has focus or not. 58 virtual bool controlSupportsTints(const RenderObject *) const;58 virtual bool controlSupportsTints(const RenderObject&) const; 59 59 60 60 // A general method asking if any control tinting is supported at all. 61 61 virtual bool supportsControlTints() const { return true; } 62 62 63 virtual void adjustRepaintRect(const RenderObject *, IntRect&);63 virtual void adjustRepaintRect(const RenderObject&, IntRect&); 64 64 65 65 virtual bool isControlStyled(const RenderStyle*, const BorderData&, … … 87 87 protected: 88 88 // Methods for each appearance value. 89 virtual bool paintCheckbox( RenderObject*, const PaintInfo&, const IntRect&);89 virtual bool paintCheckbox(const RenderObject&, const PaintInfo&, const IntRect&); 90 90 virtual void setCheckboxSize(RenderStyle*) const; 91 91 92 virtual bool paintRadio( RenderObject*, const PaintInfo&, const IntRect&);92 virtual bool paintRadio(const RenderObject&, const PaintInfo&, const IntRect&); 93 93 virtual void setRadioSize(RenderStyle*) const; 94 94 95 95 virtual void adjustButtonStyle(StyleResolver*, RenderStyle*, WebCore::Element*) const; 96 virtual bool paintButton( RenderObject*, const PaintInfo&, const IntRect&);96 virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&); 97 97 virtual void setButtonSize(RenderStyle*) const; 98 98 99 virtual bool paintTextField( RenderObject*, const PaintInfo&, const IntRect&);99 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&); 100 100 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 101 101 102 virtual bool paintTextArea( RenderObject*, const PaintInfo&, const IntRect&);102 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&); 103 103 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const; 104 104 105 virtual bool paintMenuList( RenderObject*, const PaintInfo&, const IntRect&);105 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&); 106 106 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const; 107 107 108 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&);108 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&); 109 109 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 110 110 111 virtual bool paintSliderTrack( RenderObject*, const PaintInfo&, const IntRect&);112 virtual bool paintSliderThumb( RenderObject*, const PaintInfo&, const IntRect&);111 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 112 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 113 113 114 virtual bool paintSearchField( RenderObject*, const PaintInfo&, const IntRect&);114 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&); 115 115 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 116 116 117 117 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 118 virtual bool paintSearchFieldCancelButton( RenderObject*, const PaintInfo&, const IntRect&);118 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&); 119 119 120 120 virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 121 virtual bool paintSearchFieldDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);121 virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 122 122 123 123 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 124 virtual bool paintSearchFieldResultsDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);124 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 125 125 126 126 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 127 virtual bool paintSearchFieldResultsButton( RenderObject*, const PaintInfo&, const IntRect&);127 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&); 128 128 129 virtual bool paintCapsLockIndicator( RenderObject*, const PaintInfo&, const IntRect&);129 virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&); 130 130 131 131 #if ENABLE(VIDEO) … … 138 138 virtual bool supportsMeter(ControlPart) const override; 139 139 virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const override; 140 virtual bool paintMeter( RenderObject*, const PaintInfo&, const IntRect&) override;140 virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override; 141 141 #endif 142 142 … … 173 173 const int* popupButtonMargins(NSControlSize) const; 174 174 const int* popupButtonPadding(NSControlSize) const; 175 void paintMenuListButtonGradients( RenderObject*, const PaintInfo&, const IntRect&);175 void paintMenuListButtonGradients(const RenderObject&, const PaintInfo&, const IntRect&); 176 176 const IntSize* menuListSizes() const; 177 177 … … 181 181 void setSearchFieldSize(RenderStyle*) const; 182 182 183 ThemeControlState determineState( RenderObject*) const;183 ThemeControlState determineState(const RenderObject&) const; 184 184 185 185 String m_mediaControlsScript; -
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
r167145 r167755 435 435 } 436 436 437 unsigned RenderThemeWin::determineClassicState( RenderObject*o, ControlSubPart subPart)437 unsigned RenderThemeWin::determineClassicState(const RenderObject& o, ControlSubPart subPart) 438 438 { 439 439 unsigned state = 0; 440 switch (o ->style().appearance()) {440 switch (o.style().appearance()) { 441 441 case PushButtonPart: 442 442 case ButtonPart: … … 450 450 case RadioPart: 451 451 case CheckboxPart: 452 state = (o ->style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;452 state = (o.style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK; 453 453 if (isChecked(o)) 454 454 state |= DFCS_CHECKED; … … 482 482 } 483 483 484 unsigned RenderThemeWin::determineState( RenderObject*o)484 unsigned RenderThemeWin::determineState(const RenderObject& o) 485 485 { 486 486 unsigned result = TS_NORMAL; 487 ControlPart appearance = o ->style().appearance();487 ControlPart appearance = o.style().appearance(); 488 488 if (!isEnabled(o)) 489 489 result = TS_DISABLED; … … 503 503 } 504 504 505 unsigned RenderThemeWin::determineSliderThumbState( RenderObject*o)505 unsigned RenderThemeWin::determineSliderThumbState(const RenderObject& o) 506 506 { 507 507 unsigned result = TUS_NORMAL; 508 508 if (!isEnabled(o)) 509 509 result = TUS_DISABLED; 510 else if (supportsFocus(o ->style().appearance()) && isFocused(o))510 else if (supportsFocus(o.style().appearance()) && isFocused(o)) 511 511 result = TUS_FOCUSED; 512 512 else if (isPressed(o)) … … 517 517 } 518 518 519 unsigned RenderThemeWin::determineButtonState( RenderObject*o)519 unsigned RenderThemeWin::determineButtonState(const RenderObject& o) 520 520 { 521 521 unsigned result = PBS_NORMAL; … … 524 524 else if (isPressed(o)) 525 525 result = PBS_PRESSED; 526 else if (supportsFocus(o ->style().appearance()) && isFocused(o))526 else if (supportsFocus(o.style().appearance()) && isFocused(o)) 527 527 result = PBS_DEFAULTED; 528 528 else if (isHovered(o)) … … 533 533 } 534 534 535 unsigned RenderThemeWin::determineSpinButtonState( RenderObject*o, ControlSubPart subPart)535 unsigned RenderThemeWin::determineSpinButtonState(const RenderObject& o, ControlSubPart subPart) 536 536 { 537 537 bool isUpButton = subPart == SpinButtonUp; … … 546 546 } 547 547 548 ThemeData RenderThemeWin::getClassicThemeData( RenderObject*o, ControlSubPart subPart)548 ThemeData RenderThemeWin::getClassicThemeData(const RenderObject& o, ControlSubPart subPart) 549 549 { 550 550 ThemeData result; 551 switch (o ->style().appearance()) {551 switch (o.style().appearance()) { 552 552 case PushButtonPart: 553 553 case ButtonPart: … … 598 598 } 599 599 600 ThemeData RenderThemeWin::getThemeData( RenderObject*o, ControlSubPart subPart)600 ThemeData RenderThemeWin::getThemeData(const RenderObject& o, ControlSubPart subPart) 601 601 { 602 602 if (!haveTheme) … … 604 604 605 605 ThemeData result; 606 switch (o ->style().appearance()) {606 switch (o.style().appearance()) { 607 607 case PushButtonPart: 608 608 case ButtonPart: … … 619 619 const bool isVistaOrLater = (windowsVersion() >= WindowsVista); 620 620 result.m_part = isVistaOrLater ? CP_DROPDOWNBUTTONRIGHT : CP_DROPDOWNBUTTON; 621 if (isVistaOrLater && o ->frame().settings().applicationChromeMode()) {621 if (isVistaOrLater && o.frame().settings().applicationChromeMode()) { 622 622 // The "readonly" look we use in application chrome mode 623 623 // only uses a "normal" look for the drop down button. … … 666 666 } 667 667 668 static void drawControl(GraphicsContext* context, RenderObject*o, HANDLE theme, const ThemeData& themeData, const IntRect& r)668 static void drawControl(GraphicsContext* context, const RenderObject& o, HANDLE theme, const ThemeData& themeData, const IntRect& r) 669 669 { 670 670 bool alphaBlend = false; … … 686 686 ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); 687 687 ::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH)); 688 } else if ((o ->style().appearance() == SliderThumbHorizontalPart ||689 o->style().appearance() == SliderThumbVerticalPart) &&690 (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP ||691 688 } else if ((o.style().appearance() == SliderThumbHorizontalPart 689 || o.style().appearance() == SliderThumbVerticalPart) 690 && (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP 691 || themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) { 692 692 ::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST); 693 693 if (themeData.m_state == TUS_DISABLED) { … … 711 711 } else { 712 712 // Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists. 713 if (o ->style().appearance() == DefaultButtonPart) {713 if (o.style().appearance() == DefaultButtonPart) { 714 714 HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW); 715 715 ::FrameRect(hdc, &widgetRect, brush); … … 725 725 } 726 726 727 bool RenderThemeWin::paintButton( RenderObject*o, const PaintInfo& i, const IntRect& r)727 bool RenderThemeWin::paintButton(const RenderObject& o, const PaintInfo& i, const IntRect& r) 728 728 { 729 729 drawControl(i.context, o, buttonTheme(), getThemeData(o), r); … … 740 740 } 741 741 742 bool RenderThemeWin::paintInnerSpinButton( RenderObject*o, const PaintInfo& i, const IntRect& r)742 bool RenderThemeWin::paintInnerSpinButton(const RenderObject& o, const PaintInfo& i, const IntRect& r) 743 743 { 744 744 // We split the specified rectangle into two vertically. We can't draw a … … 772 772 } 773 773 774 bool RenderThemeWin::paintTextField( RenderObject*o, const PaintInfo& i, const IntRect& r)774 bool RenderThemeWin::paintTextField(const RenderObject& o, const PaintInfo& i, const IntRect& r) 775 775 { 776 776 drawControl(i.context, o, textFieldTheme(), getThemeData(o), r); … … 778 778 } 779 779 780 bool RenderThemeWin::paintMenuList( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)780 bool RenderThemeWin::paintMenuList(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 781 781 { 782 782 HANDLE theme; … … 784 784 if (haveTheme && (windowsVersion() >= WindowsVista)) { 785 785 theme = menuListTheme(); 786 if (renderer ->frame().settings().applicationChromeMode())786 if (renderer.frame().settings().applicationChromeMode()) 787 787 part = CP_READONLY; 788 788 else … … 793 793 } 794 794 795 drawControl(paintInfo.context, 795 drawControl(paintInfo.context, renderer, theme, ThemeData(part, determineState(renderer)), rect); 796 796 797 797 return paintMenuListButtonDecorations(renderer, paintInfo, rect); … … 835 835 } 836 836 837 bool RenderThemeWin::paintMenuListButtonDecorations( RenderObject*renderer, const PaintInfo& paintInfo, const IntRect& rect)837 bool RenderThemeWin::paintMenuListButtonDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect) 838 838 { 839 839 // FIXME: Don't make hardcoded assumptions about the thickness of the textfield border. … … 844 844 IntRect buttonRect(rect); 845 845 buttonRect.inflate(-borderThickness); 846 if (renderer ->style().direction() == LTR)846 if (renderer.style().direction() == LTR) 847 847 buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth); 848 848 buttonRect.setWidth(dropDownButtonWidth); … … 862 862 const int trackWidth = 4; 863 863 864 bool RenderThemeWin::paintSliderTrack( RenderObject*o, const PaintInfo& i, const IntRect& r)864 bool RenderThemeWin::paintSliderTrack(const RenderObject& o, const PaintInfo& i, const IntRect& r) 865 865 { 866 866 IntRect bounds = r; 867 867 868 if (o ->style().appearance() == SliderHorizontalPart) {868 if (o.style().appearance() == SliderHorizontalPart) { 869 869 bounds.setHeight(trackWidth); 870 870 bounds.setY(r.y() + r.height() / 2 - trackWidth / 2); 871 } else if (o ->style().appearance() == SliderVerticalPart) {871 } else if (o.style().appearance() == SliderVerticalPart) { 872 872 bounds.setWidth(trackWidth); 873 873 bounds.setX(r.x() + r.width() / 2 - trackWidth / 2); … … 878 878 } 879 879 880 bool RenderThemeWin::paintSliderThumb( RenderObject*o, const PaintInfo& i, const IntRect& r)880 bool RenderThemeWin::paintSliderThumb(const RenderObject& o, const PaintInfo& i, const IntRect& r) 881 881 { 882 882 drawControl(i.context, o, sliderTheme(), getThemeData(o), r); … … 903 903 } 904 904 905 bool RenderThemeWin::paintSearchField( RenderObject*o, const PaintInfo& i, const IntRect& r)905 bool RenderThemeWin::paintSearchField(const RenderObject& o, const PaintInfo& i, const IntRect& r) 906 906 { 907 907 return paintTextField(o, i, r); … … 920 920 } 921 921 922 bool RenderThemeWin::paintSearchFieldCancelButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)922 bool RenderThemeWin::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 923 923 { 924 924 IntRect bounds = r; 925 ASSERT(o ->parent());926 if (!o ->parent() || !o->parent()->isBox())925 ASSERT(o.parent()); 926 if (!o.parent() || !o.parent()->isBox()) 927 927 return false; 928 928 929 RenderBox* parentRenderBox = toRenderBox(o ->parent());929 RenderBox* parentRenderBox = toRenderBox(o.parent()); 930 930 931 931 IntRect parentBox = parentRenderBox->absoluteContentBox(); … … 941 941 static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef(); 942 942 static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef(); 943 paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o ->style().colorSpace(), bounds);943 paintInfo.context->drawImage(isPressed(o) ? cancelPressedImage : cancelImage, o.style().colorSpace(), bounds); 944 944 return false; 945 945 } … … 971 971 } 972 972 973 bool RenderThemeWin::paintSearchFieldResultsDecorationPart( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)973 bool RenderThemeWin::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 974 974 { 975 975 IntRect bounds = r; 976 ASSERT(o ->parent());977 if (!o ->parent() || !o->parent()->isBox())976 ASSERT(o.parent()); 977 if (!o.parent() || !o.parent()->isBox()) 978 978 return false; 979 979 980 RenderBox* parentRenderBox = toRenderBox(o ->parent());980 RenderBox* parentRenderBox = toRenderBox(o.parent()); 981 981 IntRect parentBox = parentRenderBox->absoluteContentBox(); 982 982 … … 990 990 991 991 static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef(); 992 paintInfo.context->drawImage(magnifierImage, o ->style().colorSpace(), bounds);992 paintInfo.context->drawImage(magnifierImage, o.style().colorSpace(), bounds); 993 993 return false; 994 994 } … … 1005 1005 } 1006 1006 1007 bool RenderThemeWin::paintSearchFieldResultsButton( RenderObject*o, const PaintInfo& paintInfo, const IntRect& r)1007 bool RenderThemeWin::paintSearchFieldResultsButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1008 1008 { 1009 1009 IntRect bounds = r; 1010 ASSERT(o ->parent());1011 if (!o ->parent())1010 ASSERT(o.parent()); 1011 if (!o.parent()) 1012 1012 return false; 1013 if (!o ->parent() || !o->parent()->isBox())1013 if (!o.parent() || !o.parent()->isBox()) 1014 1014 return false; 1015 1015 1016 RenderBox* parentRenderBox = toRenderBox(o ->parent());1016 RenderBox* parentRenderBox = toRenderBox(o.parent()); 1017 1017 IntRect parentBox = parentRenderBox->absoluteContentBox(); 1018 1018 … … 1026 1026 1027 1027 static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef(); 1028 paintInfo.context->drawImage(magnifierImage, o ->style().colorSpace(), bounds);1028 paintInfo.context->drawImage(magnifierImage, o.style().colorSpace(), bounds); 1029 1029 return false; 1030 1030 } … … 1178 1178 } 1179 1179 1180 bool RenderThemeWin::paintMeter( RenderObject*renderObject, const PaintInfo& paintInfo, const IntRect& rect)1181 { 1182 if (!renderObject ->isMeter())1180 bool RenderThemeWin::paintMeter(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect) 1181 { 1182 if (!renderObject.isMeter()) 1183 1183 return true; 1184 1184 1185 HTMLMeterElement* element = toRenderMeter( renderObject)->meterElement();1185 HTMLMeterElement* element = toRenderMeter(&renderObject)->meterElement(); 1186 1186 1187 1187 ThemeData theme = getThemeData(renderObject); -
trunk/Source/WebCore/rendering/RenderThemeWin.h
r166782 r167755 67 67 virtual Color systemColor(CSSValueID) const; 68 68 69 virtual bool paintCheckbox( RenderObject*o, const PaintInfo& i, const IntRect& r)69 virtual bool paintCheckbox(const RenderObject& o, const PaintInfo& i, const IntRect& r) 70 70 { return paintButton(o, i, r); } 71 71 virtual void setCheckboxSize(RenderStyle*) const; 72 72 73 virtual bool paintRadio( RenderObject*o, const PaintInfo& i, const IntRect& r)73 virtual bool paintRadio(const RenderObject& o, const PaintInfo& i, const IntRect& r) 74 74 { return paintButton(o, i, r); } 75 75 virtual void setRadioSize(RenderStyle* style) const 76 76 { return setCheckboxSize(style); } 77 77 78 virtual bool paintButton( RenderObject*, const PaintInfo&, const IntRect&);78 virtual bool paintButton(const RenderObject&, const PaintInfo&, const IntRect&); 79 79 80 80 virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 81 virtual bool paintInnerSpinButton( RenderObject*, const PaintInfo&, const IntRect&);81 virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&); 82 82 83 virtual bool paintTextField( RenderObject*, const PaintInfo&, const IntRect&);83 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&); 84 84 85 virtual bool paintTextArea( RenderObject*o, const PaintInfo& i, const IntRect& r)85 virtual bool paintTextArea(const RenderObject& o, const PaintInfo& i, const IntRect& r) 86 86 { return paintTextField(o, i, r); } 87 87 88 88 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const; 89 virtual bool paintMenuList( RenderObject*, const PaintInfo&, const IntRect&);89 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&); 90 90 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 91 91 92 virtual bool paintMenuListButtonDecorations( RenderObject*, const PaintInfo&, const IntRect&);92 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&); 93 93 94 virtual bool paintSliderTrack( RenderObject* o, const PaintInfo& i, const IntRect& r);95 virtual bool paintSliderThumb( RenderObject* o, const PaintInfo& i, const IntRect& r);94 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&); 95 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&); 96 96 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const; 97 97 … … 99 99 100 100 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const; 101 virtual bool paintSearchField( RenderObject*, const PaintInfo&, const IntRect&);101 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&); 102 102 103 103 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 104 virtual bool paintSearchFieldCancelButton( RenderObject*, const PaintInfo&, const IntRect&);104 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&); 105 105 106 106 virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 107 virtual bool paintSearchFieldDecorationPart( RenderObject*, const PaintInfo&, const IntRect&) { return false; }107 virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) { return false; } 108 108 109 109 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const; 110 virtual bool paintSearchFieldResultsDecorationPart( RenderObject*, const PaintInfo&, const IntRect&);110 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&); 111 111 112 112 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const; 113 virtual bool paintSearchFieldResultsButton( RenderObject*, const PaintInfo&, const IntRect&);113 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&); 114 114 115 115 virtual void themeChanged(); … … 134 134 virtual bool supportsMeter(ControlPart) const override; 135 135 virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const override; 136 virtual bool paintMeter( RenderObject*, const PaintInfo&, const IntRect&) override;136 virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override; 137 137 #endif 138 138 … … 152 152 void close(); 153 153 154 unsigned determineState( RenderObject*);155 unsigned determineClassicState( RenderObject*, ControlSubPart = None);156 unsigned determineSliderThumbState( RenderObject*);157 unsigned determineButtonState( RenderObject*);158 unsigned determineSpinButtonState( RenderObject*, ControlSubPart = None);154 unsigned determineState(const RenderObject&); 155 unsigned determineClassicState(const RenderObject&, ControlSubPart = None); 156 unsigned determineSliderThumbState(const RenderObject&); 157 unsigned determineButtonState(const RenderObject&); 158 unsigned determineSpinButtonState(const RenderObject&, ControlSubPart = None); 159 159 160 160 bool supportsFocus(ControlPart) const; 161 161 162 ThemeData getThemeData( RenderObject*, ControlSubPart = None);163 ThemeData getClassicThemeData( RenderObject* o, ControlSubPart = None);162 ThemeData getThemeData(const RenderObject&, ControlSubPart = None); 163 ThemeData getClassicThemeData(const RenderObject&, ControlSubPart = None); 164 164 165 165 HANDLE buttonTheme() const;
Note: See TracChangeset
for help on using the changeset viewer.