Bug 381120, ensure view in reflowcallback, r+sr=roc

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-06-12 03:26:13 -07:00
parent 57d8a6ea55
commit 4c1bf9be59

View File

@ -387,6 +387,15 @@ void
nsTreeBodyFrame::EnsureView()
{
if (!mView) {
PRBool isInReflow;
PresContext()->PresShell()->IsReflowLocked(&isInReflow);
if (isInReflow) {
if (!mReflowCallbackPosted) {
mReflowCallbackPosted = PR_TRUE;
PresContext()->PresShell()->PostReflowCallback(this);
}
return;
}
nsCOMPtr<nsIBoxObject> box = do_QueryInterface(mTreeBoxObject);
if (box) {
nsCOMPtr<nsITreeView> treeView;
@ -433,6 +442,11 @@ nsTreeBodyFrame::SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRec
PRBool
nsTreeBodyFrame::ReflowFinished()
{
if (!mView) {
nsWeakFrame weakFrame(this);
EnsureView();
NS_ENSURE_TRUE(weakFrame.IsAlive(), PR_FALSE);
}
if (mView) {
CalcInnerBox();
ScrollParts parts = GetScrollParts();