Bug 936313 part.1 Remove DOM_KEY_LOCATION_MOBILE and DOM_KEY_LOCATION_JOYSTICK r=smaug+mwu+cpeterson, sr=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 28 Jan 2015 22:36:53 +0900
changeset 239615 3f291f100e26507fef3bc08b4d8d66733eacfbd1
parent 239614 c738e5c9a061aece7914714b5c18ee6c6bd1bce9
child 239616 53cf3295596e0e3d5da1fe8e02e664c9692da149
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewerssmaug, smaug
bugs936313
milestone38.0a1
Bug 936313 part.1 Remove DOM_KEY_LOCATION_MOBILE and DOM_KEY_LOCATION_JOYSTICK r=smaug+mwu+cpeterson, sr=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/test/test_dom_keyboard_event.html
dom/interfaces/base/nsIDOMWindowUtils.idl
dom/interfaces/events/nsIDOMKeyEvent.idl
dom/webidl/KeyboardEvent.webidl
mobile/android/base/GeckoEvent.java
services/sync/tps/extensions/mozmill/resource/stdlib/EventUtils.js
testing/mochitest/tests/SimpleTest/EventUtils.js
widget/android/AndroidJavaWrappers.cpp
widget/android/AndroidJavaWrappers.h
widget/android/nsWindow.cpp
widget/gonk/nsAppShell.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1215,37 +1215,30 @@ nsDOMWindowUtils::SendKeyEvent(const nsA
     event.charCode = aCharCode;
   } else {
     event.keyCode = aKeyCode;
     event.charCode = 0;
   }
 
   uint32_t locationFlag = (aAdditionalFlags &
     (KEY_FLAG_LOCATION_STANDARD | KEY_FLAG_LOCATION_LEFT |
-     KEY_FLAG_LOCATION_RIGHT | KEY_FLAG_LOCATION_NUMPAD |
-     KEY_FLAG_LOCATION_MOBILE | KEY_FLAG_LOCATION_JOYSTICK));
+     KEY_FLAG_LOCATION_RIGHT | KEY_FLAG_LOCATION_NUMPAD));
   switch (locationFlag) {
     case KEY_FLAG_LOCATION_STANDARD:
       event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD;
       break;
     case KEY_FLAG_LOCATION_LEFT:
       event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_LEFT;
       break;
     case KEY_FLAG_LOCATION_RIGHT:
       event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_RIGHT;
       break;
     case KEY_FLAG_LOCATION_NUMPAD:
       event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_NUMPAD;
       break;
-    case KEY_FLAG_LOCATION_MOBILE:
-      event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE;
-      break;
-    case KEY_FLAG_LOCATION_JOYSTICK:
-      event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_JOYSTICK;
-      break;
     default:
       if (locationFlag != 0) {
         return NS_ERROR_INVALID_ARG;
       }
       // If location flag isn't set, choose the location from keycode.
       switch (aKeyCode) {
         case nsIDOMKeyEvent::DOM_VK_NUMPAD0:
         case nsIDOMKeyEvent::DOM_VK_NUMPAD1:
--- a/dom/events/test/test_dom_keyboard_event.html
+++ b/dom/events/test/test_dom_keyboard_event.html
@@ -195,36 +195,24 @@ function testSynthesizedKeyLocation()
     { key: "VK_DOWN", isModifier: false,
       event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
                location: KeyboardEvent.DOM_KEY_LOCATION_STANDARD },
     },
     { key: "VK_DOWN", isModifier: false,
       event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
                location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD },
     },
-    { key: "VK_DOWN", isModifier: false,
-      event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
-               location: KeyboardEvent.DOM_KEY_LOCATION_JOYSTICK },
-    },
     { key: "5", isModifier: false,
       event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
                location: KeyboardEvent.DOM_KEY_LOCATION_STANDARD },
     },
     { key: "VK_NUMPAD5", isModifier: false,
       event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
                location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD },
     },
-    { key: "5", isModifier: false,
-      event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
-               location: KeyboardEvent.DOM_KEY_LOCATION_MOBILE },
-    },
-    { key: "VK_NUMPAD5", isModifier: false,
-      event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
-               location: KeyboardEvent.DOM_KEY_LOCATION_MOBILE },
-    },
     { key: "+", isModifier: false,
       event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
                location: KeyboardEvent.DOM_KEY_LOCATION_STANDARD },
     },
     { key: "VK_ADD", isModifier: false,
       event: { shiftKey: false, ctrlKey: false, altKey: false, metaKey: false,
                location: KeyboardEvent.DOM_KEY_LOCATION_NUMPAD },
     },
@@ -254,22 +242,18 @@ function testSynthesizedKeyLocation()
   {
     switch (aLocation) {
       case KeyboardEvent.DOM_KEY_LOCATION_STANDARD:
         return "DOM_KEY_LOCATION_STANDARD";
       case KeyboardEvent.DOM_KEY_LOCATION_LEFT:
         return "DOM_KEY_LOCATION_LEFT";
       case KeyboardEvent.DOM_KEY_LOCATION_RIGHT:
         return "DOM_KEY_LOCATION_RIGHT";
-      case KeyboardEvent.DOM_KEY_LOCATION_MOBILE:
-        return "DOM_KEY_LOCATION_MOBILE";
       case KeyboardEvent.DOM_KEY_LOCATION_NUMPAD:
         return "DOM_KEY_LOCATION_NUMPAD";
-      case KeyboardEvent.DOM_KEY_LOCATION_JOYSTICK:
-        return "DOM_KEY_LOCATION_JOYSTICK";
       default:
         return "Invalid value (" + aLocation + ")";
     }
   }
 
   var currentTest, description;
   var events = { keydown: false, keypress: false, keyup: false };
 
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -45,17 +45,17 @@ interface nsIFile;
 interface nsIDOMClientRect;
 interface nsIURI;
 interface nsIDOMEventTarget;
 interface nsIRunnable;
 interface nsITranslationNodeList;
 interface nsIJSRAIIHelper;
 interface nsIContentPermissionRequest;
 
-[scriptable, uuid(04db2684-f9ed-4d70-827d-3d5b87825238)]
+[scriptable, uuid(5ed850de-2b57-4555-ac48-93292e852eab)]
 interface nsIDOMWindowUtils : nsISupports {
 
   /**
    * Image animation mode of the window. When this attribute's value
    * is changed, the implementation should set all images in the window
    * to the given value. That is, when set to kDontAnimMode, all images
    * will stop animating. The attribute's value must be one of the
    * animationMode values from imgIContainer.
@@ -551,18 +551,16 @@ interface nsIDOMWindowUtils : nsISupport
   const unsigned long KEY_FLAG_NOT_SYNTHESIZED_FOR_TESTS = 0x0002;
 
   // if one of these flags is set, the KeyboardEvent.location will be the value.
   // Otherwise, it will be computed from aKeyCode.
   const unsigned long KEY_FLAG_LOCATION_STANDARD = 0x0010;
   const unsigned long KEY_FLAG_LOCATION_LEFT     = 0x0020;
   const unsigned long KEY_FLAG_LOCATION_RIGHT    = 0x0040;
   const unsigned long KEY_FLAG_LOCATION_NUMPAD   = 0x0080;
-  const unsigned long KEY_FLAG_LOCATION_MOBILE   = 0x0100;
-  const unsigned long KEY_FLAG_LOCATION_JOYSTICK = 0x0200;
 
   boolean sendKeyEvent(in AString aType,
                        in long aKeyCode,
                        in long aCharCode,
                        in long aModifiers,
                        [optional] in unsigned long aAdditionalFlags);
 
   /**
--- a/dom/interfaces/events/nsIDOMKeyEvent.idl
+++ b/dom/interfaces/events/nsIDOMKeyEvent.idl
@@ -245,16 +245,14 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
                                          in unsigned long charCodeArg);
 
   bool getModifierState(in DOMString keyArg);
 
   const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
   const unsigned long DOM_KEY_LOCATION_LEFT     = 0x01;
   const unsigned long DOM_KEY_LOCATION_RIGHT    = 0x02;
   const unsigned long DOM_KEY_LOCATION_NUMPAD   = 0x03;
-  const unsigned long DOM_KEY_LOCATION_MOBILE   = 0x04;
-  const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05;
 
   readonly attribute unsigned long location;
   readonly attribute boolean       repeat;
 
   readonly attribute DOMString key;
 };
--- a/dom/webidl/KeyboardEvent.webidl
+++ b/dom/webidl/KeyboardEvent.webidl
@@ -16,18 +16,16 @@ interface KeyboardEvent : UIEvent
   readonly attribute boolean          metaKey;
 
   boolean getModifierState(DOMString key);
 
   const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
   const unsigned long DOM_KEY_LOCATION_LEFT     = 0x01;
   const unsigned long DOM_KEY_LOCATION_RIGHT    = 0x02;
   const unsigned long DOM_KEY_LOCATION_NUMPAD   = 0x03;
-  const unsigned long DOM_KEY_LOCATION_MOBILE   = 0x04;
-  const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05;
 
   readonly attribute unsigned long location;
   readonly attribute boolean       repeat;
   readonly attribute boolean       isComposing;
 
   readonly attribute DOMString key;
   [Pref="dom.keyboardevent.code.enabled"]
   readonly attribute DOMString code;
--- a/mobile/android/base/GeckoEvent.java
+++ b/mobile/android/base/GeckoEvent.java
@@ -110,36 +110,16 @@ public class GeckoEvent {
 
         public final int value;
 
         private NativeGeckoEvent(int value) {
             this.value = value;
         }
     }
 
-    /**
-     * The DomKeyLocation enum encapsulates the DOM KeyboardEvent's constants.
-     * @see https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent#Key_location_constants
-     */
-    @JNITarget
-    public enum DomKeyLocation {
-        DOM_KEY_LOCATION_STANDARD(0),
-        DOM_KEY_LOCATION_LEFT(1),
-        DOM_KEY_LOCATION_RIGHT(2),
-        DOM_KEY_LOCATION_NUMPAD(3),
-        DOM_KEY_LOCATION_MOBILE(4),
-        DOM_KEY_LOCATION_JOYSTICK(5);
-
-        public final int value;
-
-        private DomKeyLocation(int value) {
-            this.value = value;
-        }
-    }
-
     // Encapsulation of common IME actions.
     @JNITarget
     public enum ImeAction {
         IME_SYNCHRONIZE(0),
         IME_REPLACE_TEXT(1),
         IME_SET_SELECTION(2),
         IME_ADD_COMPOSITION_RANGE(3),
         IME_UPDATE_COMPOSITION(4),
@@ -218,17 +198,16 @@ public class GeckoEvent {
     private int mRangeStyles;
     private int mRangeLineStyle;
     private boolean mRangeBoldLine;
     private int mRangeForeColor;
     private int mRangeBackColor;
     private int mRangeLineColor;
     private Location mLocation;
     private Address mAddress;
-    private DomKeyLocation mDomKeyLocation;
 
     private int     mConnectionType;
     private boolean mIsWifi;
     private int     mDHCPGateway;
 
     private int mNativeWindow;
 
     private short mScreenOrientation;
@@ -308,40 +287,16 @@ public class GeckoEvent {
             int unmodifiedMetaState =
                 mMetaState & ~(KeyEvent.META_ALT_MASK |
                                KeyEvent.META_CTRL_MASK |
                                KeyEvent.META_META_MASK);
             if (unmodifiedMetaState != mMetaState) {
                 mDOMPrintableKeyValue = k.getUnicodeChar(unmodifiedMetaState);
             }
         }
-        mDomKeyLocation = isJoystickButton(mKeyCode) ? DomKeyLocation.DOM_KEY_LOCATION_JOYSTICK
-                                                     : DomKeyLocation.DOM_KEY_LOCATION_MOBILE;
-    }
-
-    /**
-     * This method tests if a key is one of the described in:
-     * https://bugzilla.mozilla.org/show_bug.cgi?id=756504#c0
-     * @param keyCode int with the key code (Android key constant from KeyEvent)
-     * @return true if the key is one of the listed above, false otherwise.
-     */
-    private static boolean isJoystickButton(int keyCode) {
-        switch (keyCode) {
-            case KeyEvent.KEYCODE_DPAD_CENTER:
-            case KeyEvent.KEYCODE_DPAD_LEFT:
-            case KeyEvent.KEYCODE_DPAD_RIGHT:
-            case KeyEvent.KEYCODE_DPAD_DOWN:
-            case KeyEvent.KEYCODE_DPAD_UP:
-                return true;
-            default:
-                if (Versions.feature12Plus) {
-                    return KeyEvent.isGamepadButton(keyCode);
-                }
-                return GeckoEvent.isGamepadButton(keyCode);
-        }
     }
 
     /**
      * This method is a replacement for the the KeyEvent.isGamepadButton method to be
      * compatible with Build.VERSION.SDK_INT < 12. This is an implementation of the
      * same method isGamepadButton available after SDK 12.
      * @param keyCode int with the key code (Android key constant from KeyEvent).
      * @return True if the keycode is a gamepad button, such as {@link #KEYCODE_BUTTON_A}.
--- a/services/sync/tps/extensions/mozmill/resource/stdlib/EventUtils.js
+++ b/services/sync/tps/extensions/mozmill/resource/stdlib/EventUtils.js
@@ -547,22 +547,16 @@ function synthesizeKey(aKey, aEvent, aWi
           flags |= utils.KEY_FLAG_LOCATION_LEFT;
           break;
         case KeyboardEvent.DOM_KEY_LOCATION_RIGHT:
           flags |= utils.KEY_FLAG_LOCATION_RIGHT;
           break;
         case KeyboardEvent.DOM_KEY_LOCATION_NUMPAD:
           flags |= utils.KEY_FLAG_LOCATION_NUMPAD;
           break;
-        case KeyboardEvent.DOM_KEY_LOCATION_MOBILE:
-          flags |= utils.KEY_FLAG_LOCATION_MOBILE;
-          break;
-        case KeyboardEvent.DOM_KEY_LOCATION_JOYSTICK:
-          flags |= utils.KEY_FLAG_LOCATION_JOYSTICK;
-          break;
       }
     }
 
     if (!("type" in aEvent) || !aEvent.type) {
       // Send keydown + (optional) keypress + keyup events.
       var keyDownDefaultHappened =
         utils.sendKeyEvent("keydown", keyCode, 0, modifiers, flags);
       if (isKeypressFiredKey(keyCode)) {
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -581,22 +581,16 @@ function synthesizeKey(aKey, aEvent, aWi
           flags |= utils.KEY_FLAG_LOCATION_LEFT;
           break;
         case KeyboardEvent.DOM_KEY_LOCATION_RIGHT:
           flags |= utils.KEY_FLAG_LOCATION_RIGHT;
           break;
         case KeyboardEvent.DOM_KEY_LOCATION_NUMPAD:
           flags |= utils.KEY_FLAG_LOCATION_NUMPAD;
           break;
-        case KeyboardEvent.DOM_KEY_LOCATION_MOBILE:
-          flags |= utils.KEY_FLAG_LOCATION_MOBILE;
-          break;
-        case KeyboardEvent.DOM_KEY_LOCATION_JOYSTICK:
-          flags |= utils.KEY_FLAG_LOCATION_JOYSTICK;
-          break;
       }
     }
 
     if (!("type" in aEvent) || !aEvent.type) {
       // Send keydown + (optional) keypress + keyup events.
       var keyDownDefaultHappened =
         utils.sendKeyEvent("keydown", keyCode, 0, modifiers, flags);
       if (isKeypressFiredKey(keyCode) && keyDownDefaultHappened) {
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -35,17 +35,16 @@ jfieldID AndroidGeckoEvent::jNativeWindo
 
 jfieldID AndroidGeckoEvent::jCharactersField = 0;
 jfieldID AndroidGeckoEvent::jCharactersExtraField = 0;
 jfieldID AndroidGeckoEvent::jDataField = 0;
 jfieldID AndroidGeckoEvent::jDOMPrintableKeyValueField = 0;
 jfieldID AndroidGeckoEvent::jKeyCodeField = 0;
 jfieldID AndroidGeckoEvent::jScanCodeField = 0;
 jfieldID AndroidGeckoEvent::jMetaStateField = 0;
-jfieldID AndroidGeckoEvent::jDomKeyLocationField = 0;
 jfieldID AndroidGeckoEvent::jFlagsField = 0;
 jfieldID AndroidGeckoEvent::jUnicodeCharField = 0;
 jfieldID AndroidGeckoEvent::jBaseUnicodeCharField = 0;
 jfieldID AndroidGeckoEvent::jRepeatCountField = 0;
 jfieldID AndroidGeckoEvent::jCountField = 0;
 jfieldID AndroidGeckoEvent::jStartField = 0;
 jfieldID AndroidGeckoEvent::jEndField = 0;
 jfieldID AndroidGeckoEvent::jPointerIndexField = 0;
@@ -67,19 +66,16 @@ jfieldID AndroidGeckoEvent::jHeightField
 jfieldID AndroidGeckoEvent::jIDField = 0;
 jfieldID AndroidGeckoEvent::jGamepadButtonField = 0;
 jfieldID AndroidGeckoEvent::jGamepadButtonPressedField = 0;
 jfieldID AndroidGeckoEvent::jGamepadButtonValueField = 0;
 jfieldID AndroidGeckoEvent::jGamepadValuesField = 0;
 jfieldID AndroidGeckoEvent::jPrefNamesField = 0;
 jfieldID AndroidGeckoEvent::jObjectField = 0;
 
-jclass AndroidGeckoEvent::jDomKeyLocationClass = 0;
-jfieldID AndroidGeckoEvent::jDomKeyLocationValueField = 0;
-
 jclass AndroidPoint::jPointClass = 0;
 jfieldID AndroidPoint::jXField = 0;
 jfieldID AndroidPoint::jYField = 0;
 
 jclass AndroidRect::jRectClass = 0;
 jfieldID AndroidRect::jBottomField = 0;
 jfieldID AndroidRect::jLeftField = 0;
 jfieldID AndroidRect::jRightField = 0;
@@ -145,17 +141,16 @@ AndroidGeckoEvent::InitGeckoEventClass(J
     jRectField = geckoEvent.getField("mRect", "Landroid/graphics/Rect;");
 
     jCharactersField = geckoEvent.getField("mCharacters", "Ljava/lang/String;");
     jCharactersExtraField = geckoEvent.getField("mCharactersExtra", "Ljava/lang/String;");
     jDataField = geckoEvent.getField("mData", "Ljava/lang/String;");
     jKeyCodeField = geckoEvent.getField("mKeyCode", "I");
     jScanCodeField = geckoEvent.getField("mScanCode", "I");
     jMetaStateField = geckoEvent.getField("mMetaState", "I");
-    jDomKeyLocationField = geckoEvent.getField("mDomKeyLocation", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
     jFlagsField = geckoEvent.getField("mFlags", "I");
     jUnicodeCharField = geckoEvent.getField("mUnicodeChar", "I");
     jBaseUnicodeCharField = geckoEvent.getField("mBaseUnicodeChar", "I");
     jDOMPrintableKeyValueField = geckoEvent.getField("mDOMPrintableKeyValue", "I");
     jRepeatCountField = geckoEvent.getField("mRepeatCount", "I");
     jCountField = geckoEvent.getField("mCount", "I");
     jStartField = geckoEvent.getField("mStart", "I");
     jEndField = geckoEvent.getField("mEnd", "I");
@@ -177,21 +172,16 @@ AndroidGeckoEvent::InitGeckoEventClass(J
     jHeightField = geckoEvent.getField("mHeight", "I");
     jIDField = geckoEvent.getField("mID", "I");
     jGamepadButtonField = geckoEvent.getField("mGamepadButton", "I");
     jGamepadButtonPressedField = geckoEvent.getField("mGamepadButtonPressed", "Z");
     jGamepadButtonValueField = geckoEvent.getField("mGamepadButtonValue", "F");
     jGamepadValuesField = geckoEvent.getField("mGamepadValues", "[F");
     jPrefNamesField = geckoEvent.getField("mPrefNames", "[Ljava/lang/String;");
     jObjectField = geckoEvent.getField("mObject", "Ljava/lang/Object;");
-
-    // Init GeckoEvent.DomKeyLocation enum
-    AutoJNIClass domKeyLocation(jEnv, "org/mozilla/gecko/GeckoEvent$DomKeyLocation");
-    jDomKeyLocationClass = domKeyLocation.getGlobalRef();
-    jDomKeyLocationValueField = domKeyLocation.getField("value", "I");
 }
 
 void
 AndroidLocation::InitLocationClass(JNIEnv *jEnv)
 {
     AutoJNIClass location(jEnv, "android/location/Location");
     jLocationClass = location.getGlobalRef();
     jGetLatitudeMethod = location.getMethod("getLatitude", "()D");
@@ -384,28 +374,16 @@ AndroidGeckoEvent::ReadDataField(JNIEnv 
 }
 
 void
 AndroidGeckoEvent::UnionRect(nsIntRect const& aRect)
 {
     mRect = aRect.Union(mRect);
 }
 
-uint32_t
-AndroidGeckoEvent::ReadDomKeyLocation(JNIEnv* jenv, jobject jGeckoEventObj)
-{
-    jobject enumObject = jenv->GetObjectField(jGeckoEventObj,
-                                             jDomKeyLocationField);
-    MOZ_ASSERT(enumObject);
-    int enumValue = jenv->GetIntField(enumObject, jDomKeyLocationValueField);
-    MOZ_ASSERT(enumValue >= nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD &&
-               enumValue <= nsIDOMKeyEvent::DOM_KEY_LOCATION_JOYSTICK);
-    return static_cast<uint32_t>(enumValue);
-}
-
 void
 AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj)
 {
     NS_ASSERTION(!wrapped_obj, "Init called on non-null wrapped_obj!");
 
     wrapped_obj = jobj;
 
     if (!jobj)
@@ -419,17 +397,16 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jo
         case SIZE_CHANGED:
             ReadPointArray(mPoints, jenv, jPoints, 2);
             break;
 
         case KEY_EVENT:
         case IME_KEY_EVENT:
             mTime = jenv->GetLongField(jobj, jTimeField);
             mMetaState = jenv->GetIntField(jobj, jMetaStateField);
-            mDomKeyLocation = ReadDomKeyLocation(jenv, jobj);
             mFlags = jenv->GetIntField(jobj, jFlagsField);
             mKeyCode = jenv->GetIntField(jobj, jKeyCodeField);
             mScanCode = jenv->GetIntField(jobj, jScanCodeField);
             mUnicodeChar = jenv->GetIntField(jobj, jUnicodeCharField);
             mBaseUnicodeChar = jenv->GetIntField(jobj, jBaseUnicodeCharField);
             mDOMPrintableKeyValue =
                 jenv->GetIntField(jobj, jDOMPrintableKeyValueField);
             mRepeatCount = jenv->GetIntField(jobj, jRepeatCountField);
--- a/widget/android/AndroidJavaWrappers.h
+++ b/widget/android/AndroidJavaWrappers.h
@@ -521,17 +521,16 @@ public:
     double Z() { return mZ; }
     const nsIntRect& Rect() { return mRect; }
     nsAString& Characters() { return mCharacters; }
     nsAString& CharactersExtra() { return mCharactersExtra; }
     nsAString& Data() { return mData; }
     int KeyCode() { return mKeyCode; }
     int ScanCode() { return mScanCode; }
     int MetaState() { return mMetaState; }
-    uint32_t DomKeyLocation() { return mDomKeyLocation; }
     Modifiers DOMModifiers() const;
     bool IsAltPressed() const { return (mMetaState & AMETA_ALT_MASK) != 0; }
     bool IsShiftPressed() const { return (mMetaState & AMETA_SHIFT_MASK) != 0; }
     bool IsCtrlPressed() const { return (mMetaState & AMETA_CTRL_MASK) != 0; }
     bool IsMetaPressed() const { return (mMetaState & AMETA_META_MASK) != 0; }
     int Flags() { return mFlags; }
     int UnicodeChar() { return mUnicodeChar; }
     int BaseUnicodeChar() { return mBaseUnicodeChar; }
@@ -580,17 +579,16 @@ protected:
     nsTArray<nsIntPoint> mPoints;
     nsTArray<nsIntPoint> mPointRadii;
     nsTArray<int> mPointIndicies;
     nsTArray<float> mOrientations;
     nsTArray<float> mPressures;
     nsTArray<int> mToolTypes;
     nsIntRect mRect;
     int mFlags, mMetaState;
-    uint32_t mDomKeyLocation;
     int mKeyCode, mScanCode;
     int mUnicodeChar, mBaseUnicodeChar, mDOMPrintableKeyValue;
     int mRepeatCount;
     int mCount;
     int mStart, mEnd;
     int mRangeType, mRangeStyles, mRangeLineStyle;
     bool mRangeBoldLine;
     int mRangeForeColor, mRangeBackColor, mRangeLineColor;
@@ -632,18 +630,16 @@ protected:
                          JNIEnv *jenv,
                          jfieldID field);
     void ReadRectField(JNIEnv *jenv);
     void ReadCharactersField(JNIEnv *jenv);
     void ReadCharactersExtraField(JNIEnv *jenv);
     void ReadDataField(JNIEnv *jenv);
     void ReadStringFromJString(nsString &aString, JNIEnv *jenv, jstring s);
 
-    uint32_t ReadDomKeyLocation(JNIEnv* jenv, jobject jGeckoEventObj);
-
     static jclass jGeckoEventClass;
     static jfieldID jActionField;
     static jfieldID jTypeField;
     static jfieldID jAckNeededField;
     static jfieldID jTimeField;
     static jfieldID jPoints;
     static jfieldID jPointIndicies;
     static jfieldID jOrientations;
@@ -659,17 +655,16 @@ protected:
 
     static jfieldID jCharactersField;
     static jfieldID jCharactersExtraField;
     static jfieldID jDataField;
     static jfieldID jDOMPrintableKeyValueField;
     static jfieldID jKeyCodeField;
     static jfieldID jScanCodeField;
     static jfieldID jMetaStateField;
-    static jfieldID jDomKeyLocationField;
     static jfieldID jFlagsField;
     static jfieldID jCountField;
     static jfieldID jStartField;
     static jfieldID jEndField;
     static jfieldID jPointerIndexField;
     static jfieldID jUnicodeCharField;
     static jfieldID jBaseUnicodeCharField;
     static jfieldID jRepeatCountField;
@@ -696,19 +691,16 @@ protected:
     static jfieldID jIDField;
     static jfieldID jGamepadButtonField;
     static jfieldID jGamepadButtonPressedField;
     static jfieldID jGamepadButtonValueField;
     static jfieldID jGamepadValuesField;
 
     static jfieldID jObjectField;
 
-    static jclass jDomKeyLocationClass;
-    static jfieldID jDomKeyLocationValueField;
-
 public:
     enum {
         NATIVE_POKE = 0,
         KEY_EVENT = 1,
         MOTION_EVENT = 2,
         SENSOR_EVENT = 3,
         PROCESS_OBJECT = 4,
         LOCATION_EVENT = 5,
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1535,17 +1535,18 @@ nsWindow::InitKeyEvent(WidgetKeyboardEve
     if (event.message == NS_KEY_PRESS &&
         key.UnicodeChar() && key.UnicodeChar() != key.BaseUnicodeChar()) {
         event.modifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL | MODIFIER_META);
     }
 
     event.mIsRepeat =
         (event.message == NS_KEY_DOWN || event.message == NS_KEY_PRESS) &&
         (!!(key.Flags() & AKEY_EVENT_FLAG_LONG_PRESS) || !!key.RepeatCount());
-    event.location = key.DomKeyLocation();
+    // XXX Compute the location from code value, later.
+    event.location = nsIDOMKeyboardEvent::DOM_KEY_LOCATION_STANDARD;
     event.time = key.Time();
 
     if (gMenu)
         gMenuConsumed = true;
 }
 
 void
 nsWindow::HandleSpecialKey(AndroidGeckoEvent *ae)
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -303,17 +303,18 @@ KeyEventDispatcher::DispatchKeyEventInte
     event.isChar = !!event.charCode;
     event.mIsRepeat = IsRepeat();
     event.mKeyNameIndex = mDOMKeyNameIndex;
     if (mDOMPrintableKeyValue) {
         event.mKeyValue = mDOMPrintableKeyValue;
     }
     event.mCodeNameIndex = mDOMCodeNameIndex;
     event.modifiers = getDOMModifiers(mData.metaState);
-    event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE;
+    // XXX Compute the location from code value, later.
+    event.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD;
     event.time = mData.timeMs;
     return nsWindow::DispatchInputEvent(event);
 }
 
 void
 KeyEventDispatcher::Dispatch()
 {
     // XXX Even if unknown key is pressed, DOM key event should be