GNOME Bugzilla – Bug 615785
HTML parser error with <noscript> in the <head>
Last modified: 2012-05-11 11:37:24 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.
Created attachment 158760 [details] libxml2 program that display html parser errors
Created attachment 199772 [details] [review] In html5 noscript can be in head http://www.w3.org/TR/2011/WD-html5-author-20110809/the-noscript-element.html#the-noscript-element
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