Title: [96348] trunk/Source/WebCore
Revision
96348
Author
[email protected]
Date
2011-09-29 12:40:34 -0700 (Thu, 29 Sep 2011)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96347 => 96348)


--- trunk/Source/WebCore/ChangeLog	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/ChangeLog	2011-09-29 19:40:34 UTC (rev 96348)
@@ -1,3 +1,32 @@
+2011-09-29  Alexey Proskuryakov  <[email protected]>
+
+        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.
+
 2011-09-29  Mark Hahnenberg  <[email protected]>
 
         De-virtualize JSCell::visitChildrenVirtual and remove all other visitChildrenVirtual methods

Modified: trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp (96347 => 96348)


--- trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp	2011-09-29 19:40:34 UTC (rev 96348)
@@ -41,7 +41,6 @@
 
 namespace WebCore {
 
-#if PLATFORM(WIN)
 static Page* pageForScrollView(ScrollView* view)
 {
     if (!view)
@@ -53,7 +52,6 @@
         return 0;
     return frameView->frame()->page();
 }
-#endif
 
 bool ScrollbarThemeComposite::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
 {
@@ -308,8 +306,7 @@
 
 void ScrollbarThemeComposite::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
 {
-    FrameView* frameView = static_cast<FrameView*>(view);
-    Page* page = frameView->frame() ? frameView->frame()->page() : 0;
+    Page* page = pageForScrollView(view);
     if (page && page->settings()->shouldPaintCustomScrollbars() && page->chrome()->client()->paintCustomScrollCorner(context, cornerRect))
         return;
     context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);

Modified: trunk/Source/WebCore/platform/chromium/FramelessScrollView.cpp (96347 => 96348)


--- trunk/Source/WebCore/platform/chromium/FramelessScrollView.cpp	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/chromium/FramelessScrollView.cpp	2011-09-29 19:40:34 UTC (rev 96348)
@@ -83,12 +83,6 @@
 {
 }
 
-void FramelessScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
-{
-    // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the ScrollView is a FrameView.
-    ScrollbarTheme::defaultPaintScrollCorner(context, cornerRect);
-}
-
 void FramelessScrollView::contentsResized()
 {
 }

Modified: trunk/Source/WebCore/platform/chromium/FramelessScrollView.h (96347 => 96348)


--- trunk/Source/WebCore/platform/chromium/FramelessScrollView.h	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/chromium/FramelessScrollView.h	2011-09-29 19:40:34 UTC (rev 96348)
@@ -88,7 +88,6 @@
     protected:
         // ScrollView protected methods:
         virtual void paintContents(GraphicsContext*, const IntRect&);
-        virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
         virtual void contentsResized();
         virtual void visibleContentsResized();
 

Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp (96347 => 96348)


--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp	2011-09-29 19:40:34 UTC (rev 96348)
@@ -251,15 +251,6 @@
     return true;
 }
 
-void ScrollbarThemeGtk::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
-{
-    // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the
-    // ScrollView is a FrameView (see FramelessScrollView), so we cannot let
-    // that code run.  For FrameView's this is correct since we don't do custom
-    // scrollbar corner rendering, which ScrollbarThemeComposite supports.
-    ScrollbarTheme::paintScrollCorner(view, context, cornerRect);
-}
-
 bool ScrollbarThemeGtk::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& event)
 {
     return (event.shiftKey() && event.button() == LeftButton) || (event.button() == MiddleButton);

Modified: trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h (96347 => 96348)


--- trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h	2011-09-29 19:40:34 UTC (rev 96348)
@@ -48,7 +48,6 @@
     void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
     void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
     virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect&);
     virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
     virtual int scrollbarThickness(ScrollbarControlSize);
     virtual IntSize buttonSize(Scrollbar*);

Modified: trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.cpp (96347 => 96348)


--- trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.cpp	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.cpp	2011-09-29 19:40:34 UTC (rev 96348)
@@ -241,13 +241,8 @@
     return scrollbar->orientation() == HorizontalScrollbar ? track.width() : track.height();
 }
 
-void ScrollbarThemeQt::paintScrollCorner(ScrollView* scrollView, GraphicsContext* context, const IntRect& rect)
+void ScrollbarThemeQt::paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& rect)
 {
-    if (context->updatingControlTints()) {
-       scrollView->invalidateRect(rect);
-       return;
-    }
-
     StylePainter p(this, context);
     if (!p.isValid())
         return;

Modified: trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp (96347 => 96348)


--- trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp	2011-09-29 19:40:34 UTC (rev 96348)
@@ -179,15 +179,6 @@
     return IntRect(scrollbar->x(), scrollbar->y() + trackStart, thickness, scrollbar->height() - 2 * bs.height());
 }
 
-void ScrollbarThemeWx::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect)
-{
-    // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the
-    // ScrollView is a FrameView (see FramelessScrollView), so we cannot let
-    // that code run.  For FrameView's this is correct since we don't do custom
-    // scrollbar corner rendering, which ScrollbarThemeComposite supports.
-    ScrollbarTheme::paintScrollCorner(view, context, cornerRect);
-}
-
 bool ScrollbarThemeWx::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& rect)
 {
     wxOrientation orientation = (scrollbar->orientation() == HorizontalScrollbar) ? wxHORIZONTAL : wxVERTICAL;

Modified: trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.h (96347 => 96348)


--- trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.h	2011-09-29 19:37:53 UTC (rev 96347)
+++ trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.h	2011-09-29 19:40:34 UTC (rev 96348)
@@ -36,8 +36,6 @@
     virtual ~ScrollbarThemeWx();
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
     virtual bool paint(Scrollbar*, GraphicsContext*, const IntRect&);
-
-    virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect);
     
 protected:
     virtual bool hasButtons(Scrollbar*) { return true; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to