From 685e2a2b04f8d04294230d199d67c5bbd6fbe520 Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Tue, 29 Apr 2008 03:55:07 +0000 Subject: [PATCH] b=431081; native selection box frame missing in fx3 - vista content only; r+sr=roc,a=beltzner git-svn-id: svn://10.0.0.236/trunk@250906 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/forms/nsComboboxControlFrame.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index c3d6dbe21a8..aacf89090f8 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -1399,7 +1399,13 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, } void nsComboboxControlFrame::PaintFocus(nsIRenderingContext& aRenderingContext, - nsPoint aPt) { + nsPoint aPt) +{ + /* Do we need to do anything? */ + if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled) || + mFocused != this) + return; + aRenderingContext.PushState(); nsRect clipRect = mDisplayFrame->GetRect() + aPt; aRenderingContext.SetClipRect(clipRect, nsClipCombine_kIntersect); @@ -1410,16 +1416,12 @@ void nsComboboxControlFrame::PaintFocus(nsIRenderingContext& aRenderingContext, ///////////////////// // draw focus - // XXX This is only temporary - if (!mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled) && - mFocused == this) { - aRenderingContext.SetLineStyle(nsLineStyle_kDotted); - aRenderingContext.SetColor(GetStyleColor()->mColor); - } else { - aRenderingContext.SetColor(GetStyleBackground()->mBackgroundColor); - aRenderingContext.SetLineStyle(nsLineStyle_kSolid); - } + + aRenderingContext.SetLineStyle(nsLineStyle_kDotted); + aRenderingContext.SetColor(GetStyleColor()->mColor); + //aRenderingContext.DrawRect(clipRect); + nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1); clipRect.width -= onePixel; clipRect.height -= onePixel;