Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix #10067. Create jQuery.quickReady; closes gh-736.
Allows us to get to the ready state sooner by not waiting for iframes to load. If that causes backcompat pain, use `jQuery.quickReady = false` as prescribed by your developer.
- Loading branch information
1 parent
58ed62e
commit 54fab31
Showing
12 changed files
with
149 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!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 jQuery ticket #10067</title> | ||
<script type="text/javascript"> | ||
|
||
// ready should fire callback after the iframe fires the callback | ||
setTimeout(function () { | ||
el = document.createElement('script'); | ||
el.type = 'text/javascript'; | ||
el.onload = function () { | ||
jQuery.quickReady = false; | ||
jQuery(document).ready(function () { | ||
// unfortunately, Opera 11.6 and lower has a bug where | ||
// document.readyState is "complete" before all subresources | ||
// are loaded, so we need this check here for tests to pass | ||
if ( document.readyState !== "complete" ) { | ||
window.parent.iframeCallback(false); | ||
} | ||
}); | ||
} | ||
document.getElementsByTagName('head')[0].appendChild(el); | ||
el.src = "../include_js.php"; | ||
}, 1000); | ||
</script> | ||
</head> | ||
<body> | ||
<!-- long loading iframe --> | ||
<iframe src="longLoad.php?sleep=3&return=true" style="width: 1px; height: 1px"></iframe> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!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 jQuery ticket #10067</title> | ||
<script type="text/javascript"> | ||
// browsers that implement the non-standard event API will load the iframe | ||
// before loading up jQuery, so quickReady has no effect here | ||
if( document.attachEvent ){ | ||
window.parent.iframeCallback(true); | ||
} else { | ||
setTimeout(function () { | ||
el = document.createElement('script'); | ||
el.type = 'text/javascript'; | ||
el.onload = function () { | ||
jQuery(document).ready(function () { | ||
window.parent.iframeCallback(true); | ||
}); | ||
} | ||
document.getElementsByTagName('head')[0].appendChild(el); | ||
el.src = "../include_js.php"; | ||
}, 1000); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<!-- long loading iframe --> | ||
<iframe src="longLoad.php?sleep=30&return=false" style="width: 1px; height: 1px"></iframe> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
sleep((int)$_GET['sleep']); | ||
?> | ||
<script type="text/javascript"> | ||
window.parent.parent.iframeCallback(<?php echo $_GET['return'];?>); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!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 jQuery ticket #10067</title> | ||
<script type="text/javascript" src="../include_js.php"></script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
jQuery(document).ready(function () { | ||
window.parent.iframeCallback(true); | ||
}); | ||
</script> | ||
<!-- long loading iframe --> | ||
<iframe src="longLoad.php?sleep=10&return=false" style="width: 1px; height: 1px"></iframe> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters