if (!mControl || !mModel)
if (!mControl || !mModel || !mHasParent)
nsXFormsInputElement::Refresh(){  if (!mControl || !mModel)    return NS_OK;  nsAutoString text;  PRBool readonly = GetReadOnlyState();      if (mBoundNode) {    nsXFormsUtils::GetNodeValue(mBoundNode, text);  }  if (mType == eType_TextArea) {    nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(mControl);    NS_ENSURE_STATE(textArea);    textArea->SetValue(text);    textArea->SetReadOnly(readonly);    } else {    nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(mControl);    NS_ENSURE_STATE(input);    if (mType == eType_Input) {      nsCOMPtr<nsISchemaType> type;      mModel->GetTypeForControl(this, getter_AddRefs(type));      nsCOMPtr<nsISchemaBuiltinType> biType = do_QueryInterface(type);      PRUint16 typeValue = nsISchemaBuiltinType::BUILTIN_TYPE_STRING;      if (biType)        biType->GetBuiltinType(&typeValue);      if (typeValue == nsISchemaBuiltinType::BUILTIN_TYPE_BOOLEAN) {        input->SetAttribute(NS_LITERAL_STRING("type"),                             NS_LITERAL_STRING("checkbox"));        input->SetChecked(text.EqualsLiteral("true") ||                           text.EqualsLiteral("1"));        // other xforms processors default to incremental update in this case,        // so we should, too.        mIncremental = PR_TRUE;      } else {        input->RemoveAttribute(NS_LITERAL_STRING("type"));        input->SetValue(text);      }    } else {      input->SetValue(text);    }    input->SetReadOnly(readonly);  }  return NS_OK;}