diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 667db78be0ee..d0ee0b149905 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,20 @@ +2017-08-13 Carlos Garcia Campos + + [GTK] stop kinetic scrolling when a zero movement is reached + https://bugs.webkit.org/show_bug.cgi?id=175468 + + Reviewed by Michael Catanzaro. + + This is GTK+ change by Christian Hergert. + https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6 + + When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels, + followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it + feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement. + + * platform/ScrollAnimationKinetic.cpp: + (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll): + 2017-08-13 Chris Dumez Drop non-const getter for CachedResource::resourceRequest() diff --git a/Source/WebCore/platform/ScrollAnimationKinetic.cpp b/Source/WebCore/platform/ScrollAnimationKinetic.cpp index 6e9b9a0653a9..a1ea14f44d85 100644 --- a/Source/WebCore/platform/ScrollAnimationKinetic.cpp +++ b/Source/WebCore/platform/ScrollAnimationKinetic.cpp @@ -81,6 +81,8 @@ ScrollAnimationKinetic::PerAxisData::PerAxisData(double lower, double upper, dou bool ScrollAnimationKinetic::PerAxisData::animateScroll(Seconds timeDelta) { + auto lastPosition = m_position; + auto lastTime = m_elapsedTime; m_elapsedTime += timeDelta; double exponentialPart = exp(-decelFriction * m_elapsedTime.value()); @@ -93,7 +95,7 @@ bool ScrollAnimationKinetic::PerAxisData::animateScroll(Seconds timeDelta) } else if (m_position > m_upper) { m_position = m_upper; m_velocity = 0; - } else if (fabs(m_velocity) < 1) { + } else if (fabs(m_velocity) < 1 || (lastTime && fabs(m_position - lastPosition) < 1)) { m_position = round(m_position); m_velocity = 0; }