[Qt] Clean up the remaining duplicate code after the RenderThemeQt refactoring.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Nov 2011 13:43:36 +0000 (13:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Nov 2011 13:43:36 +0000 (13:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72262

Patch by Pierre Rossi <pierre.rossi@gmail.com> on 2011-11-15
Reviewed by Antonio Gomes.

No new tests needed, this is purely cosmetic.

* platform/qt/RenderThemeQStyle.cpp:
(WebCore::RenderThemeQStyle::adjustMenuListButtonStyle):
* platform/qt/RenderThemeQStyle.h:
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::adjustMenuListButtonStyle): remove the call to resetBorderRadius()
since the mobile theme actually didn't do this.
* platform/qt/RenderThemeQtMobile.cpp:
(WebCore::RenderThemeQtMobile::adjustMenuListStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/qt/RenderThemeQStyle.cpp
Source/WebCore/platform/qt/RenderThemeQStyle.h
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/qt/RenderThemeQtMobile.cpp

index 0cacc2f402ca8d8f59f769cd644ac820e3916b7e..5306afb618d9845ebe1946b7207b3bd00b2f9be0 100644 (file)
@@ -1,3 +1,21 @@
+2011-11-15  Pierre Rossi  <pierre.rossi@gmail.com>
+
+        [Qt] Clean up the remaining duplicate code after the RenderThemeQt refactoring.
+        https://bugs.webkit.org/show_bug.cgi?id=72262
+
+        Reviewed by Antonio Gomes.
+
+        No new tests needed, this is purely cosmetic.
+
+        * platform/qt/RenderThemeQStyle.cpp:
+        (WebCore::RenderThemeQStyle::adjustMenuListButtonStyle):
+        * platform/qt/RenderThemeQStyle.h:
+        * platform/qt/RenderThemeQt.cpp:
+        (WebCore::RenderThemeQt::adjustMenuListButtonStyle): remove the call to resetBorderRadius()
+        since the mobile theme actually didn't do this.
+        * platform/qt/RenderThemeQtMobile.cpp:
+        (WebCore::RenderThemeQtMobile::adjustMenuListStyle):
+
 2011-11-15  Pavel Feldman  <pfeldman@google.com>
 
         Web Inspector: move generic code from DevTools.js into the WebCore.
index dd09e207c6ed56cd6a97aa04b7f61d416bf81dc4..12e25c73c1b7eb7ca8218d9104cca60ee29c903e 100644 (file)
@@ -382,19 +382,6 @@ bool RenderThemeQStyle::paintButton(RenderObject* o, const PaintInfo& i, const I
     return false;
 }
 
-void RenderThemeQStyle::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
-{
-    // Resetting the style like this leads to differences like:
-    // - RenderTextControl {INPUT} at (2,2) size 168x25 [bgcolor=#FFFFFF] border: (2px inset #000000)]
-    // + RenderTextControl {INPUT} at (2,2) size 166x26
-    // in layout tests when a CSS style is applied that doesn't affect background color, border or
-    // padding. Just worth keeping in mind!
-    style->setBackgroundColor(Color::transparent);
-    style->resetBorder();
-    style->resetPadding();
-    computeSizeBasedOnStyle(style);
-}
-
 bool RenderThemeQStyle::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& r)
 {
     StylePainterQStyle p(this, i);
@@ -477,22 +464,13 @@ bool RenderThemeQStyle::paintMenuList(RenderObject* o, const PaintInfo& i, const
     return false;
 }
 
-void RenderThemeQStyle::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+void RenderThemeQStyle::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
 {
     // WORKAROUND because html.css specifies -webkit-border-radius for <select> so we override it here
     // see also http://bugs.webkit.org/show_bug.cgi?id=18399
     style->resetBorderRadius();
 
-    // Height is locked to auto.
-    style->setHeight(Length(Auto));
-
-    // White-space is locked to pre
-    style->setWhiteSpace(PRE);
-
-    computeSizeBasedOnStyle(style);
-
-    // Add in the padding that we'd like to use.
-    setPopupPadding(style);
+    RenderThemeQt::adjustMenuListButtonStyle(selector, style, e);
 }
 
 bool RenderThemeQStyle::paintMenuListButton(RenderObject* o, const PaintInfo& i,
@@ -640,20 +618,6 @@ bool RenderThemeQStyle::paintSearchField(RenderObject* o, const PaintInfo& pi,
     return paintTextField(o, pi, r);
 }
 
-void RenderThemeQStyle::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style,
-                                           Element* e) const
-{
-    // Resetting the style like this leads to differences like:
-    // - RenderTextControl {INPUT} at (2,2) size 168x25 [bgcolor=#FFFFFF] border: (2px inset #000000)]
-    // + RenderTextControl {INPUT} at (2,2) size 166x26
-    // in layout tests when a CSS style is applied that doesn't affect background color, border or
-    // padding. Just worth keeping in mind!
-    style->setBackgroundColor(Color::transparent);
-    style->resetBorder();
-    style->resetPadding();
-    computeSizeBasedOnStyle(style);
-}
-
 void RenderThemeQStyle::adjustSearchFieldDecorationStyle(CSSStyleSelector* selector, RenderStyle* style,
                                                      Element* e) const
 {
index c7df1082e0d28fab6a7d49da43894ddd6334a6c8..28b76f27220b7f9452fef5d18b239d1caaae22f8 100644 (file)
@@ -55,7 +55,6 @@ protected:
     virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&);
 
     virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
     virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
     virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
@@ -78,7 +77,6 @@ protected:
     virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
     virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&);
-    virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
     virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, const IntRect&);
index 2484da0058f3dd38cbec01cb810855dda6bdb3b5..b65de33723970c7b44e12e30acc77bc3c03606ce 100644 (file)
@@ -332,10 +332,6 @@ void RenderThemeQt::adjustMenuListStyle(CSSStyleSelector*, RenderStyle* style, E
 
 void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
 {
-    // WORKAROUND because html.css specifies -webkit-border-radius for <select> so we override it here
-    // see also http://bugs.webkit.org/show_bug.cgi?id=18399
-    style->resetBorderRadius();
-
     // Height is locked to auto.
     style->setHeight(Length(Auto));
 
index 29daaca4fc8ce997ffdfe81e8c82fc38f1935c9b..def5f5bb9600831d8ee6f1128d5e1eabfcdaca9c 100644 (file)
@@ -553,20 +553,9 @@ bool RenderThemeQtMobile::paintTextField(RenderObject* o, const PaintInfo& i, co
     return false;
 }
 
-void RenderThemeQtMobile::adjustMenuListStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
+void RenderThemeQtMobile::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
 {
-    style->resetBorder();
-
-    // Height is locked to auto.
-    style->setHeight(Length(Auto));
-
-    // White-space is locked to pre
-    style->setWhiteSpace(PRE);
-
-    computeSizeBasedOnStyle(style);
-
-    // Add in the padding that we'd like to use.
-    setPopupPadding(style);
+    RenderThemeQt::adjustMenuListStyle(selector, style, e);
     style->setPaddingLeft(Length(menuListPadding, Fixed));
 }