while (aView != aStopAtView) {
while (NS_STATIC_CAST(nsIView*, aView) != aStopAtView) {
static PRBool ApplyClipRect(const nsView* aView, nsRect* aRect, PRBool aFollowPlaceholders,                            nsIView* aStopAtView){  // this records the offset from the origin of the current aView  // to the origin of the initial aView  nsPoint offset(0, 0);  PRBool lastViewIsFloating = aView->GetFloating();  PRBool foundPlaceholders = PR_FALSE;  while (aView != aStopAtView) {    const nsView* parentView = aView->GetParent();    nsPoint offsetFromParent = aView->GetPosition();    const nsView* zParent = aView->GetZParent();    if (zParent) {      foundPlaceholders = PR_TRUE;      if (aFollowPlaceholders) {        // correct offsetFromParent to account for the fact that we're        // switching parentView to ZParent        // Note that the common case is that parentView is an ancestor of        // ZParent.        const nsView* zParentChain;        for (zParentChain = zParent;             zParentChain != parentView && zParentChain;             zParentChain = zParentChain->GetParent()) {          offsetFromParent -= zParentChain->GetPosition();        }        if (!zParentChain) {          // uh oh. As we walked up the tree, we missed zParent. This can          // happen because of odd (but legal) containing block hierarchies.          // Just compute the required offset from scratch; this is slow,          // but hopefully rarely executed.          offsetFromParent = nsViewManager::ComputeViewOffset(aView)            - nsViewManager::ComputeViewOffset(zParent);        }        parentView = zParent;      }    }    if (!parentView) {      break;    }    PRBool parentIsFloating = parentView->GetFloating();    if (lastViewIsFloating && !parentIsFloating) {      break;    }    // now make offset be the offset from parentView's origin to the initial    // aView's origin    offset += offsetFromParent;    if (parentView->GetClipChildrenToBounds(aFollowPlaceholders)) {      // Get the parent's clip rect (which is just the dimensions in this      // case) into the initial aView's coordinates      nsRect clipRect = parentView->GetDimensions();      clipRect -= offset;      PRBool overlap = aRect->IntersectRect(clipRect, *aRect);      if (!overlap) {        break;      }    }    const nsRect* r = parentView->GetClipChildrenToRect();    if (r && !aFollowPlaceholders) {      // Get the parent's clip rect into the initial aView's coordinates      nsRect clipRect = *r;      clipRect -= offset;      PRBool overlap = aRect->IntersectRect(clipRect, *aRect);      if (!overlap) {        break;      }    }    aView = parentView;    lastViewIsFloating = parentIsFloating;  }  return foundPlaceholders;}