]> source.dussan.org Git - jquery.git/commitdiff
Selector: Fix test iframe submission for firefox
authorOleg Gaidarenko <markelog@gmail.com>
Thu, 29 May 2014 17:45:59 +0000 (21:45 +0400)
committerOleg Gaidarenko <markelog@gmail.com>
Thu, 29 May 2014 17:49:53 +0000 (21:49 +0400)
Ref jquery/sizzle@20fbadb0870bd30e0e66c68891f121c0450374c4
(Cherry-picked from efc4f8d7814a8c44bd5b4d924d237a04263e1a85)

test/unit/selector.js

index 57e10489495bf3c610b8e3c1cfbf90dab97bf9ef..e963187ff0d3d5979a8b1bd7d07752af2a9e71aa 100644 (file)
@@ -474,10 +474,10 @@ testIframe("selector/sizzle_cache", "Sizzle cache collides with multiple Sizzles
        equal( jQuery(".evil a").length, 0, "Select nothing again with second sizzle" );
 });
 
-asyncTest( "Iframe dispatch should not affect Sizzle, see #13936", 1, function() {
+asyncTest( "Iframe dispatch should not affect jQuery (#13936)", 1, function() {
        var loaded = false,
                thrown = false,
-               iframe = document.getElementById("iframe"),
+               iframe = document.getElementById( "iframe" ),
                iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
 
        jQuery( iframe ).on( "load", function() {
@@ -485,17 +485,13 @@ asyncTest( "Iframe dispatch should not affect Sizzle, see #13936", 1, function()
 
                try {
                        iframeDoc = this.contentDocument || this.contentWindow.document;
-                       form = jQuery( "#navigate", iframeDoc )[ 0 ];
+                       form = Sizzle( "#navigate", iframeDoc )[ 0 ];
                } catch ( e ) {
                        thrown = e;
                }
 
                if ( loaded ) {
-                       strictEqual( thrown, false, "No error thrown from post-reload jQuery call" );
-
-                       // clean up
-                       jQuery( iframe ).off();
-
+                       strictEqual( thrown, false, "No error thrown from post-reload Sizzle call" );
                        start();
                } else {
                        loaded = true;
@@ -504,6 +500,6 @@ asyncTest( "Iframe dispatch should not affect Sizzle, see #13936", 1, function()
        });
 
        iframeDoc.open();
-       iframeDoc.write("<body><form id='navigate'></form></body>");
+       iframeDoc.write( "<body><form id='navigate' action='?'></form></body>" );
        iframeDoc.close();
 });