From f2e6115404dbd211ddef223e2b380cefd999aac4 Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 20 Aug 2012 17:13:47 -0700 Subject: [PATCH] Support scrolling layers with the mousewheel Bug: 6635437 Fix onGenericAction to support scrolling layers. Calling startScrollingLayer detects if there is a layer under the mouse pointer, and if so switches to DRAG_LAYER_MODE. Then, calling doDrag will correctly handle scrolling the layer in DRAG_LAYER_MODE, switching out of DRAG_LAYER_MODE when we hit the end of a layer, and scrolling the page if there isn't a layer. It is the method used by the touch drag path. Change-Id: I00be09a63c40caa8fce94134c57db0894a62fef0 --- core/java/android/webkit/WebViewClassic.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index c816d5b50f373..56654fd257cfe 100644 --- a/core/java/android/webkit/WebViewClassic.java +++ b/core/java/android/webkit/WebViewClassic.java @@ -6441,9 +6441,13 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc mWebViewPrivate.getVerticalScrollFactor()); final int hdelta = (int) (hscroll * mWebViewPrivate.getHorizontalScrollFactor()); - if (pinScrollBy(hdelta, vdelta, false, 0)) { - return true; - } + + abortAnimation(); + int oldTouchMode = mTouchMode; + startScrollingLayer(event.getX(), event.getY()); + doDrag(hdelta, vdelta); + mTouchMode = oldTouchMode; + return true; } } }