diff options
| -rw-r--r-- | core/java/android/webkit/WebView.java | 2 | ||||
| -rw-r--r-- | core/java/android/webkit/WebViewCore.java | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 196c66b..e39e3f1 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1935,6 +1935,7 @@ public class WebView extends AbsoluteLayout int mHeight; int mTextWrapWidth; float mScale; + boolean mIgnoreHeight; } /** @@ -1969,6 +1970,7 @@ public class WebView extends AbsoluteLayout data.mTextWrapWidth = mInZoomOverview ? Math.round(viewWidth / mLastScale) : newWidth; data.mScale = mActualScale; + data.mIgnoreHeight = mZoomScale != 0 && !mHeightCanMeasure; mWebViewCore.sendMessage(EventHub.VIEW_SIZE_CHANGED, data); mLastWidthSent = newWidth; mLastHeightSent = newHeight; diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 25cb249..f474f15 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -418,7 +418,8 @@ final class WebViewCore { should this be called nativeSetViewPortSize? */ private native void nativeSetSize(int width, int height, int screenWidth, - float scale, int realScreenWidth, int screenHeight); + float scale, int realScreenWidth, int screenHeight, + boolean ignoreHeight); private native int nativeGetContentMinPrefWidth(); @@ -918,7 +919,8 @@ final class WebViewCore { WebView.ViewSizeData data = (WebView.ViewSizeData) msg.obj; viewSizeChanged(data.mWidth, data.mHeight, - data.mTextWrapWidth, data.mScale); + data.mTextWrapWidth, data.mScale, + data.mIgnoreHeight); break; } case SET_SCROLL_OFFSET: @@ -1411,7 +1413,8 @@ final class WebViewCore { private float mCurrentViewScale = 1.0f; // notify webkit that our virtual view size changed size (after inv-zoom) - private void viewSizeChanged(int w, int h, int textwrapWidth, float scale) { + private void viewSizeChanged(int w, int h, int textwrapWidth, float scale, + boolean ignoreHeight) { if (DebugFlags.WEB_VIEW_CORE) { Log.v(LOGTAG, "viewSizeChanged w=" + w + "; h=" + h + "; textwrapWidth=" + textwrapWidth + "; scale=" + scale); @@ -1447,7 +1450,7 @@ final class WebViewCore { } } nativeSetSize(width, width == w ? h : Math.round((float) width * h / w), - textwrapWidth, scale, w, h); + textwrapWidth, scale, w, h, ignoreHeight); // Remember the current width and height boolean needInvalidate = (mCurrentViewWidth == 0); mCurrentViewWidth = w; @@ -1905,6 +1908,7 @@ final class WebViewCore { // true. It is safe to use mWidth for mTextWrapWidth. data.mTextWrapWidth = data.mWidth; data.mScale = -1.0f; + data.mIgnoreHeight = false; mEventHub.sendMessageAtFrontOfQueue(Message.obtain(null, EventHub.VIEW_SIZE_CHANGED, data)); } else if (mSettings.getUseWideViewPort()) { @@ -1926,6 +1930,7 @@ final class WebViewCore { / mCurrentViewWidth; data.mTextWrapWidth = Math.round(webViewWidth / mRestoreState.mTextWrapScale); + data.mIgnoreHeight = false; mEventHub.sendMessageAtFrontOfQueue(Message.obtain(null, EventHub.VIEW_SIZE_CHANGED, data)); } |
