mWebShell->SetScrolling(-1, PR_FALSE);
HTMLContentSink::StartLayout(){  if (mLayoutStarted) {    return;  }  mLayoutStarted = PR_TRUE;  mLastNotificationTime = PR_Now();  // If it's a frameset document then disable scrolling. If it is not a <frame>   // document, then let the style dictate. We need to do this before the initial reflow...  if (mWebShell) {    // initially show the scrollbars. We need to do this because another    // document like a XUL document, could have have hidden the scrollbars. -EDV    mWebShell->SetScrolling(-1, PR_FALSE);    if (mFrameset) {      mWebShell->SetScrolling(NS_STYLE_OVERFLOW_HIDDEN, PR_FALSE);    }     else if (mBody) {      PRBool isFrameDoc = PR_FALSE;      nsCOMPtr<nsIContentViewer> cv;      mWebShell->GetContentViewer(getter_AddRefs(cv));      if (cv)      {        nsCOMPtr<nsIMarkupDocumentViewer> muCV = do_QueryInterface(cv);                    if (muCV)        {          muCV->GetIsFrame(&isFrameDoc);        }      }      // a <frame> webshell will have its scrolling set by the parent nsFramesetFrame.       // a <body> webshell is reset here just for safety.      if (!isFrameDoc) {        mWebShell->SetScrolling(-1, PR_FALSE);      }    }  }  PRInt32 i, ns = mDocument->GetNumberOfShells();  for (i = 0; i < ns; i++) {    nsCOMPtr<nsIPresShell> shell(dont_AddRef(mDocument->GetShellAt(i)));    if (shell) {      // Make shell an observer for next time      shell->BeginObservingDocument();      // Resize-reflow this time      nsCOMPtr<nsIPresContext> cx;      shell->GetPresContext(getter_AddRefs(cx));      nsRect r;      cx->GetVisibleArea(r);      shell->InitialReflow(r.width, r.height);      // Now trigger a refresh      nsCOMPtr<nsIViewManager> vm;      shell->GetViewManager(getter_AddRefs(vm));      if (vm) {        RefreshIfEnabled(vm);      }    }  }  // If the document we are loading has a reference or it is a   // frameset document, disable the scroll bars on the views.  char* ref = nsnull;           // init in case mDocumentURI is not a url  nsIURL* url;  nsresult rv = mDocumentURI->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);  if (NS_SUCCEEDED(rv)) {    rv = url->GetRef(&ref);    NS_RELEASE(url);  }  if (rv == NS_OK) {    mRef = new nsString(ref);    nsCRT::free(ref);  }  if ((nsnull != ref) || mFrameset) {    // XXX support more than one presentation-shell here    // Get initial scroll preference and save it away; disable the    // scroll bars.    ns = mDocument->GetNumberOfShells();    for (i = 0; i < ns; i++) {      nsCOMPtr<nsIPresShell> shell(dont_AddRef(mDocument->GetShellAt(i)));      if (shell) {        nsCOMPtr<nsIViewManager> vm;        shell->GetViewManager(getter_AddRefs(vm));        if (vm) {          nsIView* rootView = nsnull;          vm->GetRootView(rootView);          if (nsnull != rootView) {            nsIScrollableView* sview = nsnull;            rootView->QueryInterface(kIScrollableViewIID, (void**) &sview);            if (nsnull != sview) {              if (mFrameset)                mOriginalScrollPreference = nsScrollPreference_kNeverScroll;              else                sview->GetScrollPreference(mOriginalScrollPreference);              sview->SetScrollPreference(nsScrollPreference_kNeverScroll);            }          }        }      }    }  }}