WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 232471
256253
HTML page load failure when javascript inside <script> includes && and xmlns is specified xhtml only on ubuntu
https://bugs.webkit.org/show_bug.cgi?id=256253
Summary
HTML page load failure when javascript inside <script> includes && and xmlns ...
Terry Knowlton
Reported
2023-05-03 06:55:29 PDT
Created
attachment 466192
[details]
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 <html xmlns="
http://www.w3.org/1999/xhtml
"> root tag, it appears that javascript inlined within a <script> tag is not being properly parsed and ampersand (&) symbols are attempting parse as escaped html. Instead of loading the page I get "error on line {x} at column {y}: xmlParseEntityRef: no name" where the line and column are the second & symbol. Below is some example html that demonstrates this issue. I have also attached the html file to this report. <html xmlns="
http://www.w3.org/1999/xhtml
"> <head> <title>ubuntu webkit redering</title> <script type="text/javascript"> if (1 === 1 && 1 != 2) { console.log("Parsed!"); } </script> </head> <body> <h1>Page loaded successfully</h1> </body> </html>
Attachments
html file that fails to load on Ubuntu 22.04
(290 bytes, text/html)
2023-05-03 06:55 PDT
,
Terry Knowlton
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2023-05-03 07:05:02 PDT
Your attachment actually gets parsed as HTML for me. What version of WebKitGTK? What version of shared-mime-info? You have the strings "xmlns" and "xhtml" in the first line of the input, so it'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.
Michael Catanzaro
Comment 2
2023-05-03 07:07:23 PDT
*** This bug has been marked as a duplicate of
bug 232471
***
Terry Knowlton
Comment 3
2023-05-03 07:24:45 PDT
(In reply to Michael Catanzaro from
comment #1
)
> Your attachment actually gets parsed as HTML for me. What version of > WebKitGTK? What version of shared-mime-info? > > You have the strings "xmlns" and "xhtml" in the first line of the input, so > it'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.
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.
Michael Catanzaro
Comment 4
2023-05-03 07:48:50 PDT
For avoidance of doubt: that input is malformed, and you cannot expect it to do the same thing on different platforms. Sorry. :(
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug