Bug 840031 - Use IsTextControl() in nsEventStateManager.cpp. r=smaug

This commit is contained in:
Mounir Lamouri 2013-02-12 16:41:58 +00:00
Родитель d561628a63
Коммит e9154483f4
1 изменённых файлов: 2 добавлений и 15 удалений

Просмотреть файл

@ -1882,21 +1882,8 @@ nsEventStateManager::FireContextClick()
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 ||