diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2015-10-28 13:54:04 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2016-01-14 10:18:31 -0500 |
commit | 8c293e62bb39cdf347bd045a1e89a54549f972eb (patch) | |
tree | 2b2f8e9990152f6061ee79174677d95c1f591a5d /test | |
parent | d19aa974630b31e58d1c35b72157eb73fd59d638 (diff) | |
download | jquery-8c293e62bb39cdf347bd045a1e89a54549f972eb.tar.gz jquery-8c293e62bb39cdf347bd045a1e89a54549f972eb.zip |
Core: use interactive to evaluate dom ready, barring IE6-10
Fixes gh-2100
Close gh-2821
Diffstat (limited to 'test')
-rw-r--r-- | test/data/event/interactiveReady.html | 23 | ||||
-rw-r--r-- | test/unit/event.js | 12 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/data/event/interactiveReady.html b/test/data/event/interactiveReady.html new file mode 100644 index 000000000..77b37104d --- /dev/null +++ b/test/data/event/interactiveReady.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<meta http-equiv="content-type" content="text/html; charset=utf-8"> +<title>Test case for gh-2100</title> +<script src="../../jquery.js"></script> +</head> +<body> + +<script type="text/javascript"> +jQuery( document ).ready(function () { + window.parent.iframeCallback( jQuery("#container").length === 1 ); +}); +</script> + +<!-- external resources that come before elements trick + oldIE into thinking the dom is ready, but it's not... + leaving this check here for future trailblazers to attempt + fixing this...--> +<script type="text/javascript" src="../longLoadScript.php?sleep=1"></script> +<div id="container" style="height: 300px"></div> +</body> +</html> diff --git a/test/unit/event.js b/test/unit/event.js index c8c0667d3..14fcba0b3 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -2589,6 +2589,18 @@ testIframeWithCallback( } ); +// need PHP here to make the incepted IFRAME hang +if ( hasPHP ) { + testIframeWithCallback( + "jQuery.ready uses interactive", + "event/interactiveReady.html", + function( isOk, assert ) { + assert.expect( 1 ); + assert.ok( isOk, "jQuery fires ready when the DOM can truly be interacted with" ); + } + ); +} + testIframeWithCallback( "Focusing iframe element", "event/focusElem.html", |