From 67950dbf822acf2db87111ba366a4a4cac92134f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 5 Aug 2010 14:39:39 -0400 Subject: [PATCH] Bug 547342 real fix. Flush on ScrollToRow. r=enn --- content/xul/templates/tests/test_bug441785.xul | 1 - layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp | 1 + layout/xul/base/src/tree/src/nsTreeBoxObject.cpp | 6 +++--- layout/xul/base/src/tree/src/nsTreeBoxObject.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/xul/templates/tests/test_bug441785.xul b/content/xul/templates/tests/test_bug441785.xul index a67448cb1df0..b34d9dc9ea55 100644 --- a/content/xul/templates/tests/test_bug441785.xul +++ b/content/xul/templates/tests/test_bug441785.xul @@ -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); diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index ff0792d76ea1..ad94f6a187f4 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -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), diff --git a/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp b/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp index d49f60128342..fb5a6aaf3ac8 100644 --- a/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp @@ -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; diff --git a/layout/xul/base/src/tree/src/nsTreeBoxObject.h b/layout/xul/base/src/tree/src/nsTreeBoxObject.h index 7d7612ba3df0..971ecb0fe011 100644 --- a/layout/xul/base/src/tree/src/nsTreeBoxObject.h +++ b/layout/xul/base/src/tree/src/nsTreeBoxObject.h @@ -57,7 +57,7 @@ public: nsTreeBoxObject(); ~nsTreeBoxObject(); - nsTreeBodyFrame* GetTreeBody(); + nsTreeBodyFrame* GetTreeBody(bool aFlushLayout = false); nsTreeBodyFrame* GetCachedTreeBody() { return mTreeBody; } //NS_PIBOXOBJECT interfaces