diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 7e382e96f18..307751a5a07 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -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); diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index f253052a27a..9f25469f6a1 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -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,