<?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>256253</bug_id>
          
          <creation_ts>2023-05-03 06:55:29 -0700</creation_ts>
          <short_desc>HTML page load failure when javascript inside &lt;script&gt; includes &amp;&amp; and xmlns is specified xhtml only on ubuntu</short_desc>
          <delta_ts>2023-05-03 07:48:50 -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>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>232471</dup_id>
          
          <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="Terry Knowlton">terry</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1952622</commentid>
    <comment_count>0</comment_count>
      <attachid>466192</attachid>
    <who name="Terry Knowlton">terry</who>
    <bug_when>2023-05-03 06:55:29 -0700</bug_when>
    <thetext>Created attachment 466192
html file that fails to load on Ubuntu 22.04

There is an issue loading some pages on Ubuntu 22.04 but load correctly in Safari and other WebKit browsers on MacOS, as well as other browsers and platforms.

When loading an html page with

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; root tag, it appears that javascript inlined within a &lt;script&gt; tag is not being properly parsed and ampersand (&amp;) symbols are attempting parse as escaped html. Instead of loading the page I get &quot;error on line {x} at column {y}: xmlParseEntityRef: no name&quot; where the line and column are the second &amp; symbol.


Below is some example html that demonstrates this issue.  I have also attached the html file to this report. 

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head&gt;
    &lt;title&gt;ubuntu webkit redering&lt;/title&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
      if (1 === 1 &amp;&amp; 1 != 2) {
        console.log(&quot;Parsed!&quot;);
      }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Page loaded successfully&lt;/h1&gt;
  &lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1952623</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-03 07:05:02 -0700</bug_when>
    <thetext>Your attachment actually gets parsed as HTML for me. What version of WebKitGTK? What version of shared-mime-info?

You have the strings &quot;xmlns&quot; and &quot;xhtml&quot; in the first line of the input, so it&apos;s pretty reasonable for WebKit to treat the input as XHTML, and then the error is required because it is not valid XHTML. Remove that and it will probably work? Or you could try adding an HTML DOCTYPE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1952626</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-03 07:07:23 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 232471 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1952632</commentid>
    <comment_count>3</comment_count>
    <who name="Terry Knowlton">terry</who>
    <bug_when>2023-05-03 07:24:45 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #1)
&gt; Your attachment actually gets parsed as HTML for me. What version of
&gt; WebKitGTK? What version of shared-mime-info?
&gt; 
&gt; You have the strings &quot;xmlns&quot; and &quot;xhtml&quot; in the first line of the input, so
&gt; it&apos;s pretty reasonable for WebKit to treat the input as XHTML, and then the
&gt; error is required because it is not valid XHTML. Remove that and it will
&gt; probably work? Or you could try adding an HTML DOCTYPE.

It does work if I remove it. The problem for me is I only have read access to the html files and I am validating cross browser and cross platform compatibility which only appears to be failing for webkit on ubuntu in this particular case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1952634</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-03 07:48:50 -0700</bug_when>
    <thetext>For avoidance of doubt: that input is malformed, and you cannot expect it to do the same thing on different platforms. Sorry. :(</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>466192</attachid>
            <date>2023-05-03 06:55:29 -0700</date>
            <delta_ts>2023-05-03 06:55:29 -0700</delta_ts>
            <desc>html file that fails to load on Ubuntu 22.04</desc>
            <filename>webkit-ubuntu-xhtml-rendering-failure.html</filename>
            <type>text/html</type>
            <size>290</size>
            <attacher name="Terry Knowlton">terry</attacher>
            
              <data encoding="base64">PGh0bWwgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgogIDxoZWFkPgogICAg
PHRpdGxlPnVidW50dSB3ZWJraXQgcmVkZXJpbmc8L3RpdGxlPgogICAgPHNjcmlwdCB0eXBlPSJ0
ZXh0L2phdmFzY3JpcHQiPgogICAgICBpZiAoMSA9PT0gMSAmJiAxICE9IDIpIHsKICAgICAgICBj
b25zb2xlLmxvZygiUGFyc2VkISIpOwogICAgICB9CiAgICA8L3NjcmlwdD4KICA8L2hlYWQ+CiAg
PGJvZHk+CiAgICA8aDE+UGFnZSBsb2FkZWQgc3VjY2Vzc2Z1bGx5PC9oMT4KICA8L2JvZHk+Cjwv
aHRtbD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>