isJavaScript = type.EqualsIgnoreCase("text/javascript") || type.EqualsIgnoreCase("application/x-javascript");
nsAutoString  mimeType; nsAutoString  params; SplitMimeType(type, mimeType, params);  isJavaScript = mimeType.EqualsIgnoreCase("text/javascript") || mimeType.EqualsIgnoreCase("application/x-javascript");
HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode){  nsresult rv = NS_OK;  PRBool   isJavaScript = PR_TRUE;  PRInt32 i, ac = aNode.GetAttributeCount();  // Look for SRC attribute and look for a LANGUAGE attribute  nsAutoString src;  for (i = 0; i < ac; i++) {    const nsString& key = aNode.GetKeyAt(i);    if (key.EqualsIgnoreCase("src")) {      GetAttributeValueAt(aNode, i, src, nsnull);    }    else if (key.EqualsIgnoreCase("type")) {      nsAutoString  type;      GetAttributeValueAt(aNode, i, type, nsnull);      isJavaScript = type.EqualsIgnoreCase("text/javascript") ||         type.EqualsIgnoreCase("application/x-javascript");    }    else if (key.EqualsIgnoreCase("language")) {      nsAutoString  lang;             GetAttributeValueAt(aNode, i, lang, nsnull);      isJavaScript = IsJavaScriptLanguage(lang);    }  }  // Don't process scripts that aren't JavaScript  if (isJavaScript) {    nsAutoString script;    // If there is a SRC attribute...    if (src.Length() > 0) {      // Use the SRC attribute value to load the URL      nsIURL* url = nsnull;      nsIURLGroup* urlGroup = nsnull;      mDocumentBaseURL->GetURLGroup(&urlGroup);      if (urlGroup) {        rv = urlGroup->CreateURL(&url, mDocumentBaseURL, src, nsnull);        NS_RELEASE(urlGroup);      }      else {        rv = NS_NewURL(&url, src, mDocumentBaseURL);      }      if (NS_OK != rv) {        return rv;      }      // Add a reference to this since the url loader is holding      // onto it as opaque data.      NS_ADDREF(this);      nsIUnicharStreamLoader* loader;      rv = NS_NewUnicharStreamLoader(&loader,                                     url,                                      (nsStreamCompleteFunc)nsDoneLoadingScript,                                      (void *)this);      NS_RELEASE(url);      if (NS_OK == rv) {        rv = NS_ERROR_HTMLPARSER_BLOCK;      }    }    else {      PRBool bodyPresent = PreEvaluateScript();      // Otherwise, get the text content of the script tag      script = aNode.GetSkippedContent();      PRUint32 lineNo = (PRUint32)aNode.GetSourceLineNumber();      EvaluateScript(script, lineNo);            PostEvaluateScript(bodyPresent);      // If the parse was disabled as a result of this evaluate script      // (for example, if the script document.wrote a SCRIPT SRC= tag,      // we remind the parser to block.      if ((nsnull != mParser) && (PR_FALSE == mParser->IsParserEnabled())) {        rv = NS_ERROR_HTMLPARSER_BLOCK;      }    }  }  return rv;}