mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 870917: Fix overlay scrollbars in XUL trees to fade and disappear correctly instead of pulsating continuously. r=roc
This commit is contained in:
parent
778f76a35a
commit
ee67877064
@ -114,6 +114,7 @@ nsTreeBodyFrame::nsTreeBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aCont
|
||||
mTopRowIndex(0),
|
||||
mPageLength(0),
|
||||
mHorzPosition(0),
|
||||
mOriginalHorzWidth(-1),
|
||||
mHorzWidth(0),
|
||||
mAdjustWidth(0),
|
||||
mRowHeight(0),
|
||||
@ -384,16 +385,29 @@ nsTreeBodyFrame::EnsureView()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsTreeBodyFrame::ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth)
|
||||
{
|
||||
if (!mReflowCallbackPosted &&
|
||||
(!aRect.IsEqualEdges(mRect) || mHorzWidth != aHorzWidth)) {
|
||||
PresContext()->PresShell()->PostReflowCallback(this);
|
||||
mReflowCallbackPosted = true;
|
||||
mOriginalHorzWidth = mHorzWidth;
|
||||
}
|
||||
else if (mReflowCallbackPosted &&
|
||||
mHorzWidth != aHorzWidth && mOriginalHorzWidth == aHorzWidth) {
|
||||
PresContext()->PresShell()->CancelReflowCallback(this);
|
||||
mReflowCallbackPosted = false;
|
||||
mOriginalHorzWidth = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsTreeBodyFrame::SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
|
||||
bool aRemoveOverflowArea)
|
||||
{
|
||||
nscoord horzWidth = CalcHorzWidth(GetScrollParts());
|
||||
if ((!aRect.IsEqualEdges(mRect) || mHorzWidth != horzWidth) && !mReflowCallbackPosted) {
|
||||
mReflowCallbackPosted = true;
|
||||
PresContext()->PresShell()->PostReflowCallback(this);
|
||||
}
|
||||
|
||||
ManageReflowCallback(aRect, horzWidth);
|
||||
mHorzWidth = horzWidth;
|
||||
|
||||
nsLeafBoxFrame::SetBounds(aBoxLayoutState, aRect, aRemoveOverflowArea);
|
||||
|
@ -120,6 +120,8 @@ public:
|
||||
nsresult EndUpdateBatch();
|
||||
nsresult ClearStyleAndImageCaches();
|
||||
|
||||
void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth);
|
||||
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
|
||||
virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
|
||||
bool aRemoveOverflowArea = false) MOZ_OVERRIDE;
|
||||
@ -576,6 +578,13 @@ protected: // Data Members
|
||||
|
||||
// The horizontal scroll position
|
||||
nscoord mHorzPosition;
|
||||
|
||||
// The original desired horizontal width before changing it and posting a
|
||||
// reflow callback. In some cases, the desired horizontal width can first be
|
||||
// different from the current desired horizontal width, only to return to
|
||||
// the same value later during the same reflow. In this case, we can cancel
|
||||
// the posted reflow callback and prevent an unnecessary reflow.
|
||||
nscoord mOriginalHorzWidth;
|
||||
// Our desired horizontal width (the width for which we actually have tree
|
||||
// columns).
|
||||
nscoord mHorzWidth;
|
||||
|
Loading…
Reference in New Issue
Block a user