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:
masayuki%d-toybox.com
2006-04-28 23:21:01 +00:00
parent 3ce4234ace
commit b2f32dc37e
2 changed files with 15 additions and 2 deletions

View File

@@ -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,