Changeset 169699 in webkit
- Timestamp:
- Jun 9, 2014, 11:43:20 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r169697 r169699 1 2014-06-09 Alexey Proskuryakov <ap@apple.com> 2 3 REGRESSION (r169681): Three tests are broken 4 https://bugs.webkit.org/show_bug.cgi?id=133646 5 6 Reviewed by Tim Horton. 7 8 r169681 removed platformFocusRingMaxWidth() override, which returned either 0 or 9 9 on Mac. But the cross-platform default is 3, so this changed Mac behavior. 10 11 I'm not entirely sure why the cross-platform default is 3 (it was also added in r168397), 12 but restoring the override to return 0 fixes test cases. 13 14 While at it, also added final/override, and removed some functions that were only 15 needed by subclasses, which we now have none. 16 17 * rendering/RenderThemeMac.h: 18 (WebCore::RenderThemeMac::supportsControlTints): Deleted. 19 (WebCore::RenderThemeMac::scrollbarControlSizeForPart): Deleted. 20 (WebCore::RenderThemeMac::supportsSelectionForegroundColors): Deleted. 21 (WebCore::RenderThemeMac::supportsClosedCaptioning): Deleted. 22 (WebCore::RenderThemeMac::updateActiveState): Deleted. 23 * rendering/RenderThemeMac.mm: 24 (WebCore::RenderThemeMac::platformFocusRingMaxWidth): 25 (WebCore::RenderThemeMac::setPopupButtonCellState): 26 (WebCore::RenderThemeMac::paintSliderThumb): 27 (WebCore::RenderThemeMac::setSearchCellState): 28 (WebCore::RenderThemeMac::paintSearchFieldCancelButton): 29 (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart): 30 (WebCore::RenderThemeMac::paintSearchFieldResultsButton): 31 1 32 2014-06-09 Bem Jones-Bey <bjonesbe@adobe.com> 2 33 -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r169681 r169699 40 40 class RenderStyle; 41 41 42 class RenderThemeMac : public RenderTheme {42 class RenderThemeMac final : public RenderTheme { 43 43 public: 44 44 static PassRefPtr<RenderTheme> create(); 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 override; 48 48 49 49 // A general method asking if any control tinting is supported at all. 50 virtual bool supportsControlTints() const { return true; }50 virtual bool supportsControlTints() const override { return true; } 51 51 52 52 virtual void adjustRepaintRect(const RenderObject&, IntRect&) override; 53 53 54 virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const; 55 56 virtual Color platformActiveSelectionBackgroundColor() const; 57 virtual Color platformInactiveSelectionBackgroundColor() const; 58 virtual Color platformActiveListBoxSelectionBackgroundColor() const; 59 virtual Color platformActiveListBoxSelectionForegroundColor() const; 60 virtual Color platformInactiveListBoxSelectionBackgroundColor() const; 61 virtual Color platformInactiveListBoxSelectionForegroundColor() const; 62 virtual Color platformFocusRingColor() const; 63 64 virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return SmallScrollbar; } 65 66 virtual void platformColorsDidChange(); 54 virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const override; 55 56 virtual Color platformActiveSelectionBackgroundColor() const override; 57 virtual Color platformInactiveSelectionBackgroundColor() const override; 58 virtual Color platformActiveListBoxSelectionBackgroundColor() const override; 59 virtual Color platformActiveListBoxSelectionForegroundColor() const override; 60 virtual Color platformInactiveListBoxSelectionBackgroundColor() const override; 61 virtual Color platformInactiveListBoxSelectionForegroundColor() const override; 62 virtual Color platformFocusRingColor() const override; 63 virtual int platformFocusRingMaxWidth() const override; 64 65 virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) override { return SmallScrollbar; } 66 67 virtual void platformColorsDidChange() override; 67 68 68 69 // System fonts. 69 virtual void systemFont(CSSValueID, FontDescription&) const ;70 71 virtual int minimumMenuListSize(RenderStyle*) const ;72 73 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const ;70 virtual void systemFont(CSSValueID, FontDescription&) const override; 71 72 virtual int minimumMenuListSize(RenderStyle*) const override; 73 74 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const override; 74 75 75 76 #if ENABLE(DATALIST_ELEMENT) … … 78 79 #endif 79 80 80 virtual int popupInternalPaddingLeft(RenderStyle*) const ;81 virtual int popupInternalPaddingRight(RenderStyle*) const ;82 virtual int popupInternalPaddingTop(RenderStyle*) const ;83 virtual int popupInternalPaddingBottom(RenderStyle*) const ;84 virtual PopupMenuStyle::PopupMenuSize popupMenuSize(const RenderStyle*, IntRect&) const ;81 virtual int popupInternalPaddingLeft(RenderStyle*) const override; 82 virtual int popupInternalPaddingRight(RenderStyle*) const override; 83 virtual int popupInternalPaddingTop(RenderStyle*) const override; 84 virtual int popupInternalPaddingBottom(RenderStyle*) const override; 85 virtual PopupMenuStyle::PopupMenuSize popupMenuSize(const RenderStyle*, IntRect&) const override; 85 86 86 87 virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) override; … … 90 91 #if ENABLE(METER_ELEMENT) 91 92 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const override; 92 virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) ;93 virtual bool supportsMeter(ControlPart) const ;93 virtual bool paintMeter(const RenderObject&, const PaintInfo&, const IntRect&) override; 94 virtual bool supportsMeter(ControlPart) const override; 94 95 #endif 95 96 96 97 #if ENABLE(PROGRESS_ELEMENT) 97 98 // Returns the repeat interval of the animation for the progress bar. 98 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const ;99 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const override; 99 100 // Returns the duration of the animation for the progress bar. 100 virtual double animationDurationForProgressBar(RenderProgress*) const ;101 virtual double animationDurationForProgressBar(RenderProgress*) const override; 101 102 virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override; 102 103 #endif 103 104 104 virtual Color systemColor(CSSValueID) const ;105 virtual Color systemColor(CSSValueID) const override; 105 106 // Controls color values returned from platformFocusRingColor(). systemColor() will be used when false. 106 virtualbool usesTestModeFocusRingColor() const;107 // A view associated to the contained document. Subclasses may not have such a view and return a fake.107 bool usesTestModeFocusRingColor() const; 108 // A view associated to the contained document. 108 109 NSView* documentViewFor(const RenderObject&) const; 109 110 110 111 111 protected: … … 123 123 #endif 124 124 125 virtual bool supportsSelectionForegroundColors() const { return false; }126 127 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&) ;128 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const ;129 130 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&) ;131 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const ;132 133 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) ;134 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const ;135 136 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) ;137 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const ;125 virtual bool supportsSelectionForegroundColors() const override { return false; } 126 127 virtual bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&) override; 128 virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const override; 129 130 virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&) override; 131 virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const override; 132 133 virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) override; 134 virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const override; 135 136 virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) override; 137 virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override; 138 138 139 139 #if ENABLE(PROGRESS_ELEMENT) 140 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const ;141 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) ;142 #endif 143 144 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) ;145 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const ;146 147 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) ;148 virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const ;149 150 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&) ;151 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const ;152 153 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const ;154 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&) ;155 156 virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const ;157 virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) ;158 159 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const ;160 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) ;161 162 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const ;163 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&) ;140 virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const override; 141 virtual bool paintProgressBar(const RenderObject&, const PaintInfo&, const IntRect&) override; 142 #endif 143 144 virtual bool paintSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override; 145 virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const override; 146 147 virtual bool paintSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) override; 148 virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const override; 149 150 virtual bool paintSearchField(const RenderObject&, const PaintInfo&, const IntRect&) override; 151 virtual void adjustSearchFieldStyle(StyleResolver*, RenderStyle*, Element*) const override; 152 153 virtual void adjustSearchFieldCancelButtonStyle(StyleResolver*, RenderStyle*, Element*) const override; 154 virtual bool paintSearchFieldCancelButton(const RenderObject&, const PaintInfo&, const IntRect&) override; 155 156 virtual void adjustSearchFieldDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const override; 157 virtual bool paintSearchFieldDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) override; 158 159 virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const override; 160 virtual bool paintSearchFieldResultsDecorationPart(const RenderObject&, const PaintInfo&, const IntRect&) override; 161 162 virtual void adjustSearchFieldResultsButtonStyle(StyleResolver*, RenderStyle*, Element*) const override; 163 virtual bool paintSearchFieldResultsButton(const RenderObject&, const PaintInfo&, const IntRect&) override; 164 164 165 165 #if ENABLE(VIDEO) 166 virtual bool supportsClosedCaptioning() const { return true; }167 #endif 168 169 virtual bool shouldShowPlaceholderWhenFocused() const ;170 171 virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) ;166 virtual bool supportsClosedCaptioning() const override { return true; } 167 #endif 168 169 virtual bool shouldShowPlaceholderWhenFocused() const override; 170 171 virtual bool paintSnapshottedPluginOverlay(const RenderObject&, const PaintInfo&, const IntRect&) override; 172 172 173 173 private: … … 192 192 void updateFocusedState(NSCell*, const RenderObject&); 193 193 void updatePressedState(NSCell*, const RenderObject&); 194 // An optional hook for subclasses to update the control tint of NSCell.195 virtual void updateActiveState(NSCell*, const RenderObject&) { }196 194 197 195 // Helpers for adjusting appearance and for painting -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r169681 r169699 303 303 } 304 304 305 int RenderThemeMac::platformFocusRingMaxWidth() const 306 { 307 // FIXME: Shouldn't this function be named platformFocusRingMinWidth? But also, I'm not sure if this function is needed - looks like 308 // all platforms just used 0 for this before <http://trac.webkit.org/changeset/168397>. 309 return 0; 310 } 311 305 312 Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor() const 306 313 { … … 1435 1442 1436 1443 // Update the various states we respond to. 1437 updateActiveState(popupButton, o);1438 1444 updateCheckedState(popupButton, o); 1439 1445 updateEnabledState(popupButton, o); … … 1518 1524 1519 1525 // Update the various states we respond to. 1520 updateActiveState(sliderThumbCell, o);1521 1526 updateEnabledState(sliderThumbCell, o); 1522 1527 Element* focusDelegate = (o.node() && o.node()->isElementNode()) ? toElement(o.node())->focusDelegate() : 0; … … 1607 1612 1608 1613 // Update the various states we respond to. 1609 updateActiveState(search, o);1610 1614 updateEnabledState(search, o); 1611 1615 updateFocusedState(search, o); … … 1673 1677 NSSearchFieldCell* search = this->search(); 1674 1678 1675 if (!input->isDisabledFormControl() && (input->isTextFormControl() && !toHTMLTextFormControlElement(input)->isReadOnly())) { 1676 updateActiveState([search cancelButtonCell], o); 1679 if (!input->isDisabledFormControl() && (input->isTextFormControl() && !toHTMLTextFormControlElement(input)->isReadOnly())) 1677 1680 updatePressedState([search cancelButtonCell], o); 1678 }1679 1681 else if ([[search cancelButtonCell] isHighlighted]) 1680 1682 [[search cancelButtonCell] setHighlighted:NO]; … … 1769 1771 [search setSearchMenuTemplate:nil]; 1770 1772 1771 updateActiveState([search searchButtonCell], o);1772 1773 1773 FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())]; 1774 1774 localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r); … … 1800 1800 1801 1801 NSSearchFieldCell* search = this->search(); 1802 1803 updateActiveState([search searchButtonCell], o);1804 1802 1805 1803 if (![search searchMenuTemplate])
Note:
See TracChangeset
for help on using the changeset viewer.