From f116b073399a3c3f644d6e6aeb2521ef9d2c9e9b Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 18 May 2010 13:32:59 -0400 Subject: Prohibit scrolling not initiated by the user. We used to have an ANDROID specific change that was removed when webkit changed. See https://android-git.corp.google.com/w/?p=platform/external/webkit.git;a=commitdiff;h=57a47dd4f75b9c15804c3c61479540cfdc11bd6e Bug 1330729 Bug 2694223 Change-Id: Id51edbb4943eb0a1357477d4bcd31d838febb8fb --- WebKit/android/WebCoreSupport/PlatformBridge.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'WebKit/android/WebCoreSupport') diff --git a/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/WebKit/android/WebCoreSupport/PlatformBridge.cpp index 05aa42b..13bbf38 100644 --- a/WebKit/android/WebCoreSupport/PlatformBridge.cpp +++ b/WebKit/android/WebCoreSupport/PlatformBridge.cpp @@ -27,9 +27,11 @@ #include #include "CookieClient.h" +#include "FrameView.h" #include "JavaSharedClient.h" #include "KeyGeneratorClient.h" #include "PluginView.h" +#include "WebCoreFrameBridge.h" #include "WebViewCore.h" #include "npruntime.h" #include @@ -135,6 +137,17 @@ bool PlatformBridge::isWebViewPaused(const WebCore::FrameView* frameView) return webViewCore->isPaused(); } +bool PlatformBridge::canScroll(const WebCore::FrameView* frameView) +{ + // We want to ignore requests to scroll that were not initiated by the + // user. An example of this is when text is inserted into a + // textfield/area, which results in a scroll. We ignore this because + // we know how to do this ourselves in the UI thread. + // An example of it being initiated by the user is if the user clicks + // an anchor element which simply scrolls the page. + return android::WebFrame::getWebFrame(frameView->frame())->userInitiatedClick(); +} + bool PlatformBridge::popupsAllowed(NPP) { return false; -- cgit v1.1