Bug 1230838 - Let hover events fall through to Gecko when accessibility is turned on - don't throw an exception in the NativePanZoomController when default prevented. r=kats
authorsgiles <sgiles@mozilla.com>
Thu, 10 Dec 2015 13:20:53 -0500
changeset 276194 58b6faf4c31c9145981552c22c924d4e7c5d8bae
parent 276193 74f815f997bb2443ab39c403afce33c5cbbae58f
child 276195 b4fa22948cf411dddee52b893f2f49bad4dcf9d7
push id29785
push userphilringnalda@gmail.com
push dateSat, 12 Dec 2015 05:18:28 +0000
treeherdermozilla-central@d8ce27c85590 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1230838
milestone45.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 1230838 - Let hover events fall through to Gecko when accessibility is turned on - don't throw an exception in the NativePanZoomController when default prevented. r=kats
mobile/android/base/java/org/mozilla/gecko/gfx/LayerView.java
mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
widget/android/AndroidJavaWrappers.cpp
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/LayerView.java
@@ -247,20 +247,16 @@ public class LayerView extends ScrollVie
     public boolean onHoverEvent(MotionEvent event) {
         // If we get a touchscreen hover event, and accessibility is not enabled,
         // don't send it to gecko.
         if (event.getSource() == InputDevice.SOURCE_TOUCHSCREEN &&
             !GeckoAccessibility.isEnabled()) {
             return false;
         }
 
-        if (AppConstants.MOZ_ANDROID_APZ && mPanZoomController != null && mPanZoomController.onTouchEvent(event)) {
-            return true;
-        }
-
         return sendEventToGecko(event);
     }
 
     @Override
     public boolean onGenericMotionEvent(MotionEvent event) {
         if (AndroidGamepadManager.handleMotionEvent(event)) {
             return true;
         }
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
@@ -71,19 +71,19 @@ class NativePanZoomController implements
 
     @Override
     public void abortPanning() {
         // no-op in APZC, I think
     }
 
     @Override
     public void notifyDefaultActionPrevented(boolean prevented) {
-        // This should never get called; there is a different
-        // codepath that notifies the APZ code of this.
-        throw new IllegalStateException("APZCCallbackHandler::NotifyDefaultPrevented should be getting called, not this!");
+        // no-op: This could get called if accessibility is enabled and the events
+        // are sent to Gecko directly without going through APZ. In this case
+        // we just want to ignore this callback.
     }
 
     @Override
     public native void abortAnimation();
 
     private native void init();
     private native boolean handleTouchEvent(GeckoEvent event);
     private native void handleMotionEvent(GeckoEvent event);
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -679,40 +679,25 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWid
 MultiTouchInput
 AndroidGeckoEvent::MakeMultiTouchInput(nsIWidget* widget)
 {
     MultiTouchInput::MultiTouchType type = (MultiTouchInput::MultiTouchType)-1;
     int startIndex = 0;
     int endIndex = Count();
 
     switch (Action()) {
-        case AndroidMotionEvent::ACTION_HOVER_ENTER: {
-            if (ToolTypes()[0] == AndroidMotionEvent::TOOL_TYPE_MOUSE) {
-                break;
-            }
-        }
         case AndroidMotionEvent::ACTION_DOWN:
         case AndroidMotionEvent::ACTION_POINTER_DOWN: {
             type = MultiTouchInput::MULTITOUCH_START;
             break;
         }
-        case AndroidMotionEvent::ACTION_HOVER_MOVE: {
-            if (ToolTypes()[0] == AndroidMotionEvent::TOOL_TYPE_MOUSE) {
-                break;
-            }
-        }
         case AndroidMotionEvent::ACTION_MOVE: {
             type = MultiTouchInput::MULTITOUCH_MOVE;
             break;
         }
-        case AndroidMotionEvent::ACTION_HOVER_EXIT: {
-            if (ToolTypes()[0] == AndroidMotionEvent::TOOL_TYPE_MOUSE) {
-                break;
-            }
-        }
         case AndroidMotionEvent::ACTION_UP:
         case AndroidMotionEvent::ACTION_POINTER_UP: {
             // for pointer-up events we only want the data from
             // the one pointer that went up
             startIndex = PointerIndex();
             endIndex = startIndex + 1;
             type = MultiTouchInput::MULTITOUCH_END;
             break;