Commit 8aabc22e authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Remove root scroll offset code in Android accessibility.

Android accessibility was using a different code path than other platforms
to compute the bounding box of accessibility objects. In particular, we
were ignoring the root scroll offset from the accessibility tree and using
the offsets from RenderCoordinatesImpl instead.

It looks like this is causing problems with ImplicitRootScroller, and
furthermore it looks like this code is no longer necessary. Switching back
to use the scroll offsets from the accessibility tree seems to fix the
problem.

A follow-up change will remove UseRootScrollOffsetsWhenComputingBounds
entirely. This change is minimal in order to be considered for merging.

Bug: 1005121
Change-Id: I82e97f046cee6b8b08238fcd4368228da368b92a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017662Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734630}
parent 2319d44d
......@@ -431,8 +431,7 @@ void BrowserAccessibilityManagerAndroid::OnAtomicUpdateFinished(
bool BrowserAccessibilityManagerAndroid::
UseRootScrollOffsetsWhenComputingBounds() {
// The Java layer handles the root scroll offset.
return false;
return true;
}
WebContentsAccessibilityAndroid*
......
......@@ -1327,11 +1327,8 @@ public class WebContentsAccessibilityImpl extends AccessibilityNodeProvider
}
protected void convertWebRectToAndroidCoordinates(Rect rect) {
// Offset by the scroll position.
RenderCoordinatesImpl rc = mWebContents.getRenderCoordinates();
rect.offset(-(int) rc.getScrollX(), -(int) rc.getScrollY());
// Convert CSS (web) pixels to Android View pixels
RenderCoordinatesImpl rc = mWebContents.getRenderCoordinates();
rect.left = (int) rc.fromLocalCssToPix(rect.left);
rect.top = (int) rc.fromLocalCssToPix(rect.top);
rect.bottom = (int) rc.fromLocalCssToPix(rect.bottom);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment