Changeset 244649 in webkit
- Timestamp:
- Apr 25, 2019 9:59:04 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244648 r244649 1 2019-04-25 Alexander Mikhaylenko <exalm7659@gmail.com> 2 3 [GTK] Back/Forward gesture interferes with scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=197168 5 6 Reviewed by Michael Catanzaro. 7 8 When the gesture is released with 0 velocity close to an edge of the webview, 9 the finishing animation is way too long, and in some cases it can look like the 10 gesture is already over, when it's still animating. By scrolling vertically while 11 that happens, it's possible to reset animation over and over again. 12 13 To reduce the duration in this case, instead of using maximum possible duration 14 (400ms), introduce a base velocity and use it for calculating the duration if 15 the actual velocity, relative to the end point, is equal to or less than 0. 16 17 * UIProcess/gtk/ViewGestureControllerGtk.cpp: 18 (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): 19 1 20 2019-04-25 Alexander Mikhaylenko <exalm7659@gmail.com> 2 21 -
trunk/Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp
r241952 r244649 35 35 static const Seconds swipeMinAnimationDuration = 100_ms; 36 36 static const Seconds swipeMaxAnimationDuration = 400_ms; 37 static const double swipeAnimationBaseVelocity = 0.002; 37 38 38 39 // This is derivative of the easing function at t=0 … … 214 215 m_endProgress = m_viewGestureController.isPhysicallySwipingLeft(m_direction) ? 1 : -1; 215 216 216 Seconds duration = swipeMaxAnimationDuration; 217 if ((m_endProgress - m_progress) * m_velocity > 0) { 218 duration = Seconds::fromMilliseconds(std::abs((m_progress - m_endProgress) / m_velocity * swipeAnimationDurationMultiplier)); 219 duration = clampTo<WTF::Seconds>(duration, swipeMinAnimationDuration, swipeMaxAnimationDuration); 220 } 217 double velocity = swipeAnimationBaseVelocity; 218 if ((m_endProgress - m_progress) * m_velocity > 0) 219 velocity = m_velocity; 220 221 Seconds duration = Seconds::fromMilliseconds(std::abs((m_progress - m_endProgress) / velocity * swipeAnimationDurationMultiplier)); 222 duration = clampTo<Seconds>(duration, swipeMinAnimationDuration, swipeMaxAnimationDuration); 221 223 222 224 GtkWidget* widget = m_webPageProxy.viewWidget();
Note: See TracChangeset
for help on using the changeset viewer.