After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615785 - HTML parser error with <noscript> in the <head>
HTML parser error with <noscript> in the <head>
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-14 21:18 UTC by Jeff Balogh
Modified: 2012-05-11 11:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example failing html5 document. (206 bytes, text/html)
2010-04-14 21:18 UTC, Jeff Balogh
  Details
libxml2 program that display html parser errors (2.23 KB, text/plain)
2010-04-14 21:19 UTC, Jeff Balogh
  Details
In html5 noscript can be in head (459 bytes, patch)
2011-10-23 19:36 UTC, Denis Pauk
none Details | Review

Description Jeff Balogh 2010-04-14 21:18:38 UTC
Created attachment 158759 [details]
Example failing html5 document.

Here's a document that fails:

<!DOCTYPE html>
<html>
    <head>
        <title>omg</title>
        <noscript><link rel="stylesheet" href="http://foo.com"></noscript>
    </head>
    <body id="xxx">
        <p>yo</p>
    </body>
</html>

When the <noscript> is found, <head> is closed and a <body> element is created.  The real <body id="xxx"> gets skipped over, so I can't see any of the body's attributes.

I'm attaching the test html file and a program that shows the error (adapted from the examples).  It compiles with warnings.

This may be occurring due to differences in HTML4 vs. HTML5.  validator.nu says it's valid html5 but invalid html4.
Comment 1 Jeff Balogh 2010-04-14 21:19:11 UTC
Created attachment 158760 [details]
libxml2 program that display html parser errors
Comment 3 Daniel Veillard 2012-05-11 11:37:24 UTC
Right, I think that's the beginning of a bunch of change that will
come as HTML5 gets deployed !

Denis, thanks for your patch, and yes that's the right approach !
Commited upstream along with the test for regressions

http://git.gnome.org/browse/libxml2/commit/?id=a0cd075d94518cd254d5fe122cc6825a1dfc6093

 thanks to both !

Daniel