case HTMLELEMENT_INNERHTML: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_INNERHTML, PR_FALSE); if (NS_SUCCEEDED(rv)) { nsAutoString prop; rv = a->GetInnerHTML(prop); if (NS_SUCCEEDED(rv)) { nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); } } break; }
GetHTMLElementProperty(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_FALSE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          rv = a->GetId(prop);          if (NS_SUCCEEDED(rv)) {            nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);          }        }        break;      }      case HTMLELEMENT_TITLE:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_TITLE, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          rv = a->GetTitle(prop);          if (NS_SUCCEEDED(rv)) {            nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);          }        }        break;      }      case HTMLELEMENT_LANG:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_LANG, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          rv = a->GetLang(prop);          if (NS_SUCCEEDED(rv)) {            nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);          }        }        break;      }      case HTMLELEMENT_DIR:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_DIR, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          rv = a->GetDir(prop);          if (NS_SUCCEEDED(rv)) {            nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);          }        }        break;      }      case HTMLELEMENT_CLASSNAME:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_CLASSNAME, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsAutoString prop;          rv = a->GetClassName(prop);          if (NS_SUCCEEDED(rv)) {            nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);          }        }        break;      }      case HTMLELEMENT_STYLE:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_STYLE, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsIDOMCSSStyleDeclaration* prop;          rv = a->GetStyle(&prop);          if (NS_SUCCEEDED(rv)) {            // get the js object            nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);          }        }        break;      }      case HTMLELEMENT_OFFSETTOP:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_OFFSETTOP, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRInt32 prop;          rv = a->GetOffsetTop(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = INT_TO_JSVAL(prop);          }        }        break;      }      case HTMLELEMENT_OFFSETLEFT:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_OFFSETLEFT, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRInt32 prop;          rv = a->GetOffsetLeft(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = INT_TO_JSVAL(prop);          }        }        break;      }      case HTMLELEMENT_OFFSETWIDTH:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_OFFSETWIDTH, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRInt32 prop;          rv = a->GetOffsetWidth(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = INT_TO_JSVAL(prop);          }        }        break;      }      case HTMLELEMENT_OFFSETHEIGHT:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_OFFSETHEIGHT, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          PRInt32 prop;          rv = a->GetOffsetHeight(&prop);          if (NS_SUCCEEDED(rv)) {            *vp = INT_TO_JSVAL(prop);          }        }        break;      }      case HTMLELEMENT_OFFSETPARENT:      {        rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_HTMLELEMENT_OFFSETPARENT, PR_FALSE);        if (NS_SUCCEEDED(rv)) {          nsIDOMElement* prop;          rv = a->GetOffsetParent(&prop);          if (NS_SUCCEEDED(rv)) {            // get the js object            nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);          }        }        break;      }      default:        return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);    }  }  else {    return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);  }  if (NS_FAILED(rv))      return nsJSUtils::nsReportError(cx, obj, rv);  return PR_TRUE;}