From 18a084574e587c1621dc25416e7636d8ed0c5209 Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 22 Nov 2017 21:26:01 +0000 Subject: [PATCH] fix Common.isElement, closes #501, closes #507, closes #459, closes #468, closes #517 --- src/core/Common.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/Common.js b/src/core/Common.js index 350e7518..f020b9cc 100644 --- a/src/core/Common.js +++ b/src/core/Common.js @@ -177,7 +177,11 @@ module.exports = Common; * @return {boolean} True if the object is a HTMLElement, otherwise false */ Common.isElement = function(obj) { - return obj instanceof HTMLElement; + if (typeof HTMLElement !== 'undefined') { + return obj instanceof HTMLElement; + } + + return !!(obj.nodeType && obj.nodeName); }; /**