2009-11-26 Kent Tamura <tkent@chromium.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Nov 2009 05:59:55 +0000 (05:59 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Nov 2009 05:59:55 +0000 (05:59 +0000)
        Reviewed by Eric Seidel.

        [Chromium] Ignore line-height CSS property specified to push buttons on
        Windows and Linux.
        https://bugs.webkit.org/show_bug.cgi?id=31712

        LayoutTests/fast/forms/control-restrict-line-height.html checks that the
        following controls should ignore line-height CSS property.
         - <select>
         - <input type=button>
         - <input type=search>
        This change addresses the <input type=button> issue with Chromium/Windows
        and Chromium/Linux.

        * rendering/RenderThemeChromiumSkia.cpp: Implement adjustButtonStyle() to ignore line-height.
        * rendering/RenderThemeChromiumSkia.h: Declare adjustButtonStyle().

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

WebCore/ChangeLog
WebCore/rendering/RenderThemeChromiumSkia.cpp
WebCore/rendering/RenderThemeChromiumSkia.h

index 3903f76e9c8af73b1e64ab569f597ed8f5e56692..7005c379b5a4cff62f7dd4c162f1f3a02e0ebbc4 100644 (file)
@@ -1,3 +1,22 @@
+2009-11-26  Kent Tamura  <tkent@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Ignore line-height CSS property specified to push buttons on
+        Windows and Linux.
+        https://bugs.webkit.org/show_bug.cgi?id=31712
+
+        LayoutTests/fast/forms/control-restrict-line-height.html checks that the
+        following controls should ignore line-height CSS property.
+         - <select>
+         - <input type=button>
+         - <input type=search>
+        This change addresses the <input type=button> issue with Chromium/Windows
+        and Chromium/Linux.
+        
+        * rendering/RenderThemeChromiumSkia.cpp: Implement adjustButtonStyle() to ignore line-height.
+        * rendering/RenderThemeChromiumSkia.h: Declare adjustButtonStyle().
+
 2009-11-26  Kinuko Yasuda  <kinuko@chromium.com>
 
         Reviewed by Eric Seidel.
index 86cd77266e0b68c3736a2f05aaf8f1abba73685d..dcc280d86ee3971eddf05ddc277efba808d7c904 100644 (file)
@@ -348,6 +348,15 @@ bool RenderThemeChromiumSkia::paintButton(RenderObject* o, const RenderObject::P
     return false;
 }
 
+void RenderThemeChromiumSkia::adjustButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const;
+{
+    if (style->appearance() == PushButtonPart) {
+        // Ignore line-height.
+        style->setLineHeight(RenderStyle::initialLineHeight());
+    }
+}
+
+
 bool RenderThemeChromiumSkia::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
 {
     return true;
index 241e836cead97821ac1f211569cae8dbfbfc1389..18fa8594e64e7a9979ca4ba86e20fc8c22fa4a18 100644 (file)
@@ -71,6 +71,7 @@ namespace WebCore {
         virtual void setRadioSize(RenderStyle*) const;
 
         virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+        virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
 
         virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);