nsresult result = blockFrame->GetParent(&blockFrame); if (NS_FAILED(result) || !blockFrame)
blockFrame = blockFrame->GetParent(); if (!blockFrame)
GetBlockFrameAndLineIter(nsIFrame* aFrame, nsIFrame** aBlockFrame){  nsILineIterator* it;  nsIFrame *blockFrame = aFrame;  nsIFrame *thisBlock = aFrame;  nsresult result = blockFrame->GetParent(&blockFrame);  if (NS_FAILED(result) || !blockFrame) //if at line 0 then nothing to do    return 0;  result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator), (void**)&it);  if (NS_SUCCEEDED(result) && it)  {    if (aBlockFrame)      *aBlockFrame = blockFrame;    return it;  }  while (blockFrame)  {    thisBlock = blockFrame;    result = blockFrame->GetParent(&blockFrame);    if (NS_SUCCEEDED(result) && blockFrame){      result = blockFrame->QueryInterface(NS_GET_IID(nsILineIterator),                                          (void**)&it);      if (NS_SUCCEEDED(result) && it)      {        if (aBlockFrame)          *aBlockFrame = blockFrame;        return it;      }    }  }  return 0;}