for (stopFrame = mFrames.FirstChild(); stopFrame; stopFrame = stopFrame->GetNextSibling()) { nsIDOMSVGStopElement *stopElement; stopFrame->GetContent()->QueryInterface(NS_GET_IID(nsIDOMSVGStopElement),(void**)&stopElement); if (stopElement) {  if (stopCount == aIndex) { break; } stopCount++; } } if (stopCount == 0) {
PRInt32 stopCount = GetStopElement(aIndex, &stopElement, &stopFrame); if (stopCount == 0 && !stopElement) {
nsSVGGradientFrame::GetStopColor(PRInt32 aIndex, nscolor *aStopColor) {  PRInt32 stopCount = 0;  nsIFrame *stopFrame = nsnull;  for (stopFrame = mFrames.FirstChild(); stopFrame;       stopFrame = stopFrame->GetNextSibling()) {    nsIDOMSVGStopElement *stopElement;    stopFrame->GetContent()->QueryInterface(NS_GET_IID(nsIDOMSVGStopElement),(void**)&stopElement);    if (stopElement) {      // Is this the one we're looking for?      if (stopCount == aIndex) {        break; // Yes, break out of the loop      }      stopCount++;    }  }  if (stopCount == 0) {    // No stops?  check for URI target    if (checkURITarget())      return mNextGrad->GetStopColor(aIndex, aStopColor);  }  NS_ASSERTION(stopFrame, "No stop frame found!");  if (!stopFrame) {    *aStopColor = 0;    return NS_ERROR_FAILURE;  }  *aStopColor = stopFrame->GetStyleSVG()->mStopColor.mPaint.mColor;  return NS_OK;}