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
parent 6af397de71
commit 4c89e70f45
2 changed files with 9 additions and 24 deletions

View File

@ -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);
}

View File

@ -563,15 +563,7 @@ nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
// now.
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