mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Merge branch 'master' of github.com:jquery/jquery
This commit is contained in:
@@ -1451,7 +1451,7 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
|
||||
|
||||
|
||||
jQuery.each( [ "Same Domain", "Cross Domain" ], function( crossDomain, label ) {
|
||||
|
||||
|
||||
asyncTest( "jQuery.ajax() - JSONP, Query String (?n)" + label, function() {
|
||||
expect( 4 );
|
||||
|
||||
@@ -1543,7 +1543,7 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
|
||||
plus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
window["jsonpResults"] = function( data ) {
|
||||
ok( data["data"], "JSON results returned (GET, custom callback function)" );
|
||||
window["jsonpResults"] = undefined;
|
||||
@@ -2725,4 +2725,38 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
|
||||
expect( 1 );
|
||||
ok( jQuery.active === 0, "ajax active counter should be zero: " + jQuery.active );
|
||||
});
|
||||
|
||||
test("jQuery.ajax - falsy url as argument (#10093)", function() {
|
||||
expect( 4 );
|
||||
|
||||
jQuery.ajaxSetup({ timeout: 0 });
|
||||
|
||||
stop();
|
||||
|
||||
jQuery.when(
|
||||
jQuery.ajax("").success(function(){ ok( true, "settings object - empty string" ); }),
|
||||
jQuery.ajax( false ).success(function(){ ok( true, "false" ); }),
|
||||
jQuery.ajax( null ).success(function(){ ok( true, "null" ); }),
|
||||
jQuery.ajax( undefined ).success(function(){ ok( true, "undefined" ); })
|
||||
).always(function () {
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
test("jQuery.ajax - falsy url in settings object (#10093)", function() {
|
||||
expect( 4 );
|
||||
|
||||
jQuery.ajaxSetup({ timeout: 0 });
|
||||
|
||||
stop();
|
||||
|
||||
jQuery.when(
|
||||
jQuery.ajax({ url: "" }).success(function(){ ok( true, "settings object - empty string" ); }),
|
||||
jQuery.ajax({ url: false }).success(function(){ ok( true, "false" ); }),
|
||||
jQuery.ajax({ url: null }).success(function(){ ok( true, "null" ); }),
|
||||
jQuery.ajax({ url: undefined }).success(function(){ ok( true, "undefined" ); })
|
||||
).always(function () {
|
||||
start();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -107,4 +107,33 @@ if ( jQuery.browser ) {
|
||||
ok(!!jQuery.attrFn, "attrFnPresent");
|
||||
});
|
||||
|
||||
test("hover pseudo-event", function() {
|
||||
expect(2);
|
||||
|
||||
var balance = 0;
|
||||
jQuery( "#firstp" )
|
||||
.on( "hovercraft", function() {
|
||||
ok( false, "hovercraft is full of ills" );
|
||||
})
|
||||
.on( "click.hover.me.not", function( e ) {
|
||||
equal( e.handleObj.namespace, "hover.me.not", "hover hack doesn't mangle namespaces" );
|
||||
})
|
||||
.bind("hover", function( e ) {
|
||||
if ( e.type === "mouseenter" ) {
|
||||
balance++;
|
||||
} else if ( e.type === "mouseleave" ) {
|
||||
balance--;
|
||||
} else {
|
||||
ok( false, "hover pseudo: unknown event type "+e.type );
|
||||
}
|
||||
})
|
||||
.trigger("click")
|
||||
.trigger("mouseenter")
|
||||
.trigger("mouseleave")
|
||||
.unbind("hover")
|
||||
.trigger("mouseenter");
|
||||
|
||||
equal( balance, 0, "hover pseudo-event" );
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ var testWidth = function( val ) {
|
||||
|
||||
equal( jQuery(window).width(), document.documentElement.clientWidth, "Window width is equal to width reported by window/document." );
|
||||
|
||||
jQuery.removeData($div[0], "olddisplay", true);
|
||||
jQuery._removeData( $div[0], "olddisplay" );
|
||||
};
|
||||
|
||||
test("width()", function() {
|
||||
@@ -101,7 +101,7 @@ var testHeight = function( val ) {
|
||||
|
||||
equal( jQuery(window).height(), document.documentElement.clientHeight, "Window width is equal to width reported by window/document." );
|
||||
|
||||
jQuery.removeData($div[0], "olddisplay", true);
|
||||
jQuery._removeData( $div[0], "olddisplay" );
|
||||
};
|
||||
|
||||
test("height()", function() {
|
||||
@@ -156,7 +156,7 @@ test("innerWidth()", function() {
|
||||
equal( div.innerWidth(), 0, "Make sure that disconnected nodes are handled." );
|
||||
|
||||
div.remove();
|
||||
jQuery.removeData($div[0], "olddisplay", true);
|
||||
jQuery._removeData( $div[0], "olddisplay" );
|
||||
});
|
||||
|
||||
test("innerHeight()", function() {
|
||||
@@ -191,7 +191,7 @@ test("innerHeight()", function() {
|
||||
equal( div.innerHeight(), 0, "Make sure that disconnected nodes are handled." );
|
||||
|
||||
div.remove();
|
||||
jQuery.removeData($div[0], "olddisplay", true);
|
||||
jQuery._removeData( $div[0], "olddisplay" );
|
||||
});
|
||||
|
||||
test("outerWidth()", function() {
|
||||
@@ -229,7 +229,7 @@ test("outerWidth()", function() {
|
||||
equal( div.outerWidth(), 0, "Make sure that disconnected nodes are handled." );
|
||||
|
||||
div.remove();
|
||||
jQuery.removeData($div[0], "olddisplay", true);
|
||||
jQuery._removeData( $div[0], "olddisplay" );
|
||||
});
|
||||
|
||||
test("child of a hidden elem (or unconnected node) has accurate inner/outer/Width()/Height() see #9441 #9300", function() {
|
||||
@@ -375,7 +375,7 @@ test("outerHeight()", function() {
|
||||
equal( div.outerHeight(), 0, "Make sure that disconnected nodes are handled." );
|
||||
|
||||
div.remove();
|
||||
jQuery.removeData($div[0], "olddisplay", true);
|
||||
jQuery._removeData( $div[0], "olddisplay" );
|
||||
});
|
||||
|
||||
test("passing undefined is a setter #5571", function() {
|
||||
|
||||
8
test/unit/effects.js
vendored
8
test/unit/effects.js
vendored
@@ -1014,7 +1014,7 @@ jQuery.checkState = function() {
|
||||
});
|
||||
|
||||
// manually clean data on modified element
|
||||
jQuery.removeData( this, "olddisplay", true );
|
||||
jQuery._removeData( this, "olddisplay" );
|
||||
|
||||
start();
|
||||
};
|
||||
@@ -1148,7 +1148,7 @@ function( method, defProp ) {
|
||||
equal( defProp( $elem ), startVal, "After doing .stop() halfway through show, check that state has been saved for returning to original property value." );
|
||||
|
||||
// Remove olddisplay data from .hide() call
|
||||
jQuery.removeData( this, "olddisplay", true );
|
||||
jQuery._removeData( this, "olddisplay" );
|
||||
start();
|
||||
});
|
||||
}, animTime / 2);
|
||||
@@ -1498,7 +1498,7 @@ test( "animate should set display for disconnected nodes", function() {
|
||||
|
||||
// cleanup
|
||||
jQuery.each( elems, function() {
|
||||
jQuery.removeData( this[ 0 ], "olddisplay", true );
|
||||
jQuery._removeData( this[ 0 ], "olddisplay" );
|
||||
});
|
||||
|
||||
stop();
|
||||
@@ -1515,7 +1515,7 @@ test( "animate should set display for disconnected nodes", function() {
|
||||
var callback = [function () {
|
||||
strictEqual( this.style.display, "block", "set display to block with " + name );
|
||||
|
||||
jQuery.removeData( this, "olddisplay", true );
|
||||
jQuery._removeData( this, "olddisplay" );
|
||||
|
||||
if ( ++i === 14 ) {
|
||||
start();
|
||||
|
||||
@@ -798,8 +798,8 @@ test("unbind(eventObject)", function() {
|
||||
assert( 0 );
|
||||
});
|
||||
|
||||
test("hover() and hover pseudo-event", function() {
|
||||
expect(3);
|
||||
test("hover() mouseenter mouseleave", function() {
|
||||
expect(1);
|
||||
|
||||
var times = 0,
|
||||
handler1 = function( event ) { ++times; },
|
||||
@@ -817,30 +817,6 @@ test("hover() and hover pseudo-event", function() {
|
||||
|
||||
equal( times, 4, "hover handlers fired" );
|
||||
|
||||
var balance = 0;
|
||||
jQuery( "#firstp" )
|
||||
.on( "hovercraft", function() {
|
||||
ok( false, "hovercraft is full of ills" );
|
||||
})
|
||||
.on( "click.hover.me.not", function( e ) {
|
||||
equal( e.handleObj.namespace, "hover.me.not", "hover hack doesn't mangle namespaces" );
|
||||
})
|
||||
.bind("hover", function( e ) {
|
||||
if ( e.type === "mouseenter" ) {
|
||||
balance++;
|
||||
} else if ( e.type === "mouseleave" ) {
|
||||
balance--;
|
||||
} else {
|
||||
ok( false, "hover pseudo: unknown event type "+e.type );
|
||||
}
|
||||
})
|
||||
.trigger("click")
|
||||
.trigger("mouseenter")
|
||||
.trigger("mouseleave")
|
||||
.unbind("hover")
|
||||
.trigger("mouseenter");
|
||||
|
||||
equal( balance, 0, "hover pseudo-event" );
|
||||
});
|
||||
|
||||
test("mouseover triggers mouseenter", function() {
|
||||
|
||||
@@ -119,7 +119,7 @@ test("callbacks keep their place in the queue", function() {
|
||||
|
||||
div.promise("fx").done(function() {
|
||||
equal(counter, 4, "Deferreds resolved");
|
||||
jQuery.removeData( div[0], "olddisplay", true );
|
||||
jQuery._removeData( div[0], "olddisplay" );
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,6 +38,11 @@ testIframeWithCallback( "A background on the testElement does not cause IE8 to c
|
||||
ok( true, "IE8 does not crash" );
|
||||
});
|
||||
|
||||
testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlocks", "support/shrinkWrapBlocks.html", function( shrinkWrapBlocks ) {
|
||||
expect( 1 );
|
||||
strictEqual( shrinkWrapBlocks, jQuery.support.shrinkWrapBlocks, "jQuery.support.shrinkWrapBlocks properties are the same" );
|
||||
});
|
||||
|
||||
(function() {
|
||||
|
||||
var userAgent = window.navigator.userAgent,
|
||||
|
||||
@@ -582,7 +582,7 @@ test("contents()", function() {
|
||||
});
|
||||
|
||||
test("add(String|Element|Array|undefined)", function() {
|
||||
expect(16);
|
||||
expect( 15 );
|
||||
deepEqual( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
|
||||
deepEqual( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
|
||||
|
||||
@@ -597,13 +597,10 @@ test("add(String|Element|Array|undefined)", function() {
|
||||
//equal( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" );
|
||||
|
||||
var divs = jQuery("<div/>").add("#sndp");
|
||||
ok( !divs[0].parentNode, "Make sure the first element is still the disconnected node." );
|
||||
|
||||
divs = jQuery("<div>test</div>").add("#sndp");
|
||||
equal( divs[0].parentNode.nodeType, 11, "Make sure the first element is still the disconnected node." );
|
||||
ok( divs[0].parentNode, "Sort with the disconnected node last (started with disconnected first)." );
|
||||
|
||||
divs = jQuery("#sndp").add("<div/>");
|
||||
ok( !divs[1].parentNode, "Make sure the first element is still the disconnected node." );
|
||||
ok( !divs[1].parentNode, "Sort with the disconnected node last." );
|
||||
|
||||
var tmp = jQuery("<div/>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user