From 0653d22f6279a81cbad27d8b0d5729f43ae1d66e Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 23 Apr 2010 15:21:24 -0700 Subject: [PATCH] Only honor the scrollbar mode at the minimum zoom level. This reduced the impact of https://android-git.corp.google.com/g/#change,48683. In GB, we need to revisit this issue. Wit this CL, http://b/issue?id=2512549 is still fine. Fix http://b/issue?id=2619398 It should fix http://b/issue?id=2619415 when it is not in zoom out case. It doesn't fix http://b/issue?id=2620979 as the site is a mobile site. We have conflict with the requirement from http://b/issue?id=2512549 --- core/java/android/webkit/WebView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 66dad0bc107b1..6f4c6ffc87087 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -2286,7 +2286,9 @@ public class WebView extends AbsoluteLayout protected int computeHorizontalScrollRange() { if (mDrawHistory) { return mHistoryWidth; - } else if (mHorizontalScrollBarMode == SCROLLBAR_ALWAYSOFF) { + } else if (mHorizontalScrollBarMode == SCROLLBAR_ALWAYSOFF + && (mActualScale - mMinZoomScale <= MINIMUM_SCALE_INCREMENT)) { + // only honor the scrollbar mode when it is at minimum zoom level return computeHorizontalScrollExtent(); } else { // to avoid rounding error caused unnecessary scrollbar, use floor @@ -2298,7 +2300,9 @@ public class WebView extends AbsoluteLayout protected int computeVerticalScrollRange() { if (mDrawHistory) { return mHistoryHeight; - } else if (mVerticalScrollBarMode == SCROLLBAR_ALWAYSOFF) { + } else if (mVerticalScrollBarMode == SCROLLBAR_ALWAYSOFF + && (mActualScale - mMinZoomScale <= MINIMUM_SCALE_INCREMENT)) { + // only honor the scrollbar mode when it is at minimum zoom level return computeVerticalScrollExtent(); } else { // to avoid rounding error caused unnecessary scrollbar, use floor