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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 28 18:11:32 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=126907

--- Comment #48 from Carlos Eduardo Ramalho <cadubentzen at gmail.com> ---
(In reply to Michael Catanzaro from comment #40)
> static GRefPtr<GtkWidgetPath> createWidgetPath()
> {
>     GRefPtr<GtkWidgetPath> path = adoptGRef(gtk_widget_path_new());
>     
>     gtk_widget_path_append_type(path, GTK_TYPE_WINDOW);
>     gtk_widget_path_iter_add_class (path, -1, GTK_STYLE_CLASS_BACKGROUND);
> 
>     gtk_widget_path_append_type(path, WEBKIT_TYPE_WEB_VIEW);
>     gtk_widget_path_iter_set_object_name(path, -1, "webview");
> 
>     return path;
> }

I did not add the WEBKIT_TYPE_WEB_VIEW part because then I would have to include a header from Source/WebKit.. Would that be correct? I thought only WebKit could include files from WebCore and not the other way around... Or is there other way to call the append_type without doing that?

(In reply to Benjamin Otte from comment #46)
> Setting the widget path is not gonna help, the widget path just sets the
> color to "inherit" at which point the CSS engine looks up the color in the
> parent style context.
> 
> Which is why you need a parent RenderThemeGadget set to "window.background"
> that has the correct color, so GTK finds the right StyleContext to inherit
> from.

There is already a parent RenderThemeGadget that all other gadgets inherit from.. The thing is when creating the GtkStyleContext in the RenderThemeGadget constructor, the parent StyleContext was null when not coming from a another RenderThemeGadget already. So I set it to a window.background StyleContext here:

-    m_context = createStyleContext(path.get(), parent ? parent->context() : nullptr);
+    m_context = createStyleContext(path.get(), parent ? parent->context() : baseContext.get());

It fixes the problem here. What do you think?

-- 
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/79436c4a/attachment.html>


More information about the webkit-unassigned mailing list