зеркало из https://github.com/mozilla/gecko-dev.git
Eliminated a bunch of code now that CreateViewForFrame() takes care of calling
SetScrolledView()
This commit is contained in:
Родитель
7e29c81e53
Коммит
c5204005c1
|
@ -98,44 +98,13 @@ nsScrollFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||||
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName,
|
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName,
|
||||||
aChildList);
|
aChildList);
|
||||||
|
|
||||||
// Get our view
|
#ifdef NS_DEBUG
|
||||||
nsIView* myView;
|
// Verify that the scrolled frame has a view
|
||||||
nsIViewManager* viewManager;
|
|
||||||
|
|
||||||
GetView(myView);
|
|
||||||
NS_ASSERTION(nsnull != myView, "no view");
|
|
||||||
myView->GetViewManager(viewManager);
|
|
||||||
|
|
||||||
// Get the scrolled frame's view. Note that it must already have a view
|
|
||||||
nsIView* scrolledView;
|
nsIView* scrolledView;
|
||||||
|
|
||||||
mFirstChild->GetView(scrolledView);
|
mFirstChild->GetView(scrolledView);
|
||||||
NS_ASSERTION(nsnull != scrolledView, "no view");
|
NS_ASSERTION(nsnull != scrolledView, "no view");
|
||||||
|
#endif
|
||||||
// If the scrolled view is currently inserted in the view hierarchy then
|
|
||||||
// remove it. We'll add it to the scrolling view below
|
|
||||||
nsIView* parentView;
|
|
||||||
scrolledView->GetParent(parentView);
|
|
||||||
if (nsnull != parentView) {
|
|
||||||
viewManager->RemoveChild(parentView, scrolledView);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set it as the scrolling view's scrolled view
|
|
||||||
nsIScrollableView* scrollingView;
|
|
||||||
myView->QueryInterface(kScrollViewIID, (void**)&scrollingView);
|
|
||||||
scrollingView->SetScrolledView(scrolledView);
|
|
||||||
|
|
||||||
// Get the color style info
|
|
||||||
const nsStyleColor* color;
|
|
||||||
mFirstChild->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)color);
|
|
||||||
|
|
||||||
// If the background is transparent then inform the view manager
|
|
||||||
if (NS_STYLE_BG_COLOR_TRANSPARENT & color->mBackgroundFlags) {
|
|
||||||
viewManager->SetViewContentTransparency(scrolledView, PR_TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the opacity
|
|
||||||
viewManager->SetViewOpacity(scrolledView, color->mOpacity);
|
|
||||||
|
|
||||||
// We need to allow the view's position to be different than the
|
// We need to allow the view's position to be different than the
|
||||||
// frame's position
|
// frame's position
|
||||||
|
@ -144,7 +113,6 @@ nsScrollFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||||
state &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
|
state &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
|
||||||
mFirstChild->SetFrameState(state);
|
mFirstChild->SetFrameState(state);
|
||||||
|
|
||||||
NS_RELEASE(viewManager);
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче