Fix bug 225565 by looking at the actual control type. r+sr=peterv

This commit is contained in:
bzbarsky%mit.edu 2003-11-13 18:38:41 +00:00
Родитель dd4cda948d
Коммит 3c78a4048f
1 изменённых файлов: 18 добавлений и 18 удалений

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

@ -3436,24 +3436,24 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent,
nextInput->GetDisabled(&disabled);
nextInput->GetTabIndex(&tabIndex);
nsAutoString type;
nextInput->GetType(type);
if (type.EqualsIgnoreCase("text")
|| type.EqualsIgnoreCase("autocomplete")
|| type.EqualsIgnoreCase("password")) {
// It's a text field or password field
disabled = PR_FALSE;
}
else if (type.EqualsIgnoreCase("hidden")) {
hidden = PR_TRUE;
}
else if (type.EqualsIgnoreCase("file")) {
disabled = PR_TRUE;
}
else {
// it's some other type of form element
disabled =
disabled || !(tabFocusModel & eTabFocus_formElementsMask);
// The type attribute is unreliable; use the actual input type
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(child));
NS_ASSERTION(formControl, "DOMHTMLInputElement must QI to nsIFormControl!");
switch (formControl->GetType()) {
case NS_FORM_INPUT_TEXT:
case NS_FORM_INPUT_PASSWORD:
disabled = PR_FALSE;
break;
case NS_FORM_INPUT_HIDDEN:
hidden = PR_TRUE;
break;
case NS_FORM_INPUT_FILE:
disabled = PR_TRUE;
break;
default:
disabled =
disabled || !(tabFocusModel & eTabFocus_formElementsMask);
break;
}
}
}