followup for 370659, all popups started overflowing because we were assigning overflow to too many widgets. Thanks to Mano for figuring out what the problem was. b=370769 r=cbarrett

git-svn-id: svn://10.0.0.236/trunk@220591 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
joshmoz%gmail.com 2007-02-20 19:33:20 +00:00
parent 983ff6cdd3
commit eb773195b7

View File

@ -721,18 +721,32 @@ PRBool
nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFrame,
PRUint8 aWidgetType, nsRect* aResult)
{
// We assume that all native widgets can draw a focus ring that will be less than
// or equal to 4 pixels thick.
nsIntMargin extraSize = nsIntMargin(4, 4, 4, 4);
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
nsMargin m(NSIntPixelsToAppUnits(extraSize.left, p2a),
NSIntPixelsToAppUnits(extraSize.top, p2a),
NSIntPixelsToAppUnits(extraSize.right, p2a),
NSIntPixelsToAppUnits(extraSize.bottom, p2a));
nsRect r(nsPoint(0, 0), aFrame->GetSize());
r.Inflate(m);
*aResult = r;
return PR_TRUE;
switch (aWidgetType) {
case NS_THEME_BUTTON:
case NS_THEME_BUTTON_SMALL:
case NS_THEME_TEXTFIELD:
case NS_THEME_LISTBOX:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_CHECKBOX:
case NS_THEME_CHECKBOX_SMALL:
case NS_THEME_RADIO:
case NS_THEME_RADIO_SMALL:
// We assume that the above widgets can draw a focus ring that will be less than
// or equal to 4 pixels thick.
nsIntMargin extraSize = nsIntMargin(4, 4, 4, 4);
PRInt32 p2a = aContext->AppUnitsPerDevPixel();
nsMargin m(NSIntPixelsToAppUnits(extraSize.left, p2a),
NSIntPixelsToAppUnits(extraSize.top, p2a),
NSIntPixelsToAppUnits(extraSize.right, p2a),
NSIntPixelsToAppUnits(extraSize.bottom, p2a));
nsRect r(nsPoint(0, 0), aFrame->GetSize());
r.Inflate(m);
*aResult = r;
return PR_TRUE;
}
return PR_FALSE;
}
NS_IMETHODIMP