mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 05:47:04 +00:00
Fix for 51084, sr=waterson
This commit is contained in:
parent
57db879fec
commit
87fc282f05
@ -267,6 +267,20 @@ nsTreeLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
nsXULTreeOuterGroupFrame* outer = (nsXULTreeOuterGroupFrame*) frame;
|
||||
nsTreeLayoutState state = outer->GetTreeLayoutState();
|
||||
|
||||
// Always ensure an accurate scrollview position
|
||||
// This is an edge case that was caused by the row height
|
||||
// changing after a scroll had occurred. (Bug #51084)
|
||||
PRInt32 index;
|
||||
outer->GetIndexOfFirstVisibleRow(&index);
|
||||
if (index > 0) {
|
||||
nscoord pos = outer->GetYPosition();
|
||||
PRInt32 rowHeight = outer->GetRowHeightTwips();
|
||||
if (pos != (rowHeight*index)) {
|
||||
outer->VerticalScroll(rowHeight*index);
|
||||
outer->Redraw(aState, nsnull, PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult rv = LayoutInternal(aBox, aState);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
state = outer->GetTreeLayoutState();
|
||||
|
@ -295,9 +295,7 @@ nsXULTreeOuterGroupFrame::SetRowHeight(nscoord aRowHeight)
|
||||
nsBoxLayoutState state(mPresContext);
|
||||
MarkDirtyChildren(state);
|
||||
mTreeLayoutState = eTreeLayoutAbort;
|
||||
if (mCurrentIndex > 0)
|
||||
VerticalScroll(mCurrentIndex * mRowHeight);
|
||||
|
||||
|
||||
PostReflowCallback();
|
||||
}
|
||||
}
|
||||
@ -1040,6 +1038,7 @@ nsXULTreeOuterGroupFrame::IndexOfItem(nsIContent* aRoot, nsIContent* aContent,
|
||||
NS_IMETHODIMP
|
||||
nsXULTreeOuterGroupFrame::ReflowFinished(nsIPresShell* aPresShell, PRBool* aFlushFlag)
|
||||
{
|
||||
// Now dirty the world.s
|
||||
nsCOMPtr<nsIContent> tree;
|
||||
mContent->GetParent(*getter_AddRefs(tree));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user