summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2011-11-10 08:32:18 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-10 08:32:18 -0800
commitc60baec7a737d3c3cd596c5c4378a6e12450da3d (patch)
tree5bf7e9264f31596906a6000570059a72807a1c7b /core/java/android/webkit/WebView.java
parent7c61fa70a50e15466f807dd194e530bc4fd3a96a (diff)
parent331493085d7afd88158c83d0f1f9605da671049c (diff)
downloadframeworks_base-c60baec7a737d3c3cd596c5c4378a6e12450da3d.zip
frameworks_base-c60baec7a737d3c3cd596c5c4378a6e12450da3d.tar.gz
frameworks_base-c60baec7a737d3c3cd596c5c4378a6e12450da3d.tar.bz2
Merge "DO NOT MERGE Set the initial scroll position for RTL." into ics-mr1
Diffstat (limited to 'core/java/android/webkit/WebView.java')
-rw-r--r--core/java/android/webkit/WebView.java39
1 files changed, 18 insertions, 21 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 35efabc..c80994a 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -8733,27 +8733,6 @@ public class WebView extends AbsoluteLayout
isPictureAfterFirstLayout, registerPageSwapCallback);
}
final Point viewSize = draw.mViewSize;
- if (isPictureAfterFirstLayout) {
- // Reset the last sent data here since dealing with new page.
- mLastWidthSent = 0;
- mZoomManager.onFirstLayout(draw);
- if (!mDrawHistory) {
- // Do not send the scroll event for this particular
- // scroll message. Note that a scroll event may
- // still be fired if the user scrolls before the
- // message can be handled.
- mSendScrollEvent = false;
- setContentScrollTo(viewState.mScrollX, viewState.mScrollY);
- mSendScrollEvent = true;
-
- // As we are on a new page, remove the WebTextView. This
- // is necessary for page loads driven by webkit, and in
- // particular when the user was on a password field, so
- // the WebTextView was visible.
- clearTextEntry();
- }
- }
-
// We update the layout (i.e. request a layout from the
// view system) if the last view size that we sent to
// WebCore matches the view size of the picture we just
@@ -8766,7 +8745,25 @@ public class WebView extends AbsoluteLayout
mSendScrollEvent = false;
recordNewContentSize(draw.mContentSize.x,
draw.mContentSize.y, updateLayout);
+
+ if (isPictureAfterFirstLayout) {
+ // Reset the last sent data here since dealing with new page.
+ mLastWidthSent = 0;
+ mZoomManager.onFirstLayout(draw);
+ int scrollX = viewState.mShouldStartScrolledRight
+ ? getContentWidth() : viewState.mScrollX;
+ int scrollY = viewState.mScrollY;
+ setContentScrollTo(scrollX, scrollY);
+ if (!mDrawHistory) {
+ // As we are on a new page, remove the WebTextView. This
+ // is necessary for page loads driven by webkit, and in
+ // particular when the user was on a password field, so
+ // the WebTextView was visible.
+ clearTextEntry();
+ }
+ }
mSendScrollEvent = true;
+
if (DebugFlags.WEB_VIEW) {
Rect b = draw.mInvalRegion.getBounds();
Log.v(LOGTAG, "NEW_PICTURE_MSG_ID {" +