<?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>230797</bug_id>
          
          <creation_ts>2021-09-25 06:57:42 -0700</creation_ts>
          <short_desc>REGRESSION(r276635): [SOUP] local HTML file is downloaded instead of displayed if any application has ever called g_desktop_app_info_set_as_default_for_extension(info, &quot;html&quot;)</short_desc>
          <delta_ts>2022-05-06 12:23:15 -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 Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=232386</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=239597</see_also>
          <bug_file_loc>https://gitlab.gnome.org/GNOME/glib/-/issues/2511</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="Pierre Labastie">pierre.labastie</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>clopez</cc>
    
    <cc>crzwdjk</cc>
    
    <cc>jtojnar</cc>
    
    <cc>lmoura</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pnormand</cc>
    
    <cc>xry111</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1797206</commentid>
    <comment_count>0</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2021-09-25 06:57:42 -0700</bug_when>
    <thetext>This does not seem to be a duplicate of https://bugs.webkit.org/show_bug.cgi?id=160347, since it works with webkitgtk-2.32.x, and not with webkitgtk-2.34.0.

My system is a custom one (https://www.linuxfromscratch.org/blfs). shared-mime-info version is 2.1.

Step to reproduce: build from source according to instructions at https://www.linuxfromscratch.org/blfs/view/svn/x/webkitgtk.html

After installation run /usr/libexec/webkit2gtk-4.0/MiniBrowser

enter the url: file:///tmp/index.html

The file /tmp/index.html:
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=
    &quot;application/xhtml+xml; charset=iso-8859-1&quot; /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;
      Linux From Scratch
    &lt;/h1&gt;
  &lt;/body&gt;
&lt;/html&gt;

with webkitgtk-2.32.4:
Linux From Scratch is displayed
with webkitgkt-2.34.0:
the index.html file is &quot;downloaded&quot; to ~/Downloads

Note that I log the installed files, and I clear them before installing the other version.
Not sure which information you might need. Please ask.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1802450</commentid>
    <comment_count>1</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2021-10-10 04:40:54 -0700</bug_when>
    <thetext>I&apos;ve made some progress on this issue, that is I found how to reproduce it.
It happens if there is a mime directory in $HOME/.local/share, which contains a mime type definition for the html extension. This can be created as follow:

Create the following program (say create-user-html-ext.c):

#include &lt;gio/gio.h&gt;

int main(int argc, char **argv)
{
    GAppInfo *dummy_app_info =
              g_app_info_create_from_commandline (&quot;dummy_app&quot;,
                                                  NULL,
                                                  G_APP_INFO_CREATE_NONE,
                                                  NULL);
    g_app_info_set_as_default_for_extension
                               (dummy_app_info,
                                &quot;html&quot;,
                                NULL);
}

Compile it:
gcc -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -o create-user-html-ext -lgio-2.0 -lgobject-2.0 -lglib-2.0 create-user-html-ext.c

Run it:
./create-user-html-ext

Run MiniBrowser, and enter the file url as in the initial report

Then you should observe the reported behavior: works with 2.32.4, regression in 2.34.0.

Don&apos;t forget to (recursively) remove $HOME/.local/share/mime after the test...

Note that any application can use libgio to create those files more or less automatically, so this bug may be triggered without the user knowing (as happened to me: some application that run in January 2020).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1802451</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-10 05:35:52 -0700</bug_when>
    <thetext>Uhhh. Loads via API request (webkit_web_view_load_uri() etc., like you&apos;re doing with your MiniBrowser test) should always load in WebKit. Only actual downloads (download=) should use the default HTML handler. Sounds like a WebKit regression indeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1804856</commentid>
    <comment_count>3</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2021-10-15 09:46:26 -0700</bug_when>
    <thetext>I&apos;ve found the commit that triggered the change in behavior between 2.32 and 2.34: it is commit 5f694471d0d885bd292960af132ee9334474ab45, or r276635 for svn.

That commit inverted the logic for mime type detection, going from:
1. try extractMIMETypeFromMediaType
2. then try mimeTypeForPath

to the reverse. Problem is that mimeTypeForPath uses mimeTypeForExtension, and I guess the GTK port uses the one in MIMETypeRegistryXdg.cpp, which itself uses
xdg_mime_get_mime_type_from_file_name from xdgmime.c. This ones first tries the user mime database (in $XDG_DATA_HOME/mime (default .local/share/mime), then the system database (from XDG_DATA_DIRS path, adding mime). If there is something in the user database, this is what is returned. If the user database is created by gio, the mime type is application/x-extension-html, which is not in the WebKit mime type registry, so that the file is not recognized as html. With shared-mime-info-2.1, the system database returns application/xhtml+xml (which it should), and that is recognized as html in the WebKit registry .

I do not know what extractMIMETypeFromMediaType returns, but it is recognized as html too, so all is well if that one is used.

For my use case (I do not tell it is what you should do), I&apos;ve reverted the order of the checks in etworkProcess/soup/NetworkDataTaskSoup.cpp, and the file:///xxx.html is displayed as it should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805156</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-15 17:40:30 -0700</bug_when>
    <thetext>&gt; If there is something in the user database, this is what is returned. If the user database is created by gio, the mime type is application/x-extension-html, which is not in the WebKit mime type registry, so that the file is not recognized as html.

----

Thinking about GLib:

Well that sucks. So g_desktop_app_info_set_as_default_for_extension() is sabotage if it&apos;s ever used for any extension that corresponds to a MIME type in the system database. I&apos;ll probably need to forward this to the GLib issue tracker to decide what to do but I expect we&apos;re going to need to rewrite g_desktop_app_info_set_as_default_for_extension().

----

Thinking about WebKit:

Ironically, r276635 was intended to make MIME type detection *more* robust by assuming the file extension accurately indicates MIME type if we have an exact match, instead of passing the file contents to shared-mime-info and allowing it to sometimes guess wrong. What went wrong here is you have an exact match for &quot;*.html&quot; that is bogus and overrides the real application/html. I was going to say &quot;I don&apos;t think we should revert it, because avoiding shared-mime-info if possible should help avoid mistakes,&quot; but... actually, maybe we need to, because your test file is *NOT* HTML at all! It is XHTML, which is different. I would expect WebKit would screw up rendering if it tries loading XHTML as HTML or vice-versa, but if it tries MIMETypeRegistry::mimeTypeForExtension first it&apos;s going to get it wrong (because XHTML often uses the normal .html extension). Your test case looks sufficiently simple that it didn&apos;t trip over any of the differences between HTML and XHTML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805159</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-15 17:42:55 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #4)
&gt; Well that sucks. So g_desktop_app_info_set_as_default_for_extension() is
&gt; sabotage if it&apos;s ever used for any extension that corresponds to a MIME type
&gt; in the system database. I&apos;ll probably need to forward this to the GLib issue
&gt; tracker to decide what to do but I expect we&apos;re going to need to rewrite
&gt; g_desktop_app_info_set_as_default_for_extension().

Maybe g_desktop_app_info_set_as_default_for_extension() should only create the x-extension-foo MIME type after first checking if xdg_mime_get_mime_type_from_file_name() fails. If it returns something, modify that one instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805242</commentid>
    <comment_count>6</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2021-10-16 03:08:40 -0700</bug_when>
    <thetext>FWIIW, if you start firefox for a new user, and you click on &quot;make firefox your default browser&quot; (yeah, I understand that I shouldn&apos;t tell this story on a WebKit bug comment :), then the .local/share/mime user database is created using g_app_info_set_as_default_for_extension, at least on GNU-linux (not tested on other OS&apos;es). It defines a mime type for .html, .htm, .shtml, .xhtml, and .xht.

Whether or not firefox expects to find application/x-extension-html as a MIME type, I have not analyzed...

Besides mozilla apps (firefox, thunderbird, seamonkey), other users of g_app_info_set_as_default_for_extension are evolution, evolution-data-server, glibmm, gobject-introspection, pygobject, libfm, libdazzle, librsvg, and vala (among the packages I have built on my system. There are certainly others.)

I have not analyzed what those packages do (although my guess is that glibmm, go-i, pygobjet, and vala just provide wrappers or bindings).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805251</commentid>
    <comment_count>7</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2021-10-16 05:33:30 -0700</bug_when>
    <thetext>(In reply to Pierre Labastie from comment #6)
&gt; FWIIW, if you start firefox for a new user, and you click on &quot;make firefox
&gt; your default browser&quot; (yeah, I understand that I shouldn&apos;t tell this story
&gt; on a WebKit bug comment :), then the .local/share/mime user database is
&gt; created using g_app_info_set_as_default_for_extension, at least on GNU-linux
&gt; (not tested on other OS&apos;es). It defines a mime type for .html, .htm, .shtml,
&gt; .xhtml, and .xht.
&gt; 
&gt; Whether or not firefox expects to find application/x-extension-html as a
&gt; MIME type, I have not analyzed...
&gt; 
&gt; Besides mozilla apps (firefox, thunderbird, seamonkey), other users of
&gt; g_app_info_set_as_default_for_extension are evolution,
&gt; evolution-data-server, glibmm, gobject-introspection, pygobject, libfm,
&gt; libdazzle, librsvg, and vala (among the packages I have built on my system.
&gt; There are certainly others.)
&gt; 
&gt; I have not analyzed what those packages do (although my guess is that
&gt; glibmm, go-i, pygobjet, and vala just provide wrappers or bindings).

EDIT:
Actually, not evolution, nor evolution-data-server, nor libfm, (my search string was not long enough); I guess librsvg only defines a rust wrapper but doesn&apos;t use it (might be wrong, my rust knowledge is small); and libdazzle seems to reference it only in tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806112</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-19 10:08:49 -0700</bug_when>
    <thetext>This is causing https://gitlab.gnome.org/GNOME/devhelp/-/issues/56.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806117</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-19 10:11:59 -0700</bug_when>
    <thetext>Oh and the reason I didn&apos;t notice: Ephy Tech Preview doesn&apos;t have permission to read ~/.local/share/mime. So only system apps will be affected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806125</commentid>
    <comment_count>10</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2021-10-19 10:18:35 -0700</bug_when>
    <thetext>Revert?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806133</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-19 10:28:20 -0700</bug_when>
    <thetext>Workaround:

$ rm ~/.local/share/mime/packages/user-extension-html.xml
$ update-mime-database ~/.local/share/mime

(In reply to Philippe Normand from comment #10)
&gt; Revert?

Maybe. I&apos;m not sure. We&apos;re discussing in #gnome-hackers:gnome.org.

How important was this commit for AVIF? Can you make it work some other way?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806195</commentid>
    <comment_count>12</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-19 11:38:46 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #10)
&gt; Revert?

I think we do indeed need to revert, because we are indeed now misdetecting HTML vs. XHTML if the XHTML file uses the .html file extension. Both text/html and application/xhtml+xml register a glob for *.html, exactly the same as this fake application/x-extension-html does. If we rely on filename alone to select the content type, there&apos;s no way to choose the right one and we cannot win.

Test case:

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=
    &quot;application/xhtml+xml; charset=iso-8859-1&quot; /&gt;
  &lt;/head&gt;
  &lt;P&gt;
    This document is not valid XHTML, so you should see a parser error. You should not see this text.
  &lt;/p&gt;
&lt;/html&gt;

Prior to r276635, that document displayed a parser error because the &lt;P&gt; tag is capitalized, which is not valid XHTML. That was the correct behavior. Since r276635, that document now renders &quot;correctly,&quot; which indicates WebKit is treating it as HTML rather than XHTML. That is not correct because it could cause broken rendering of actual XHTML content. (My test case shows the opposite because it&apos;s a lot easier. I&apos;m sure you could construct an example XHTML page that previously rendered correctly but no longer does.)

Note that when loaded via HTTP or HTTPS, the content type set by the HTTP header takes precedence, so this is best tested using local files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806211</commentid>
    <comment_count>13</comment_count>
      <attachid>441766</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-19 12:03:57 -0700</bug_when>
    <thetext>Created attachment 441766
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806212</commentid>
    <comment_count>14</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-19 12:05:15 -0700</bug_when>
    <thetext>What really surprises me: r276635 should have broken layout tests. It&apos;s unbelievable that we don&apos;t have any layout tests that depend on XHTML vs. HTML differences. I wonder if it did break some tests and we just missed the bug report, or if something is funny with the tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1806529</commentid>
    <comment_count>15</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-10-20 00:54:41 -0700</bug_when>
    <thetext>Committed r284521 (243264@main): &lt;https://commits.webkit.org/243264@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441766.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807082</commentid>
    <comment_count>16</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2021-10-21 04:31:01 -0700</bug_when>
    <thetext>(In reply to EWS from comment #15)
&gt; Committed r284521 (243264@main): &lt;https://commits.webkit.org/243264@main&gt;
&gt; 
&gt; All reviewed patches have been landed. Closing bug and clearing flags on
&gt; attachment 441766 [details].

This has caused around ~300 unexpected failures

Run with 284520 -&gt; &quot;failed 13 flakes 42 failures&quot;  &lt;https://build.webkit.org/#/builders/199/builds/2150&gt;
Run with 284521 -&gt; &quot;failed 21 flakes 320 failures&quot; &lt;https://build.webkit.org/#/builders/199/builds/2151&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807120</commentid>
    <comment_count>17</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-21 07:02:55 -0700</bug_when>
    <thetext>(In reply to Carlos Alberto Lopez Perez from comment #16)
&gt; This has caused around ~300 unexpected failures

That&apos;s probably good! If this didn&apos;t affect layout tests, that would indicate a serious problem with the tests.

(In reply to Carlos Alberto Lopez Perez from comment #16)
&gt; Run with 284520 -&gt; &quot;failed 13 flakes 42 failures&quot; 
&gt; &lt;https://build.webkit.org/#/builders/199/builds/2150&gt;
&gt; Run with 284521 -&gt; &quot;failed 21 flakes 320 failures&quot;
&gt; &lt;https://build.webkit.org/#/builders/199/builds/2151&gt;

Any chance these tests were rebaselined after r276635 landed? This was just a revert, so I would expect the test results to go back to what they were prior to r276635. Sadly, I don&apos;t see any mention of this in bug #222867.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807227</commentid>
    <comment_count>18</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2021-10-21 10:07:38 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #17)
&gt; 
&gt; Any chance these tests were rebaselined after r276635 landed? This was just
&gt; a revert, so I would expect the test results to go back to what they were
&gt; prior to r276635. Sadly, I don&apos;t see any mention of this in bug #222867.

Checking fast/body-propagation/background-image/003.html, its shared glib baseline was last touched last year, right when we merged the gtk/wpe ones.

Sample diff from fast/body-propagation/background-image/003.html:

--- /home/lauro/dev/WebKit/layout-test-results/fast/body-propagation/background-image/003-expected.txt
+++ /home/lauro/dev/WebKit/layout-test-results/fast/body-propagation/background-image/003-actual.txt
@@ -2,7 +2,7 @@
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x34
   RenderBlock {html} at (0,0) size 800x34
-    RenderBody {BODY} at (8,8) size 784x18
-      RenderBlock {P} at (0,0) size 784x18
+    RenderBody {body} at (8,8) size 784x18
+      RenderBlock {p} at (0,0) size 784x18
         RenderText {#text} at (0,0) size 334x17
           text run at (0,0) width 334: &quot;This line should be green and there should be no red.&quot;

It seems the `document().isHTMLDocument()` is returning false inside  `HTMLElement::nodeName()` (used when dumping the render tree). Maybe some other commit also affected this check and reverting r276635 just uncovered the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807312</commentid>
    <comment_count>19</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-21 12:42:48 -0700</bug_when>
    <thetext>(In reply to Lauro Moura from comment #18)
&gt; ---
&gt; /home/lauro/dev/WebKit/layout-test-results/fast/body-propagation/background-
&gt; image/003-expected.txt
&gt; +++
&gt; /home/lauro/dev/WebKit/layout-test-results/fast/body-propagation/background-
&gt; image/003-actual.txt
&gt; @@ -2,7 +2,7 @@
&gt;    RenderView at (0,0) size 800x600
&gt;  layer at (0,0) size 800x34
&gt;    RenderBlock {html} at (0,0) size 800x34
&gt; -    RenderBody {BODY} at (8,8) size 784x18
&gt; -      RenderBlock {P} at (0,0) size 784x18
&gt; +    RenderBody {body} at (8,8) size 784x18
&gt; +      RenderBlock {p} at (0,0) size 784x18
&gt;          RenderText {#text} at (0,0) size 334x17
&gt;            text run at (0,0) width 334: &quot;This line should be green and there
&gt; should be no red.&quot;

The uppercase tags are valid HTML, but not valid XHTML. So I think this diff indicates that WebKit was previously processing the file as HTML, but is now processing it as XHTML.

(In reply to Lauro Moura from comment #18)
&gt; It seems the `document().isHTMLDocument()` is returning false inside 
&gt; `HTMLElement::nodeName()` (used when dumping the render tree). Maybe some
&gt; other commit also affected this check and reverting r276635 just uncovered
&gt; the issue.

Seems reasonable, because the test file is malformed:

&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

The first line declares that it is HTML, then the second line indicates XHTML. The content sniffing is probably picking up xmlns and xhtml in the second line and giving precedence to those.

Of course, it would be *better* for WebKit to make content type decisions based on the DOCTYPE instead, but we can&apos;t expect a content sniffer to do that. We would have to implement it ourselves in WebKit, rather than farming out the work to GIO. I wonder how other ports handle this.

(In reply to Carlos Alberto Lopez Perez from comment #16)
&gt; This has caused around ~300 unexpected failures

I&apos;m not certain what we should do with these.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1807315</commentid>
    <comment_count>20</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-10-21 12:45:35 -0700</bug_when>
    <thetext>Interestingly, there is also fast/body-propagation/background-image/003-html.xhtml, which has the exact same content:

&lt;!DOCTYPE html&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

The only difference is the file extension....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809285</commentid>
    <comment_count>21</comment_count>
    <who name="Arcady Goldmints-Orlov">crzwdjk</who>
    <bug_when>2021-10-27 09:48:12 -0700</bug_when>
    <thetext>I&apos;ve rebaselined most of the tests that just had different capitalization of the tags in the render tree, but there are still a lot of tests that just report a parse error, presumably because the file is being interpreted as XHTML and the parse fails as a result. I suppose I can open a separate bug for all of those.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862858</commentid>
    <comment_count>22</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2022-04-20 01:47:36 -0700</bug_when>
    <thetext>Not sure if this is the right bug, but I&apos;m still having problems with the parsing of local HTML files.

With WebKitGTK 2.36.0, using the MiniBrowser to open file:///tmp/page.html with these contents:

   &lt;!DOCTYPE html&gt;
   &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
   &lt;head&gt;
   &lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;
   &lt;/head&gt;
   &lt;body&gt;
   Hello, world
   &lt;/body&gt;
   &lt;/html&gt;

This fails with &quot;error on line 5 at column 8: Opening and ending tag mismatch: meta line 0 and head&quot; (because the &lt;meta&gt; tag is not properly closed).

Adding a &apos;style&apos; attribute to the &lt;html&gt; tag solves the problem:

   &lt;html style=&quot;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

However if I change the order of the attributes and put &apos;xmlns&apos; first then it fails again:

   &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; style=&quot;&quot;&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862898</commentid>
    <comment_count>23</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-20 05:24:31 -0700</bug_when>
    <thetext>(In reply to Alberto Garcia from comment #22)
&gt; Not sure if this is the right bug, but I&apos;m still having problems with the
&gt; parsing of local HTML files.

I think this regressed again... somehow. Not sure when.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862920</commentid>
    <comment_count>24</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 06:49:27 -0700</bug_when>
    <thetext>(In reply to Alberto Garcia from comment #22)
&gt; Not sure if this is the right bug, but I&apos;m still having problems with the
&gt; parsing of local HTML files.
&gt; 
&gt; With WebKitGTK 2.36.0, using the MiniBrowser to open file:///tmp/page.html
&gt; with these contents:
&gt; 
&gt;    &lt;!DOCTYPE html&gt;
&gt;    &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&gt;    &lt;head&gt;
&gt;    &lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;
&gt;    &lt;/head&gt;
&gt;    &lt;body&gt;
&gt;    Hello, world
&gt;    &lt;/body&gt;
&gt;    &lt;/html&gt;
&gt; 
&gt; This fails with &quot;error on line 5 at column 8: Opening and ending tag
&gt; mismatch: meta line 0 and head&quot; (because the &lt;meta&gt; tag is not properly
&gt; closed).

Your meta tag lacks a trailing slash: should be
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;/&gt;

&gt; 
&gt; Adding a &apos;style&apos; attribute to the &lt;html&gt; tag solves the problem:
&gt; 
&gt;    &lt;html style=&quot;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;

Amazing: the XML is still malformed, so should return the same output as above...

&gt; 
&gt; However if I change the order of the attributes and put &apos;xmlns&apos; first then
&gt; it fails again:
&gt; 
&gt;    &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; style=&quot;&quot;&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862921</commentid>
    <comment_count>25</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 07:00:30 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #23)
&gt; (In reply to Alberto Garcia from comment #22)
&gt; &gt; Not sure if this is the right bug, but I&apos;m still having problems with the
&gt; &gt; parsing of local HTML files.
&gt; 
&gt; I think this regressed again... somehow. Not sure when.

Definitely regressed: webkit-2.36.0: evolution wants again to &quot;download&quot; file:/// urls (actually copy the file to ~/Downloads, then ask whether the user wants to &quot;open&quot; it, then display it with ... firefox :). And so does MiniBrowser. I still have some content in ~/.local/share/mime, so maybe this is the &quot;reason&quot;. but webkit-2.34.x (x=1,3,5,6 at least) series was showing the correct behavior with the same .local directory...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862922</commentid>
    <comment_count>26</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 07:02:31 -0700</bug_when>
    <thetext>(In reply to Pierre Labastie from comment #25)
&gt; (In reply to Michael Catanzaro from comment #23)
&gt; &gt; (In reply to Alberto Garcia from comment #22)
&gt; &gt; &gt; Not sure if this is the right bug, but I&apos;m still having problems with the
&gt; &gt; &gt; parsing of local HTML files.
&gt; &gt; 
&gt; &gt; I think this regressed again... somehow. Not sure when.
&gt; 
&gt; Definitely regressed: webkit-2.36.0: evolution wants again to &quot;download&quot;
&gt; file:/// urls (actually copy the file to ~/Downloads, then ask whether the
&gt; user wants to &quot;open&quot; it, then display it with ... firefox :). And so does
&gt; MiniBrowser. I still have some content in ~/.local/share/mime, so maybe this
&gt; is the &quot;reason&quot;. but webkit-2.34.x (x=1,3,5,6 at least) series was showing
&gt; the correct behavior with the same .local directory...

Removing ~/.local/share/mime allows to display file:/// urls</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862924</commentid>
    <comment_count>27</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 07:05:10 -0700</bug_when>
    <thetext>Reopening since the issue seems very similar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862925</commentid>
    <comment_count>28</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2022-04-20 07:06:55 -0700</bug_when>
    <thetext>(In reply to Pierre Labastie from comment #24)
&gt; Your meta tag lacks a trailing slash: should be
&gt; &lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;/&gt;

I know, and this is on purpose because this example is based on actual
HTML pages that people are using on a daily basis and that every other
browser can open just fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862926</commentid>
    <comment_count>29</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2022-04-20 07:09:41 -0700</bug_when>
    <thetext>(In reply to Pierre Labastie from comment #26)
&gt; Removing ~/.local/share/mime allows to display file:/// urls

I don&apos;t have ~/.local/share/mime and I still get that error.

On a Debian system I can reproduce the problem by simply doing this:

$ /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/MiniBrowser file:///tmp/hello.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862935</commentid>
    <comment_count>30</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 07:47:38 -0700</bug_when>
    <thetext>(In reply to Alberto Garcia from comment #28)
&gt; (In reply to Pierre Labastie from comment #24)
&gt; &gt; Your meta tag lacks a trailing slash: should be
&gt; &gt; &lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;/&gt;
&gt; 
&gt; I know, and this is on purpose because this example is based on actual
&gt; HTML pages that people are using on a daily basis and that every other
&gt; browser can open just fine.

Ok so maybe not really the same issue, but could be related... FWIIW, and as I said in a previous comment, the (well formed) index.html given in the initial report can be opened when there is nothing in ~/.local/share/mime.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862936</commentid>
    <comment_count>31</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 07:50:32 -0700</bug_when>
    <thetext>(In reply to Pierre Labastie from comment #25)
&gt; (In reply to Michael Catanzaro from comment #23)
&gt; &gt; (In reply to Alberto Garcia from comment #22)
&gt; &gt; &gt; Not sure if this is the right bug, but I&apos;m still having problems with the
&gt; &gt; &gt; parsing of local HTML files.
&gt; &gt; 
&gt; &gt; I think this regressed again... somehow. Not sure when.
&gt; 
&gt; Definitely regressed: webkit-2.36.0: evolution wants again to &quot;download&quot;
&gt; file:/// urls (actually copy the file to ~/Downloads, then ask whether the
&gt; user wants to &quot;open&quot; it, then display it with ... firefox :). And so does
&gt; MiniBrowser. I still have some content in ~/.local/share/mime, so maybe this
&gt; is the &quot;reason&quot;. but webkit-2.34.x (x=1,3,5,6 at least) series was showing
&gt; the correct behavior with the same .local directory...

Edit: obviously, this is not &quot;evolution&quot;, but &quot;epiphany/web&quot;, sorry...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862940</commentid>
    <comment_count>32</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-20 08:22:48 -0700</bug_when>
    <thetext>(In reply to Alberto Garcia from comment #29)
&gt; I don&apos;t have ~/.local/share/mime and I still get that error.

Please report a new bug, then. What you&apos;re hitting is probably *caused* by the fix for this bug. To fix the regression here, I needed to restore content sniffing. Your new example is surely a case where the content sniffing fails.

If you right click on your hello.html in nautilus, and look at the file&apos;s Type, what does it say? I see &quot;XHTML page (application/xhtml+xml)&quot;. MiniBrowser attempts to display it and fails because it&apos;s not valid XHTML, but does not attempt to download it. I expect that for you it&apos;s going to show some MIME type that we cannot display. (I have shared-mime-info 2.1.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1862968</commentid>
    <comment_count>33</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 09:58:30 -0700</bug_when>
    <thetext>I do have an issue when ~/.local/share/mime is populated by firefox. Here is a way to get the bug:
If you have firefox, and firefox is not your default browser:
open firefox
go to about:preferences
in general, click &quot;make firefox your default browser&quot;

Then a mime directory is installed into .local/share and nautilus tells the mime time of /tmp/index.html is:
html document (application/x-extension-html)

So I think this should get reopened: leaving this up to you. If you prefer, I can make a new bug for webkitgtk-2.36, but it seems to be really the same bug.

I agree the one reported in comment #22 is not the same...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1863018</commentid>
    <comment_count>34</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-20 12:14:31 -0700</bug_when>
    <thetext>That is https://gitlab.gnome.org/GNOME/glib/-/issues/2511, which is not fixed. That shouldn&apos;t cause WebKit to download files anymore after https://commits.webkit.org/243264@main.

If you revert https://commits.webkit.org/243264@main, then you&apos;ll (probably) fix the case that Berto is complaining about now in comment #22, but you&apos;ll reintroduce the original bug here... and *then* we would want to reopen this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1863068</commentid>
    <comment_count>35</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-20 14:40:59 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #34)
&gt; That is https://gitlab.gnome.org/GNOME/glib/-/issues/2511, which is not
&gt; fixed. That shouldn&apos;t cause WebKit to download files anymore after
&gt; https://commits.webkit.org/243264@main.

My point is that it does cause WebKit to download files in webkitgtk-2.36.0, although https://commits.webkit.org/243264@main is applied there (I just checked). It&apos;s a regression respective to the 2.34.x series (x&gt;0). The original report was for 2.34.0, and has been fixed by the above commit. But for 2.36.0, something else seems to have reintroduced the bug...

&gt; 
&gt; If you revert https://commits.webkit.org/243264@main, then you&apos;ll (probably)
&gt; fix the case that Berto is complaining about now in comment #22, but you&apos;ll
&gt; reintroduce the original bug here... and *then* we would want to reopen this.

I&apos;m sorry if I sounded like this bug should be reopened because of comment #22. It is another issue, which is similar to the original bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1863269</commentid>
    <comment_count>36</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-21 06:10:20 -0700</bug_when>
    <thetext>Are you sure you&apos;re experiencing the same bug with the same files as before? And downgrading 2.36 -&gt; 2.34 is sufficient to fix the issue? Then it is possible for you to bisect it and find out what commit broke it (if you&apos;re sufficiently patient).

I&apos;m skeptical because Berto is describing a confusingly-similar yet clearly distinct problem. He has opened bug #239597 for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1863312</commentid>
    <comment_count>37</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-21 09:08:30 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #36)
&gt; Are you sure you&apos;re experiencing the same bug with the same files as before?
&gt; And downgrading 2.36 -&gt; 2.34 is sufficient to fix the issue? Then it is
&gt; possible for you to bisect it and find out what commit broke it (if you&apos;re
&gt; sufficiently patient).
&gt; 
&gt; I&apos;m skeptical because Berto is describing a confusingly-similar yet clearly
&gt; distinct problem. He has opened bug #239597 for this.

The answer to the first question is yes: same files as before, using MiniBrowser, file:///tmp/index.html is downloaded if .local/share/mime has been populated by g_desktop_app_info_set_as_default_for_extension. But to my amazement, downgrading to 2.34 did not solve the bug. The problem is glib-2.72: downgrading to glib-2.70 is enough to have the file displayed, even with webkitgtk-2.36. Sorry for the noise. I&apos;m bisecting glib right now, but they have a bunch of commits that FTBFS, so it takes a little more time...

Will open an issue in glib once I find something (and report here).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1863382</commentid>
    <comment_count>38</comment_count>
    <who name="Pierre Labastie">pierre.labastie</who>
    <bug_when>2022-04-21 13:30:13 -0700</bug_when>
    <thetext>You might be interested in the glib commits that reintroduce the bug (most recent first):
fa6f45536 xdgmime: Add xdg_mime_set_dirs() method to override XDG envvars
b765c7950 gio/xdgmime/: LGPLv2+ -&gt; LGPLv2.1+
e4d181336 xdgmime: Finer handling for cases where mmap() is not available
e7822bd30 Silence an uninitialize variable warning
14e46ca28 Don&apos;t compile some unused functions in gio/xdgmime/
a1bfe899a Don&apos;t give up too early when collecting mime types
b4893986b Force to use the config.h header file (required for HAVE_MMAP macro)
3d2ac608d Update gio/xdgmime with commit 722325f of xdgmime project

Note that all those commits except fa6f45536 lack xdg_mime_set_dirs so cannot be built.

I&apos;m not sure how to report the issue to glib...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1863392</commentid>
    <comment_count>39</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-04-21 13:42:24 -0700</bug_when>
    <thetext>Ah, well it broke in 3d2ac608d then.

Might as well track this here for now, since it&apos;s as yet unclear whether anything is wrong in GLib.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1866887</commentid>
    <comment_count>40</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-05 09:36:11 -0700</bug_when>
    <thetext>Another glib issue: https://gitlab.gnome.org/GNOME/glib/-/issues/2639</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867303</commentid>
    <comment_count>41</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-05-06 12:23:15 -0700</bug_when>
    <thetext>Let&apos;s track this problem in bug #238347, since the original issue here is solved, and it&apos;s not our regression.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>441766</attachid>
            <date>2021-10-19 12:03:57 -0700</date>
            <delta_ts>2021-10-20 00:54:43 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-230797-20211019140356.patch</filename>
            <type>text/plain</type>
            <size>2732</size>
            <attacher name="Michael Catanzaro">mcatanzaro</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjg0MjcxCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IGJjMjRhODdlN2Y0OTllOTQx
YzQzYTEyOTVmNDE4Yjg4NThkZGRlMDQuLjMzODJjNzViNzI3YzY2N2IyYjEzZjhmN2RiOTNmMGIx
YjRmYjk4YTkgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCisrKyBiL1NvdXJj
ZS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