Bug 1564549 - Remove event dispatching to dead code. r=geckoview-reviewers,snorp
authorEitan Isaacson <eitan@monotonous.org>
Mon, 23 Sep 2019 23:42:36 +0000
changeset 494803 87148740a6c26ca8fc440804e29ae932c25a22fe
parent 494802 348ec040eaa29265fde613c82d08d5b89ecbd9ba
child 494804 5eca1b56929069654b5851c9dd054e821570fd78
push id114131
push userdluca@mozilla.com
push dateThu, 26 Sep 2019 09:47:34 +0000
treeherdermozilla-inbound@1dc1a755079a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp
bugs1564549
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1564549 - Remove event dispatching to dead code. r=geckoview-reviewers,snorp Some of these should be implemented in the future. Differential Revision: https://phabricator.services.mozilla.com/D45603
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
@@ -212,36 +212,38 @@ public class SessionAccessibility {
                     GeckoBundle nodeInfo = getMostRecentBundle(virtualViewId);
                     if (nodeInfo != null) {
                         if ((nodeInfo.getInt("flags") & (FLAG_SELECTABLE | FLAG_CHECKABLE)) == 0) {
                             sendEvent(AccessibilityEvent.TYPE_VIEW_CLICKED, virtualViewId, nodeInfo.getInt("className"), null);
                         }
                     }
                     return true;
                 case AccessibilityNodeInfo.ACTION_LONG_CLICK:
-                    mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityLongPress", null);
+                    // XXX: Implement long press.
                     return true;
                 case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
                     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);
+                        // XXX: It looks like we never call scroll on virtual views.
+                        // If we did, we should synthesize a wheel event on it's center coordinate.
                     }
                     return true;
                 case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
                     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);
+                        // XXX: It looks like we never call scroll on virtual views.
+                        // If we did, we should synthesize a wheel event on it's center coordinate.
                     }
                     return true;
                 case AccessibilityNodeInfo.ACTION_SELECT:
                     nativeProvider.click(virtualViewId);
                     return true;
                 case AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT:
                     requestViewFocus();
                     nativeProvider.pivot(virtualViewId, arguments != null ?
@@ -260,20 +262,18 @@ public class SessionAccessibility {
                     // the argument value is the BRAILLE_CLICK_BASE_INDEX - the index of the routing key that was hit.
                     // Other negative values are used by ChromeVox, but we don't support them.
                     // FAKE_GRANULARITY_READ_CURRENT = -1
                     // FAKE_GRANULARITY_READ_TITLE = -2
                     // FAKE_GRANULARITY_STOP_SPEECH = -3
                     // FAKE_GRANULARITY_CHANGE_SHIFTER = -4
                     int granularity = arguments.getInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT);
                     if (granularity <= BRAILLE_CLICK_BASE_INDEX) {
-                        int keyIndex = BRAILLE_CLICK_BASE_INDEX - granularity;
-                        data = new GeckoBundle(1);
-                        data.putInt("keyIndex", keyIndex);
-                        mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityActivate", data);
+                        // XXX: Use click offset to update caret position in editables (BRAILLE_CLICK_BASE_INDEX - granularity).
+                        nativeProvider.click(virtualViewId);
                     } else if (granularity > 0) {
                         boolean extendSelection = arguments.getBoolean(AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN);
                         nativeProvider.navigateText(virtualViewId, granularity, mStartOffset, mEndOffset, action == AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, extendSelection);
                     }
                     return true;
                 case AccessibilityNodeInfo.ACTION_SET_SELECTION:
                     if (arguments == null) {
                         return false;