Changeset 169699 in webkit


Ignore:
Timestamp:
Jun 9, 2014 11:43:20 AM (10 years ago)
Author:
ap@apple.com
Message:

REGRESSION (r169681): Three tests are broken
https://bugs.webkit.org/show_bug.cgi?id=133646

Reviewed by Tim Horton.

r169681 removed platformFocusRingMaxWidth() override, which returned either 0 or 9
on Mac. But the cross-platform default is 3, so this changed Mac behavior.

I'm not entirely sure why the cross-platform default is 3 (it was also added in r168397),
but restoring the override to return 0 fixes test cases.

While at it, also added final/override, and removed some functions that were only
needed by subclasses, which we now have none.

  • rendering/RenderThemeMac.h:

(WebCore::RenderThemeMac::supportsControlTints): Deleted.
(WebCore::RenderThemeMac::scrollbarControlSizeForPart): Deleted.
(WebCore::RenderThemeMac::supportsSelectionForegroundColors): Deleted.
(WebCore::RenderThemeMac::supportsClosedCaptioning): Deleted.
(WebCore::RenderThemeMac::updateActiveState): Deleted.

  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::platformFocusRingMaxWidth):
(WebCore::RenderThemeMac::setPopupButtonCellState):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::setSearchCellState):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r169697 r169699  
     12014-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
    1322014-06-09  Bem Jones-Bey  <bjonesbe@adobe.com>
    233
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r169681 r169699  
    4040class RenderStyle;
    4141
    42 class RenderThemeMac : public RenderTheme {
     42class RenderThemeMac final : public RenderTheme {
    4343public:
    4444    static PassRefPtr<RenderTheme> create();
    4545
    4646    // A method asking if the control changes its tint when the window has focus or not.
    47     virtual bool controlSupportsTints(const RenderObject&) const;
     47    virtual bool controlSupportsTints(const RenderObject&) const override;
    4848
    4949    // 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; }
    5151
    5252    virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;
    5353
    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;
    6768
    6869    // 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;
    7475
    7576#if ENABLE(DATALIST_ELEMENT)
     
    7879#endif
    7980
    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;
    8586
    8687    virtual bool paintCapsLockIndicator(const RenderObject&, const PaintInfo&, const IntRect&) override;
     
    9091#if ENABLE(METER_ELEMENT)
    9192    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;
    9495#endif
    9596
    9697#if ENABLE(PROGRESS_ELEMENT)
    9798    // Returns the repeat interval of the animation for the progress bar.
    98     virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
     99    virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const override;
    99100    // Returns the duration of the animation for the progress bar.
    100     virtual double animationDurationForProgressBar(RenderProgress*) const;
     101    virtual double animationDurationForProgressBar(RenderProgress*) const override;
    101102    virtual IntRect progressBarRectForBounds(const RenderObject&, const IntRect&) const override;
    102103#endif
    103104
    104     virtual Color systemColor(CSSValueID) const;
     105    virtual Color systemColor(CSSValueID) const override;
    105106    // Controls color values returned from platformFocusRingColor(). systemColor() will be used when false.
    106     virtual bool 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.
    108109    NSView* documentViewFor(const RenderObject&) const;
    109 
    110110
    111111protected:
     
    123123#endif
    124124
    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;
    138138
    139139#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;
    164164
    165165#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;
    172172
    173173private:
     
    192192    void updateFocusedState(NSCell*, const RenderObject&);
    193193    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&) { }
    196194
    197195    // Helpers for adjusting appearance and for painting
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r169681 r169699  
    303303}
    304304
     305int 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
    305312Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor() const
    306313{
     
    14351442
    14361443    // Update the various states we respond to.
    1437     updateActiveState(popupButton, o);
    14381444    updateCheckedState(popupButton, o);
    14391445    updateEnabledState(popupButton, o);
     
    15181524
    15191525    // Update the various states we respond to.
    1520     updateActiveState(sliderThumbCell, o);
    15211526    updateEnabledState(sliderThumbCell, o);
    15221527        Element* focusDelegate = (o.node() && o.node()->isElementNode()) ? toElement(o.node())->focusDelegate() : 0;
     
    16071612
    16081613    // Update the various states we respond to.
    1609     updateActiveState(search, o);
    16101614    updateEnabledState(search, o);
    16111615    updateFocusedState(search, o);
     
    16731677    NSSearchFieldCell* search = this->search();
    16741678
    1675     if (!input->isDisabledFormControl() && (input->isTextFormControl() && !toHTMLTextFormControlElement(input)->isReadOnly())) {
    1676         updateActiveState([search cancelButtonCell], o);
     1679    if (!input->isDisabledFormControl() && (input->isTextFormControl() && !toHTMLTextFormControlElement(input)->isReadOnly()))
    16771680        updatePressedState([search cancelButtonCell], o);
    1678     }
    16791681    else if ([[search cancelButtonCell] isHighlighted])
    16801682        [[search cancelButtonCell] setHighlighted:NO];
     
    17691771        [search setSearchMenuTemplate:nil];
    17701772
    1771     updateActiveState([search searchButtonCell], o);
    1772 
    17731773    FloatRect localBounds = [search searchButtonRectForBounds:NSRect(input->renderBox()->pixelSnappedBorderBoxRect())];
    17741774    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
     
    18001800
    18011801    NSSearchFieldCell* search = this->search();
    1802 
    1803     updateActiveState([search searchButtonCell], o);
    18041802
    18051803    if (![search searchMenuTemplate])
Note: See TracChangeset for help on using the changeset viewer.