Bug 379635. Don't return random min-widths for native scrollbars when the scrollbar rect is empty. r=cbarrett, sr=dmose
git-svn-id: svn://10.0.0.236/trunk@226481 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
7cd747c7c6
commit
0e65fa8a88
@ -1146,8 +1146,15 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
||||
nsIFrame *scrollbarFrame = GetParentScrollbarFrame(aFrame);
|
||||
if (!scrollbarFrame) return NS_ERROR_FAILURE;
|
||||
|
||||
nsRect scrollbarRect = scrollbarFrame->GetRect();
|
||||
*aIsOverridable = PR_FALSE;
|
||||
|
||||
if (scrollbarRect.IsEmpty()) {
|
||||
// just return (0,0)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// We need to get the device context to convert from app units :(
|
||||
nsRect scrollbarRect = scrollbarFrame->GetRect();
|
||||
nsCOMPtr<nsIDeviceContext> dctx;
|
||||
aContext->GetDeviceContext(*getter_AddRefs(dctx));
|
||||
PRInt32 p2a = dctx->AppUnitsPerDevPixel();
|
||||
@ -1171,7 +1178,6 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
||||
aResult->SizeTo(nscoord(thumbRect.size.width), nscoord(thumbRect.size.height - thumbAdjust));
|
||||
else
|
||||
aResult->SizeTo(nscoord(thumbRect.size.width - thumbAdjust), nscoord(thumbRect.size.height));
|
||||
*aIsOverridable = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user