mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 11:58:55 +00:00
Remove the VerticalScroll() before layout, nsListBoxBodyFrame does that in its post reflow callback. b=547338 r=roc
This commit is contained in:
parent
f4d91f2af0
commit
db44c31d90
@ -130,26 +130,7 @@ nsListBoxLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
|
||||
NS_IMETHODIMP
|
||||
nsListBoxLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
||||
{
|
||||
nsListBoxBodyFrame* frame = static_cast<nsListBoxBodyFrame*>(aBox);
|
||||
|
||||
// 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;
|
||||
frame->GetIndexOfFirstVisibleRow(&index);
|
||||
if (index > 0) {
|
||||
nscoord pos = frame->GetYPosition();
|
||||
PRInt32 rowHeight = frame->GetRowHeightAppUnits();
|
||||
if (pos != (rowHeight*index)) {
|
||||
frame->VerticalScroll(rowHeight*index);
|
||||
frame->Redraw(aState, nsnull, PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult rv = LayoutInternal(aBox, aState);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
return LayoutInternal(aBox, aState);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user