From: Oleg Gaidarenko Date: Tue, 22 Dec 2015 14:29:42 +0000 (+0300) Subject: Revert "Traversing: simplify jQuery#contents method" X-Git-Tag: 1.12.0~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c463327a5d0f6d84c14d1d69f794f574e0cbcfd4;p=jquery.git Revert "Traversing: simplify jQuery#contents method" This reverts commit 7230df15ac612e0e5a08ed7ffc02f6700b2ec898. --- diff --git a/src/traversing.js b/src/traversing.js index addc79080..5b0b1a02b 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -142,7 +142,9 @@ jQuery.each( { return siblings( elem.firstChild ); }, contents: function( elem ) { - return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) {