From e9154483f420a515acf48bae95859e490fbef580 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Tue, 12 Feb 2013 16:41:58 +0000 Subject: [PATCH] Bug 840031 - Use IsTextControl() in nsEventStateManager.cpp. r=smaug --- content/events/src/nsEventStateManager.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index d91524ad9aa5..65d41dd7c090 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -1882,21 +1882,8 @@ nsEventStateManager::FireContextClick() nsCOMPtr 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 ||