if (!mVisibility) {
if (!mVisibility && !mVisibilityOverride) {
nsHTMLFramesetBorderFrame::Paint(nsIPresContext*      aPresContext,                                 nsIRenderingContext& aRenderingContext,                                 const nsRect&        aDirtyRect,                                 nsFramePaintLayer    aWhichLayer,                                 PRUint32             aFlags){  if (NS_FRAME_PAINT_LAYER_FOREGROUND != aWhichLayer) {    return NS_OK;  }  //printf("border frame paint %X (%d,%d,%d,%d) \n", this, aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);  nscolor WHITE    = NS_RGB(255, 255, 255);  nscolor bgColor  = NS_RGB(200,200,200);  nscolor fgColor  = NS_RGB(0,0,0);  nscolor hltColor = NS_RGB(255,255,255);  nscolor sdwColor = NS_RGB(128,128,128);  nsILookAndFeel * lookAndFeel;  if (NS_OK == nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, NS_GET_IID(nsILookAndFeel), (void**)&lookAndFeel)) {   lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetBackground,  bgColor);   lookAndFeel->GetColor(nsILookAndFeel::eColor_WidgetForeground,  fgColor);   lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DShadow,    sdwColor);   lookAndFeel->GetColor(nsILookAndFeel::eColor_Widget3DHighlight, hltColor);   NS_RELEASE(lookAndFeel);  }  float t2p;  aPresContext->GetTwipsToPixels(&t2p);  nscoord widthInPixels = NSTwipsToIntPixels(mWidth, t2p);  float p2t;  aPresContext->GetPixelsToTwips(&p2t);  nscoord pixelWidth    = NSIntPixelsToTwips(1, p2t);  if (widthInPixels <= 0) {    return NS_OK;  }  nscoord x0 = 0;  nscoord y0 = 0;  nscoord x1 = (mVertical) ? x0 : mRect.width;  nscoord y1 = (mVertical) ? mRect.height : x0;  nscolor color = WHITE;  if (mVisibility) {    color = (NO_COLOR == mColor) ? bgColor : mColor;  }  aRenderingContext.SetColor(color);  // draw grey or white first  for (int i = 0; i < widthInPixels; i++) {    aRenderingContext.DrawLine (x0, y0, x1, y1);    if (mVertical) {      x0 += pixelWidth;      x1 =  x0;    } else {      y0 += pixelWidth;      y1 =  y0;    }  }  if (!mVisibility) {    return NS_OK;  }  if (widthInPixels >= 5) {    aRenderingContext.SetColor(hltColor);    x0 = (mVertical) ? pixelWidth : 0;    y0 = (mVertical) ? 0 : pixelWidth;    x1 = (mVertical) ? x0 : mRect.width;    y1 = (mVertical) ? mRect.height : y0;    aRenderingContext.DrawLine(x0, y0, x1, y1);  }  if (widthInPixels >= 2) {    aRenderingContext.SetColor(sdwColor);    x0 = (mVertical) ? mRect.width - (2 * pixelWidth) : 0;    y0 = (mVertical) ? 0 : mRect.height - (2 * pixelWidth);    x1 = (mVertical) ? x0 : mRect.width;    y1 = (mVertical) ? mRect.height : y0;    aRenderingContext.DrawLine(x0, y0, x1, y1);  }  if (widthInPixels >= 1) {    aRenderingContext.SetColor(fgColor);    x0 = (mVertical) ? mRect.width - pixelWidth : 0;    y0 = (mVertical) ? 0 : mRect.height - pixelWidth;    x1 = (mVertical) ? x0 : mRect.width;    y1 = (mVertical) ? mRect.height : y0;    aRenderingContext.DrawLine(x0, y0, x1, y1);  }  return NS_OK;}