Bug 235706 - [GTK] Support accent colors
Summary: [GTK] Support accent colors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexander Mikhaylenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-27 04:37 PST by Alexander Mikhaylenko
Modified: 2022-01-27 10:18 PST (History)
18 users (show)

See Also:


Attachments
Patch (23.86 KB, patch)
2022-01-27 04:39 PST, Alexander Mikhaylenko
no flags Details | Formatted Diff | Diff
Patch (24.04 KB, patch)
2022-01-27 08:09 PST, Alexander Mikhaylenko
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Mikhaylenko 2022-01-27 04:37:32 PST
See the patch. Had it lying around for a while, probably forgot to submit.

Untested on WPE, let's see what EWS says. There is logic to fall back to the previous blue if no accent was set, but I don't know if it builds.
Comment 1 Alexander Mikhaylenko 2022-01-27 04:39:04 PST
Created attachment 450127 [details]
Patch
Comment 2 EWS Watchlist 2022-01-27 04:41:31 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Michael Catanzaro 2022-01-27 07:05:01 PST
Comment on attachment 450127 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        here. Remove the last bits of ThemeGtk and foreign drawing on GTK3.

You haven't really removed the last bits, since we still draw GTK-style scrollbars.

> Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:1847
> +#if USE(GTK4)
> +static void webkitWebViewBaseCssChanged(GtkWidget* widget, GtkCssStyleChange* change)
> +#else
> +static void webkitWebViewBaseStyleUpdated(GtkWidget* widget)
> +#endif
> +{
> +#if USE(GTK4)
> +    GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->css_changed(widget, change);
> +#else
> +    GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->style_updated(widget);
> +#endif
> +
> +    WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
> +    WebKitWebViewBasePrivate* priv = webViewBase->priv;
> +    priv->pageProxy->accentColorDidChange();
> +}

Style nit: it's more readable to duplicate this short function for GTK 4 vs. GTK 3 than to have all the #ifs inside of it.
Comment 4 Alexander Mikhaylenko 2022-01-27 08:09:04 PST
Created attachment 450138 [details]
Patch
Comment 5 EWS 2022-01-27 10:18:20 PST
Committed r288679 (246485@main): <https://commits.webkit.org/246485@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450138 [details].