| Index: content/public/android/java/src/org/chromium/content/browser/input/HandleView.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/HandleView.java b/content/public/android/java/src/org/chromium/content/browser/input/HandleView.java
|
| index e41efcfdfd053684238c41ed651870883aadae57..b8bac44a4cad98f35f370f71bcbee6c61e357fa3 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/input/HandleView.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/HandleView.java
|
| @@ -18,6 +18,8 @@ import android.view.ViewParent;
|
| import android.view.animation.AnimationUtils;
|
| import android.widget.PopupWindow;
|
|
|
| +import com.google.common.annotations.VisibleForTesting;
|
| +
|
| import org.chromium.content.browser.PositionObserver;
|
|
|
| /**
|
| @@ -230,7 +232,8 @@ public class HandleView extends View {
|
| return mContainer.isShowing();
|
| }
|
|
|
| - private boolean isPositionVisible() {
|
| + @VisibleForTesting
|
| + boolean isPositionVisible() {
|
| // Always show a dragging handle.
|
| if (mIsDragging) {
|
| return true;
|
| @@ -250,8 +253,17 @@ public class HandleView extends View {
|
| final int posX = getContainerPositionX() + (int) mHotspotX;
|
| final int posY = getContainerPositionY() + (int) mHotspotY;
|
|
|
| - return posX >= clip.left && posX <= clip.right &&
|
| + boolean result = posX >= clip.left && posX <= clip.right &&
|
| posY >= clip.top && posY <= clip.bottom;
|
| +
|
| + final Rect clippingRect = mController.getVisibleClippingRectangle();
|
| + if (result && clippingRect != null) {
|
| + // We need to clip against the visible areas as supplied by Blink,
|
| + // e.g. textaread and text input elements.
|
| + return clippingRect.contains(getAdjustedPositionX(), getAdjustedPositionY());
|
| + }
|
| +
|
| + return result;
|
| }
|
|
|
| // x and y are in physical pixels.
|
|
|