From cefb9670e3f804a51a7bc5794fd004c51c603731 Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Thu, 7 Feb 2008 21:54:24 +0000 Subject: [PATCH] Bug 416113 - cocoa widget does not draw focus rings for xul textboxes. r=josh, sr=roc, a=damons. git-svn-id: svn://10.0.0.236/trunk@245172 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/cocoa/nsNativeThemeCocoa.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/widget/src/cocoa/nsNativeThemeCocoa.mm b/mozilla/widget/src/cocoa/nsNativeThemeCocoa.mm index e5597759681..296b3a1390a 100644 --- a/mozilla/widget/src/cocoa/nsNativeThemeCocoa.mm +++ b/mozilla/widget/src/cocoa/nsNativeThemeCocoa.mm @@ -1056,6 +1056,15 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame // HIThemeSetFill is not available on 10.3 CGContextSetRGBFillColor(cgContext, 1.0, 1.0, 1.0, 1.0); CGContextFillRect(cgContext, macRect); + + // XUL textboxes set the native appearance on the containing box, while + // concrete focus is set on the html:input element within it. We can + // though, check the focused attribute of xul textboxes in this case. + if (aFrame->GetContent()->IsNodeOfType(nsINode::eXUL) && + IsFocused(aFrame)) { + eventState |= NS_EVENT_STATE_FOCUS; + } + DrawFrame(cgContext, kHIThemeFrameTextFieldSquare, macRect, (IsDisabled(aFrame) || IsReadOnly(aFrame)), eventState); break;