Bug 212628

Summary: REGRESSION (r258949): Dynamic user accent color changes are not respected by WKWebView
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bfulgham, darin, pvollan, simon.fraser, timothy, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch pvollan: review+

Description Tim Horton 2020-06-02 00:39:26 PDT
REGRESSION (r258949): Dynamic user accent color changes are not respected by WKWebView
Comment 1 Tim Horton 2020-06-02 00:40:03 PDT
Created attachment 400790 [details]
Patch
Comment 2 Tim Horton 2020-06-02 00:40:05 PDT
<rdar://problem/63436275>
Comment 3 Tim Horton 2020-06-02 01:45:46 PDT
Created attachment 400796 [details]
Patch
Comment 4 Per Arne Vollan 2020-06-02 08:35:32 PDT
Comment on attachment 400796 [details]
Patch

Thanks for fixing this! R=me.
Comment 5 Tim Horton 2020-06-02 10:09:52 PDT
https://trac.webkit.org/changeset/262427/webkit
Comment 6 Darin Adler 2020-06-02 10:55:04 PDT
Comment on attachment 400796 [details]
Patch

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

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:926
> +static const WTF::String& userAccentColorPreferenceKey()
> +{
> +    static NeverDestroyed<WTF::String> userAccentColorPreferenceKey(MAKE_STATIC_STRING_IMPL("AppleAccentColor"));
> +    return userAccentColorPreferenceKey;
> +}

Possible future tidying step. Seems like this could return a const char* or an ASCIILiteral instead. No need for a NeverDestroyed, and comparing a WTF::String is not faster with another WTF::String than it is with a const char*.

Or this could be userAccentColorPreferenceKey() instead.
Comment 7 Tim Horton 2020-06-02 11:04:11 PDT
(In reply to Darin Adler from comment #6)
> Comment on attachment 400796 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=400796&action=review
> 
> > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:926
> > +static const WTF::String& userAccentColorPreferenceKey()
> > +{
> > +    static NeverDestroyed<WTF::String> userAccentColorPreferenceKey(MAKE_STATIC_STRING_IMPL("AppleAccentColor"));
> > +    return userAccentColorPreferenceKey;
> > +}
> 
> Possible future tidying step. Seems like this could return a const char* or
> an ASCIILiteral instead. No need for a NeverDestroyed, and comparing a
> WTF::String is not faster with another WTF::String than it is with a const
> char*.
> 
> Or this could be userAccentColorPreferenceKey() instead.

Heh, I followed what we did with all of our generated preference keys. OK! This is good to know.