Skip to content
Permalink
Browse files
Selector: Fix test iframe submission for firefox
  • Loading branch information
markelog committed May 29, 2014
1 parent 1d93106 commit efc4f8d7814a8c44bd5b4d924d237a04263e1a85
Showing 1 changed file with 5 additions and 9 deletions.
@@ -475,28 +475,24 @@ 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() {
var form;

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;
@@ -505,6 +501,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();
});

0 comments on commit efc4f8d

Please sign in to comment.