diff options
author | Natalia Sroka <37873210+natipo@users.noreply.github.com> | 2020-07-27 22:01:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-27 22:01:55 +0200 |
commit | bf1430a7e6a69129a28608695a747f30eb7c4e22 (patch) | |
tree | eec3e0efdaba4fa3d33143af8dae76917d098c9b /src | |
parent | fe4098005e1d9e1445eb9eab0318b245e3f299a4 (diff) | |
download | jquery-bf1430a7e6a69129a28608695a747f30eb7c4e22.tar.gz jquery-bf1430a7e6a69129a28608695a747f30eb7c4e22.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/var/isFunction.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/var/isFunction.js b/src/var/isFunction.js index 564537902..6e2d3a743 100644 --- a/src/var/isFunction.js +++ b/src/var/isFunction.js @@ -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"; }; } ); |