From 6b6403731606a6dcd6a2a6d60a799369924f88d6 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Thu, 8 Oct 2009 14:18:16 -0400 Subject: Fix bug 2132969 Check for a user gesture before adding the history item during a fragment scroll. The bug has been reported to webkit.org with the suggested fix. Although upstream webkit does not have the user gesture additions defined by ANDROID_USER_GESTURE. Bug: 2132969 --- WebCore/loader/FrameLoader.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'WebCore/loader') diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 8e8540d..c28040f 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -3907,7 +3907,14 @@ void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequ KURL url = request.url(); m_documentLoader->replaceRequestURLForAnchorScroll(url); +#ifdef ANDROID_USER_GESTURE + // Do not add history items for a fragment scroll not initiated by the + // user. http://bugs.webkit.org/show_bug.cgi?id=30224 + if (!isRedirect && !shouldTreatURLAsSameAsCurrent(url) + && (isProcessingUserGesture() || request.getUserGesture())) { +#else if (!isRedirect && !shouldTreatURLAsSameAsCurrent(url)) { +#endif // NB: must happen after _setURL, since we add based on the current request. // Must also happen before we openURL and displace the scroll position, since // adding the BF item will save away scroll state. -- cgit v1.1