]> source.dussan.org Git - jquery.git/commitdiff
Revert "Traversing: simplify jQuery#contents method"
authorOleg Gaidarenko <markelog@gmail.com>
Tue, 22 Dec 2015 14:29:42 +0000 (17:29 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Tue, 22 Dec 2015 14:29:42 +0000 (17:29 +0300)
This reverts commit 7230df15ac612e0e5a08ed7ffc02f6700b2ec898.

src/traversing.js

index addc7908072019a5604feb06537d24d7c9ddca45..5b0b1a02b764cf74efba66fa07886b5e7e7d7db5 100644 (file)
@@ -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 ) {