[Webkit-unassigned] [Bug 126907] [GTK] Hardcoded text color in input fields

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 28 21:07:42 PDT 2018


--- Comment #55 from Carlos Eduardo Ramalho <cadubentzen at gmail.com> ---
Thanks for the reviews Michael Catanzaro and Benjamin Otte!

(In reply to Michael Catanzaro from comment #51)
> static NeverDestroyed<GRefPtr<GtkStyleContext>> baseContext =
> createBaseStyleContext();
> I know it might look pretty weird to put a GRefPtr into a NeverDestroyed,
> but that's the idiom we use, just roll with it.

Even weirder having baseContext.get().get() to get the raw pointer... But nice catch indeed!

(In reply to Benjamin Otte from comment #53)
> One comment:
> There's some GTK_CHECK_VERSION(3, 20, 0) parts but they don't cover
> gtk_widget_path_iter_set_object_name() - Those and using names for CSS was
> added with GTK 3.20, so either those parts also need #ifdef's or (my
> suggestion) the dependency should be upped to at least 3.20.

The whole RenderThemeGadget file is under `#if GTK_CHECK_VERSION(3, 20, 0)`, which is hidden out in the patch view :)

(In reply to Michael Catanzaro from comment #52)
> Since adding WebKitWebView to the widget path is really easy, I'd go ahead
> and do it now.

I tried adding it with G_TYPE_NONE but then the problem with HighContrast comes back.

static GRefPtr<GtkStyleContext> createBaseStyleContext()
    GRefPtr<GtkWidgetPath> path = adoptGRef(gtk_widget_path_new());

    gtk_widget_path_append_type(path.get(), GTK_TYPE_WINDOW);
    gtk_widget_path_iter_set_object_name(path.get(), -1, "window");
    gtk_widget_path_iter_add_class(path.get(), -1, GTK_STYLE_CLASS_BACKGROUND);

    gtk_widget_path_append_type(path.get(), G_TYPE_NONE);
    gtk_widget_path_iter_set_object_name(path.get(), -1, "webview");

    GRefPtr<GtkStyleContext> baseContext = adoptGRef(gtk_style_context_new());
    gtk_style_context_set_path(baseContext.get(), path.get());
    gtk_style_context_set_parent(baseContext.get(), nullptr);

    return baseContext;

Getting the return `pos = gtk_widget_path_append_type(path, G_TYPE_NONE)` and using it as position for gtk_widget_path_iter_set_object_name(path.get(), pos, "webview") also didn't help. It seems like it requires more investigation, so I think should move it to another bug.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180529/5ff0f720/attachment.html>

More information about the webkit-unassigned mailing list