Bug 335474 Crash in [@ nsCSSRendering::DrawDashedSides] r+sr=roc
git-svn-id: svn://10.0.0.236/trunk@195696 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -920,7 +920,9 @@ PRBool bSolid = PR_TRUE;
|
||||
float over = 0.0f;
|
||||
PRBool skippedSide = PR_FALSE;
|
||||
|
||||
NS_ASSERTION((aDoOutline && aOutlineStyle) || (!aDoOutline && aBorderStyle), "null params not allowed");
|
||||
NS_ASSERTION(aColorStyle &&
|
||||
((aDoOutline && aOutlineStyle) || (!aDoOutline && aBorderStyle)),
|
||||
"null params not allowed");
|
||||
PRUint8 style = aDoOutline
|
||||
? aOutlineStyle->GetOutlineStyle()
|
||||
: aBorderStyle->GetBorderStyle(startSide);
|
||||
|
||||
@@ -502,6 +502,17 @@ CanvasFrame::PaintFocus(nsIRenderingContext& aRenderingContext, nsPoint aPt)
|
||||
outlineStyle.SetOutlineStyle(NS_STYLE_BORDER_STYLE_DOTTED);
|
||||
outlineStyle.SetOutlineInvert();
|
||||
|
||||
// XXX use the root frame foreground color, but should we find BODY frame
|
||||
// for HTML documents?
|
||||
nsIFrame* root = mFrames.FirstChild();
|
||||
const nsStyleColor* color =
|
||||
root ? root->GetStyleContext()->GetStyleColor() :
|
||||
mStyleContext->GetStyleColor();
|
||||
if (!color) {
|
||||
NS_ERROR("current color cannot be found");
|
||||
return;
|
||||
}
|
||||
|
||||
float p2t = GetPresContext()->PixelsToTwips();
|
||||
// XXX the CSS border for links is specified as 2px, but it
|
||||
// is only drawn as 1px. Match this here.
|
||||
@@ -513,7 +524,7 @@ CanvasFrame::PaintFocus(nsIRenderingContext& aRenderingContext, nsPoint aPt)
|
||||
focusRect.height - 2 * onePixel);
|
||||
|
||||
nsCSSRendering::DrawDashedSides(0, aRenderingContext,
|
||||
focusRect, nsnull,
|
||||
focusRect, color,
|
||||
nsnull, &outlineStyle,
|
||||
PR_TRUE, focusRect,
|
||||
borderInside, 0,
|
||||
|
||||
Reference in New Issue
Block a user