Commit 4b1b70a1 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1642343 - Fix Mac themed focus outline to not show white edges. r=mstange, a=jcristau

This can be reproduced trivially on a MacBook on the test page with
layout.css.devPixelsPerPx = 1.

I wanted to fix this independently of following the outline radius.

Differential Revision: https://phabricator.services.mozilla.com/D77943
parent 9b373313
......@@ -1331,19 +1331,14 @@ void nsNativeThemeCocoa::DrawDisclosureButton(CGContextRef cgContext, const HIRe
void nsNativeThemeCocoa::DrawFocusOutline(CGContextRef cgContext, const HIRect& inBoxRect) {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
HIThemeFrameDrawInfo fdi;
fdi.version = 0;
fdi.kind = kHIThemeFrameTextFieldSquare;
fdi.state = kThemeStateActive;
fdi.isFocused = TRUE;
#if DRAW_IN_FRAME_DEBUG
CGContextSetRGBFillColor(cgContext, 0.0, 0.0, 0.5, 0.25);
CGContextFillRect(cgContext, inBoxRect);
#endif
HIThemeDrawFrame(&inBoxRect, &fdi, cgContext, HITHEME_ORIENTATION);
NSGraphicsContext* savedContext = [NSGraphicsContext currentContext];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:cgContext
flipped:YES]];
CGContextSaveGState(cgContext);
NSSetFocusRingStyle(NSFocusRingOnly);
NSRectFill(NSRectFromCGRect(inBoxRect));
CGContextRestoreGState(cgContext);
[NSGraphicsContext setCurrentContext:savedContext];
NS_OBJC_END_TRY_ABORT_BLOCK;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment