Fix indentation in /speed and /test dirs, closes gh-780.

This commit is contained in:
Trey Hunner 2012-05-18 13:28:50 -04:00 committed by Dave Methvin
parent c4df0c91be
commit f1dcaad097
18 changed files with 646 additions and 646 deletions

View File

@ -5,11 +5,11 @@ function benchmark(fn, times, name){
e = fn.lastIndexOf('}'); e = fn.lastIndexOf('}');
fn = fn.substring(s,e); fn = fn.substring(s,e);
return benchmarkString(fn, times, name); return benchmarkString(fn, times, name);
} }
function benchmarkString(fn, times, name) { function benchmarkString(fn, times, name) {
var fn = new Function("i", "var t=new Date; while(i--) {" + fn + "}; return new Date - t")(times) var fn = new Function("i", "var t=new Date; while(i--) {" + fn + "}; return new Date - t")(times)
fn.displayName = name || "benchmarked"; fn.displayName = name || "benchmarked";
return fn; return fn;
} }

View File

@ -1,10 +1,10 @@
.dialog { .dialog {
margin-bottom: 1em; margin-bottom: 1em;
} }
a.expand { a.expand {
background: #e3e3e3; background: #e3e3e3;
} }
div#time-test { div#time-test {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
@ -42,14 +42,14 @@
text-align: center; text-align: center;
} }
#time-test { #time-test {
margin: 1em 0; margin: 1em 0;
padding: .5em; padding: .5em;
background: #e3e3e3; background: #e3e3e3;
} }
#time-taken { #time-taken {
font-weight: bold; font-weight: bold;
} }
span.wins { span.wins {
color: #330; color: #330;
@ -62,4 +62,4 @@
div.buttons { div.buttons {
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }

View File

@ -1,41 +1,41 @@
jQuery.benchmarker.tests = [ jQuery.benchmarker.tests = [
// Selectors from: // Selectors from:
// http://ejohn.org/blog/selectors-that-people-actually-use/ // http://ejohn.org/blog/selectors-that-people-actually-use/
/* /*
// For Amazon.com // For Amazon.com
"#navAmazonLogo", "#navSwmSkedPop", "#navAmazonLogo", "#navSwmSkedPop",
".navbar", ".navGreeting", ".navbar", ".navGreeting",
"div", "table", "div", "table",
"img.navCrossshopTabCap", "span.navGreeting", "img.navCrossshopTabCap", "span.navGreeting",
"#navbar table", "#navidWelcomeMsg span", "#navbar table", "#navidWelcomeMsg span",
"div#navbar", "ul#navAmazonLogo", "div#navbar", "ul#navAmazonLogo",
"#navAmazonLogo .navAmazonLogoGatewayPanel", "#navidWelcomeMsg .navGreeting", "#navAmazonLogo .navAmazonLogoGatewayPanel", "#navidWelcomeMsg .navGreeting",
".navbar .navAmazonLogoGatewayPanel", ".navbar .navGreeting", ".navbar .navAmazonLogoGatewayPanel", ".navbar .navGreeting",
"*", "*",
"#navAmazonLogo li.navAmazonLogoGatewayPanel", "#navidWelcomeMsg span.navGreeting", "#navAmazonLogo li.navAmazonLogoGatewayPanel", "#navidWelcomeMsg span.navGreeting",
"a[name=top]", "form[name=site-search]", "a[name=top]", "form[name=site-search]",
".navbar li", ".navbar span", ".navbar li", ".navbar span",
"[name=top]", "[name=site-search]", "[name=top]", "[name=site-search]",
"ul li", "a img", "ul li", "a img",
"#navbar #navidWelcomeMsg", "#navbar #navSwmDWPop", "#navbar #navidWelcomeMsg", "#navbar #navSwmDWPop",
"#navbar ul li", "#navbar a img" "#navbar ul li", "#navbar a img"
*/ */
// For Yahoo.com // For Yahoo.com
"#page", "#masthead", "#mastheadhd", "#page", "#masthead", "#mastheadhd",
".mastheadbd", ".first", ".on", ".mastheadbd", ".first", ".on",
"div", "li", "a", "div", "li", "a",
"div.mastheadbd", "li.first", "li.on", "div.mastheadbd", "li.first", "li.on",
"#page div", "#dtba span", "#page div", "#dtba span",
"div#page", "div#masthead", "div#page", "div#masthead",
"#page .mastheadbd", "#page .first", "#page .mastheadbd", "#page .first",
".outer_search_container .search_container", ".searchbox_container .inputtext", ".outer_search_container .search_container", ".searchbox_container .inputtext",
"*", "*",
"#page div.mastheadbd", "#page li.first", "#page div.mastheadbd", "#page li.first",
"input[name=p]", "a[name=marketplace]", "input[name=p]", "a[name=marketplace]",
".outer_search_container div", ".searchbox_container span", ".outer_search_container div", ".searchbox_container span",
"[name=p]", "[name=marketplace]", "[name=p]", "[name=marketplace]",
"ul li", "form input", "ul li", "form input",
"#page #e2econtent", "#page #e2e" "#page #e2econtent", "#page #e2e"
]; ];
jQuery.fn.benchmark = function() { jQuery.fn.benchmark = function() {
@ -110,7 +110,7 @@
timeArr.push(new Date() - time); timeArr.push(new Date() - time);
} }
var diff = Math.sum(timeArr) - Math.max.apply( Math, timeArr ) var diff = Math.sum(timeArr) - Math.max.apply( Math, timeArr )
- Math.min.apply( Math, timeArr ); - Math.min.apply( Math, timeArr );
try { try {
var libRes = window[libraries[0]](code); var libRes = window[libraries[0]](code);
var jqRes = jQuery(code); var jqRes = jQuery(code);

View File

@ -6,34 +6,34 @@
<script src="jquery-basis.js"></script> <script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script> <script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script> <script src="../dist/jquery.js"></script>
<script> <script>
jQuery(function ready() { jQuery(function ready() {
var node = $("#child"), name; var node = $("#child"), name;
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) { jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){ setTimeout(function(){
name = "closest '" + item + "'"; name = "closest '" + item + "'";
jQuery("#results").append("<li>" + name + "<ul>" + jQuery("#results").append("<li>" + name + "<ul>" +
"<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "</li>" + "<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "</li>" +
"<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "</li>" "<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "</li>"
+ "</ul></li>"); + "</ul></li>");
}, 100); }, 100);
}); });
}); });
</script> </script>
</head> </head>
<body> <body>
<div> <div>
<p>Hello</p> <p>Hello</p>
<div class="zoo" id="zoo" data-foo="bar"> <div class="zoo" id="zoo" data-foo="bar">
<div> <div>
<p id="child">lorem ipsum</p> <p id="child">lorem ipsum</p>
<p>dolor sit amet</p> <p>dolor sit amet</p>
</div> </div>
</div> </div>
</div> </div>
<ul id="results"></ul> <ul id="results"></ul>
</body> </body>
</html> </html>

View File

@ -6,178 +6,178 @@
<script src="jquery-basis.js"></script> <script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script> <script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script> <script src="../dist/jquery.js"></script>
<script> <script>
jQuery(function ready() { jQuery(function ready() {
var node = $("#child"), name; var node = $("#child"), name;
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) { jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){ setTimeout(function(){
name = "filter '" + item + "'"; name = "filter '" + item + "'";
jQuery("#results").append("<li>" + name + "<ul>" + jQuery("#results").append("<li>" + name + "<ul>" +
"<li>new: " + benchmarkString("$('div').filter('" + item + "')", 100, name) + "</li>" + "<li>new: " + benchmarkString("$('div').filter('" + item + "')", 100, name) + "</li>" +
"<li>old: " + benchmarkString("old('div').filter('" + item + "')", 100, name) + "</li>" + "<li>old: " + benchmarkString("old('div').filter('" + item + "')", 100, name) + "</li>" +
"</ul></li>"); "</ul></li>");
jQuery("#results").append("<li>single " + name + "<ul>" + jQuery("#results").append("<li>single " + name + "<ul>" +
"<li>new: " + benchmarkString("$('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" + "<li>new: " + benchmarkString("$('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" +
"<li>old: " + benchmarkString("old('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" + "<li>old: " + benchmarkString("old('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" +
"</ul></li>"); "</ul></li>");
}, 100); }, 100);
}); });
}); });
</script> </script>
</head> </head>
<body> <body>
<div> <div>
<p>Hello</p> <p>Hello</p>
<div class="zoo" id="nonexistant" data-foo="bar"><div></div></div> <div class="zoo" id="nonexistant" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
</div> </div>
<ul id="results"></ul> <ul id="results"></ul>
</body> </body>
</html> </html>

View File

@ -6,174 +6,174 @@
<script src="jquery-basis.js"></script> <script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script> <script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script> <script src="../dist/jquery.js"></script>
<script> <script>
jQuery(function ready() { jQuery(function ready() {
var node = $("#child"), name; var node = $("#child"), name;
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) { jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){ setTimeout(function(){
name = "find '" + item + "'"; name = "find '" + item + "'";
jQuery("#results").append("<li>rooted " + name + "<ul>" + jQuery("#results").append("<li>rooted " + name + "<ul>" +
"<li>new: " + benchmarkString("$('body').find('" + item + "')", 250, name) + "</li>" + "<li>new: " + benchmarkString("$('body').find('" + item + "')", 250, name) + "</li>" +
"<li>old: " + benchmarkString("old('body').find('" + item + "')", 250, name) + "</li>" + "<li>old: " + benchmarkString("old('body').find('" + item + "')", 250, name) + "</li>" +
"</ul></li>"); "</ul></li>");
}, 100); }, 100);
}); });
}); });
</script> </script>
</head> </head>
<body> <body>
<div> <div>
<p>Hello</p> <p>Hello</p>
<div class="zoo" id="nonexistant" data-foo="bar"><div></div></div> <div class="zoo" id="nonexistant" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div> <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
</div> </div>
<ul id="results"></ul> <ul id="results"></ul>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -708,7 +708,7 @@ jQuery.extend({
/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) ||
!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
[]; [];
return { browser: match[1] || "", version: match[2] || "0" }; return { browser: match[1] || "", version: match[2] || "0" };
}, },

View File

@ -2,10 +2,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSP Test Page</title> <title>CSP Test Page</title>
<script src="data/include_js.php"></script> <script src="data/include_js.php"></script>
</head> </head>
<body> <body>
<p>CSP Test Page</p> <p>CSP Test Page</p>

View File

@ -6,8 +6,8 @@ $etag = md5($ts);
$ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false; $ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false;
if ($ifNoneMatch == $etag) { if ($ifNoneMatch == $etag) {
header('HTTP/1.0 304 Not Modified'); header('HTTP/1.0 304 Not Modified');
die; // stop processing die; // stop processing
} }
header("Etag: " . $etag); header("Etag: " . $etag);

View File

@ -17,7 +17,7 @@ if ( document.attachEvent ) {
jQuery("body").append("<div>modifying DOM</div>"); jQuery("body").append("<div>modifying DOM</div>");
window.parent.iframeCallback( true ); window.parent.iframeCallback( true );
}); });
} }
document.getElementsByTagName("head")[ 0 ].appendChild( el ); document.getElementsByTagName("head")[ 0 ].appendChild( el );
el.src = "../include_js.php"; el.src = "../include_js.php";
}, 1000 ); }, 1000 );
@ -28,4 +28,4 @@ if ( document.attachEvent ) {
<!-- long loading iframe --> <!-- long loading iframe -->
<iframe src="longLoad.php?sleep=15&return=false" style="width: 1px; height: 1px"></iframe> <iframe src="longLoad.php?sleep=15&return=false" style="width: 1px; height: 1px"></iframe>
</body> </body>
</html> </html>

View File

@ -5,8 +5,8 @@ $ts = $_REQUEST['ts'];
$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false; $ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false;
if ($ifModifiedSince == $ts) { if ($ifModifiedSince == $ts) {
header('HTTP/1.0 304 Not Modified'); header('HTTP/1.0 304 Not Modified');
die; // stop processing die; // stop processing
} }
header("Last-Modified: " . $ts); header("Last-Modified: " . $ts);

View File

@ -1,8 +1,8 @@
<html> <html>
<head> <head>
<title>iframe</title> <title>iframe</title>
</head> </head>
<body> <body>
<div><span>span text</span></div> <div><span>span text</span></div>
</body> </body>
</html> </html>

View File

@ -89,37 +89,37 @@ th, td {
</table> </table>
<p>NOTE: Only IE supports propertychange, beforeactivate, beforedeactivate; buttons do not support change events.</p> <p>NOTE: Only IE supports propertychange, beforeactivate, beforedeactivate; buttons do not support change events.</p>
<h2>Submit Tests</h2> <h2>Submit Tests</h2>
<table> <table>
<tr> <tr>
<td> <td>
Submit each: Submit each:
</td> </td>
<td> <td>
<form action="" id="text_submit"> <form action="" id="text_submit">
<input class='test' type='text' value='Key Return To Submit'/> <input class='test' type='text' value='Key Return To Submit'/>
</form> </form>
</td> </td>
<td> <td>
<form action="" id="password_submit"> <form action="" id="password_submit">
<input class='test' type='password' value=''/> <input class='test' type='password' value=''/>
</form> </form>
</td> </td>
<td> <td>
<form action="" id="submit_submit"> <form action="" id="submit_submit">
<input type='submit' value="Click Me To Submit" /> <input type='submit' value="Click Me To Submit" />
</form> </form>
</td> </td>
<td>$(document).bind('submit')</td> <td>$(document).bind('submit')</td>
</tr> </tr>
<tr> <tr>
<td>Results:</td> <td>Results:</td>
<td id='textSubmit' class="red">TEXT</td> <td id='textSubmit' class="red">TEXT</td>
<td id='passwordSubmit' class="red">PASSWORD</td> <td id='passwordSubmit' class="red">PASSWORD</td>
<td id='submitSubmit' class="red">BUTTON</td> <td id='submitSubmit' class="red">BUTTON</td>
<td id='boundSubmit' class="red">DOCUMENT</td> <td id='boundSubmit' class="red">DOCUMENT</td>
</tr> </tr>
</table> </table>
<form id="autosub"><input type=submit name=subme /></form> <form id="autosub"><input type=submit name=subme /></form>

View File

@ -31,64 +31,64 @@ p {
</style> </style>
</head> </head>
<body> <body>
<h2>Hover (mouse{over,out,enter,leave}) Tests</h2> <h2>Hover (mouse{over,out,enter,leave}) Tests</h2>
<p>Be sure to try moving the mouse out of the browser via the left side on each test.</p> <p>Be sure to try moving the mouse out of the browser via the left side on each test.</p>
<div id="wrapper"> <div id="wrapper">
<div id="hoverbox" class="hover-box"> <div id="hoverbox" class="hover-box">
<div class="hover-status"> <div class="hover-status">
<button>Activate</button> <button>Activate</button>
.hover() in/out: <span class="ins">0</span> / <span class="outs">0</span> .hover() in/out: <span class="ins">0</span> / <span class="outs">0</span>
</div> </div>
<div class="hover-inside"> <div class="hover-inside">
Mouse over here should NOT trigger the counter. Mouse over here should NOT trigger the counter.
</div> </div>
</div> </div>
<div id="liveenterbox" class="hover-box"> <div id="liveenterbox" class="hover-box">
<div class="hover-status"> <div class="hover-status">
<button>Activate</button> <button>Activate</button>
Live enter/leave: <span class="ins">0</span> / <span class="outs">0</span> Live enter/leave: <span class="ins">0</span> / <span class="outs">0</span>
</div> </div>
<div class="hover-inside"> <div class="hover-inside">
Mouse over here should NOT trigger the counter. Mouse over here should NOT trigger the counter.
</div> </div>
</div> </div>
<div id="delegateenterbox" class="hover-box"> <div id="delegateenterbox" class="hover-box">
<div class="hover-status"> <div class="hover-status">
<button>Activate</button> <button>Activate</button>
Delegated enter/leave: <span class="ins">0</span> / <span class="outs">0</span> Delegated enter/leave: <span class="ins">0</span> / <span class="outs">0</span>
</div> </div>
<div class="hover-inside"> <div class="hover-inside">
Mouse over here should NOT trigger the counter. Mouse over here should NOT trigger the counter.
</div> </div>
</div> </div>
<div id="overbox" class="hover-box"> <div id="overbox" class="hover-box">
<div class="hover-status"> <div class="hover-status">
<button>Activate</button> <button>Activate</button>
Bind over/out: <span class="ins">0</span> / <span class="outs">0</span> Bind over/out: <span class="ins">0</span> / <span class="outs">0</span>
</div> </div>
<div class="hover-inside"> <div class="hover-inside">
Mouse over here SHOULD trigger the counter. Mouse over here SHOULD trigger the counter.
</div> </div>
</div> </div>
<div id="liveoverbox" class="hover-box"> <div id="liveoverbox" class="hover-box">
<div class="hover-status"> <div class="hover-status">
<button>Activate</button> <button>Activate</button>
Live over/out: <span class="ins">0</span> / <span class="outs">0</span> Live over/out: <span class="ins">0</span> / <span class="outs">0</span>
</div> </div>
<div class="hover-inside"> <div class="hover-inside">
Mouse over here SHOULD trigger the counter. Mouse over here SHOULD trigger the counter.
</div> </div>
</div> </div>
<div id="delegateoverbox" class="hover-box"> <div id="delegateoverbox" class="hover-box">
<div class="hover-status"> <div class="hover-status">
<button>Activate</button> <button>Activate</button>
Delegated over/out: <span class="ins">0</span> / <span class="outs">0</span> Delegated over/out: <span class="ins">0</span> / <span class="outs">0</span>
</div> </div>
<div class="hover-inside"> <div class="hover-inside">
Mouse over here SHOULD trigger the counter. Mouse over here SHOULD trigger the counter.
</div> </div>
</div> </div>
</div> <!-- wrapper --> </div> <!-- wrapper -->

View File

@ -63,7 +63,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Run jQuery Test Suite Polluted</title> <title>Run jQuery Test Suite Polluted</title>
<style type="text/css"> <style type="text/css">
.otherlibs fieldset { .otherlibs fieldset {

View File

@ -769,8 +769,8 @@ test("jQuery.ajax() - disabled globals", function() {
success: function(){ ok(true, "success"); }, success: function(){ ok(true, "success"); },
error: function(){ ok(false, "error"); }, error: function(){ ok(false, "error"); },
complete: function(){ complete: function(){
ok(true, "complete"); ok(true, "complete");
setTimeout(function(){ start(); }, 13); setTimeout(function(){ start(); }, 13);
} }
}); });
}); });
@ -779,14 +779,14 @@ test("jQuery.ajax - xml: non-namespace elements inside namespaced elements", fun
expect(3); expect(3);
stop(); stop();
jQuery.ajax({ jQuery.ajax({
url: url("data/with_fries.xml"), url: url("data/with_fries.xml"),
dataType: "xml", dataType: "xml",
success: function(resp) { success: function(resp) {
equal( jQuery("properties", resp).length, 1, "properties in responseXML" ); equal( jQuery("properties", resp).length, 1, "properties in responseXML" );
equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" ); equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" );
equal( jQuery("thing", resp).length, 2, "things in responseXML" ); equal( jQuery("thing", resp).length, 2, "things in responseXML" );
start(); start();
} }
}); });
}); });
@ -794,18 +794,18 @@ test("jQuery.ajax - xml: non-namespace elements inside namespaced elements (over
expect(3); expect(3);
stop(); stop();
jQuery.ajax({ jQuery.ajax({
url: url("data/with_fries_over_jsonp.php"), url: url("data/with_fries_over_jsonp.php"),
dataType: "jsonp xml", dataType: "jsonp xml",
success: function(resp) { success: function(resp) {
equal( jQuery("properties", resp).length, 1, "properties in responseXML" ); equal( jQuery("properties", resp).length, 1, "properties in responseXML" );
equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" ); equal( jQuery("jsconf", resp).length, 1, "jsconf in responseXML" );
equal( jQuery("thing", resp).length, 2, "things in responseXML" ); equal( jQuery("thing", resp).length, 2, "things in responseXML" );
start(); start();
}, },
error: function(_1,_2,error) { error: function(_1,_2,error) {
ok( false, error ); ok( false, error );
start(); start();
} }
}); });
}); });
@ -914,13 +914,13 @@ test("jQuery.ajax - dataType html", function() {
}; };
jQuery.ajax({ jQuery.ajax({
dataType: "html", dataType: "html",
url: url("data/test.html"), url: url("data/test.html"),
success: function(data) { success: function(data) {
jQuery("#ap").html(data); jQuery("#ap").html(data);
ok( data.match(/^html text/), "Check content for datatype html" ); ok( data.match(/^html text/), "Check content for datatype html" );
setTimeout(verifyEvaluation, 600); setTimeout(verifyEvaluation, 600);
} }
}); });
}); });
@ -953,7 +953,7 @@ test("serialize()", function() {
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=", "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&select5=3&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Multiple form serialization as query string"); "Multiple form serialization as query string");
/* Temporarily disabled. Opera 10 has problems with form serialization. /* Temporarily disabled. Opera 10 has problems with form serialization.
equal( jQuery("#form, #testForm :input").serialize(), equal( jQuery("#form, #testForm :input").serialize(),
"action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=", "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&search=search&email=dave%40jquery.com&number=43&select1=&select2=3&select3=1&select3=2&T3=%3F%0D%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=",
"Mixed form/input serialization as query string"); "Mixed form/input serialization as query string");
@ -1741,7 +1741,7 @@ test("jQuery.ajax() - malformed JSON", function() {
error: function(xhr, msg, detailedMsg) { error: function(xhr, msg, detailedMsg) {
equal( "parsererror", msg, "A parse error occurred." ); equal( "parsererror", msg, "A parse error occurred." );
ok( /(invalid|error|exception)/i.test(detailedMsg), "Detailed parsererror message provided" ); ok( /(invalid|error|exception)/i.test(detailedMsg), "Detailed parsererror message provided" );
start(); start();
} }
}); });
}); });
@ -1777,12 +1777,12 @@ test("jQuery.ajax() - json by content-type", function() {
url: "data/json.php", url: "data/json.php",
data: { header: "json", json: "array" }, data: { header: "json", json: "array" },
success: function( json ) { success: function( json ) {
ok( json.length >= 2, "Check length"); ok( json.length >= 2, "Check length");
equal( json[0].name, "John", "Check JSON: first, name" ); equal( json[0].name, "John", "Check JSON: first, name" );
equal( json[0].age, 21, "Check JSON: first, age" ); equal( json[0].age, 21, "Check JSON: first, age" );
equal( json[1].name, "Peter", "Check JSON: second, name" ); equal( json[1].name, "Peter", "Check JSON: second, name" );
equal( json[1].age, 25, "Check JSON: second, age" ); equal( json[1].age, 25, "Check JSON: second, age" );
start(); start();
} }
}); });
}); });
@ -1801,12 +1801,12 @@ test("jQuery.ajax() - json by content-type disabled with options", function() {
success: function( text ) { success: function( text ) {
equal( typeof text , "string" , "json wasn't auto-determined" ); equal( typeof text , "string" , "json wasn't auto-determined" );
var json = jQuery.parseJSON( text ); var json = jQuery.parseJSON( text );
ok( json.length >= 2, "Check length"); ok( json.length >= 2, "Check length");
equal( json[0].name, "John", "Check JSON: first, name" ); equal( json[0].name, "John", "Check JSON: first, name" );
equal( json[0].age, 21, "Check JSON: first, age" ); equal( json[0].age, 21, "Check JSON: first, age" );
equal( json[1].name, "Peter", "Check JSON: second, name" ); equal( json[1].name, "Peter", "Check JSON: second, name" );
equal( json[1].age, 25, "Check JSON: second, age" ); equal( json[1].age, 25, "Check JSON: second, age" );
start(); start();
} }
}); });
}); });
@ -1815,12 +1815,12 @@ test("jQuery.getJSON(String, Hash, Function) - JSON array", function() {
expect(5); expect(5);
stop(); stop();
jQuery.getJSON(url("data/json.php"), {json: "array"}, function(json) { jQuery.getJSON(url("data/json.php"), {json: "array"}, function(json) {
ok( json.length >= 2, "Check length"); ok( json.length >= 2, "Check length");
equal( json[0].name, "John", "Check JSON: first, name" ); equal( json[0].name, "John", "Check JSON: first, name" );
equal( json[0].age, 21, "Check JSON: first, age" ); equal( json[0].age, 21, "Check JSON: first, age" );
equal( json[1].name, "Peter", "Check JSON: second, name" ); equal( json[1].name, "Peter", "Check JSON: second, name" );
equal( json[1].age, 25, "Check JSON: second, age" ); equal( json[1].age, 25, "Check JSON: second, age" );
start(); start();
}); });
}); });
@ -1828,11 +1828,11 @@ test("jQuery.getJSON(String, Function) - JSON object", function() {
expect(2); expect(2);
stop(); stop();
jQuery.getJSON(url("data/json.php"), function(json) { jQuery.getJSON(url("data/json.php"), function(json) {
if (json && json.data) { if (json && json.data) {
equal( json.data.lang, "en", "Check JSON: lang" ); equal( json.data.lang, "en", "Check JSON: lang" );
equal( json.data.length, 25, "Check JSON: length" ); equal( json.data.length, 25, "Check JSON: length" );
} }
start(); start();
}); });
}); });
@ -1862,9 +1862,9 @@ test("jQuery.getJSON(String, Function) - JSON object with absolute url to local
stop(); stop();
jQuery.getJSON(url(base + "data/json.php"), function(json) { jQuery.getJSON(url(base + "data/json.php"), function(json) {
equal( json.data.lang, "en", "Check JSON: lang" ); equal( json.data.lang, "en", "Check JSON: lang" );
equal( json.data.length, 25, "Check JSON: length" ); equal( json.data.length, 25, "Check JSON: length" );
start(); start();
}); });
}); });
@ -1904,19 +1904,19 @@ test("jQuery.post(String, Hash, Function) - simple with xml", function() {
var done = 0; var done = 0;
jQuery.post(url("data/name.php"), {xml: "5-2"}, function(xml){ jQuery.post(url("data/name.php"), {xml: "5-2"}, function(xml){
jQuery("math", xml).each(function() { jQuery("math", xml).each(function() {
equal( jQuery("calculation", this).text(), "5-2", "Check for XML" ); equal( jQuery("calculation", this).text(), "5-2", "Check for XML" );
equal( jQuery("result", this).text(), "3", "Check for XML" ); equal( jQuery("result", this).text(), "3", "Check for XML" );
}); });
if ( ++done === 2 ) start(); if ( ++done === 2 ) start();
}); });
jQuery.post(url("data/name.php?xml=5-2"), {}, function(xml){ jQuery.post(url("data/name.php?xml=5-2"), {}, function(xml){
jQuery("math", xml).each(function() { jQuery("math", xml).each(function() {
equal( jQuery("calculation", this).text(), "5-2", "Check for XML" ); equal( jQuery("calculation", this).text(), "5-2", "Check for XML" );
equal( jQuery("result", this).text(), "3", "Check for XML" ); equal( jQuery("result", this).text(), "3", "Check for XML" );
}); });
if ( ++done === 2 ) start(); if ( ++done === 2 ) start();
}); });
}); });
@ -1944,10 +1944,10 @@ test("jQuery.ajaxSetup({timeout: Number}) - with global timeout", function() {
jQuery("#qunit-fixture").ajaxError(pass); jQuery("#qunit-fixture").ajaxError(pass);
jQuery.ajax({ jQuery.ajax({
type: "GET", type: "GET",
url: url("data/name.php?wait=5"), url: url("data/name.php?wait=5"),
error: pass, error: pass,
success: fail success: fail
}); });
// reset timeout // reset timeout
@ -1959,17 +1959,17 @@ test("jQuery.ajaxSetup({timeout: Number}) with localtimeout", function() {
jQuery.ajaxSetup({timeout: 50}); jQuery.ajaxSetup({timeout: 50});
jQuery.ajax({ jQuery.ajax({
type: "GET", type: "GET",
timeout: 15000, timeout: 15000,
url: url("data/name.php?wait=1"), url: url("data/name.php?wait=1"),
error: function() { error: function() {
ok( false, "Check for local timeout failed" ); ok( false, "Check for local timeout failed" );
start(); start();
}, },
success: function() { success: function() {
ok( true, "Check for local timeout" ); ok( true, "Check for local timeout" );
start(); start();
} }
}); });
// reset timeout // reset timeout
@ -1980,12 +1980,12 @@ test("jQuery.ajax - simple get", function() {
expect(1); expect(1);
stop(); stop();
jQuery.ajax({ jQuery.ajax({
type: "GET", type: "GET",
url: url("data/name.php?name=foo"), url: url("data/name.php?name=foo"),
success: function(msg){ success: function(msg){
equal( msg, "bar", "Check for GET" ); equal( msg, "bar", "Check for GET" );
start(); start();
} }
}); });
}); });
@ -1993,13 +1993,13 @@ test("jQuery.ajax - simple post", function() {
expect(1); expect(1);
stop(); stop();
jQuery.ajax({ jQuery.ajax({
type: "POST", type: "POST",
url: url("data/name.php"), url: url("data/name.php"),
data: "name=peter", data: "name=peter",
success: function(msg){ success: function(msg){
equal( msg, "pan", "Check for POST" ); equal( msg, "pan", "Check for POST" );
start(); start();
} }
}); });
}); });
@ -2091,7 +2091,7 @@ jQuery.each( { " (cache)": true, " (no cache)": false }, function( label, cache
ok(data == null, "response body should be empty"); ok(data == null, "response body should be empty");
} }
start(); start();
}, },
error: function() { error: function() {
// Do this because opera simply refuses to implement 304 handling :( // Do this because opera simply refuses to implement 304 handling :(
// A feature-driven way of detecting this would be appreciated // A feature-driven way of detecting this would be appreciated
@ -2140,8 +2140,8 @@ jQuery.each( { " (cache)": true, " (no cache)": false }, function( label, cache
ok(data == null, "response body should be empty"); ok(data == null, "response body should be empty");
} }
start(); start();
}, },
error: function() { error: function() {
// Do this because opera simply refuses to implement 304 handling :( // Do this because opera simply refuses to implement 304 handling :(
// A feature-driven way of detecting this would be appreciated // A feature-driven way of detecting this would be appreciated
// See: http://gist.github.com/599419 // See: http://gist.github.com/599419
@ -2476,7 +2476,7 @@ test( "jQuery.domManip - script in comments are properly evaluated (#11402)", fu
}); });
test("jQuery.ajax - active counter", function() { test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active ); ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
}); });
} }

View File

@ -1064,13 +1064,13 @@ test("jQuery.proxy", function(){
// Make sure it doesn't freak out // Make sure it doesn't freak out
equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." ); equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." );
// Partial application // Partial application
var test2 = function( a ){ equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); }; var test2 = function( a ){ equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); };
jQuery.proxy( test2, null, "pre-applied" )(); jQuery.proxy( test2, null, "pre-applied" )();
// Partial application w/ normal arguments // Partial application w/ normal arguments
var test3 = function( a, b ){ equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); }; var test3 = function( a, b ){ equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); };
jQuery.proxy( test3, null, "pre-applied" )( "normal" ); jQuery.proxy( test3, null, "pre-applied" )( "normal" );
// Test old syntax // Test old syntax
var test4 = { meth: function( a ){ equal( a, "boom", "Ensure old syntax works." ); } }; var test4 = { meth: function( a ){ equal( a, "boom", "Ensure old syntax works." ); } };
@ -1137,52 +1137,52 @@ test("jQuery.parseXML", 8, function(){
}); });
test("jQuery.sub() - Static Methods", function(){ test("jQuery.sub() - Static Methods", function(){
expect(18); expect(18);
var Subclass = jQuery.sub(); var Subclass = jQuery.sub();
Subclass.extend({ Subclass.extend({
topLevelMethod: function() {return this.debug;}, topLevelMethod: function() {return this.debug;},
debug: false, debug: false,
config: { config: {
locale: "en_US" locale: "en_US"
}, },
setup: function(config) { setup: function(config) {
this.extend(true, this.config, config); this.extend(true, this.config, config);
} }
}); });
Subclass.fn.extend({subClassMethod: function() { return this;}}); Subclass.fn.extend({subClassMethod: function() { return this;}});
//Test Simple Subclass //Test Simple Subclass
ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true"); ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!"); ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly"); deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods"); equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
//Create a SubSubclass //Create a SubSubclass
var SubSubclass = Subclass.sub(); var SubSubclass = Subclass.sub();
//Make Sure the SubSubclass inherited properly //Make Sure the SubSubclass inherited properly
ok(SubSubclass.topLevelMethod() === false, "SubSubclass.topLevelMethod thought debug was true"); ok(SubSubclass.topLevelMethod() === false, "SubSubclass.topLevelMethod thought debug was true");
ok(SubSubclass.config.locale == "en_US", SubSubclass.config.locale + " is wrong!"); ok(SubSubclass.config.locale == "en_US", SubSubclass.config.locale + " is wrong!");
deepEqual(SubSubclass.config.test, undefined, "SubSubclass.config.test is set incorrectly"); deepEqual(SubSubclass.config.test, undefined, "SubSubclass.config.test is set incorrectly");
equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods"); equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
//Modify The Subclass and test the Modifications //Modify The Subclass and test the Modifications
SubSubclass.fn.extend({subSubClassMethod: function() { return this;}}); SubSubclass.fn.extend({subSubClassMethod: function() { return this;}});
SubSubclass.setup({locale: "es_MX", test: "worked"}); SubSubclass.setup({locale: "es_MX", test: "worked"});
SubSubclass.debug = true; SubSubclass.debug = true;
SubSubclass.ajax = function() {return false;}; SubSubclass.ajax = function() {return false;};
ok(SubSubclass.topLevelMethod(), "SubSubclass.topLevelMethod thought debug was false"); ok(SubSubclass.topLevelMethod(), "SubSubclass.topLevelMethod thought debug was false");
deepEqual(SubSubclass(document).subClassMethod, Subclass.fn.subClassMethod, "Methods Differ!"); deepEqual(SubSubclass(document).subClassMethod, Subclass.fn.subClassMethod, "Methods Differ!");
ok(SubSubclass.config.locale == "es_MX", SubSubclass.config.locale + " is wrong!"); ok(SubSubclass.config.locale == "es_MX", SubSubclass.config.locale + " is wrong!");
ok(SubSubclass.config.test == "worked", "SubSubclass.config.test is set incorrectly"); ok(SubSubclass.config.test == "worked", "SubSubclass.config.test is set incorrectly");
notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods"); notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
//This shows that the modifications to the SubSubClass did not bubble back up to it's superclass //This shows that the modifications to the SubSubClass did not bubble back up to it's superclass
ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true"); ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!"); ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly"); deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
deepEqual(Subclass(document).subSubClassMethod, undefined, "subSubClassMethod set incorrectly"); deepEqual(Subclass(document).subSubClassMethod, undefined, "subSubClassMethod set incorrectly");
equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods"); equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
}); });
test("jQuery.sub() - .fn Methods", function(){ test("jQuery.sub() - .fn Methods", function(){