Title: [91146] trunk/Source
Revision
91146
Author
[email protected]
Date
2011-07-15 22:15:36 -0700 (Fri, 15 Jul 2011)

Log Message

Overlay scrollbars in overflow areas no longer pulse when revealed
https://bugs.webkit.org/show_bug.cgi?id=64606
<rdar://problem/9390674>

Patch by Tim Horton <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/WebCore.exp.in (91145 => 91146)


--- trunk/Source/WebCore/WebCore.exp.in	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-07-16 05:15:36 UTC (rev 91146)
@@ -1471,6 +1471,7 @@
 _wkScrollbarPainterKnobRect
 _wkScrollbarPainterPaint
 _wkScrollbarPainterSetDelegate
+_wkScrollbarPainterSetEnabled
 _wkScrollbarPainterSetOverlayState
 _wkScrollbarPainterTrackAlpha
 _wkScrollbarPainterUsesOverlayScrollers

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (91145 => 91146)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2011-07-16 05:15:36 UTC (rev 91146)
@@ -893,6 +893,7 @@
         return;
 
     if (platformWidget()) {
+        notifyPageThatContentAreaWillPaint();
         platformRepaintContentRectangle(paintRect, now);
         return;
     }

Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (91145 => 91146)


--- trunk/Source/WebCore/platform/Scrollbar.cpp	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp	2011-07-16 05:15:36 UTC (rev 91146)
@@ -459,6 +459,7 @@
     if (m_enabled == e)
         return;
     m_enabled = e;
+    theme()->updateEnabledState(this);
     invalidate();
 }
 

Modified: trunk/Source/WebCore/platform/ScrollbarTheme.h (91145 => 91146)


--- trunk/Source/WebCore/platform/ScrollbarTheme.h	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/ScrollbarTheme.h	2011-07-16 05:15:36 UTC (rev 91146)
@@ -42,6 +42,8 @@
     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; }
     

Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (91145 => 91146)


--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h	2011-07-16 05:15:36 UTC (rev 91146)
@@ -39,6 +39,8 @@
     ScrollbarThemeMac();
     virtual ~ScrollbarThemeMac();
 
+    virtual void updateEnabledState(Scrollbar*);
+
     virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
 
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);

Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (91145 => 91146)


--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm	2011-07-16 05:15:36 UTC (rev 91146)
@@ -160,6 +160,7 @@
     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::setNewPainterForScrollbar(Scrollbar* scrollbar, WKScrollbarPainterRef newPainter)
 {
     scrollbarMap()->set(scrollbar, newPainter);
+    updateEnabledState(scrollbar);
 }
 
 WKScrollbarPainterRef ScrollbarThemeMac::painterForScrollbar(Scrollbar* scrollbar)
@@ -444,6 +446,13 @@
 }
 #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)

Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (91145 => 91146)


--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h	2011-07-16 05:15:36 UTC (rev 91146)
@@ -246,6 +246,7 @@
 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);

Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm (91145 => 91146)


--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm	2011-07-16 05:15:36 UTC (rev 91146)
@@ -126,6 +126,7 @@
 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);

Modified: trunk/Source/WebKit/mac/ChangeLog (91145 => 91146)


--- trunk/Source/WebKit/mac/ChangeLog	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-07-16 05:15:36 UTC (rev 91146)
@@ -1,3 +1,19 @@
+2011-07-15  Tim Horton  <[email protected]>
+
+        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  <[email protected]>
 
         Rename applicationIsSolarWalk() to applicationIsSolarWalkMac().

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm (91145 => 91146)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm	2011-07-16 05:15:36 UTC (rev 91146)
@@ -123,6 +123,7 @@
     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
     INIT(MakeScrollbarPainter);
     INIT(ScrollbarPainterSetDelegate);
+    INIT(ScrollbarPainterSetEnabled);
     INIT(ScrollbarPainterPaint);
     INIT(ScrollbarPainterForceFlashScrollers);
     INIT(ScrollbarThickness);

Modified: trunk/Source/WebKit2/ChangeLog (91145 => 91146)


--- trunk/Source/WebKit2/ChangeLog	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebKit2/ChangeLog	2011-07-16 05:15:36 UTC (rev 91146)
@@ -1,3 +1,19 @@
+2011-07-15  Tim Horton  <[email protected]>
+
+        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  <[email protected]>
 
         Have GraphicsLayer pull their contentsScale, rather than pushing it onto them

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (91145 => 91146)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm	2011-07-16 04:41:42 UTC (rev 91145)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm	2011-07-16 05:15:36 UTC (rev 91146)
@@ -113,6 +113,7 @@
         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
         INIT(MakeScrollbarPainter);
         INIT(ScrollbarPainterSetDelegate);
+        INIT(ScrollbarPainterSetEnabled);
         INIT(ScrollbarPainterPaint);
         INIT(ScrollbarPainterForceFlashScrollers);
         INIT(ScrollbarThickness);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to