case HTMLELEMENT_INNERHTML: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_INNERHTML, PR_TRUE); if (NS_SUCCEEDED(rv)) { nsAutoString prop; nsJSUtils::nsConvertJSValToString(prop, cx, *vp);  rv = a->SetInnerHTML(prop);  } break; }
SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp){  nsIDOMHTMLElement *a = (nsIDOMHTMLElement*)nsJSUtils::nsGetNativeThis(cx, obj);  // If there's no private data, this must be the prototype, so ignore  if (nsnull == a) {    return JS_TRUE;  }  nsresult rv = NS_OK;  if (JSVAL_IS_INT(id)) {    nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj);    if (!secMan)        return PR_FALSE;    switch(JSVAL_TO_INT(id)) {      case HTMLELEMENT_ID:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_ID, PR_TRUE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          nsJSUtils::nsConvertJSValToString(prop, cx, *vp);                rv = a->SetId(prop);                  }        break;      }      case HTMLELEMENT_TITLE:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_TITLE, PR_TRUE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          nsJSUtils::nsConvertJSValToString(prop, cx, *vp);                rv = a->SetTitle(prop);                  }        break;      }      case HTMLELEMENT_LANG:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_LANG, PR_TRUE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          nsJSUtils::nsConvertJSValToString(prop, cx, *vp);                rv = a->SetLang(prop);                  }        break;      }      case HTMLELEMENT_DIR:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_DIR, PR_TRUE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          nsJSUtils::nsConvertJSValToString(prop, cx, *vp);                rv = a->SetDir(prop);                  }        break;      }      case HTMLELEMENT_CLASSNAME:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_CLASSNAME, PR_TRUE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          nsJSUtils::nsConvertJSValToString(prop, cx, *vp);                rv = a->SetClassName(prop);                  }        break;      }      default:        return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, obj, id, vp);    }  }  else {    return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, obj, id, vp);  }  if (NS_FAILED(rv))      return nsJSUtils::nsReportError(cx, obj, rv);  return PR_TRUE;}