PRInt32 index = 0; while (index < mPendingAlternateSheets.Count()) { SheetLoadData* data = (SheetLoadData*)mPendingAlternateSheets.ElementAt(index); if (! IsAlternate(data->mTitle)) { mPendingAlternateSheets.RemoveElementAt(index); URLKey key(data->mURL); LoadSheet(key, data); } else { index++; } }
mPendingDatas.Enumerate(StartNonAlternates, this);
CSSLoaderImpl::SetPreferredSheet(const nsAString& aTitle){  mPreferredSheet = aTitle;  // start any pending alternates that aren't alternates anymore  PRInt32 index = 0;  while (index < mPendingAlternateSheets.Count()) { // count will change during loop    SheetLoadData* data = (SheetLoadData*)mPendingAlternateSheets.ElementAt(index);    if (! IsAlternate(data->mTitle)) {      mPendingAlternateSheets.RemoveElementAt(index);      URLKey key(data->mURL);      LoadSheet(key, data); // this may steal pending alternates too    }    else {      index++;    }  }  return NS_OK;}