rv = NS_NewLayoutHistoryState(aState);
if (!mHistoryState) {  rv = NS_NewLayoutHistoryState(aState);
PresShell::GetHistoryState(nsILayoutHistoryState** aState){  nsresult rv = NS_OK;  NS_PRECONDITION(nsnull != aState, "null state pointer");  // Create the document state object  rv = NS_NewLayoutHistoryState(aState);    if (NS_FAILED(rv)) {     *aState = nsnull;    return rv;  }  // Capture frame state for the entire frame hierarchy  nsIFrame* rootFrame = nsnull;  rv = GetRootFrame(&rootFrame);  if (NS_FAILED(rv) || nsnull == rootFrame) return rv;  rv = mFrameManager->CaptureFrameState(mPresContext, rootFrame, *aState);  return rv;}