Make checkboxes without value attribute work.

b=109122 r=bz sr=jst a=asa (for drivers)
This commit is contained in:
sicking%bigfoot.com 2001-11-09 06:14:52 +00:00
Родитель 24d8e626d2
Коммит 2c1ee7f6bf
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -431,8 +431,8 @@ nsHTMLInputElement::GetValue(nsAWritableString& aValue)
{
PRInt32 type;
GetType(&type);
if (NS_FORM_INPUT_TEXT == type || NS_FORM_INPUT_PASSWORD == type ||
NS_FORM_INPUT_FILE == type) {
if (type == NS_FORM_INPUT_TEXT || type == NS_FORM_INPUT_PASSWORD ||
type == NS_FORM_INPUT_FILE) {
nsIFormControlFrame* formControlFrame = nsnull;
// No need to flush here, if there's no frame created for this
@ -454,8 +454,9 @@ nsHTMLInputElement::GetValue(nsAWritableString& aValue)
nsHTMLAtoms::value,
aValue);
if (rv == NS_CONTENT_ATTR_NOT_THERE && type == NS_FORM_INPUT_RADIO) {
// The defauly value of a radio input is "on".
if (rv == NS_CONTENT_ATTR_NOT_THERE &&
(type == NS_FORM_INPUT_RADIO || type == NS_FORM_INPUT_CHECKBOX)) {
// The default value of a radio or checkbox input is "on".
aValue.Assign(NS_LITERAL_STRING("on"));
return NS_OK;