[chromium] Halt in progress flings on receipt of key events
[WebKit-https.git] / Source / WebKit / chromium / src / WebViewImpl.cpp
index 554b7b7da4a3832274ca1c2b3eb31836056692c8..c47fddaaee6e5fa5020ca59201ef6e9fcb7f4318 100644 (file)
@@ -690,6 +690,10 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event)
         || (event.type == WebInputEvent::KeyDown)
         || (event.type == WebInputEvent::KeyUp));
 
+    // Halt an in-progress fling on a key event.
+    if (m_gestureAnimation)
+        m_gestureAnimation.clear();
+
     // Please refer to the comments explaining the m_suppressNextKeypressEvent
     // member.
     // The m_suppressNextKeypressEvent is set if the KeyDown is handled by