Title: [107490] trunk/Source/WebCore
Revision
107490
Author
ander...@apple.com
Date
2012-02-11 15:36:34 -0800 (Sat, 11 Feb 2012)

Log Message

Overlay scrollbars don't appear when scrolling on the scrolling thread
https://bugs.webkit.org/show_bug.cgi?id=78427

Reviewed by Sam Weinig.

Add a ScrollAnimator::notifyContentAreaScrolled and call it from ScrollAnimator::notifyContentAreaScrolled.
It is then overridden in ScrollAnimatorMac to tickle AppKit so that overlay scrollbars will be shown.

* platform/ScrollAnimator.h:
(WebCore::ScrollAnimator::notifyContentAreaScrolled):
(ScrollAnimator):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::notifyScrollPositionChanged):
* platform/mac/ScrollAnimatorMac.h:
(ScrollAnimatorMac):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::notifyPositionChanged):
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107489 => 107490)


--- trunk/Source/WebCore/ChangeLog	2012-02-11 23:10:24 UTC (rev 107489)
+++ trunk/Source/WebCore/ChangeLog	2012-02-11 23:36:34 UTC (rev 107490)
@@ -1,5 +1,27 @@
 2012-02-11  Anders Carlsson  <ander...@apple.com>
 
+        Overlay scrollbars don't appear when scrolling on the scrolling thread
+        https://bugs.webkit.org/show_bug.cgi?id=78427
+
+        Reviewed by Sam Weinig.
+
+        Add a ScrollAnimator::notifyContentAreaScrolled and call it from ScrollAnimator::notifyContentAreaScrolled.
+        It is then overridden in ScrollAnimatorMac to tickle AppKit so that overlay scrollbars will be shown.
+
+        * platform/ScrollAnimator.h:
+        (WebCore::ScrollAnimator::notifyContentAreaScrolled):
+        (ScrollAnimator):
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::notifyScrollPositionChanged):
+        * platform/mac/ScrollAnimatorMac.h:
+        (ScrollAnimatorMac):
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::notifyPositionChanged):
+        (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
+        (WebCore):
+
+2012-02-11  Anders Carlsson  <ander...@apple.com>
+
         Implement more ScrollElasticityControllerClient member functions
         https://bugs.webkit.org/show_bug.cgi?id=78425
         <rdar://problem/10710727>

Modified: trunk/Source/WebCore/platform/ScrollAnimator.h (107489 => 107490)


--- trunk/Source/WebCore/platform/ScrollAnimator.h	2012-02-11 23:10:24 UTC (rev 107489)
+++ trunk/Source/WebCore/platform/ScrollAnimator.h	2012-02-11 23:36:34 UTC (rev 107490)
@@ -98,6 +98,8 @@
 
     virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return true; }
 
+    virtual void notifyContentAreaScrolled() { }
+
 protected:
     ScrollAnimator(ScrollableArea*);
 

Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (107489 => 107490)


--- trunk/Source/WebCore/platform/ScrollableArea.cpp	2012-02-11 23:10:24 UTC (rev 107489)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp	2012-02-11 23:36:34 UTC (rev 107490)
@@ -149,6 +149,8 @@
         if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrollbar())
             verticalScrollbar->invalidate();
     }
+
+    scrollAnimator()->notifyContentAreaScrolled();
 }
 
 void ScrollableArea::zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState)

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h (107489 => 107490)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h	2012-02-11 23:10:24 UTC (rev 107489)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h	2012-02-11 23:36:34 UTC (rev 107490)
@@ -111,6 +111,8 @@
 
     virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*);
 
+    virtual void notifyContentAreaScrolled() OVERRIDE;
+
     FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const;
 
     void immediateScrollTo(const FloatPoint&);

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (107489 => 107490)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2012-02-11 23:10:24 UTC (rev 107489)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2012-02-11 23:36:34 UTC (rev 107490)
@@ -653,13 +653,7 @@
 
 void ScrollAnimatorMac::notifyPositionChanged()
 {
-    if (isScrollbarOverlayAPIAvailable()) {
-        // This function is called when a page is going into the page cache, but the page 
-        // isn't really scrolling in that case. We should only pass the message on to the
-        // ScrollbarPainterController when we're really scrolling on an active page.
-        if (scrollableArea()->isOnActivePage())
-            [m_scrollbarPainterController.get() contentAreaScrolled];
-    }
+    notifyContentAreaScrolled();
     ScrollAnimator::notifyPositionChanged();
 }
 
@@ -871,6 +865,18 @@
     return [painter knobAlpha] > 0;
 }
 
+void ScrollAnimatorMac::notifyContentAreaScrolled()
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    // This function is called when a page is going into the page cache, but the page 
+    // isn't really scrolling in that case. We should only pass the message on to the
+    // ScrollbarPainterController when we're really scrolling on an active page.
+    if (scrollableArea()->isOnActivePage())
+        [m_scrollbarPainterController.get() contentAreaScrolled];
+}
+
 void ScrollAnimatorMac::cancelAnimations()
 {
     m_haveScrolledSincePageLoad = false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to