Changeset 80353 in webkit


Ignore:
Timestamp:
Mar 4, 2011 8:07:12 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-03-04 Ilya Sherman <isherman@chromium.org>

Reviewed by James Robinson.

Override paintScrollCorner() for FramelessScrollView to forego any custom scrollbar corner rendering.
This was previously done in ScrollbarThemeChromium, but we also need this on the Mac when the ScrollView
is a FramelessScrollView -- which is mostly just for Autofill.
In service of http://crbug.com/73772 (crash)
https://bugs.webkit.org/show_bug.cgi?id=55557

No tests added because this fix is Chromium-specific and the code is currently untestable from within WebKit.
In particular, DRT crashes when trying to render a FramelessScrollView.

  • platform/ScrollbarTheme.h: (WebCore::ScrollbarTheme::paintScrollCorner): Body moved to static function defaultPaintScrollCorner(). (WebCore::ScrollbarTheme::defaultPaintScrollCorner): Added.
  • platform/chromium/FramelessScrollView.cpp: (WebCore::FramelessScrollView::paintContents): (WebCore::FramelessScrollView::paintScrollCorner): Fix implementation moved to here from ScrollbarThemeChromium
  • platform/chromium/FramelessScrollView.h:
  • platform/chromium/ScrollbarThemeChromium.cpp:
  • platform/chromium/ScrollbarThemeChromium.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80350 r80353  
     12011-03-04  Ilya Sherman  <isherman@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        Override paintScrollCorner() for FramelessScrollView to forego any custom scrollbar corner rendering.
     6        This was previously done in ScrollbarThemeChromium, but we also need this on the Mac when the ScrollView
     7        is a FramelessScrollView -- which is mostly just for Autofill.
     8        In service of http://crbug.com/73772 (crash)
     9        https://bugs.webkit.org/show_bug.cgi?id=55557
     10
     11        No tests added because this fix is Chromium-specific and the code is currently untestable from within WebKit.
     12        In particular, DRT crashes when trying to render a FramelessScrollView.
     13
     14        * platform/ScrollbarTheme.h:
     15        (WebCore::ScrollbarTheme::paintScrollCorner): Body moved to static function defaultPaintScrollCorner().
     16        (WebCore::ScrollbarTheme::defaultPaintScrollCorner): Added.
     17        * platform/chromium/FramelessScrollView.cpp:
     18        (WebCore::FramelessScrollView::paintContents):
     19        (WebCore::FramelessScrollView::paintScrollCorner): Fix implementation moved to here from ScrollbarThemeChromium
     20        * platform/chromium/FramelessScrollView.h:
     21        * platform/chromium/ScrollbarThemeChromium.cpp:
     22        * platform/chromium/ScrollbarThemeChromium.h:
     23
    1242011-03-04  Yury Semikhatsky  <yurys@chromium.org>
    225
  • trunk/Source/WebCore/platform/ScrollbarTheme.h

    r76248 r80353  
    7777    virtual void invalidatePart(Scrollbar*, ScrollbarPart) {}
    7878
    79     virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
     79    virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
     80    static void defaultPaintScrollCorner(GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
    8081
    8182    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&) { return false; }
  • trunk/Source/WebCore/platform/chromium/FramelessScrollView.cpp

    r55675 r80353  
    3333
    3434#include "FramelessScrollViewClient.h"
     35#include "ScrollbarTheme.h"
    3536
    3637namespace WebCore {
     
    7374}
    7475
    75 void FramelessScrollView::paintContents(GraphicsContext*, const IntRect& damageRect)
     76void FramelessScrollView::paintContents(GraphicsContext*, const IntRect&)
    7677{
     78}
     79
     80void FramelessScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
     81{
     82    // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the ScrollView is a FrameView.
     83    ScrollbarTheme::defaultPaintScrollCorner(context, cornerRect);
    7784}
    7885
  • trunk/Source/WebCore/platform/chromium/FramelessScrollView.h

    r76378 r80353  
    7575    protected:
    7676        // ScrollView protected methods:
    77         virtual void paintContents(GraphicsContext*, const IntRect& damageRect);
     77        virtual void paintContents(GraphicsContext*, const IntRect&);
     78        virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
    7879        virtual void contentsResized();
    7980        virtual void visibleContentsResized();
  • trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp

    r77286 r80353  
    138138}
    139139
    140 void ScrollbarThemeChromium::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
    141 {
    142     // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the
    143     // ScrollView is a FrameView (see FramelessScrollView), so we cannot let
    144     // that code run.  For FrameView's this is correct since we don't do custom
    145     // scrollbar corner rendering, which ScrollbarThemeComposite supports.
    146     ScrollbarTheme::paintScrollCorner(view, context, cornerRect);
    147 }
    148 
    149140} // namespace WebCore
  • trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromium.h

    r45459 r80353  
    4949        virtual IntRect trackRect(Scrollbar*, bool painting = false);
    5050
    51         virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect&);
    52 
    5351        virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
    5452        virtual void paintTickmarks(GraphicsContext*, Scrollbar*, const IntRect&);
Note: See TracChangeset for help on using the changeset viewer.