Changeset 96348 in webkit


Ignore:
Timestamp:
Sep 29, 2011 12:40:34 PM (13 years ago)
Author:
ap@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=69040
ScrollbarThemeComposite requires a ScrollView to draw scroll corner

Reviewed by Simon Fraser.

No new tests. This will be needed later.

  • platform/ScrollbarThemeComposite.cpp:

(WebCore::pageForScrollView):
(WebCore::ScrollbarThemeComposite::paintScrollCorner):
Use pageForScrollView() function which already existed in this file, used in another similar
location.

  • platform/chromium/FramelessScrollView.cpp:
  • platform/chromium/FramelessScrollView.h:
  • platform/gtk/ScrollbarThemeGtk.cpp:
  • platform/gtk/ScrollbarThemeGtk.h:
  • platform/wx/ScrollbarThemeWx.cpp:
  • platform/wx/ScrollbarThemeWx.h:

All these overrides are no longer needed, ScrollbarThemeComposite will do the right thing.

  • platform/qt/ScrollbarThemeQt.cpp: (WebCore::ScrollbarThemeQt::paintScrollCorner):

Removed a special case for updatingControlTints phase. The same case is present in cross-platform
code now, and Qt doesn't have any custom subclasses of ScrollableArea or ScrollView to need
special handling.
This was added in r37377 without a bug or much ChangeLog explanation.

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96346 r96348  
     12011-09-29  Alexey Proskuryakov  <ap@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=69040
     4        ScrollbarThemeComposite requires a ScrollView to draw scroll corner
     5
     6        Reviewed by Simon Fraser.
     7
     8        No new tests. This will be needed later.
     9
     10        * platform/ScrollbarThemeComposite.cpp:
     11        (WebCore::pageForScrollView):
     12        (WebCore::ScrollbarThemeComposite::paintScrollCorner):
     13        Use pageForScrollView() function which already existed in this file, used in another similar
     14        location.
     15
     16        * platform/chromium/FramelessScrollView.cpp:
     17        * platform/chromium/FramelessScrollView.h:
     18        * platform/gtk/ScrollbarThemeGtk.cpp:
     19        * platform/gtk/ScrollbarThemeGtk.h:
     20        * platform/wx/ScrollbarThemeWx.cpp:
     21        * platform/wx/ScrollbarThemeWx.h:
     22        All these overrides are no longer needed, ScrollbarThemeComposite will do the right thing.
     23
     24        * platform/qt/ScrollbarThemeQt.cpp: (WebCore::ScrollbarThemeQt::paintScrollCorner):
     25        Removed a special case for updatingControlTints phase. The same case is present in cross-platform
     26        code now, and Qt doesn't have any custom subclasses of ScrollableArea or ScrollView to need
     27        special handling.
     28        This was added in r37377 without a bug or much ChangeLog explanation.
     29
    1302011-09-29  Mark Hahnenberg  <mhahnenberg@apple.com>
    231
  • trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp

    r95901 r96348  
    4242namespace WebCore {
    4343
    44 #if PLATFORM(WIN)
    4544static Page* pageForScrollView(ScrollView* view)
    4645{
     
    5453    return frameView->frame()->page();
    5554}
    56 #endif
    5755
    5856bool ScrollbarThemeComposite::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
     
    309307void ScrollbarThemeComposite::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
    310308{
    311     FrameView* frameView = static_cast<FrameView*>(view);
    312     Page* page = frameView->frame() ? frameView->frame()->page() : 0;
     309    Page* page = pageForScrollView(view);
    313310    if (page && page->settings()->shouldPaintCustomScrollbars() && page->chrome()->client()->paintCustomScrollCorner(context, cornerRect))
    314311        return;
  • trunk/Source/WebCore/platform/chromium/FramelessScrollView.cpp

    r95901 r96348  
    8484}
    8585
    86 void FramelessScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
    87 {
    88     // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the ScrollView is a FrameView.
    89     ScrollbarTheme::defaultPaintScrollCorner(context, cornerRect);
    90 }
    91 
    9286void FramelessScrollView::contentsResized()
    9387{
  • trunk/Source/WebCore/platform/chromium/FramelessScrollView.h

    r95901 r96348  
    8989        // ScrollView protected methods:
    9090        virtual void paintContents(GraphicsContext*, const IntRect&);
    91         virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
    9291        virtual void contentsResized();
    9392        virtual void visibleContentsResized();
  • trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp

    r95901 r96348  
    252252}
    253253
    254 void ScrollbarThemeGtk::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
    255 {
    256     // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the
    257     // ScrollView is a FrameView (see FramelessScrollView), so we cannot let
    258     // that code run.  For FrameView's this is correct since we don't do custom
    259     // scrollbar corner rendering, which ScrollbarThemeComposite supports.
    260     ScrollbarTheme::paintScrollCorner(view, context, cornerRect);
    261 }
    262 
    263254bool ScrollbarThemeGtk::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& event)
    264255{
  • trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h

    r95901 r96348  
    4949    void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
    5050    virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
    51     virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect&);
    5251    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
    5352    virtual int scrollbarThickness(ScrollbarControlSize);
  • trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.cpp

    r95901 r96348  
    242242}
    243243
    244 void ScrollbarThemeQt::paintScrollCorner(ScrollView* scrollView, GraphicsContext* context, const IntRect& rect)
    245 {
    246     if (context->updatingControlTints()) {
    247        scrollView->invalidateRect(rect);
    248        return;
    249     }
    250 
     244void ScrollbarThemeQt::paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& rect)
     245{
    251246    StylePainter p(this, context);
    252247    if (!p.isValid())
  • trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp

    r95901 r96348  
    180180}
    181181
    182 void ScrollbarThemeWx::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
    183 {
    184     // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the
    185     // ScrollView is a FrameView (see FramelessScrollView), so we cannot let
    186     // that code run.  For FrameView's this is correct since we don't do custom
    187     // scrollbar corner rendering, which ScrollbarThemeComposite supports.
    188     ScrollbarTheme::paintScrollCorner(view, context, cornerRect);
    189 }
    190 
    191182bool ScrollbarThemeWx::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& rect)
    192183{
  • trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.h

    r95901 r96348  
    3737    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
    3838    virtual bool paint(Scrollbar*, GraphicsContext*, const IntRect&);
    39 
    40     virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect);
    4139   
    4240protected:
Note: See TracChangeset for help on using the changeset viewer.