('+' == mToken.mSymbol || '>' == mToken.mSymbol)) {
('+' == mToken.mSymbol || '>' == mToken.mSymbol || '~' == mToken.mSymbol)) {
PRBool CSSParserImpl::ParseSelectorGroup(nsresult& aErrorCode,                                         nsCSSSelectorList*& aList){  nsCSSSelectorList* list = nsnull;  PRUnichar     combinator = PRUnichar(0);  PRInt32       weight = 0;  PRBool        havePseudoElement = PR_FALSE;  PRBool        done = PR_FALSE;  while (!done) {    nsCSSSelector selector;    if (! ParseSelector(aErrorCode, selector)) {      break;    }    if (nsnull == list) {      list = new nsCSSSelectorList();      if (nsnull == list) {        aErrorCode = NS_ERROR_OUT_OF_MEMORY;        return PR_FALSE;      }    }    list->AddSelector(selector);    nsCSSSelector* listSel = list->mSelectors;    // pull out pseudo elements here    nsAtomStringList* prevList = nsnull;    nsAtomStringList* pseudoClassList = listSel->mPseudoClassList;    while (nsnull != pseudoClassList) {      if (! nsCSSPseudoClasses::IsPseudoClass(pseudoClassList->mAtom)) {        havePseudoElement = PR_TRUE;        if (IsSinglePseudoClass(*listSel)) {  // convert to pseudo element selector          nsIAtom* pseudoElement = pseudoClassList->mAtom;  // steal ref count          pseudoClassList->mAtom = nsnull;          listSel->Reset();          if (listSel->mNext) {// more to the selector            listSel->mOperator = PRUnichar('>');            nsCSSSelector empty;            list->AddSelector(empty); // leave a blank (universal) selector in the middle            listSel = list->mSelectors; // use the new one for the pseudo          }          listSel->mTag = pseudoElement;        }        else {  // append new pseudo element selector          selector.Reset();          selector.mTag = pseudoClassList->mAtom; // steal ref count#ifdef MOZ_XUL          if (IsTreePseudoElement(selector.mTag)) {            // Take the remaining "pseudoclasses" that we parsed            // inside the tree pseudoelement's ()-list, and            // make our new selector have these pseudoclasses            // in its pseudoclass list.            selector.mPseudoClassList = pseudoClassList->mNext;            pseudoClassList->mNext = nsnull;          }#endif          list->AddSelector(selector);          pseudoClassList->mAtom = nsnull;          listSel->mOperator = PRUnichar('>');          if (nsnull == prevList) { // delete list entry            listSel->mPseudoClassList = pseudoClassList->mNext;          }          else {            prevList->mNext = pseudoClassList->mNext;          }          pseudoClassList->mNext = nsnull;          delete pseudoClassList;          weight += listSel->CalcWeight(); // capture weight from remainder        }        break;  // only one pseudo element per selector      }      prevList = pseudoClassList;      pseudoClassList = pseudoClassList->mNext;    }    combinator = PRUnichar(0);    if (!GetToken(aErrorCode, PR_FALSE)) {      break;    }    // Assume we are done unless we find a combinator here.    done = PR_TRUE;    if (eCSSToken_WhiteSpace == mToken.mType) {      if (!GetToken(aErrorCode, PR_TRUE)) {        break;      }      done = PR_FALSE;    }    if (eCSSToken_Symbol == mToken.mType &&         ('+' == mToken.mSymbol || '>' == mToken.mSymbol)) {      done = PR_FALSE;      combinator = mToken.mSymbol;      list->mSelectors->SetOperator(combinator);    }    else {      UngetToken(); // give it back to selector    }    if (havePseudoElement) {      break;    }    else {      weight += selector.CalcWeight();    }  }  if (!list) {    REPORT_UNEXPECTED(NS_LITERAL_STRING("Selector expected."));  }  if (PRUnichar(0) != combinator) { // no dangling combinators    if (list) {      delete list;    }    list = nsnull;    // This should report the problematic combinator    REPORT_UNEXPECTED(NS_LITERAL_STRING("Dangling combinator."));  }  aList = list;  if (nsnull != list) {    list->mWeight = weight;  }  return PRBool(nsnull != aList);}