зеркало из https://github.com/mozilla/gecko-dev.git
Bug 424873. Make GetWidgetOverflow take the new frame size as input instead of using the possibly-stale old frame size. r+sr=dbaron
This commit is contained in:
Родитель
7fcd1f6092
Коммит
78a0743f5b
|
@ -108,15 +108,17 @@ public:
|
|||
nsMargin* aResult) = 0;
|
||||
|
||||
/**
|
||||
* On entry, *aResult is positioned at 0,0 and sized to the new size
|
||||
* of aFrame (aFrame->GetSize() may be stale and should not be used).
|
||||
* This method can return PR_FALSE to indicate that no special
|
||||
* overflow area is required by the native widget. Otherwise it will
|
||||
* fill in aResult with the desired overflow area, in twips, relative
|
||||
* to the widget origin, and return PR_TRUE.
|
||||
* fill in aResult with the desired overflow area, in appunits, relative
|
||||
* to the frame origin, and return PR_TRUE.
|
||||
*/
|
||||
virtual PRBool GetWidgetOverflow(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsRect* aResult)
|
||||
/*INOUT*/ nsRect* aOverflowRect)
|
||||
{ return PR_FALSE; }
|
||||
|
||||
/**
|
||||
|
|
|
@ -5310,7 +5310,7 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
|
|||
|
||||
const nsStyleDisplay *disp = GetStyleDisplay();
|
||||
if (!IsBoxWrapped() && IsThemed(disp)) {
|
||||
nsRect r;
|
||||
nsRect r(nsPoint(0, 0), aNewSize);
|
||||
nsPresContext *presContext = PresContext();
|
||||
if (presContext->GetTheme()->
|
||||
GetWidgetOverflow(presContext->DeviceContext(), this,
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
nsMargin* aResult);
|
||||
|
||||
virtual PRBool GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType, nsRect* aResult);
|
||||
PRUint8 aWidgetType, nsRect* aOverflowRect);
|
||||
|
||||
NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
|
|
|
@ -1471,7 +1471,7 @@ nsNativeThemeCocoa::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
|
||||
PRBool
|
||||
nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType, nsRect* aResult)
|
||||
PRUint8 aWidgetType, nsRect* aOverflowRect)
|
||||
{
|
||||
switch (aWidgetType) {
|
||||
case NS_THEME_BUTTON:
|
||||
|
@ -1493,9 +1493,7 @@ nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFra
|
|||
NSIntPixelsToAppUnits(extraSize.top, p2a),
|
||||
NSIntPixelsToAppUnits(extraSize.right, p2a),
|
||||
NSIntPixelsToAppUnits(extraSize.bottom, p2a));
|
||||
nsRect r(nsPoint(0, 0), aFrame->GetSize());
|
||||
r.Inflate(m);
|
||||
*aResult = r;
|
||||
aOverflowRect->Inflate(m);
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -950,7 +950,7 @@ nsNativeThemeGTK::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
PRBool
|
||||
nsNativeThemeGTK::GetWidgetOverflow(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
nsRect* aResult)
|
||||
nsRect* aOverflowRect)
|
||||
{
|
||||
nsMargin m;
|
||||
PRInt32 p2a;
|
||||
|
@ -981,9 +981,7 @@ nsNativeThemeGTK::GetWidgetOverflow(nsIDeviceContext* aContext,
|
|||
NSIntPixelsToAppUnits(extraSize.bottom, p2a));
|
||||
}
|
||||
|
||||
nsRect r(nsPoint(0, 0), aFrame->GetSize());
|
||||
r.Inflate(m);
|
||||
*aResult = r;
|
||||
aOverflowRect->Inflate(m);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
virtual NS_HIDDEN_(PRBool) GetWidgetOverflow(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsRect* aResult);
|
||||
nsRect* aOverflowRect);
|
||||
|
||||
NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
||||
nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
|
|
|
@ -1610,7 +1610,7 @@ nsNativeThemeWin::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
PRBool
|
||||
nsNativeThemeWin::GetWidgetOverflow(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
PRUint8 aOverflowRect,
|
||||
nsRect* aResult)
|
||||
{
|
||||
/* This is disabled for now, because it causes invalidation problems --
|
||||
|
@ -1632,9 +1632,7 @@ nsNativeThemeWin::GetWidgetOverflow(nsIDeviceContext* aContext,
|
|||
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
|
||||
/* Note: no overflow on the left */
|
||||
nsMargin m(0, p2a, p2a, p2a);
|
||||
nsRect r(nsPoint(0, 0), aFrame->GetSize());
|
||||
r.Inflate (m);
|
||||
*aResult = r;
|
||||
aOverflowRect->Inflate (m);
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
virtual PRBool GetWidgetOverflow(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsRect* aResult);
|
||||
nsRect* aOverflowRect);
|
||||
|
||||
NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
|
|
Загрузка…
Ссылка в новой задаче