if (presState) { presState->GetStateProperty(NS_LITERAL_STRING("value"), aValue); }
if (formControlFrame) { formControlFrame->GetProperty(nsHTMLAtoms::value, aValue); } else { GetValueInternal(aValue);
nsHTMLInputElement::GetValue(nsAWritableString& aValue){  PRInt32 type;  GetType(&type);  if (NS_FORM_INPUT_TEXT == type || NS_FORM_INPUT_PASSWORD == type ||      NS_FORM_INPUT_FILE == type) {    nsIFormControlFrame* formControlFrame = nsnull;    if (NS_SUCCEEDED(GetPrimaryFrame(this, formControlFrame))) {      if (formControlFrame) {        formControlFrame->GetProperty(nsHTMLAtoms::value, aValue);      }    }    else {      // Retrieve the presentation state instead.      nsCOMPtr<nsIPresState> presState;      GetPrimaryPresState(this, getter_AddRefs(presState));      // Obtain the value property from the presentation state.      if (presState) {        presState->GetStateProperty(NS_LITERAL_STRING("value"), aValue);      }    }          return NS_OK;  }  // Treat value == defaultValue for other input elements  nsresult rv = nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML,                                                      nsHTMLAtoms::value,                                                      aValue);  if (rv == NS_CONTENT_ATTR_NOT_THERE && type == NS_FORM_INPUT_RADIO) {    // The defauly value of a radio input is "on".    aValue.Assign(NS_LITERAL_STRING("on"));    return NS_OK;  }  return rv;}