nsIGfxTextControlFrame2* textControlFrame = nsnull;
PRBool frameOwnsValue = PR_FALSE;
nsHTMLInputElement::GetValue(nsAWritableString& aValue){  PRInt32 type;  GetType(&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    // input yet, there won't be a value in it (that we don't already    // have) even if we force it to be created    GetPrimaryFrame(this, formControlFrame, PR_FALSE, PR_FALSE);    nsIGfxTextControlFrame2* textControlFrame = nsnull;    if (formControlFrame) {      CallQueryInterface(formControlFrame, &textControlFrame);    }    PRBool frameOwnsValue = PR_FALSE;    if (textControlFrame) {      textControlFrame->OwnsValue(&frameOwnsValue);    }    if (frameOwnsValue) {      formControlFrame->GetProperty(nsHTMLAtoms::value, aValue);    } else {      if (!mValueChanged || !mValue) {        GetDefaultValue(aValue);      } else {        aValue = NS_ConvertUTF8toUCS2(mValue);      }    }     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 || 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;  }  return rv;}