Bug 840031 - Use IsTextControl() in nsEventStateManager.cpp. r=smaug
authorMounir Lamouri <mounir.lamouri@gmail.com>
Tue, 12 Feb 2013 16:41:58 +0000
changeset 131513 7da05ff6231c31163d9f3f0fe723fe44d848fccd
parent 131512 628f616b8ddfd3e153cd58080e533de6ca073be4
child 131514 e07057ca9502c3600d127f9ed7c94de6c32ff4db
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs840031
milestone21.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 840031 - Use IsTextControl() in nsEventStateManager.cpp. r=smaug
content/events/src/nsEventStateManager.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -1877,31 +1877,18 @@ nsEventStateManager::FireContextClick()
           }
         }
       }
     }
     else if (mGestureDownContent->IsHTML()) {
       nsCOMPtr<nsIFormControl> formCtrl(do_QueryInterface(mGestureDownContent));
 
       if (formCtrl) {
-        // of all form controls, only ones dealing with text are
-        // allowed to have context menus
-        int32_t type = formCtrl->GetType();
-
-        allowedToDispatch = (type == NS_FORM_INPUT_TEXT ||
-                             type == NS_FORM_INPUT_EMAIL ||
-                             type == NS_FORM_INPUT_SEARCH ||
-                             type == NS_FORM_INPUT_TEL ||
-                             type == NS_FORM_INPUT_URL ||
-                             type == NS_FORM_INPUT_PASSWORD ||
-                             type == NS_FORM_INPUT_FILE ||
-                             type == NS_FORM_INPUT_NUMBER ||
-                             type == NS_FORM_INPUT_DATE ||
-                             type == NS_FORM_INPUT_TIME ||
-                             type == NS_FORM_TEXTAREA);
+        allowedToDispatch = formCtrl->IsTextControl(false) ||
+                            formCtrl->GetType() == NS_FORM_INPUT_FILE;
       }
       else if (tag == nsGkAtoms::applet ||
                tag == nsGkAtoms::embed  ||
                tag == nsGkAtoms::object) {
         allowedToDispatch = false;
       }
     }