Index: content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java |
index 3b049e9533ac06e2b36860bb25e210aa189d67ac..1a09b72ba9dd9e9212884d35608ae8ece410e0a5 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java |
@@ -830,6 +830,12 @@ public class BrowserAccessibilityManager { |
mView.getLocationOnScreen(viewLocation); |
rect.offset(viewLocation[0], viewLocation[1]); |
+ // Clip the node's bounding rect to the viewport bounds. |
+ int viewportRectTop = viewLocation[1] + (int) mRenderCoordinates.getContentOffsetYPix(); |
+ int viewportRectBottom = viewportRectTop + mContentViewCore.getViewportHeightPix(); |
+ if (rect.top < viewportRectTop) rect.top = viewportRectTop; |
+ if (rect.bottom > viewportRectBottom) rect.bottom = viewportRectBottom; |
+ |
node.setBoundsInScreen(rect); |
// Work around a bug in the Android framework where if the object with accessibility |