Loading core/java/android/webkit/WebView.java +28 −0 Original line number Diff line number Diff line Loading @@ -2822,6 +2822,34 @@ public class WebView extends AbsoluteLayout return result; } int getBlockLeftEdge(int x, int y, float readingScale) { if (!sDisableNavcache) { return nativeGetBlockLeftEdge(x, y, readingScale); } float invReadingScale = 1.0f / readingScale; int readingWidth = (int) (getViewWidth() * invReadingScale); int left = NO_LEFTEDGE; if (mFocusedNode != null) { final int length = mFocusedNode.mEnclosingParentRects.length; for (int i = 0; i < length; i++) { Rect rect = mFocusedNode.mEnclosingParentRects[i]; if (rect.width() < mFocusedNode.mHitTestSlop) { // ignore bounding boxes that are too small continue; } else if (left != NO_LEFTEDGE && rect.width() > readingWidth) { // stop when bounding box doesn't fit the screen width // at reading scale break; } left = rect.left; } } return left; } // Called by JNI when the DOM has changed the focus. Clear the focus so // that new keys will go to the newly focused field private void domChangedFocus() { Loading core/java/android/webkit/WebViewCore.java +1 −0 Original line number Diff line number Diff line Loading @@ -872,6 +872,7 @@ public final class WebViewCore { Rect[] mTouchRects; boolean mEditable; int mTapHighlightColor = WebView.HIGHLIGHT_COLOR; Rect[] mEnclosingParentRects; // These are the input values that produced this hit test int mHitTestX; Loading core/java/android/webkit/ZoomManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -717,7 +717,7 @@ class ZoomManager { private void zoomToReadingLevel() { final float readingScale = getReadingLevelScale(); int left = mWebView.nativeGetBlockLeftEdge(mAnchorX, mAnchorY, mActualScale); int left = mWebView.getBlockLeftEdge(mAnchorX, mAnchorY, readingScale); if (left != WebView.NO_LEFTEDGE) { // add a 5pt padding to the left edge. int viewLeft = mWebView.contentToViewX(left < 5 ? 0 : (left - 5)) Loading Loading
core/java/android/webkit/WebView.java +28 −0 Original line number Diff line number Diff line Loading @@ -2822,6 +2822,34 @@ public class WebView extends AbsoluteLayout return result; } int getBlockLeftEdge(int x, int y, float readingScale) { if (!sDisableNavcache) { return nativeGetBlockLeftEdge(x, y, readingScale); } float invReadingScale = 1.0f / readingScale; int readingWidth = (int) (getViewWidth() * invReadingScale); int left = NO_LEFTEDGE; if (mFocusedNode != null) { final int length = mFocusedNode.mEnclosingParentRects.length; for (int i = 0; i < length; i++) { Rect rect = mFocusedNode.mEnclosingParentRects[i]; if (rect.width() < mFocusedNode.mHitTestSlop) { // ignore bounding boxes that are too small continue; } else if (left != NO_LEFTEDGE && rect.width() > readingWidth) { // stop when bounding box doesn't fit the screen width // at reading scale break; } left = rect.left; } } return left; } // Called by JNI when the DOM has changed the focus. Clear the focus so // that new keys will go to the newly focused field private void domChangedFocus() { Loading
core/java/android/webkit/WebViewCore.java +1 −0 Original line number Diff line number Diff line Loading @@ -872,6 +872,7 @@ public final class WebViewCore { Rect[] mTouchRects; boolean mEditable; int mTapHighlightColor = WebView.HIGHLIGHT_COLOR; Rect[] mEnclosingParentRects; // These are the input values that produced this hit test int mHitTestX; Loading
core/java/android/webkit/ZoomManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -717,7 +717,7 @@ class ZoomManager { private void zoomToReadingLevel() { final float readingScale = getReadingLevelScale(); int left = mWebView.nativeGetBlockLeftEdge(mAnchorX, mAnchorY, mActualScale); int left = mWebView.getBlockLeftEdge(mAnchorX, mAnchorY, readingScale); if (left != WebView.NO_LEFTEDGE) { // add a 5pt padding to the left edge. int viewLeft = mWebView.contentToViewX(left < 5 ? 0 : (left - 5)) Loading