Title: [113161] trunk/Source/WebCore
Revision
113161
Author
[email protected]
Date
2012-04-04 03:29:26 -0700 (Wed, 04 Apr 2012)

Log Message

[GTK] Scrolling doesn't work in WebKit2 since r110185
https://bugs.webkit.org/show_bug.cgi?id=81779

Patch by Zan Dobersek <[email protected]> on 2012-04-04
Reviewed by James Robinson.

Bring back functionality of the ScrollAnimatorNone for ports that
use a fallback timer for animation frames.

No new tests - only restoring previous functionality.

* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::ScrollAnimatorNone):
(WebCore::ScrollAnimatorNone::fireUpAnAnimation):
(WebCore):
(WebCore::ScrollAnimatorNone::animationTimerFired):
(WebCore::ScrollAnimatorNone::startNextTimer):
(WebCore::ScrollAnimatorNone::animationTimerActive):
(WebCore::ScrollAnimatorNone::stopAnimationTimerIfNeeded):
* platform/ScrollAnimatorNone.h:
(ScrollAnimatorNone):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (113160 => 113161)


--- trunk/Source/WebCore/ChangeLog	2012-04-04 10:27:09 UTC (rev 113160)
+++ trunk/Source/WebCore/ChangeLog	2012-04-04 10:29:26 UTC (rev 113161)
@@ -1,3 +1,26 @@
+2012-04-04  Zan Dobersek  <[email protected]>
+
+        [GTK] Scrolling doesn't work in WebKit2 since r110185
+        https://bugs.webkit.org/show_bug.cgi?id=81779
+
+        Reviewed by James Robinson.
+
+        Bring back functionality of the ScrollAnimatorNone for ports that
+        use a fallback timer for animation frames.
+
+        No new tests - only restoring previous functionality.
+
+        * platform/ScrollAnimatorNone.cpp:
+        (WebCore::ScrollAnimatorNone::ScrollAnimatorNone):
+        (WebCore::ScrollAnimatorNone::fireUpAnAnimation):
+        (WebCore):
+        (WebCore::ScrollAnimatorNone::animationTimerFired):
+        (WebCore::ScrollAnimatorNone::startNextTimer):
+        (WebCore::ScrollAnimatorNone::animationTimerActive):
+        (WebCore::ScrollAnimatorNone::stopAnimationTimerIfNeeded):
+        * platform/ScrollAnimatorNone.h:
+        (ScrollAnimatorNone):
+
 2012-04-02  Peter Rybin  <[email protected]>
 
         Web Inspector: CodeGeneratorInspector.py: switch Inspector, Memory and Database domains to typed API

Modified: trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp (113160 => 113161)


--- trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp	2012-04-04 10:27:09 UTC (rev 113160)
+++ trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp	2012-04-04 10:29:26 UTC (rev 113161)
@@ -381,7 +381,11 @@
     , m_horizontalData(this, &m_currentPosX, scrollableArea->visibleWidth())
     , m_verticalData(this, &m_currentPosY, scrollableArea->visibleHeight())
     , m_startTime(0)
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+    , m_animationTimer(this, &ScrollAnimatorNone::animationTimerFired)
+#else
     , m_animationActive(false)
+#endif
     , m_firstVelocity(0)
     , m_firstVelocitySet(false)
     , m_firstVelocityIsVertical(false)
@@ -398,7 +402,11 @@
     if (m_gestureAnimation)
         m_gestureAnimation.clear();
     m_gestureAnimation = ActivePlatformGestureAnimation::create(TouchpadFlingPlatformGestureCurve::create(fp), this);
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+    startNextTimer(0);
+#else
     startNextTimer();
+#endif
 }
 
 bool ScrollAnimatorNone::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
@@ -479,6 +487,7 @@
     notifyPositionChanged();
 }
 
+#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
 void ScrollAnimatorNone::cancelAnimations()
 {
     m_animationActive = false;
@@ -490,6 +499,7 @@
     if (m_animationActive)
         animationTimerFired();
 }
+#endif
 
 void ScrollAnimatorNone::willEndLiveResize()
 {
@@ -512,6 +522,13 @@
     m_verticalData.updateVisibleLength(scrollableArea()->visibleHeight());
 }
 
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+void ScrollAnimatorNone::animationTimerFired(Timer<ScrollAnimatorNone>* timer)
+{
+    animationTimerFired();
+}
+#endif
+
 void ScrollAnimatorNone::animationTimerFired()
 {
 #if PLATFORM(CHROMIUM)
@@ -536,9 +553,13 @@
     }
 
     if (continueAnimation)
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+        startNextTimer(max(kMinimumTimerInterval, deltaToNextFrame));
+#else
         startNextTimer();
     else
         m_animationActive = false;
+#endif
 
 #if PLATFORM(CHROMIUM)
     TRACE_EVENT("ScrollAnimatorNone::notifyPositionChanged", this, 0);
@@ -546,21 +567,36 @@
     notifyPositionChanged();
 }
 
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+void ScrollAnimatorNone::startNextTimer(double delay)
+{
+    m_animationTimer.startOneShot(delay);
+}
+#else
 void ScrollAnimatorNone::startNextTimer()
 {
     if (scrollableArea()->scheduleAnimation())
         m_animationActive = true;
 }
+#endif
 
 bool ScrollAnimatorNone::animationTimerActive()
 {
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+    return m_animationTimer.isActive();
+#else
     return m_animationActive;
+#endif
 }
 
 void ScrollAnimatorNone::stopAnimationTimerIfNeeded()
 {
     if (animationTimerActive())
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+        m_animationTimer.stop();
+#else
         m_animationActive = false;
+#endif
 }
 
 void ScrollAnimatorNone::scrollBy(const IntPoint& location)

Modified: trunk/Source/WebCore/platform/ScrollAnimatorNone.h (113160 => 113161)


--- trunk/Source/WebCore/platform/ScrollAnimatorNone.h	2012-04-04 10:27:09 UTC (rev 113160)
+++ trunk/Source/WebCore/platform/ScrollAnimatorNone.h	2012-04-04 10:29:26 UTC (rev 113161)
@@ -59,8 +59,10 @@
     virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
     virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
 
+#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
     virtual void cancelAnimations();
     virtual void serviceScrollAnimations();
+#endif
 
     virtual void willEndLiveResize();
     virtual void didAddVerticalScrollbar(Scrollbar*);
@@ -141,7 +143,12 @@
         int m_visibleLength;
     };
 
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+    void animationTimerFired(Timer<ScrollAnimatorNone>*);
+    void startNextTimer(double delay);
+#else
     void startNextTimer();
+#endif
     void animationTimerFired();
 
     void stopAnimationTimerIfNeeded();
@@ -153,7 +160,11 @@
     PerAxisData m_verticalData;
 
     double m_startTime;
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+    Timer<ScrollAnimatorNone> m_animationTimer;
+#else
     bool m_animationActive;
+#endif
 
     float m_firstVelocity;
     bool m_firstVelocitySet;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to