From 5fd03af0d9f4f978332fa17a40cc9f782db2432c Mon Sep 17 00:00:00 2001 From: George Mount Date: Mon, 24 Oct 2011 15:45:31 -0700 Subject: DO NOT MERGE Offset scroll area by the scroll origin on Android Bug 5268793 The scrolled area for WebView is 0,0 - maxX,maxY while ScrollView can have any origin. On RTL pages, the origin is negative when it can scroll. This scrolls the page to the right when it detects an RTL page. Cherry-picked from master CL: I6a91b97f Framework CL: I2537b84a Change-Id: I6a91b97f90f5ba4c323c56dda9d125108d9502c4 --- Source/WebCore/platform/android/ScrollViewAndroid.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source/WebCore/platform/android') diff --git a/Source/WebCore/platform/android/ScrollViewAndroid.cpp b/Source/WebCore/platform/android/ScrollViewAndroid.cpp index f54e5ea..f29e998 100644 --- a/Source/WebCore/platform/android/ScrollViewAndroid.cpp +++ b/Source/WebCore/platform/android/ScrollViewAndroid.cpp @@ -100,7 +100,8 @@ void ScrollView::platformSetScrollPosition(const WebCore::IntPoint& pt) { if (parent()) // don't attempt to scroll subframes; they're fully visible return; - PlatformBridge::setScrollPosition(this, pt.x(), pt.y()); + PlatformBridge::setScrollPosition(this, m_scrollOrigin.x() + pt.x(), + m_scrollOrigin.y() + pt.y()); } void ScrollView::platformSetScrollbarModes() @@ -119,7 +120,9 @@ void ScrollView::platformScrollbarModes(ScrollbarMode& h, ScrollbarMode& v) cons void ScrollView::platformRepaintContentRectangle(const IntRect &rect, bool now) { - android::WebViewCore::getWebViewCore(this)->contentInvalidate(rect); + IntRect offsetRect = rect; + offsetRect.move(m_scrollOrigin.x(), m_scrollOrigin.y()); + android::WebViewCore::getWebViewCore(this)->contentInvalidate(offsetRect); } #ifdef ANDROID_CAPTURE_OFFSCREEN_PAINTS -- cgit v1.1