if (NS_FORM_INPUT_FILE == type) { nsresult result; NS_WITH_SERVICE(nsIScriptSecurityManager, securityManager, NS_SCRIPTSECURITYMANAGER_PROGID, &result); if (NS_FAILED(result)) return result; PRBool enabled; if (NS_FAILED(result = securityManager->IsCapabilityEnabled("UniversalFileRead", &enabled))) { return result; } if (!enabled) {  return NS_ERROR_DOM_SECURITY_ERR; }  }
nsHTMLInputElement::SetValue(const nsString& 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(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {      if (nsnull != formControlFrame ) {         nsIPresContext* presContext;        nsGenericHTMLElement::GetPresContext(this, &presContext);        formControlFrame->SetProperty(presContext, nsHTMLAtoms::value, aValue);        NS_IF_RELEASE(presContext);      }    }    else {      // Retrieve the presentation state instead.      nsCOMPtr<nsIPresState> presState;      nsGenericHTMLElement::GetPrimaryPresState(this, nsIStatefulFrame::eTextType, getter_AddRefs(presState));      // Obtain the value property from the presentation state.      if (presState) {        presState->SetStateProperty("value", aValue);      }    }    return NS_OK;  }  // Treat value == defaultValue for other input elements.  return mInner.SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, aValue, PR_TRUE);}