зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d8b7df23dc
Коммит
cb019e769a
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче