Skip to content

Commit 9490fe4

Browse files
jreckAndroid (Google) Code Review
authored andcommitted
Merge "Fix lastVisible/global rects" into ics-mr1
2 parents 99898de + 9f9fac0 commit 9490fe4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/java/android/webkit/WebView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,8 +2861,8 @@ private void recordNewContentSize(int w, int h, boolean updateLayout) {
28612861
}
28622862

28632863
// Used to avoid sending many visible rect messages.
2864-
private Rect mLastVisibleRectSent;
2865-
private Rect mLastGlobalRect;
2864+
private Rect mLastVisibleRectSent = new Rect();
2865+
private Rect mLastGlobalRect = new Rect();
28662866
private Rect mVisibleRect = new Rect();
28672867
private Rect mGlobalVisibleRect = new Rect();
28682868
private Point mScrollOffset = new Point();
@@ -2878,7 +2878,7 @@ Rect sendOurVisibleRect() {
28782878
mWebViewCore.sendMessage(EventHub.SET_SCROLL_OFFSET,
28792879
nativeMoveGeneration(), mSendScrollEvent ? 1 : 0, mScrollOffset);
28802880
}
2881-
mLastVisibleRectSent = mVisibleRect;
2881+
mLastVisibleRectSent.set(mVisibleRect);
28822882
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
28832883
}
28842884
if (getGlobalVisibleRect(mGlobalVisibleRect)
@@ -2894,7 +2894,7 @@ Rect sendOurVisibleRect() {
28942894
if (!mBlockWebkitViewMessages) {
28952895
mWebViewCore.sendMessage(EventHub.SET_GLOBAL_BOUNDS, mGlobalVisibleRect);
28962896
}
2897-
mLastGlobalRect = mGlobalVisibleRect;
2897+
mLastGlobalRect.set(mGlobalVisibleRect);
28982898
}
28992899
return mVisibleRect;
29002900
}

0 commit comments

Comments
 (0)