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 747301 - HTML serializer could output HTML5 DOCTYPE
HTML serializer could output HTML5 DOCTYPE
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-03 14:23 UTC by Shaun McCance
Modified: 2015-04-03 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use simple HTML5 DOCTYPE for about:legacy-compat (923 bytes, patch)
2015-04-03 14:23 UTC, Shaun McCance
none Details | Review

Description Shaun McCance 2015-04-03 14:23:52 UTC
Created attachment 300892 [details] [review]
Use simple HTML5 DOCTYPE for about:legacy-compat

HTML5 uses a DOCTYPE without a PUBLIC or SYSTEM identifier. It looks like this:

<!DOCTYPE html>

I can't use XSLT to output this, because to get a DOCTYPE I have to provide a PUBLIC or SYSTEM identifier. Luckily, the standards folks recognized this and provided this semantically equivalent form for the HTML DOCTYPE:

<!DOCTYPE html SYSTEM "about:legacy-compat">

But people don't like seeing the "legacy" identifier in their output. They'd rather see the shiny new DOCTYPE. Since we know that about:legacy-compat is defined by the W3C to be semantically equivalent to the sans-SYSTEM DOCTYPE, we could just special-case it in the HTML serializer in libxml2. So if you set the SYSTEM identifier to "about:legacy-compat", you get an HTML5 short-form DOCTYPE. Patch attached.
Comment 1 Daniel Veillard 2015-04-03 14:54:45 UTC
   Looks simple and fine, applied and pushed:

https://git.gnome.org/browse/libxml2/commit/?id=7607d9dd450275911eec5fcb66b69aacd13a4cc8

 thanks :-)

Daniel