if (!mToken.mIdent.IsEmpty()) { PRUnichar first = mToken.mIdent.First(); PRUnichar second = 0; if (mToken.mIdent.Length() >= 2) { second = mToken.mIdent.CharAt(1); } if (!nsCSSScanner::StartsIdent(first, second, nsCSSScanner::GetLexTable())) { REPORT_UNEXPECTED_TOKEN(PEIDSelNotIdent); UngetToken(); return eSelectorParsingStatus_Error; } aDataMask |= SEL_MASK_ID; aSelector.AddID(mToken.mIdent); } else { REPORT_UNEXPECTED_TOKEN(PEIDSelEmpty); UngetToken(); return eSelectorParsingStatus_Error; }
NS_ASSERTION(!mToken.mIdent.IsEmpty(), "Empty mIdent in eCSSToken_ID token?"); aDataMask |= SEL_MASK_ID; aSelector.AddID(mToken.mIdent);
CSSParserImpl::ParseIDSelector(PRInt32&       aDataMask,                               nsCSSSelector& aSelector,                               nsresult&      aErrorCode){  if (!mToken.mIdent.IsEmpty()) { // verify is legal ID    PRUnichar first = mToken.mIdent.First();    PRUnichar second = 0;    if (mToken.mIdent.Length() >= 2) {      second = mToken.mIdent.CharAt(1);    }    if (!nsCSSScanner::StartsIdent(first, second,                                   nsCSSScanner::GetLexTable())) {      REPORT_UNEXPECTED_TOKEN(PEIDSelNotIdent);      UngetToken();      return eSelectorParsingStatus_Error;    }    aDataMask |= SEL_MASK_ID;    aSelector.AddID(mToken.mIdent);  }  else {    REPORT_UNEXPECTED_TOKEN(PEIDSelEmpty);    UngetToken();    return eSelectorParsingStatus_Error;  }  return eSelectorParsingStatus_Continue;}