mChildSheetCount = 0;
CSSParserImpl::Parse(nsIUnicharInputStream* aInput,                     nsIURL*                aInputURL,                     nsICSSStyleSheet*&     aResult){  NS_ASSERTION(nsnull != aInputURL, "need base URL");  if (nsnull == mSheet) {    NS_NewCSSStyleSheet(&mSheet, aInputURL);  }  PRInt32 errorCode = NS_OK;  mScanner = new nsCSSScanner();  if (nsnull == mScanner) {    return NS_ERROR_OUT_OF_MEMORY;  }  mScanner->Init(aInput);  mURL = aInputURL;  NS_IF_ADDREF(aInputURL);  mInHead = PR_TRUE;  nsCSSToken* tk = &mToken;  for (;;) {    // Get next non-whitespace token    if (!GetToken(errorCode, PR_TRUE)) {      break;    }    if (eCSSToken_HTMLComment == tk->mType) {      continue; // legal here only    }    if (eCSSToken_AtKeyword == tk->mType) {      ParseAtRule(errorCode);      continue;    }    mInHead = PR_FALSE;    UngetToken();    ParseRuleSet(errorCode);  }  delete mScanner;  mScanner = nsnull;  NS_IF_RELEASE(mURL);  aResult = mSheet;  NS_ADDREF(aResult);  return NS_OK;}