Bug 225375

Summary: [macOS] Use system colors for ActiveButtonText
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch for EWS
none
Patch
thorton: review+
Patch for landing none

Description Aditya Keerthi 2021-05-04 17:46:16 PDT
...
Comment 1 Aditya Keerthi 2021-05-04 17:46:39 PDT
<rdar://problem/75863443>
Comment 2 Aditya Keerthi 2021-05-04 17:48:06 PDT
Created attachment 427716 [details]
Patch for EWS
Comment 3 Aditya Keerthi 2021-05-05 12:43:26 PDT
Created attachment 427790 [details]
Patch
Comment 4 Tim Horton 2021-05-05 13:11:40 PDT
Comment on attachment 427790 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=427790&action=review

> Source/WebCore/rendering/RenderThemeMac.mm:414
> +    if ([cell interiorBackgroundStyle] == NSBackgroundStyleEmphasized)

Should also have a FIXME and an AppKit radar on all of this.
Comment 5 Aditya Keerthi 2021-05-05 13:39:56 PDT
Created attachment 427801 [details]
Patch for landing
Comment 6 EWS 2021-05-05 19:34:36 PDT
Committed r277067 (237370@main): <https://commits.webkit.org/237370@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427801 [details].
Comment 7 Simon Fraser (smfr) 2021-05-05 21:23:28 PDT
Comment on attachment 427801 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=427801&action=review

> Source/WebCore/rendering/RenderThemeMac.mm:423
> +    auto cell = adoptNS([[NSButtonCell alloc] init]);
> +    [cell setBezelStyle:NSBezelStyleRounded];
> +    [cell setHighlighted:YES];
> +
> +    NSColor *activeButtonTextColor;
> +    if ([cell interiorBackgroundStyle] == NSBackgroundStyleEmphasized)
> +        activeButtonTextColor = [NSColor alternateSelectedControlTextColor];
> +    else
> +        activeButtonTextColor = [NSColor controlTextColor];
> +
> +    return semanticColorFromNSColor(activeButtonTextColor);

Do we call this every time we paint a button? Can we cache it?
Comment 8 Tim Horton 2021-05-05 23:15:13 PDT
(In reply to Simon Fraser (smfr) from comment #7)
> Comment on attachment 427801 [details]
> Patch for landing
> Do we call this every time we paint a button? Can we cache it?

See the changelog :)