RESOLVED FIXED 196912
[GTK] fix gtk_style_context_set_background deprecation
https://bugs.webkit.org/show_bug.cgi?id=196912
Summary [GTK] fix gtk_style_context_set_background deprecation
Ludovico de Nittis
Reported 2019-04-15 08:24:54 PDT
Since gtk 3.18 gtk_style_context_set_background has been deprecated[1]. gtk_render_background should be used instead. gtk_style_context_set_background is still used in "Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp". In a few minutes I'm going to attach a patch to this issue. [1] https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-style-context-set-background
Attachments
Patch (2.00 KB, patch)
2019-04-15 08:31 PDT, Ludovico de Nittis
no flags
Patch (1.46 KB, patch)
2019-04-22 05:18 PDT, Ludovico de Nittis
no flags
Ludovico de Nittis
Comment 1 2019-04-15 08:31:52 PDT
EWS Watchlist
Comment 2 2019-04-15 08:33:20 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Michael Catanzaro
Comment 3 2019-04-15 10:48:15 PDT
Comment on attachment 367416 [details] Patch This looks correct to me. Could you test webkit_web_view_set_background_color(), please? Especially with transparent background.
Ludovico de Nittis
Comment 4 2019-04-16 00:25:20 PDT
I tried to launch it with the bg-color option, e.g. `/Tools/Scripts/webkit-flatpak --gtk --bg-color="rgba(200,10,10,0)"` I was not sure how to test it though. In the fraction of a second before the webpage was loaded I saw that the background was indeed transparent. Then I tried to increase the alpha value and I got a colored background.
Philippe Normand
Comment 5 2019-04-16 08:00:58 PDT
Can you try with Tools/Scripts/run-minibrowser --gtk --bg-color=rgba(....) ? run-minibrowser should invoke the built MiniBrowser in the Flatpak environment.
Ludovico de Nittis
Comment 6 2019-04-16 08:25:55 PDT
Philippe, yes I'm able to open the MiniBrowser even with webkit-flatpak. What I meant when I said that I wasn't sure how to test my changes, is that the chosen background color is visible only for a few ms before the webpage gets loaded on top of it. And I was unable to find another place where I could see the chosen background color. For example a blank you tab is always white. Is that how it is supposed to be?
Ludovico de Nittis
Comment 7 2019-04-16 23:32:59 PDT
s/blank you tab/blank new tab
Carlos Garcia Campos
Comment 8 2019-04-22 03:53:32 PDT
Comment on attachment 367416 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367416&action=review > Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:-387 > - gtk_style_context_set_background(gtk_widget_get_style_context(widget), window); > - Actually, I think this is no longer needed since we don't render backgrounds in the UI process. I think we can simply remove this without adding the render_background.
Carlos Garcia Campos
Comment 9 2019-04-22 03:55:51 PDT
(In reply to Ludovico de Nittis from comment #4) > I tried to launch it with the bg-color option, e.g. > `/Tools/Scripts/webkit-flatpak --gtk --bg-color="rgba(200,10,10,0)"` > > I was not sure how to test it though. > In the fraction of a second before the webpage was loaded I saw that the > background was indeed transparent. > Then I tried to increase the alpha value and I got a colored background. You can use the MiniBrowser editor mode (-e) to try it out. You can also try with any page not setting a background color in the css, as simple as <html></html> for example. But you have to load MiniBrowser without arguments and then load the test page (for some reason I don't remember the background color is not set when MiniBrowser receives arguments).
Ludovico de Nittis
Comment 10 2019-04-22 05:18:59 PDT
Ludovico de Nittis
Comment 11 2019-04-22 05:21:32 PDT
Carlos I tested it again and you are right, the background is available even without the gtk_render_background. So I uploaded a new patch, this time that just removes gtk_style_context_set_background.
WebKit Commit Bot
Comment 12 2019-04-22 09:31:46 PDT
Comment on attachment 367936 [details] Patch Clearing flags on attachment: 367936 Committed r244500: <https://trac.webkit.org/changeset/244500>
WebKit Commit Bot
Comment 13 2019-04-22 09:31:48 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.