<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>196912</bug_id>
          
          <creation_ts>2019-04-15 08:24:54 -0700</creation_ts>
          <short_desc>[GTK] fix gtk_style_context_set_background deprecation</short_desc>
          <delta_ts>2019-04-22 09:31:48 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=197156</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ludovico de Nittis">ludovico.denittis</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>gustavo</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pnormand</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1527172</commentid>
    <comment_count>0</comment_count>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-15 08:24:54 -0700</bug_when>
    <thetext>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 &quot;Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp&quot;.

In a few minutes I&apos;m going to attach a patch to this issue.


[1] https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-style-context-set-background</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1527174</commentid>
    <comment_count>1</comment_count>
      <attachid>367416</attachid>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-15 08:31:52 -0700</bug_when>
    <thetext>Created attachment 367416
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1527175</commentid>
    <comment_count>2</comment_count>
    <who name="EWS Watchlist">ews-watchlist</who>
    <bug_when>2019-04-15 08:33:20 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1527242</commentid>
    <comment_count>3</comment_count>
      <attachid>367416</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2019-04-15 10:48:15 -0700</bug_when>
    <thetext>Comment on attachment 367416
Patch

This looks correct to me. Could you test webkit_web_view_set_background_color(), please? Especially with transparent background.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1527641</commentid>
    <comment_count>4</comment_count>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-16 00:25:20 -0700</bug_when>
    <thetext>I tried to launch it with the bg-color option, e.g. `/Tools/Scripts/webkit-flatpak --gtk --bg-color=&quot;rgba(200,10,10,0)&quot;`

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1527732</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2019-04-16 08:00:58 -0700</bug_when>
    <thetext>Can you try with Tools/Scripts/run-minibrowser --gtk --bg-color=rgba(....) ?
run-minibrowser should invoke the built MiniBrowser in the Flatpak environment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1527734</commentid>
    <comment_count>6</comment_count>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-16 08:25:55 -0700</bug_when>
    <thetext>Philippe, yes I&apos;m able to open the MiniBrowser even with webkit-flatpak.
What I meant when I said that I wasn&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528032</commentid>
    <comment_count>7</comment_count>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-16 23:32:59 -0700</bug_when>
    <thetext>s/blank you tab/blank new tab</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529213</commentid>
    <comment_count>8</comment_count>
      <attachid>367416</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2019-04-22 03:53:32 -0700</bug_when>
    <thetext>Comment on attachment 367416
Patch

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

&gt; Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:-387
&gt; -    gtk_style_context_set_background(gtk_widget_get_style_context(widget), window);
&gt; -

Actually, I think this is no longer needed since we don&apos;t render backgrounds in the UI process. I think we can simply remove this without adding the render_background.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529215</commentid>
    <comment_count>9</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2019-04-22 03:55:51 -0700</bug_when>
    <thetext>(In reply to Ludovico de Nittis from comment #4)
&gt; I tried to launch it with the bg-color option, e.g.
&gt; `/Tools/Scripts/webkit-flatpak --gtk --bg-color=&quot;rgba(200,10,10,0)&quot;`
&gt; 
&gt; I was not sure how to test it though.
&gt; In the fraction of a second before the webpage was loaded I saw that the
&gt; background was indeed transparent.
&gt; 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 &lt;html&gt;&lt;/html&gt; for example. But you have to load MiniBrowser without arguments and then load the test page (for some reason I don&apos;t remember the background color is not set when MiniBrowser receives arguments).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529226</commentid>
    <comment_count>10</comment_count>
      <attachid>367936</attachid>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-22 05:18:59 -0700</bug_when>
    <thetext>Created attachment 367936
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529227</commentid>
    <comment_count>11</comment_count>
    <who name="Ludovico de Nittis">ludovico.denittis</who>
    <bug_when>2019-04-22 05:21:32 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529269</commentid>
    <comment_count>12</comment_count>
      <attachid>367936</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-04-22 09:31:46 -0700</bug_when>
    <thetext>Comment on attachment 367936
Patch

Clearing flags on attachment: 367936

Committed r244500: &lt;https://trac.webkit.org/changeset/244500&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1529270</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-04-22 09:31:48 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>367416</attachid>
            <date>2019-04-15 08:31:52 -0700</date>
            <delta_ts>2019-04-22 05:18:53 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-196912-20190415173155.patch</filename>
            <type>text/plain</type>
            <size>2046</size>
            <attacher name="Ludovico de Nittis">ludov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29sZWFuIHdlYmtpdFdlYlZpZXdCYXNlRHJhdyhHdGtXaWRnZXQqIHdp
ZGdldCwgY2Fpcm9fdCogY3IpCiB7CisgICAgR3RrU3R5bGVDb250ZXh0KiBjb250ZXh0OworCisg
ICAgY29udGV4dCA9IGd0a193aWRnZXRfZ2V0X3N0eWxlX2NvbnRleHQod2lkZ2V0KTsKKyAgICBn
dGtfcmVuZGVyX2JhY2tncm91bmQoY29udGV4dCwgY3IsIDAsIDAsIGd0a193aWRnZXRfZ2V0X2Fs
bG9jYXRlZF93aWR0aCh3aWRnZXQpLCBndGtfd2lkZ2V0X2dldF9hbGxvY2F0ZWRfaGVpZ2h0KHdp
ZGdldCkpOworCiAgICAgV2ViS2l0V2ViVmlld0Jhc2UqIHdlYlZpZXdCYXNlID0gV0VCS0lUX1dF
Ql9WSUVXX0JBU0Uod2lkZ2V0KTsKICAgICBhdXRvKiBkcmF3aW5nQXJlYSA9IHN0YXRpY19jYXN0
PERyYXdpbmdBcmVhUHJveHlDb29yZGluYXRlZEdyYXBoaWNzKj4od2ViVmlld0Jhc2UtPnByaXYt
PnBhZ2VQcm94eS0+ZHJhd2luZ0FyZWEoKSk7CiAgICAgaWYgKCFkcmF3aW5nQXJlYSkK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>367936</attachid>
            <date>2019-04-22 05:18:59 -0700</date>
            <delta_ts>2019-04-22 09:31:46 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-196912-20190422141857.patch</filename>
            <type>text/plain</type>
            <size>1497</size>
            <attacher name="Ludovico de Nittis">ludovico.denittis</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQ0MDY5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IDJiZWYyYzUwODExNWUxODA5
M2NiMDc0ZThiNDEzMT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