There was a bug in libxml prior to 2.6.27 that caused entities to be inserted twice. See http://bugzilla.gnome.org/show_bug.cgi?id=159219 . WebKit has a workaround for this: hackAroundLibXMLEntityBug. However, in libxml 2.6.27, this bug was fixed, so the workaround causes incorrect behavior with that version. A simple #if/#else can fix this.
Created attachment 14209 [details] patch No layout test is needed. Existing layout tests already fail when using libxml 2.6.27 or greater. For example, dom/xhtml/level3/core/nodegettextcontent14 fails.
Comment on attachment 14209 [details] patch This is defined by libxml in its headers?
Yes. LIBXML_VERSION is defined in libxml/xmlversion.h.
Comment on attachment 14209 [details] patch Ideally this should be done as a runtime check, not compile time, since libxml is often dynamically linked in. But looking at xmlversion.h I don't see a way to make the a check at runtime.
Comment on attachment 14209 [details] patch I agree that a runtime check would be better, but since that apparently can't be done, this seems fine. r=me
Landed in r21136.