https://bugs.webkit.org/show_bug.cgi?id=193350
Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-01-31
Reviewed by Carlos Garcia Campos.
Don't immediately set velocity to 0 when position reaches upper or bottom limit.
Instead, set it to the overshot distance, so that position exactly matches upper
or lower limit on the next frame, and then clamp velocity to 0 using the existing
mechanism.
* platform/ScrollAnimationKinetic.cpp:
(WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240789
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2019-01-31 Alexander Mikhaylenko <exalm7659@gmail.com>
+
+ [GTK] Momentum scrolling stops abruptly before websites end
+ https://bugs.webkit.org/show_bug.cgi?id=193350
+
+ Reviewed by Carlos Garcia Campos.
+
+ Don't immediately set velocity to 0 when position reaches upper or bottom limit.
+ Instead, set it to the overshot distance, so that position exactly matches upper
+ or lower limit on the next frame, and then clamp velocity to 0 using the existing
+ mechanism.
+
+ * platform/ScrollAnimationKinetic.cpp:
+ (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
+
2019-01-31 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix incorrect string format
m_velocity = -decelFriction * m_coef2 * exponentialPart;
if (m_position < m_lower) {
+ m_velocity = m_lower - m_position;
m_position = m_lower;
- m_velocity = 0;
} else if (m_position > m_upper) {
+ m_velocity = m_upper - m_position;
m_position = m_upper;
- m_velocity = 0;
- } else if (fabs(m_velocity) < 1 || (lastTime && fabs(m_position - lastPosition) < 1)) {
+ }
+
+ if (fabs(m_velocity) < 1 || (lastTime && fabs(m_position - lastPosition) < 1)) {
m_position = round(m_position);
m_velocity = 0;
}