b=427245 backing-out the previous patch, because qm-centos5-01 becomes oragne.

This commit is contained in:
masayuki@d-toybox.com 2008-04-11 03:16:18 -07:00
Родитель dd1f70d993
Коммит 375ef90980
2 изменённых файлов: 9 добавлений и 24 удалений

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

@ -1916,24 +1916,17 @@ nsGenericHTMLFormElement::UpdateEditableFormControlState()
}
nsIContent *parent = GetParent();
PRBool editable = parent && parent->HasFlag(NODE_IS_EDITABLE);
if (parent && parent->HasFlag(NODE_IS_EDITABLE)) {
SetEditableFlag(PR_TRUE);
return;
if (!editable) {
// If not contentEditable we still need to check the readonly attribute.
PRBool roState;
GetBoolAttr(nsGkAtoms::readonly, &roState);
editable = !roState;
}
PRInt32 formType = GetType();
if (formType != NS_FORM_INPUT_PASSWORD && formType != NS_FORM_INPUT_TEXT &&
formType != NS_FORM_TEXTAREA) {
SetEditableFlag(PR_FALSE);
return;
}
// If not contentEditable we still need to check the readonly attribute.
PRBool roState;
GetBoolAttr(nsGkAtoms::readonly, &roState);
SetEditableFlag(!roState);
SetEditableFlag(editable);
}

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

@ -564,14 +564,6 @@ nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIDocument* document = GetCurrentDoc();
MOZ_AUTO_DOC_UPDATE(document, UPDATE_CONTENT_STATE, aNotify);
UpdateEditableState();
if (document) {
MOZ_AUTO_DOC_UPDATE(document, UPDATE_CONTENT_STATE, PR_TRUE);
document->ContentStatesChanged(this, nsnull,
NS_EVENT_STATE_MOZ_READONLY |
NS_EVENT_STATE_MOZ_READWRITE);
}
if (!aValue) {
// We're now a text input. Note that we have to handle this manually,
// since removing an attribute (which is what happened, since aValue is