Bug 547342 real fix. Flush on ScrollToRow. r=enn

This commit is contained in:
Boris Zbarsky 2010-08-05 14:39:39 -04:00
parent 71030cb8d2
commit 67950dbf82
4 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,6 @@ var oldtreefirstrow, oldtreecfirstrow;
function nextDataSource()
{
document.documentElement.getBoundingClientRect();
var tree = document.getElementById('t');
var treec = document.getElementById('tc');
tree.treeBoxObject.scrollToRow(10);

View File

@ -143,6 +143,7 @@ nsTreeBodyFrame::nsTreeBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aCont
:nsLeafBoxFrame(aPresShell, aContext),
mSlots(nsnull),
mTopRowIndex(0),
mPageLength(0),
mHorzPosition(0),
mHorzWidth(0),
mAdjustWidth(0),

View File

@ -114,13 +114,13 @@ static void FindBodyElement(nsIContent* aParent, nsIContent** aResult)
}
nsTreeBodyFrame*
nsTreeBoxObject::GetTreeBody()
nsTreeBoxObject::GetTreeBody(bool aFlushLayout)
{
if (mTreeBody) {
return mTreeBody;
}
nsIFrame* frame = GetFrame(PR_FALSE);
nsIFrame* frame = GetFrame(aFlushLayout);
if (!frame)
return nsnull;
@ -324,7 +324,7 @@ nsTreeBoxObject::EnsureCellIsVisible(PRInt32 aRow, nsITreeColumn* aCol)
NS_IMETHODIMP
nsTreeBoxObject::ScrollToRow(PRInt32 aRow)
{
nsTreeBodyFrame* body = GetTreeBody();
nsTreeBodyFrame* body = GetTreeBody(true);
if (body)
return body->ScrollToRow(aRow);
return NS_OK;

View File

@ -57,7 +57,7 @@ public:
nsTreeBoxObject();
~nsTreeBoxObject();
nsTreeBodyFrame* GetTreeBody();
nsTreeBodyFrame* GetTreeBody(bool aFlushLayout = false);
nsTreeBodyFrame* GetCachedTreeBody() { return mTreeBody; }
//NS_PIBOXOBJECT interfaces