From 56c00800c78d3d896fa6cb97ab97b974805152c4 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 31 Mar 2011 01:17:34 -0700 Subject: fix jqLite#parent to be compatible with jQuery our original implementation doesn't work with document fragments on IE - tests were added to cover missing cases --- src/jqLite.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/jqLite.js b/src/jqLite.js index 78fc1655..d16ce19e 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -371,8 +371,8 @@ forEach({ }, parent: function(element) { - // in IE it returns undefined, but we need differentiate it from functions which have no return - return element.parentNode || null; + var parent = element.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; }, next: function(element) { -- cgit v1.2.3