mirror of
https://github.com/jquery/jquery.git
synced 2024-10-05 11:34:18 +00:00
Selector: Fix test iframe submission for firefox
Ref jquery/sizzle@20fbadb087
This commit is contained in:
parent
1d931068d3
commit
efc4f8d781
@ -475,7 +475,7 @@ testIframe("selector/sizzle_cache", "Sizzle cache collides with multiple Sizzles
|
|||||||
equal( jQuery(".evil a").length, 0, "Select nothing again with second sizzle" );
|
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,
|
var loaded = false,
|
||||||
thrown = false,
|
thrown = false,
|
||||||
iframe = document.getElementById( "iframe" ),
|
iframe = document.getElementById( "iframe" ),
|
||||||
@ -486,17 +486,13 @@ asyncTest( "Iframe dispatch should not affect Sizzle, see #13936", 1, function()
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
iframeDoc = this.contentDocument || this.contentWindow.document;
|
iframeDoc = this.contentDocument || this.contentWindow.document;
|
||||||
form = jQuery( "#navigate", iframeDoc )[ 0 ];
|
form = Sizzle( "#navigate", iframeDoc )[ 0 ];
|
||||||
} catch ( e ) {
|
} catch ( e ) {
|
||||||
thrown = e;
|
thrown = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( loaded ) {
|
if ( loaded ) {
|
||||||
strictEqual( thrown, false, "No error thrown from post-reload jQuery call" );
|
strictEqual( thrown, false, "No error thrown from post-reload Sizzle call" );
|
||||||
|
|
||||||
// clean up
|
|
||||||
jQuery( iframe ).off();
|
|
||||||
|
|
||||||
start();
|
start();
|
||||||
} else {
|
} else {
|
||||||
loaded = true;
|
loaded = true;
|
||||||
@ -505,6 +501,6 @@ asyncTest( "Iframe dispatch should not affect Sizzle, see #13936", 1, function()
|
|||||||
});
|
});
|
||||||
|
|
||||||
iframeDoc.open();
|
iframeDoc.open();
|
||||||
iframeDoc.write("<body><form id='navigate'></form></body>");
|
iframeDoc.write( "<body><form id='navigate' action='?'></form></body>" );
|
||||||
iframeDoc.close();
|
iframeDoc.close();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user