Core: Bring back QtWebKit support for jQuery 3.x

Allow jQuery to recognize that DOM types such as HTMLCollection
or NodeList are not functions.

Fixes gh-4756
Closes gh-4757
This commit is contained in:
Natalia Sroka 2020-07-27 22:01:55 +02:00 committed by GitHub
parent fe4098005e
commit bf1430a7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,11 @@ define( function() {
// In some browsers, typeof returns "function" for HTML <object> elements
// (i.e., `typeof document.createElement( "object" ) === "function"`).
// We don't want to classify *any* DOM node as a function.
return typeof obj === "function" && typeof obj.nodeType !== "number";
// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
// Plus for old WebKit, typeof returns "function" for HTML collections
// (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
return typeof obj === "function" && typeof obj.nodeType !== "number" &&
typeof obj.item !== "function";
};
} );