2009-02-25 Scott Violet <sky@google.com>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2009 23:52:29 +0000 (23:52 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2009 23:52:29 +0000 (23:52 +0000)
        Reviewed by Dave Hyatt.

        https://bugs.webkit.org/show_bug.cgi?id=24171
        Provides a RenderTheme method for getting the scroll bar size and
        changes RenderListBox to use it. RenderTheme returns a size of regular,
        and Mac's override to return small. Changes ScrollbarThemeChromium to
        use the scrollbarsize of the scrollbar when getting the size
        instead of passing in no-args.

        * platform/chromium/ScrollbarThemeChromium.cpp:
        (WebCore::ScrollbarThemeChromium::trackRect):
        (WebCore::ScrollbarThemeChromium::buttonSize):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::createScrollbar):
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::scrollbarControlSizeForPart):
        * rendering/RenderThemeChromiumMac.h:
        (WebCore::RenderThemeChromiumMac::scrollbarControlSizeForPart):
        * rendering/RenderThemeMac.h:
        (WebCore::RenderThemeMac::scrollbarControlSizeForPart):

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

WebCore/ChangeLog
WebCore/platform/chromium/ScrollbarThemeChromium.cpp
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderTheme.h
WebCore/rendering/RenderThemeChromiumMac.h
WebCore/rendering/RenderThemeMac.h

index b0de6e8ce21b94c48119504f40da34bd3a06a3d1..6be2eb91e55a06661cc2979dcd1e5a95ffc8a923 100644 (file)
@@ -1,3 +1,26 @@
+2009-02-25  Scott Violet  <sky@google.com>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24171
+        Provides a RenderTheme method for getting the scroll bar size and
+        changes RenderListBox to use it. RenderTheme returns a size of regular,
+        and Mac's override to return small. Changes ScrollbarThemeChromium to
+        use the scrollbarsize of the scrollbar when getting the size
+        instead of passing in no-args.
+
+        * platform/chromium/ScrollbarThemeChromium.cpp:
+        (WebCore::ScrollbarThemeChromium::trackRect):
+        (WebCore::ScrollbarThemeChromium::buttonSize):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::createScrollbar):
+        * rendering/RenderTheme.h:
+        (WebCore::RenderTheme::scrollbarControlSizeForPart):
+        * rendering/RenderThemeChromiumMac.h:
+        (WebCore::RenderThemeChromiumMac::scrollbarControlSizeForPart):
+        * rendering/RenderThemeMac.h:
+        (WebCore::RenderThemeMac::scrollbarControlSizeForPart):
+
 2009-02-25  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Darin Adler.
index de40572ce8ef5a069c6b01a5709beb7296b850de..4a55806c4e15bb29fa8ac927b67088ab89b5bc15 100644 (file)
@@ -96,7 +96,7 @@ IntRect ScrollbarThemeChromium::forwardButtonRect(Scrollbar* scrollbar, Scrollba
 IntRect ScrollbarThemeChromium::trackRect(Scrollbar* scrollbar, bool)
 {
     IntSize bs = buttonSize(scrollbar);
-    int thickness = scrollbarThickness();
+    int thickness = scrollbarThickness(scrollbar->controlSize());
     if (scrollbar->orientation() == HorizontalScrollbar) {
         if (scrollbar->width() < 2 * thickness)
             return IntRect();
@@ -173,7 +173,7 @@ IntSize ScrollbarThemeChromium::buttonSize(Scrollbar* scrollbar)
     // times thickness pixels left.  This allows the scrollbar to scale down
     // and function even at tiny sizes.
 
-    int thickness = scrollbarThickness();
+    int thickness = scrollbarThickness(scrollbar->controlSize());
 
 #if !defined(__linux__)
     // In layout test mode, we force the button "girth" (i.e., the length of
index 4d8b0bb79095d710ad90ff70843d4d15b4c53865..50b406b85388162113ab4f5cabe8f5336676172a 100644 (file)
@@ -629,7 +629,7 @@ PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
     if (hasCustomScrollbarStyle)
         widget = RenderScrollbar::createCustomScrollbar(this, VerticalScrollbar, this);
     else
-        widget = Scrollbar::createNativeScrollbar(this, VerticalScrollbar, SmallScrollbar);
+        widget = Scrollbar::createNativeScrollbar(this, VerticalScrollbar, theme()->scrollbarControlSizeForPart(ListboxPart));
     document()->view()->addChild(widget.get());        
     return widget.release();
 }
index af1f69490924d92f850cc435626707d020f130cb..3512b21fcf907d7fba2414c8307ec5187d871ec4 100644 (file)
@@ -29,6 +29,7 @@
 #else
 #include "ThemeTypes.h"
 #endif
+#include "ScrollTypes.h"
 
 namespace WebCore {
 
@@ -136,6 +137,8 @@ public:
     virtual int popupInternalPaddingTop(RenderStyle*) const { return 0; }
     virtual int popupInternalPaddingBottom(RenderStyle*) const { return 0; }
     
+    virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return RegularScrollbar; }
+
     // Method for painting the caps lock indicator
     virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { return 0; };
 
index b75021319a74d0deaf22b922f01ab6b628ea6622..7fd4963b165cec3194a640efd3734767177609f3 100644 (file)
@@ -77,6 +77,8 @@ namespace WebCore {
         virtual int popupInternalPaddingTop(RenderStyle*) const;
         virtual int popupInternalPaddingBottom(RenderStyle*) const;
         
+        virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return SmallScrollbar; }
+    
         virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
 
         virtual Color systemColor(int cssValueId) const;
index 0d3160316ced425a6a6ea8e05bbc55d2cc0f7383..63f1d978c707881206c7b466e823d48ae2c8a75d 100644 (file)
@@ -60,6 +60,8 @@ public:
     virtual Color platformInactiveListBoxSelectionBackgroundColor() const;
     virtual Color platformInactiveListBoxSelectionForegroundColor() const;
 
+    virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return SmallScrollbar; }
+    
     virtual void platformColorsDidChange();
 
     // System fonts.