Diff
Modified: trunk/Source/WebCore/ChangeLog (197169 => 197170)
--- trunk/Source/WebCore/ChangeLog 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/ChangeLog 2016-02-26 17:36:03 UTC (rev 197170)
@@ -1,5 +1,33 @@
2016-02-26 Zalan Bujtas <[email protected]>
+ RenderTheme::controlSize* methods should take const RenderStyle&.
+ https://bugs.webkit.org/show_bug.cgi?id=154708
+
+ Reviewed by Darin Adler.
+
+ No change in functionality.
+
+ * rendering/RenderTheme.h:
+ (WebCore::RenderTheme::minimumMenuListSize):
+ (WebCore::RenderTheme::popupInternalPaddingLeft):
+ (WebCore::RenderTheme::popupInternalPaddingRight):
+ (WebCore::RenderTheme::popupInternalPaddingTop):
+ (WebCore::RenderTheme::popupInternalPaddingBottom):
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::controlSizeForFont):
+ (WebCore::RenderThemeMac::sizeForFont):
+ (WebCore::RenderThemeMac::sizeForSystemFont):
+ (WebCore::RenderThemeMac::controlSizeForSystemFont):
+ (WebCore::RenderThemeMac::minimumProgressBarHeight):
+ (WebCore::RenderThemeMac::popupInternalPaddingLeft):
+ (WebCore::RenderThemeMac::popupInternalPaddingRight):
+ (WebCore::RenderThemeMac::popupInternalPaddingTop):
+ (WebCore::RenderThemeMac::popupInternalPaddingBottom):
+ (WebCore::RenderThemeMac::minimumMenuListSize):
+
+2016-02-26 Zalan Bujtas <[email protected]>
+
REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
https://bugs.webkit.org/show_bug.cgi?id=154692
<rdar://problem/22840453>
Modified: trunk/Source/WebCore/rendering/RenderTheme.h (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderTheme.h 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderTheme.h 2016-02-26 17:36:03 UTC (rev 197170)
@@ -180,14 +180,14 @@
void systemFont(CSSValueID, FontCascadeDescription&) const;
virtual Color systemColor(CSSValueID) const;
- virtual int minimumMenuListSize(RenderStyle&) const { return 0; }
+ virtual int minimumMenuListSize(const RenderStyle&) const { return 0; }
virtual void adjustSliderThumbSize(RenderStyle&, Element*) const;
- virtual int popupInternalPaddingLeft(RenderStyle&) const { return 0; }
- virtual int popupInternalPaddingRight(RenderStyle&) const { return 0; }
- virtual int popupInternalPaddingTop(RenderStyle&) const { return 0; }
- virtual int popupInternalPaddingBottom(RenderStyle&) const { return 0; }
+ virtual int popupInternalPaddingLeft(const RenderStyle&) const { return 0; }
+ virtual int popupInternalPaddingRight(const RenderStyle&) const { return 0; }
+ virtual int popupInternalPaddingTop(const RenderStyle&) const { return 0; }
+ virtual int popupInternalPaddingBottom(const RenderStyle&) const { return 0; }
virtual bool popupOptionSupportsTextIndent() const { return false; }
virtual PopupMenuStyle::PopupMenuSize popupMenuSize(const RenderStyle&, IntRect&) const { return PopupMenuStyle::PopupMenuSizeNormal; }
Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2016-02-26 17:36:03 UTC (rev 197170)
@@ -741,7 +741,7 @@
adjustMenuListStyle(styleResolver, style, e);
}
-static void getComboBoxMetrics(RenderStyle& style, GtkBorder& border, int& focus)
+static void getComboBoxMetrics(const RenderStyle& style, GtkBorder& border, int& focus)
{
// If this menu list button isn't drawn using the native theme, we
// don't add any extra padding beyond what WebCore already uses.
@@ -760,7 +760,7 @@
focus = interiorFocus ? focusWidth + focusPad : 0;
}
-int RenderThemeGtk::popupInternalPaddingLeft(RenderStyle& style) const
+int RenderThemeGtk::popupInternalPaddingLeft(const RenderStyle& style) const
{
GtkBorder borderWidth = { 0, 0, 0, 0 };
int focusWidth = 0;
@@ -771,7 +771,7 @@
return left;
}
-int RenderThemeGtk::popupInternalPaddingRight(RenderStyle& style) const
+int RenderThemeGtk::popupInternalPaddingRight(const RenderStyle& style) const
{
GtkBorder borderWidth = { 0, 0, 0, 0 };
int focusWidth = 0;
@@ -782,7 +782,7 @@
return right;
}
-int RenderThemeGtk::popupInternalPaddingTop(RenderStyle& style) const
+int RenderThemeGtk::popupInternalPaddingTop(const RenderStyle& style) const
{
GtkBorder borderWidth = { 0, 0, 0, 0 };
int focusWidth = 0;
@@ -790,7 +790,7 @@
return borderWidth.top + focusWidth;
}
-int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle& style) const
+int RenderThemeGtk::popupInternalPaddingBottom(const RenderStyle& style) const
{
GtkBorder borderWidth = { 0, 0, 0, 0 };
int focusWidth = 0;
Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.h (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderThemeGtk.h 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.h 2016-02-26 17:36:03 UTC (rev 197170)
@@ -119,10 +119,10 @@
virtual bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&) override;
virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&) override;
- virtual int popupInternalPaddingLeft(RenderStyle&) const override;
- virtual int popupInternalPaddingRight(RenderStyle&) const override;
- virtual int popupInternalPaddingTop(RenderStyle&) const override;
- virtual int popupInternalPaddingBottom(RenderStyle&) const override;
+ virtual int popupInternalPaddingLeft(const RenderStyle&) const override;
+ virtual int popupInternalPaddingRight(const RenderStyle&) const override;
+ virtual int popupInternalPaddingTop(const RenderStyle&) const override;
+ virtual int popupInternalPaddingBottom(const RenderStyle&) const override;
// The Mac port differentiates between the "menu list" and the "menu list button."
// The former is used when a menu list button has been styled. This is used to ensure
Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.h (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.h 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h 2016-02-26 17:36:03 UTC (rev 197170)
@@ -39,7 +39,7 @@
public:
static Ref<RenderTheme> create();
- virtual int popupInternalPaddingRight(RenderStyle&) const override;
+ virtual int popupInternalPaddingRight(const RenderStyle&) const override;
static void adjustRoundBorderRadius(RenderStyle&, RenderBox&);
Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2016-02-26 17:36:03 UTC (rev 197170)
@@ -513,7 +513,7 @@
const float MenuListArrowHeight = 6;
const float MenuListButtonPaddingRight = 19;
-int RenderThemeIOS::popupInternalPaddingRight(RenderStyle& style) const
+int RenderThemeIOS::popupInternalPaddingRight(const RenderStyle& style) const
{
if (style.appearance() == MenulistButtonPart)
return MenuListButtonPaddingRight + style.borderTopWidth();
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderThemeMac.h 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h 2016-02-26 17:36:03 UTC (rev 197170)
@@ -66,7 +66,7 @@
virtual void platformColorsDidChange() override;
- virtual int minimumMenuListSize(RenderStyle&) const override;
+ virtual int minimumMenuListSize(const RenderStyle&) const override;
virtual void adjustSliderThumbSize(RenderStyle&, Element*) const override;
@@ -75,10 +75,10 @@
virtual int sliderTickOffsetFromTrackCenter() const override;
#endif
- virtual int popupInternalPaddingLeft(RenderStyle&) const override;
- virtual int popupInternalPaddingRight(RenderStyle&) const override;
- virtual int popupInternalPaddingTop(RenderStyle&) const override;
- virtual int popupInternalPaddingBottom(RenderStyle&) const override;
+ virtual int popupInternalPaddingLeft(const RenderStyle&) const override;
+ virtual int popupInternalPaddingRight(const RenderStyle&) const override;
+ virtual int popupInternalPaddingTop(const RenderStyle&) const override;
+ virtual int popupInternalPaddingBottom(const RenderStyle&) const override;
virtual PopupMenuStyle::PopupMenuSize popupMenuSize(const RenderStyle&, IntRect&) const override;
virtual bool popsMenuByArrowKeys() const override { return true; }
@@ -175,13 +175,13 @@
virtual Color systemColor(CSSValueID) const override;
// Get the control size based off the font. Used by some of the controls (like buttons).
- NSControlSize controlSizeForFont(RenderStyle&) const;
- NSControlSize controlSizeForSystemFont(RenderStyle&) const;
+ NSControlSize controlSizeForFont(const RenderStyle&) const;
+ NSControlSize controlSizeForSystemFont(const RenderStyle&) const;
NSControlSize controlSizeForCell(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel = 1.0f) const;
void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel = 1.0f);
void setSizeFromFont(RenderStyle&, const IntSize* sizes) const;
- IntSize sizeForFont(RenderStyle&, const IntSize* sizes) const;
- IntSize sizeForSystemFont(RenderStyle&, const IntSize* sizes) const;
+ IntSize sizeForFont(const RenderStyle&, const IntSize* sizes) const;
+ IntSize sizeForSystemFont(const RenderStyle&, const IntSize* sizes) const;
void setFontFromControlSize(StyleResolver&, RenderStyle&, NSControlSize) const;
void updateCheckedState(NSCell*, const RenderObject&);
@@ -217,7 +217,7 @@
NSLevelIndicatorCell *levelIndicatorFor(const RenderMeter&) const;
#endif
- int minimumProgressBarHeight(RenderStyle&) const;
+ int minimumProgressBarHeight(const RenderStyle&) const;
const IntSize* progressBarSizes() const;
const int* progressBarMargins(NSControlSize) const;
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (197169 => 197170)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-02-26 17:15:11 UTC (rev 197169)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-02-26 17:36:03 UTC (rev 197170)
@@ -737,7 +737,7 @@
return true;
}
-NSControlSize RenderThemeMac::controlSizeForFont(RenderStyle& style) const
+NSControlSize RenderThemeMac::controlSizeForFont(const RenderStyle& style) const
{
int fontSize = style.fontSize();
if (fontSize >= 16)
@@ -767,7 +767,7 @@
[cell setControlSize:size];
}
-IntSize RenderThemeMac::sizeForFont(RenderStyle& style, const IntSize* sizes) const
+IntSize RenderThemeMac::sizeForFont(const RenderStyle& style, const IntSize* sizes) const
{
if (style.effectiveZoom() != 1.0f) {
IntSize result = sizes[controlSizeForFont(style)];
@@ -776,7 +776,7 @@
return sizes[controlSizeForFont(style)];
}
-IntSize RenderThemeMac::sizeForSystemFont(RenderStyle& style, const IntSize* sizes) const
+IntSize RenderThemeMac::sizeForSystemFont(const RenderStyle& style, const IntSize* sizes) const
{
if (style.effectiveZoom() != 1.0f) {
IntSize result = sizes[controlSizeForSystemFont(style)];
@@ -812,7 +812,7 @@
style.fontCascade().update(0);
}
-NSControlSize RenderThemeMac::controlSizeForSystemFont(RenderStyle& style) const
+NSControlSize RenderThemeMac::controlSizeForSystemFont(const RenderStyle& style) const
{
int fontSize = style.fontSize();
if (fontSize >= [NSFont systemFontSizeForControlSize:NSRegularControlSize])
@@ -1065,7 +1065,7 @@
return inflatedRect;
}
-int RenderThemeMac::minimumProgressBarHeight(RenderStyle& style) const
+int RenderThemeMac::minimumProgressBarHeight(const RenderStyle& style) const
{
return sizeForSystemFont(style, progressBarSizes()).height();
}
@@ -1344,7 +1344,7 @@
style.setBoxShadow(nullptr);
}
-int RenderThemeMac::popupInternalPaddingLeft(RenderStyle& style) const
+int RenderThemeMac::popupInternalPaddingLeft(const RenderStyle& style) const
{
if (style.appearance() == MenulistPart)
return popupButtonPadding(controlSizeForFont(style))[leftPadding] * style.effectiveZoom();
@@ -1353,7 +1353,7 @@
return 0;
}
-int RenderThemeMac::popupInternalPaddingRight(RenderStyle& style) const
+int RenderThemeMac::popupInternalPaddingRight(const RenderStyle& style) const
{
if (style.appearance() == MenulistPart)
return popupButtonPadding(controlSizeForFont(style))[rightPadding] * style.effectiveZoom();
@@ -1365,7 +1365,7 @@
return 0;
}
-int RenderThemeMac::popupInternalPaddingTop(RenderStyle& style) const
+int RenderThemeMac::popupInternalPaddingTop(const RenderStyle& style) const
{
if (style.appearance() == MenulistPart)
return popupButtonPadding(controlSizeForFont(style))[topPadding] * style.effectiveZoom();
@@ -1374,7 +1374,7 @@
return 0;
}
-int RenderThemeMac::popupInternalPaddingBottom(RenderStyle& style) const
+int RenderThemeMac::popupInternalPaddingBottom(const RenderStyle& style) const
{
if (style.appearance() == MenulistPart)
return popupButtonPadding(controlSizeForFont(style))[bottomPadding] * style.effectiveZoom();
@@ -1441,7 +1441,7 @@
return sizes;
}
-int RenderThemeMac::minimumMenuListSize(RenderStyle& style) const
+int RenderThemeMac::minimumMenuListSize(const RenderStyle& style) const
{
return sizeForSystemFont(style, menuListSizes()).width();
}