Bug 1553304 - Use APZC for accessibility scroll action on root node. r=geckoview-reviewers,snorp

Differential Revision: https://phabricator.services.mozilla.com/D32062

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eitan Isaacson 2019-05-21 21:38:57 +00:00
Родитель d8b7df23dc
Коммит cb019e769a
1 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -168,10 +168,24 @@ public class SessionAccessibility {
mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityLongPress", null);
return true;
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityScrollForward", null);
if (virtualViewId == View.NO_ID) {
// Scroll the viewport forwards by approximately 80%.
mSession.getPanZoomController().scrollBy(
ScreenLength.zero(), ScreenLength.fromViewportHeight(0.8),
PanZoomController.SCROLL_BEHAVIOR_AUTO);
} else {
mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityScrollForward", null);
}
return true;
case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityScrollBackward", null);
if (virtualViewId == View.NO_ID) {
// Scroll the viewport backwards by approximately 80%.
mSession.getPanZoomController().scrollBy(
ScreenLength.zero(), ScreenLength.fromViewportHeight(-0.8),
PanZoomController.SCROLL_BEHAVIOR_AUTO);
} else {
mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityScrollBackward", null);
}
return true;
case AccessibilityNodeInfo.ACTION_SELECT:
nativeProvider.click(virtualViewId);