mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 06:10:35 +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;
|
nsXULTreeOuterGroupFrame* outer = (nsXULTreeOuterGroupFrame*) frame;
|
||||||
nsTreeLayoutState state = outer->GetTreeLayoutState();
|
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);
|
nsresult rv = LayoutInternal(aBox, aState);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
state = outer->GetTreeLayoutState();
|
state = outer->GetTreeLayoutState();
|
||||||
|
@ -295,9 +295,7 @@ nsXULTreeOuterGroupFrame::SetRowHeight(nscoord aRowHeight)
|
|||||||
nsBoxLayoutState state(mPresContext);
|
nsBoxLayoutState state(mPresContext);
|
||||||
MarkDirtyChildren(state);
|
MarkDirtyChildren(state);
|
||||||
mTreeLayoutState = eTreeLayoutAbort;
|
mTreeLayoutState = eTreeLayoutAbort;
|
||||||
if (mCurrentIndex > 0)
|
|
||||||
VerticalScroll(mCurrentIndex * mRowHeight);
|
|
||||||
|
|
||||||
PostReflowCallback();
|
PostReflowCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1040,6 +1038,7 @@ nsXULTreeOuterGroupFrame::IndexOfItem(nsIContent* aRoot, nsIContent* aContent,
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULTreeOuterGroupFrame::ReflowFinished(nsIPresShell* aPresShell, PRBool* aFlushFlag)
|
nsXULTreeOuterGroupFrame::ReflowFinished(nsIPresShell* aPresShell, PRBool* aFlushFlag)
|
||||||
{
|
{
|
||||||
|
// Now dirty the world.s
|
||||||
nsCOMPtr<nsIContent> tree;
|
nsCOMPtr<nsIContent> tree;
|
||||||
mContent->GetParent(*getter_AddRefs(tree));
|
mContent->GetParent(*getter_AddRefs(tree));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user