Bug 375999

Summary: [test case] form siblings bug afecting all jquery 3 web sites
Product: [Applications] konqueror Reporter: Anguo <kde_bugs>
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: REPORTED ---    
Severity: major CC: porten
Priority: NOR    
Version: 4.14.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Failing this simple test case prevents jquery 3 from working in konqueror

Description Anguo 2017-02-04 13:31:10 UTC
Created attachment 103819 [details]
Failing this simple test case prevents jquery 3 from working in konqueror

I was trying to debug why one web site using jquery 3 was working in every browser I tried but in konqueror. 
As I tried to narrow down the problem,  I found that jquery 3 contains the following code, which, if removed, fixed the symptoms in konqueror:


// Support: Safari 8 only
// In Safari 8 documents created via document.implementation.createHTMLDocument
// collapse sibling forms: the second one becomes a child of the first one.
// Because of that, this security measure has to be disabled in Safari 8.
// https://bugs.webkit.org/show_bug.cgi?id=137337
support.createHTMLDocument = ( function() {                                                                                                                                 
        var body = document.implementation.createHTMLDocument( "" ).body;
        body.innerHTML = "<form></form><form></form>";
        return body.childNodes.length === 2;
} )();


Following the webkit bug report referred in the jquery code, I found the test case which I attach here. 
Today, the test case works in Firefox, etc, but does not render anything in Konqueror.

This is a pretty major bug: I don't need to tell you how many web sites out there use jquery. I don't know if the symptomatic code is in jquery 2, but it certainly is in jquery 3, which is gaining wide adoption. And as I said, I found this while trying to find out why a web site using jquery was broken and unusable in konqueror.
Comment 1 Anguo 2017-02-04 13:35:47 UTC
I am currently using Konqueror Version 4.14.24 within gentoo.
I wouldn't know where to begin to fix this bug, but if I can help you with testing, compiling from the latest version in git, etc., just let me know how I can help.