Added code to set/get the view manager's root scrollable view

This commit is contained in:
troy@netscape.com
1999-02-16 04:41:15 +00:00
parent c7ff279f2d
commit 369c7ca42b
6 changed files with 94 additions and 116 deletions

View File

@@ -77,7 +77,7 @@ static NS_DEFINE_IID(kIComboboxControlFrameIID, NS_ICOMBOBOXCONTROLFRAME_IID);
static NS_DEFINE_IID(kIListControlFrameIID, NS_ILISTCONTROLFRAME_IID);
static NS_DEFINE_IID(kIDOMHTMLImageElementIID, NS_IDOMHTMLIMAGEELEMENT_IID);
static NS_DEFINE_IID(kIDOMCharacterDataIID, NS_IDOMCHARACTERDATA_IID);
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
// Structure used when constructing formatting object trees.
struct nsFrameItems {
@@ -1372,6 +1372,15 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
NS_NewScrollFrame(scrollFrame);
// XXX should probably be a scrolled content pseudo style context
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle);
// Inform the view manager about the root scrollable view
nsIView* scrollFrameView;
nsIScrollableView* scrollingView;
scrollFrame->GetView(&scrollFrameView);
NS_ASSERTION(scrollFrameView, "scroll frame has no view");
scrollFrameView->QueryInterface(kScrollViewIID, (void**)&scrollingView);
viewManager->SetRootScrollableView(scrollingView);
}
PRBool isPaginated;