Title: [160113] trunk/Source/WebCore
Revision
160113
Author
[email protected]
Date
2013-12-04 12:17:46 -0800 (Wed, 04 Dec 2013)

Log Message

Rename RenderTheme::paintMenuListButton()
https://bugs.webkit.org/show_bug.cgi?id=125193

Reviewed by Simon Fraser.

Towards upstreaming the iOS concept of render theme decorations we should rename
RenderTheme::paintMenuListButton() to RenderTheme::paintMenuListButtonDecorations()
to better describe its purpose.

Also, fix code style issues.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::RenderThemeBlackBerry::paintMenuListButtonDecorations):
* platform/blackberry/RenderThemeBlackBerry.h:
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintMenuListButtonDecorations):
* platform/efl/RenderThemeEfl.h:
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintMenuListButtonDecorations):
* platform/gtk/RenderThemeGtk.h:
* platform/nix/RenderThemeNix.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintDecorations): Rename argument o, r to renderer and rect, respectively.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::paintMenuListButtonDecorations):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuListButtonDecorations): Rename argument o, r to renderer and rect,
respectively; also remove extraneous white space and substitute 1 for 1.0f.
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::paintMenuListButtonDecorations): Ditto.
* rendering/RenderThemeSafari.h:
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::paintMenuList): Rename argument o, i, r to renderer, paintInfo, and rect,
respectively.
(WebCore::RenderThemeWin::paintMenuListButtonDecorations): Ditto.
* rendering/RenderThemeWin.h:
* rendering/RenderThemeWinCE.cpp:
(WebCore::RenderThemeWinCE::paintMenuList): Ditto.
(WebCore::RenderThemeWinCE::paintMenuListButtonDecorations): Ditto.
* rendering/RenderThemeWinCE.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (160112 => 160113)


--- trunk/Source/WebCore/ChangeLog	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/ChangeLog	2013-12-04 20:17:46 UTC (rev 160113)
@@ -1,3 +1,47 @@
+2013-12-04  Daniel Bates  <[email protected]>
+
+        Rename RenderTheme::paintMenuListButton()
+        https://bugs.webkit.org/show_bug.cgi?id=125193
+
+        Reviewed by Simon Fraser.
+
+        Towards upstreaming the iOS concept of render theme decorations we should rename
+        RenderTheme::paintMenuListButton() to RenderTheme::paintMenuListButtonDecorations()
+        to better describe its purpose.
+
+        Also, fix code style issues.
+
+        * platform/blackberry/RenderThemeBlackBerry.cpp:
+        (WebCore::RenderThemeBlackBerry::paintMenuListButtonDecorations):
+        * platform/blackberry/RenderThemeBlackBerry.h:
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::paintMenuListButtonDecorations):
+        * platform/efl/RenderThemeEfl.h:
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::paintMenuListButtonDecorations):
+        * platform/gtk/RenderThemeGtk.h:
+        * platform/nix/RenderThemeNix.h:
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paintDecorations): Rename argument o, r to renderer and rect, respectively.
+        * rendering/RenderTheme.h:
+        (WebCore::RenderTheme::paintMenuListButtonDecorations):
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMenuListButtonDecorations): Rename argument o, r to renderer and rect,
+        respectively; also remove extraneous white space and substitute 1 for 1.0f.
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::paintMenuListButtonDecorations): Ditto.
+        * rendering/RenderThemeSafari.h:
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::RenderThemeWin::paintMenuList): Rename argument o, i, r to renderer, paintInfo, and rect,
+        respectively.
+        (WebCore::RenderThemeWin::paintMenuListButtonDecorations): Ditto.
+        * rendering/RenderThemeWin.h:
+        * rendering/RenderThemeWinCE.cpp:
+        (WebCore::RenderThemeWinCE::paintMenuList): Ditto.
+        (WebCore::RenderThemeWinCE::paintMenuListButtonDecorations): Ditto. 
+        * rendering/RenderThemeWinCE.h:
+
 2013-12-04  Andy Estes  <[email protected]>
 
         [iOS] Build projects with $(ARCHS_STANDARD_32_64_BIT)

Modified: trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp (160112 => 160113)


--- trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -618,7 +618,7 @@
     return false;
 }
 
-bool RenderThemeBlackBerry::paintMenuListButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeBlackBerry::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
 {
     return paintMenuList(object, info, rect);
 }

Modified: trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.h (160112 => 160113)


--- trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -49,7 +49,7 @@
     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
     void calculateButtonSize(RenderStyle*) const;
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;
     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);

Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp (160112 => 160113)


--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -892,7 +892,7 @@
     adjustMenuListStyle(styleResolver, style, element);
 }
 
-bool RenderThemeEfl::paintMenuListButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeEfl::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
 {
     return paintMenuList(object, info, rect);
 }

Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.h (160112 => 160113)


--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -141,7 +141,7 @@
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
 
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);

Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp (160112 => 160113)


--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -223,7 +223,7 @@
     adjustMenuListStyle(styleResolver, style, e);
 }
 
-bool RenderThemeGtk::paintMenuListButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+bool RenderThemeGtk::paintMenuListButtonDecorations(RenderObject* object, const PaintInfo& info, const IntRect& rect)
 {
     return paintMenuList(object, info, rect);
 }

Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h (160112 => 160113)


--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -137,7 +137,7 @@
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
 
     virtual void adjustSearchFieldResultsDecorationStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);

Modified: trunk/Source/WebCore/platform/nix/RenderThemeNix.h (160112 => 160113)


--- trunk/Source/WebCore/platform/nix/RenderThemeNix.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/platform/nix/RenderThemeNix.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -88,7 +88,10 @@
 
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE;
-    virtual bool paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r) OVERRIDE { return paintMenuList(o, i, r); }
+    virtual bool paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect) OVERRIDE
+    {
+        return paintMenuList(renderer, paintInfo, rect);
+    }
 
     virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE;
     virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -442,15 +442,15 @@
     return false;
 }
 
-bool RenderTheme::paintDecorations(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderTheme::paintDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     if (paintInfo.context->paintingDisabled())
         return false;
 
     // Call the appropriate paint method based off the appearance value.
-    switch (o->style().appearance()) {
+    switch (renderer->style().appearance()) {
     case MenulistButtonPart:
-        return paintMenuListButton(o, paintInfo, r);
+        return paintMenuListButtonDecorations(renderer, paintInfo, rect);
     case TextFieldPart:
     case TextAreaPart:
     case ListboxPart:

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -281,7 +281,7 @@
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
 
 #if ENABLE(METER_ELEMENT)
     virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const;

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeMac.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -122,7 +122,7 @@
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
 #if ENABLE(PROGRESS_ELEMENT)

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2013-12-04 20:17:46 UTC (rev 160113)
@@ -1191,29 +1191,29 @@
     }
 }
 
-bool RenderThemeMac::paintMenuListButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    IntRect bounds = IntRect(r.x() + o->style().borderLeftWidth(),
-                             r.y() + o->style().borderTopWidth(),
-                             r.width() - o->style().borderLeftWidth() - o->style().borderRightWidth(),
-                             r.height() - o->style().borderTopWidth() - o->style().borderBottomWidth());
+    IntRect bounds = IntRect(rect.x() + renderer->style().borderLeftWidth(),
+                             rect.y() + renderer->style().borderTopWidth(),
+                             rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),
+                             rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());
     // Draw the gradients to give the styled popup menu a button appearance
-    paintMenuListButtonGradients(o, paintInfo, bounds);
+    paintMenuListButtonGradients(renderer, paintInfo, bounds);
 
     // Since we actually know the size of the control here, we restrict the font scale to make sure the arrows will fit vertically in the bounds
-    float fontScale = std::min(o->style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
+    float fontScale = std::min(renderer->style().fontSize() / baseFontSize, bounds.height() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
     float centerY = bounds.y() + bounds.height() / 2.0f;
     float arrowHeight = baseArrowHeight * fontScale;
     float arrowWidth = baseArrowWidth * fontScale;
-    float leftEdge = bounds.maxX() - arrowPaddingRight * o->style().effectiveZoom() - arrowWidth;
+    float leftEdge = bounds.maxX() - arrowPaddingRight * renderer->style().effectiveZoom() - arrowWidth;
     float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
 
-    if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style().effectiveZoom())
+    if (bounds.width() < arrowWidth + arrowPaddingLeft * renderer->style().effectiveZoom())
         return false;
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), o->style().colorSpace());
+    paintInfo.context->setFillColor(renderer->style().visitedDependentColor(CSSPropertyColor), renderer->style().colorSpace());
     paintInfo.context->setStrokeStyle(NoStroke);
 
     FloatPoint arrow1[3];
@@ -1237,10 +1237,10 @@
 
     // FIXME: Should the separator thickness and space be scaled up by fontScale?
     int separatorSpace = 2; // Deliberately ignores zoom since it looks nicer if it stays thin.
-    int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * o->style().effectiveZoom()); // FIXME: Round?
+    int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * renderer->style().effectiveZoom()); // FIXME: Round?
 
     // Draw the separator to the left of the arrows
-    paintInfo.context->setStrokeThickness(1.0f); // Deliberately ignores zoom since it looks nicer if it stays thin.
+    paintInfo.context->setStrokeThickness(1); // Deliberately ignores zoom since it looks nicer if it stays thin.
     paintInfo.context->setStrokeStyle(SolidStroke);
     paintInfo.context->setStrokeColor(leftSeparatorColor, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),

Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.cpp (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeSafari.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -807,17 +807,17 @@
     paintInfo.context->restore();
 }
 
-bool RenderThemeSafari::paintMenuListButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeSafari::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    IntRect bounds = IntRect(r.x() + o->style().borderLeftWidth(),
-                             r.y() + o->style().borderTopWidth(),
-                             r.width() - o->style().borderLeftWidth() - o->style().borderRightWidth(),
-                             r.height() - o->style().borderTopWidth() - o->style().borderBottomWidth());
+    IntRect bounds = IntRect(rect.x() + renderer->style().borderLeftWidth(),
+                             rect.y() + renderer->style().borderTopWidth(),
+                             rect.width() - renderer->style().borderLeftWidth() - renderer->style().borderRightWidth(),
+                             rect.height() - renderer->style().borderTopWidth() - renderer->style().borderBottomWidth());
     // Draw the gradients to give the styled popup menu a button appearance
-    paintMenuListButtonGradients(o, paintInfo, bounds);
-    
+    paintMenuListButtonGradients(renderer, paintInfo, bounds);
+
     // Since we actually know the size of the control here, we restrict the font scale to make sure the arrow will fit vertically in the bounds
-    float fontScale = min(o->style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
+    float fontScale = min(renderer->style().fontSize() / baseFontSize, bounds.height() / baseArrowHeight);
     float centerY = bounds.y() + bounds.height() / 2.0f;
     float arrowHeight = baseArrowHeight * fontScale;
     float arrowWidth = baseArrowWidth * fontScale;
@@ -828,7 +828,7 @@
 
     paintInfo.context->save();
 
-    paintInfo.context->setFillColor(o->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    paintInfo.context->setFillColor(renderer->style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     paintInfo.context->setStrokeColor(NoStroke, ColorSpaceDeviceRGB);
 
     FloatPoint arrow[3];
@@ -841,13 +841,13 @@
 
     Color leftSeparatorColor(0, 0, 0, 40);
     Color rightSeparatorColor(255, 255, 255, 40);
-    
+
     // FIXME: Should the separator thickness and space be scaled up by fontScale?
     int separatorSpace = 2;
     int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft); // FIXME: Round?
 
     // Draw the separator to the left of the arrows
-    paintInfo.context->setStrokeThickness(1.0f);
+    paintInfo.context->setStrokeThickness(1);
     paintInfo.context->setStrokeStyle(SolidStroke);
     paintInfo.context->setStrokeColor(leftSeparatorColor, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),

Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.h (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeSafari.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -105,7 +105,7 @@
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
     virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);

Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -777,13 +777,13 @@
     return false;
 }
 
-bool RenderThemeWin::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintMenuList(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     HANDLE theme;
     int part;
     if (haveTheme && (windowsVersion() >= WindowsVista)) {
         theme = menuListTheme();
-        if (o->frame().settings().applicationChromeMode())
+        if (renderer->frame().settings().applicationChromeMode())
             part = CP_READONLY;
         else
             part = CP_BORDER;
@@ -792,9 +792,9 @@
         part = TFP_TEXTFIELD;
     }
 
-    drawControl(i.context,  o, theme, ThemeData(part, determineState(o)), r);
+    drawControl(i.context,  renderer, theme, ThemeData(part, determineState(renderer)), rect);
     
-    return paintMenuListButton(o, i, r);
+    return paintMenuListButtonDecorations(renderer, paintInfo, rect);
 }
 
 void RenderThemeWin::adjustMenuListStyle(StyleResolver* styleResolver, RenderStyle* style, Element* e) const
@@ -834,16 +834,16 @@
     style->setWhiteSpace(PRE);
 }
 
-bool RenderThemeWin::paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWin::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
     // FIXME: Don't make hardcoded assumptions about the thickness of the textfield border.
     int borderThickness = haveTheme ? 1 : 2;
 
     // Paint the dropdown button on the inner edge of the text field,
     // leaving space for the text field's 1px border
-    IntRect buttonRect(r);
+    IntRect buttonRect(rect);
     buttonRect.inflate(-borderThickness);
-    if (o->style().direction() == LTR)
+    if (renderer->style().direction() == LTR)
         buttonRect.setX(buttonRect.maxX() - dropDownButtonWidth);
     buttonRect.setWidth(dropDownButtonWidth);
 
@@ -854,7 +854,7 @@
         buttonRect.setWidth(buttonRect.width() + vistaMenuListButtonOutset);
     }
 
-    drawControl(i.context, o, menuListTheme(), getThemeData(o), buttonRect);
+    drawControl(paintInfo.context, renderer, menuListTheme(), getThemeData(renderer), buttonRect);
 
     return false;
 }

Modified: trunk/Source/WebCore/rendering/RenderThemeWin.h (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeWin.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -89,7 +89,7 @@
     virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+    virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
 
     virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
     virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);

Modified: trunk/Source/WebCore/rendering/RenderThemeWinCE.cpp (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeWinCE.cpp	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeWinCE.cpp	2013-12-04 20:17:46 UTC (rev 160113)
@@ -242,18 +242,18 @@
     adjustMenuListButtonStyle(styleResolver, style, e);
 }
 
-bool RenderThemeWinCE::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintMenuList(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    paintTextField(o, i, r);
-    paintMenuListButton(o, i, r);
+    paintTextField(renderer, paintInfo, rect);
+    paintMenuListButtonDecorations(renderer, paintInfo, rect);
     return true;
 }
 
-bool RenderThemeWinCE::paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r)
+bool RenderThemeWinCE::paintMenuListButtonDecorations(RenderObject* renderer, const PaintInfo& paintInfo, const IntRect& rect)
 {
-    IntRect buttonRect(r.maxX() - dropDownButtonWidth - 1, r.y(), dropDownButtonWidth, r.height());
+    IntRect buttonRect(rect.maxX() - dropDownButtonWidth - 1, rect.y(), dropDownButtonWidth, rect.height());
     buttonRect.inflateY(-1);
-    i.context->drawFrameControl(buttonRect, DFC_SCROLL, DFCS_SCROLLCOMBOBOX | determineClassicState(o));
+    paintInfo.context->drawFrameControl(buttonRect, DFC_SCROLL, DFCS_SCROLLCOMBOBOX | determineClassicState(renderer));
     return true;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderThemeWinCE.h (160112 => 160113)


--- trunk/Source/WebCore/rendering/RenderThemeWinCE.h	2013-12-04 19:56:46 UTC (rev 160112)
+++ trunk/Source/WebCore/rendering/RenderThemeWinCE.h	2013-12-04 20:17:46 UTC (rev 160113)
@@ -85,7 +85,7 @@
         virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
         virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-        virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
+        virtual bool paintMenuListButtonDecorations(RenderObject*, const PaintInfo&, const IntRect&);
 
         virtual bool paintSliderTrack(RenderObject* o, const PaintInfo& i, const IntRect& r);
         virtual bool paintSliderThumb(RenderObject* o, const PaintInfo& i, const IntRect& r);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to