Overlay scrollbars in overflow areas no longer pulse when revealed
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Jul 2011 05:15:36 +0000 (05:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Jul 2011 05:15:36 +0000 (05:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64606
<rdar://problem/9390674>

Patch by Tim Horton <timothy_horton@apple.com> on 2011-07-15
Reviewed by Simon Fraser.

Ensure that the state of the scrollbar implementation is kept in sync
with WebCore's internal representation. Previously, we synchronized them
at paint time, causing pulsing to be skipped due to the scrollbars being
disabled.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

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

12 files changed:
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/ScrollbarTheme.h
Source/WebCore/platform/mac/ScrollbarThemeMac.h
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm

index d49e93e..b9a2451 100644 (file)
@@ -1471,6 +1471,7 @@ _wkScrollbarPainterKnobAlpha
 _wkScrollbarPainterKnobRect
 _wkScrollbarPainterPaint
 _wkScrollbarPainterSetDelegate
+_wkScrollbarPainterSetEnabled
 _wkScrollbarPainterSetOverlayState
 _wkScrollbarPainterTrackAlpha
 _wkScrollbarPainterUsesOverlayScrollers
index 19a886d..f4d0634 100644 (file)
@@ -893,6 +893,7 @@ void ScrollView::repaintContentRectangle(const IntRect& rect, bool now)
         return;
 
     if (platformWidget()) {
+        notifyPageThatContentAreaWillPaint();
         platformRepaintContentRectangle(paintRect, now);
         return;
     }
index 20e0b8d..a79533b 100644 (file)
@@ -459,6 +459,7 @@ void Scrollbar::setEnabled(bool e)
     if (m_enabled == e)
         return;
     m_enabled = e;
+    theme()->updateEnabledState(this);
     invalidate();
 }
 
index dbd24b8..ed36f90 100644 (file)
@@ -42,6 +42,8 @@ public:
     ScrollbarTheme() { }
     virtual ~ScrollbarTheme() {};
 
+    virtual void updateEnabledState(Scrollbar*) { };
+
     virtual bool paint(Scrollbar*, GraphicsContext*, const IntRect& /*damageRect*/) { return false; }
     virtual ScrollbarPart hitTest(Scrollbar*, const PlatformMouseEvent&) { return NoPart; }
     
index b3be064..977a67d 100644 (file)
@@ -39,6 +39,8 @@ public:
     ScrollbarThemeMac();
     virtual ~ScrollbarThemeMac();
 
+    virtual void updateEnabledState(Scrollbar*);
+
     virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
 
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
index aa79dd9..f82f139 100644 (file)
@@ -160,6 +160,7 @@ void ScrollbarThemeMac::registerScrollbar(Scrollbar* scrollbar)
     bool isHorizontal = scrollbar->orientation() == HorizontalScrollbar;
     WKScrollbarPainterRef scrollbarPainter = wkMakeScrollbarPainter(scrollbar->controlSize(), isHorizontal);
     scrollbarMap()->add(scrollbar, scrollbarPainter);
+    updateEnabledState(scrollbar);
 #else
     scrollbarMap()->add(scrollbar);
 #endif
@@ -174,6 +175,7 @@ void ScrollbarThemeMac::unregisterScrollbar(Scrollbar* scrollbar)
 void ScrollbarThemeMac::setNewPainterForScrollbar(Scrollbar* scrollbar, WKScrollbarPainterRef newPainter)
 {
     scrollbarMap()->set(scrollbar, newPainter);
+    updateEnabledState(scrollbar);
 }
 
 WKScrollbarPainterRef ScrollbarThemeMac::painterForScrollbar(Scrollbar* scrollbar)
@@ -444,6 +446,13 @@ static inline wkScrollerKnobStyle toScrollbarPainterKnobStyle(ScrollbarOverlaySt
 }
 #endif
 
+void ScrollbarThemeMac::updateEnabledState(Scrollbar* scrollbar)
+{
+#if USE(WK_SCROLLBAR_PAINTER)
+    wkScrollbarPainterSetEnabled(scrollbarMap()->get(scrollbar).get(), scrollbar->enabled());
+#endif
+}
+
 bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
index bc24321..7652471 100644 (file)
@@ -246,6 +246,7 @@ typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
 extern WKScrollbarPainterRef (*wkMakeScrollbarPainter)(int controlSize, bool isHorizontal);
 extern WKScrollbarPainterRef (*wkMakeScrollbarReplacementPainter)(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
 extern void (*wkScrollbarPainterSetDelegate)(WKScrollbarPainterRef, id scrollbarPainterDelegate);
+extern void (*wkScrollbarPainterSetEnabled)(WKScrollbarPainterRef, bool enabled);
 extern void (*wkScrollbarPainterPaint)(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
 extern void (*wkScrollbarPainterForceFlashScrollers)(WKScrollbarPainterControllerRef);
 extern int (*wkScrollbarThickness)(int controlSize);
index 35d90b6..e55fa11 100644 (file)
@@ -126,6 +126,7 @@ CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
 WKScrollbarPainterRef (*wkMakeScrollbarPainter)(int controlSize, bool isHorizontal);
 WKScrollbarPainterRef (*wkMakeScrollbarReplacementPainter)(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
 void (*wkScrollbarPainterSetDelegate)(WKScrollbarPainterRef, id scrollbarPainterDelegate);
+void (*wkScrollbarPainterSetEnabled)(WKScrollbarPainterRef, bool enabled);
 void (*wkScrollbarPainterPaint)(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
 void (*wkScrollbarPainterForceFlashScrollers)(WKScrollbarPainterControllerRef);
 int (*wkScrollbarThickness)(int controlSize);
index bb3c5dd..3888994 100644 (file)
@@ -1,3 +1,19 @@
+2011-07-15  Tim Horton  <timothy_horton@apple.com>
+
+        Overlay scrollbars in overflow areas no longer pulse when revealed
+        https://bugs.webkit.org/show_bug.cgi?id=64606
+        <rdar://problem/9390674>
+
+        Reviewed by Simon Fraser.
+
+        Ensure that the state of the scrollbar implementation is kept in sync
+        with WebCore's internal representation. Previously, we synchronized them
+        at paint time, causing pulsing to be skipped due to the scrollbars being
+        disabled.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-07-15  Andy Estes  <aestes@apple.com>
 
         Rename applicationIsSolarWalk() to applicationIsSolarWalkMac().
index d3b1b89..f5cc69d 100644 (file)
@@ -123,6 +123,7 @@ void InitWebCoreSystemInterface(void)
     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
     INIT(MakeScrollbarPainter);
     INIT(ScrollbarPainterSetDelegate);
+    INIT(ScrollbarPainterSetEnabled);
     INIT(ScrollbarPainterPaint);
     INIT(ScrollbarPainterForceFlashScrollers);
     INIT(ScrollbarThickness);
index 2977d29..d3f6971 100644 (file)
@@ -1,3 +1,19 @@
+2011-07-15  Tim Horton  <timothy_horton@apple.com>
+
+        Overlay scrollbars in overflow areas no longer pulse when revealed
+        https://bugs.webkit.org/show_bug.cgi?id=64606
+        <rdar://problem/9390674>
+
+        Reviewed by Simon Fraser.
+
+        Ensure that the state of the scrollbar implementation is kept in sync
+        with WebCore's internal representation. Previously, we synchronized them
+        at paint time, causing pulsing to be skipped due to the scrollbars being
+        disabled.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-07-15  Simon Fraser  <simon.fraser@apple.com>
 
         Have GraphicsLayer pull their contentsScale, rather than pushing it onto them
index 47dc274..a390b2b 100644 (file)
@@ -113,6 +113,7 @@ void InitWebCoreSystemInterface(void)
         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
         INIT(MakeScrollbarPainter);
         INIT(ScrollbarPainterSetDelegate);
+        INIT(ScrollbarPainterSetEnabled);
         INIT(ScrollbarPainterPaint);
         INIT(ScrollbarPainterForceFlashScrollers);
         INIT(ScrollbarThickness);