mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Misc: Drop support for older browsers; update support comments
That includes IE<8, Opera 12.x, Firefox<29, Safari<6.0 and some hacks for old Blackberry. Fixes gh-1836 Fixes gh-1701 Refs gh-1815 Refs gh-1820
This commit is contained in:
parent
a467f8653a
commit
90d7cc1d8b
@ -14,7 +14,7 @@ In the spirit of open source software development, jQuery always encourages comm
|
|||||||
Environments in which to use jQuery
|
Environments in which to use jQuery
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
- [Browser support](http://jquery.com/browser-support/) differs between the master branch and the compat branch. Specifically, the master branch does not support legacy browsers such as IE6-8. The jQuery team continues to provide support for legacy browsers on the compat branch. Use the latest compat release if support for those browsers is required. See [browser support](http://jquery.com/browser-support/) for more info.
|
- [Browser support](http://jquery.com/browser-support/) differs between the master branch and the compat branch. Specifically, the master branch does not support legacy browsers such as IE8. The jQuery team continues to provide support for legacy browsers on the compat branch. Use the latest compat release if support for those browsers is required. See [browser support](http://jquery.com/browser-support/) for more info.
|
||||||
- To use jQuery in Node, browser extensions, and other non-browser environments, use only master branch releases given the name "jquery" rather than "jquery-compat". The compat branch does not support these environments.
|
- To use jQuery in Node, browser extensions, and other non-browser environments, use only master branch releases given the name "jquery" rather than "jquery-compat". The compat branch does not support these environments.
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
"undef": true,
|
"undef": true,
|
||||||
"unused": true,
|
"unused": true,
|
||||||
|
|
||||||
"evil": true,
|
|
||||||
"sub": true,
|
"sub": true,
|
||||||
|
|
||||||
"es3": true,
|
"es3": true,
|
||||||
|
28
src/ajax.js
28
src/ajax.js
@ -10,10 +10,6 @@ define([
|
|||||||
], function( jQuery, rnotwhite, nonce, rquery ) {
|
], function( jQuery, rnotwhite, nonce, rquery ) {
|
||||||
|
|
||||||
var
|
var
|
||||||
// Document location
|
|
||||||
ajaxLocParts,
|
|
||||||
ajaxLocation,
|
|
||||||
|
|
||||||
rhash = /#.*$/,
|
rhash = /#.*$/,
|
||||||
rts = /([?&])_=[^&]*/,
|
rts = /([?&])_=[^&]*/,
|
||||||
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
||||||
@ -42,23 +38,13 @@ var
|
|||||||
transports = {},
|
transports = {},
|
||||||
|
|
||||||
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
||||||
allTypes = "*/".concat("*");
|
allTypes = "*/".concat( "*" ),
|
||||||
|
|
||||||
// Support: IE<8
|
// Document location
|
||||||
// #8138, IE may throw an exception when accessing
|
ajaxLocation = location.href,
|
||||||
// a field from window.location if document.domain has been set
|
|
||||||
try {
|
|
||||||
ajaxLocation = location.href;
|
|
||||||
} catch ( e ) {
|
|
||||||
// Use the href attribute of an A element
|
|
||||||
// since IE will modify it given document.location
|
|
||||||
ajaxLocation = document.createElement( "a" );
|
|
||||||
ajaxLocation.href = "";
|
|
||||||
ajaxLocation = ajaxLocation.href;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Segment location into parts
|
// Segment location into parts
|
||||||
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
||||||
|
|
||||||
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
||||||
function addToPrefiltersOrTransports( structure ) {
|
function addToPrefiltersOrTransports( structure ) {
|
||||||
@ -79,7 +65,7 @@ function addToPrefiltersOrTransports( structure ) {
|
|||||||
// For each dataType in the dataTypeExpression
|
// For each dataType in the dataTypeExpression
|
||||||
while ( (dataType = dataTypes[i++]) ) {
|
while ( (dataType = dataTypes[i++]) ) {
|
||||||
// Prepend if requested
|
// Prepend if requested
|
||||||
if ( dataType.charAt( 0 ) === "+" ) {
|
if ( dataType[ 0 ] === "+" ) {
|
||||||
dataType = dataType.slice( 1 ) || "*";
|
dataType = dataType.slice( 1 ) || "*";
|
||||||
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
|
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
|
||||||
|
|
||||||
@ -509,7 +495,7 @@ jQuery.extend({
|
|||||||
jqXHR.error = jqXHR.fail;
|
jqXHR.error = jqXHR.fail;
|
||||||
|
|
||||||
// Remove hash character (#7531: and string promotion)
|
// Remove hash character (#7531: and string promotion)
|
||||||
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
// Add protocol if not provided (prefilters might expect it)
|
||||||
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
||||||
// We also use the url parameter if available
|
// We also use the url parameter if available
|
||||||
s.url = ( ( url || s.url || ajaxLocation ) + "" )
|
s.url = ( ( url || s.url || ajaxLocation ) + "" )
|
||||||
|
@ -2,48 +2,10 @@ define([
|
|||||||
"../core"
|
"../core"
|
||||||
], function( jQuery ) {
|
], function( jQuery ) {
|
||||||
|
|
||||||
var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
|
// Support: Android 2.3
|
||||||
|
// Workaround failure to string-cast null input
|
||||||
jQuery.parseJSON = function( data ) {
|
jQuery.parseJSON = function( data ) {
|
||||||
// Attempt to parse using the native JSON parser first
|
return JSON.parse( data + "" );
|
||||||
if ( window.JSON && window.JSON.parse ) {
|
|
||||||
// Support: Android 2.3
|
|
||||||
// Workaround failure to string-cast null input
|
|
||||||
return window.JSON.parse( data + "" );
|
|
||||||
}
|
|
||||||
|
|
||||||
var requireNonComma,
|
|
||||||
depth = null,
|
|
||||||
str = jQuery.trim( data + "" );
|
|
||||||
|
|
||||||
// Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
|
|
||||||
// after removing valid tokens
|
|
||||||
return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
|
|
||||||
|
|
||||||
// Force termination if we see a misplaced comma
|
|
||||||
if ( requireNonComma && comma ) {
|
|
||||||
depth = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Perform no more replacements after returning to outermost depth
|
|
||||||
if ( depth === 0 ) {
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Commas must not follow "[", "{", or ","
|
|
||||||
requireNonComma = open || comma;
|
|
||||||
|
|
||||||
// Determine new depth
|
|
||||||
// array/object open ("[" or "{"): depth += true - false (increment)
|
|
||||||
// array/object close ("]" or "}"): depth += false - true (decrement)
|
|
||||||
// other cases ("," or primitive): depth += true - true (numeric cast)
|
|
||||||
depth += !close - !open;
|
|
||||||
|
|
||||||
// Remove this token
|
|
||||||
return "";
|
|
||||||
}) ) ?
|
|
||||||
( Function( "return " + str ) )() :
|
|
||||||
jQuery.error( "Invalid JSON: " + data );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return jQuery.parseJSON;
|
return jQuery.parseJSON;
|
||||||
|
@ -77,9 +77,8 @@ jQuery.ajaxTransport( "script", function(s) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
|
|
||||||
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
||||||
head.insertBefore( script, head.firstChild );
|
head.appendChild( script );
|
||||||
},
|
},
|
||||||
|
|
||||||
abort: function() {
|
abort: function() {
|
||||||
|
@ -7,13 +7,13 @@ define([
|
|||||||
// Create the request object
|
// Create the request object
|
||||||
// (This is still attached to ajaxSettings for backward compatibility)
|
// (This is still attached to ajaxSettings for backward compatibility)
|
||||||
jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
|
jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
|
||||||
// Support: IE6+
|
// Support: IE8
|
||||||
function() {
|
function() {
|
||||||
|
|
||||||
// XHR cannot access local files, always use ActiveX for that case
|
// XHR cannot access local files, always use ActiveX for that case
|
||||||
return !this.isLocal &&
|
return !this.isLocal &&
|
||||||
|
|
||||||
// Support: IE7-8
|
// Support: IE<9
|
||||||
// oldIE XHR does not support non-RFC2616 methods (#13240)
|
// oldIE XHR does not support non-RFC2616 methods (#13240)
|
||||||
// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
|
// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
|
||||||
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
|
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
|
||||||
@ -167,10 +167,6 @@ if ( xhrSupported ) {
|
|||||||
if ( !options.async ) {
|
if ( !options.async ) {
|
||||||
// if we're in sync mode we fire the callback
|
// if we're in sync mode we fire the callback
|
||||||
callback();
|
callback();
|
||||||
} else if ( xhr.readyState === 4 ) {
|
|
||||||
// (IE6 & IE7) if it's in cache and has been
|
|
||||||
// retrieved directly we need to fire the callback
|
|
||||||
setTimeout( callback );
|
|
||||||
} else {
|
} else {
|
||||||
// Add to the list of active xhr callbacks
|
// Add to the list of active xhr callbacks
|
||||||
xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
|
xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
|
||||||
|
@ -7,10 +7,9 @@ define([
|
|||||||
"../selector"
|
"../selector"
|
||||||
], function( jQuery, rnotwhite, access, support ) {
|
], function( jQuery, rnotwhite, access, support ) {
|
||||||
|
|
||||||
var nodeHook, boolHook,
|
var boolHook,
|
||||||
attrHandle = jQuery.expr.attrHandle,
|
attrHandle = jQuery.expr.attrHandle,
|
||||||
ruseDefault = /^(?:checked|selected)$/i,
|
ruseDefault = /^(?:checked|selected)$/i,
|
||||||
getSetAttribute = support.getSetAttribute,
|
|
||||||
getSetInput = support.input;
|
getSetInput = support.input;
|
||||||
|
|
||||||
jQuery.fn.extend({
|
jQuery.fn.extend({
|
||||||
@ -45,7 +44,7 @@ jQuery.extend({
|
|||||||
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
|
||||||
name = name.toLowerCase();
|
name = name.toLowerCase();
|
||||||
hooks = jQuery.attrHooks[ name ] ||
|
hooks = jQuery.attrHooks[ name ] ||
|
||||||
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
|
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( value !== undefined ) {
|
if ( value !== undefined ) {
|
||||||
@ -88,7 +87,7 @@ jQuery.extend({
|
|||||||
// Boolean attributes get special treatment (#10870)
|
// Boolean attributes get special treatment (#10870)
|
||||||
if ( jQuery.expr.match.bool.test( name ) ) {
|
if ( jQuery.expr.match.bool.test( name ) ) {
|
||||||
// Set corresponding property to false
|
// Set corresponding property to false
|
||||||
if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
|
if ( getSetInput || !ruseDefault.test( name ) ) {
|
||||||
elem[ propName ] = false;
|
elem[ propName ] = false;
|
||||||
// Support: IE<9
|
// Support: IE<9
|
||||||
// Also clear defaultChecked/defaultSelected (if appropriate)
|
// Also clear defaultChecked/defaultSelected (if appropriate)
|
||||||
@ -96,13 +95,9 @@ jQuery.extend({
|
|||||||
elem[ jQuery.camelCase( "default-" + name ) ] =
|
elem[ jQuery.camelCase( "default-" + name ) ] =
|
||||||
elem[ propName ] = false;
|
elem[ propName ] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// See #9699 for explanation of this approach (setting first, then removal)
|
|
||||||
} else {
|
|
||||||
jQuery.attr( elem, name, "" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elem.removeAttribute( getSetAttribute ? name : propName );
|
elem.removeAttribute( name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -111,7 +106,7 @@ jQuery.extend({
|
|||||||
type: {
|
type: {
|
||||||
set: function( elem, value ) {
|
set: function( elem, value ) {
|
||||||
if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
||||||
// Setting the type on a radio button after the value resets the value in IE6-9
|
// Setting the type on a radio button after the value resets the value in IE8-9
|
||||||
// Reset value to default in case type is set after value during creation
|
// Reset value to default in case type is set after value during creation
|
||||||
var val = elem.value;
|
var val = elem.value;
|
||||||
elem.setAttribute( "type", value );
|
elem.setAttribute( "type", value );
|
||||||
@ -131,12 +126,12 @@ boolHook = {
|
|||||||
if ( value === false ) {
|
if ( value === false ) {
|
||||||
// Remove boolean attributes when set to false
|
// Remove boolean attributes when set to false
|
||||||
jQuery.removeAttr( elem, name );
|
jQuery.removeAttr( elem, name );
|
||||||
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
|
} else if ( getSetInput || !ruseDefault.test( name ) ) {
|
||||||
// IE<8 needs the *property* name
|
elem.setAttribute( jQuery.propFix[ name ] || name, name );
|
||||||
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
|
|
||||||
|
|
||||||
// Use defaultChecked and defaultSelected for oldIE
|
|
||||||
} else {
|
} else {
|
||||||
|
// Support: IE<9
|
||||||
|
// Use defaultChecked and defaultSelected for oldIE
|
||||||
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
|
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +144,7 @@ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name )
|
|||||||
|
|
||||||
var getter = attrHandle[ name ] || jQuery.find.attr;
|
var getter = attrHandle[ name ] || jQuery.find.attr;
|
||||||
|
|
||||||
attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
|
attrHandle[ name ] = getSetInput || !ruseDefault.test( name ) ?
|
||||||
function( elem, name, isXML ) {
|
function( elem, name, isXML ) {
|
||||||
var ret, handle;
|
var ret, handle;
|
||||||
if ( !isXML ) {
|
if ( !isXML ) {
|
||||||
@ -173,88 +168,17 @@ jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name )
|
|||||||
});
|
});
|
||||||
|
|
||||||
// fix oldIE attroperties
|
// fix oldIE attroperties
|
||||||
if ( !getSetInput || !getSetAttribute ) {
|
if ( !getSetInput ) {
|
||||||
jQuery.attrHooks.value = {
|
jQuery.attrHooks.value = {
|
||||||
set: function( elem, value, name ) {
|
set: function( elem, value ) {
|
||||||
if ( jQuery.nodeName( elem, "input" ) ) {
|
if ( jQuery.nodeName( elem, "input" ) ) {
|
||||||
// Does not return so that setAttribute is also used
|
// Does not return so that setAttribute is also used
|
||||||
elem.defaultValue = value;
|
elem.defaultValue = value;
|
||||||
} else {
|
|
||||||
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
|
|
||||||
return nodeHook && nodeHook.set( elem, value, name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
|
||||||
if ( !getSetAttribute ) {
|
|
||||||
|
|
||||||
// Use this for any attribute in IE6/7
|
|
||||||
// This fixes almost every IE6/7 issue
|
|
||||||
nodeHook = {
|
|
||||||
set: function( elem, value, name ) {
|
|
||||||
// Set the existing or create a new attribute node
|
|
||||||
var ret = elem.getAttributeNode( name );
|
|
||||||
if ( !ret ) {
|
|
||||||
elem.setAttributeNode(
|
|
||||||
(ret = elem.ownerDocument.createAttribute( name ))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret.value = value += "";
|
|
||||||
|
|
||||||
// Break association with cloned elements by also using setAttribute (#9646)
|
|
||||||
if ( name === "value" || value === elem.getAttribute( name ) ) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Some attributes are constructed with empty-string values when not defined
|
|
||||||
attrHandle.id = attrHandle.name = attrHandle.coords =
|
|
||||||
function( elem, name, isXML ) {
|
|
||||||
var ret;
|
|
||||||
if ( !isXML ) {
|
|
||||||
return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
|
|
||||||
ret.value :
|
|
||||||
null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Fixing value retrieval on a button requires this module
|
|
||||||
jQuery.valHooks.button = {
|
|
||||||
get: function( elem, name ) {
|
|
||||||
var ret = elem.getAttributeNode( name );
|
|
||||||
if ( ret && ret.specified ) {
|
|
||||||
return ret.value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
set: nodeHook.set
|
|
||||||
};
|
|
||||||
|
|
||||||
// Set contenteditable to false on removals(#10429)
|
|
||||||
// Setting to empty string throws an error as an invalid value
|
|
||||||
jQuery.attrHooks.contenteditable = {
|
|
||||||
set: function( elem, value, name ) {
|
|
||||||
nodeHook.set( elem, value === "" ? false : value, name );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
|
|
||||||
// This is for removals
|
|
||||||
jQuery.each([ "width", "height" ], function( i, name ) {
|
|
||||||
jQuery.attrHooks[ name ] = {
|
|
||||||
set: function( elem, value ) {
|
|
||||||
if ( value === "" ) {
|
|
||||||
elem.setAttribute( name, "auto" );
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !support.style ) {
|
if ( !support.style ) {
|
||||||
jQuery.attrHooks.style = {
|
jQuery.attrHooks.style = {
|
||||||
get: function( elem ) {
|
get: function( elem ) {
|
||||||
|
@ -80,22 +80,6 @@ jQuery.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Some attributes require a special call on IE
|
|
||||||
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
|
||||||
if ( !support.hrefNormalized ) {
|
|
||||||
// href/src property should get the full normalized URL (#10299/#12915)
|
|
||||||
jQuery.each([ "href", "src" ], function( i, name ) {
|
|
||||||
jQuery.propHooks[ name ] = {
|
|
||||||
get: function( elem ) {
|
|
||||||
return elem.getAttribute( name, 4 );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Support: Safari, IE9+
|
|
||||||
// mis-reports the default selected property of an option
|
|
||||||
// Accessing the parent's selectedIndex property fixes it
|
|
||||||
if ( !support.optSelected ) {
|
if ( !support.optSelected ) {
|
||||||
jQuery.propHooks.selected = {
|
jQuery.propHooks.selected = {
|
||||||
get: function( elem ) {
|
get: function( elem ) {
|
||||||
@ -129,9 +113,4 @@ jQuery.each([
|
|||||||
jQuery.propFix[ this.toLowerCase() ] = this;
|
jQuery.propFix[ this.toLowerCase() ] = this;
|
||||||
});
|
});
|
||||||
|
|
||||||
// IE6/7 call enctype encoding
|
|
||||||
if ( !support.enctype ) {
|
|
||||||
jQuery.propFix.enctype = "encoding";
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -8,8 +8,7 @@ define([
|
|||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
div = document.createElement( "div" );
|
div = document.createElement( "div" );
|
||||||
div.setAttribute( "className", "t" );
|
div.innerHTML = " <link/><a href='/a'>a</a><input type='checkbox'/>";
|
||||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
|
||||||
a = div.getElementsByTagName("a")[ 0 ];
|
a = div.getElementsByTagName("a")[ 0 ];
|
||||||
|
|
||||||
// First batch of tests.
|
// First batch of tests.
|
||||||
@ -19,28 +18,18 @@ define([
|
|||||||
|
|
||||||
a.style.cssText = "top:1px";
|
a.style.cssText = "top:1px";
|
||||||
|
|
||||||
// Test setAttribute on camelCase class.
|
|
||||||
// If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
|
||||||
support.getSetAttribute = div.className !== "t";
|
|
||||||
|
|
||||||
// Get the style information from getAttribute
|
// Get the style information from getAttribute
|
||||||
// (IE uses .cssText instead)
|
// (IE uses .cssText instead)
|
||||||
support.style = /top/.test( a.getAttribute("style") );
|
support.style = /top/.test( a.getAttribute("style") );
|
||||||
|
|
||||||
// Make sure that URLs aren't manipulated
|
|
||||||
// (IE normalizes it by default)
|
|
||||||
support.hrefNormalized = a.getAttribute("href") === "/a";
|
|
||||||
|
|
||||||
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
|
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
|
||||||
support.checkOn = !!input.value;
|
support.checkOn = !!input.value;
|
||||||
|
|
||||||
|
// Support: IE8-11+
|
||||||
// Make sure that a selected-by-default option has a working selected property.
|
// Make sure that a selected-by-default option has a working selected property.
|
||||||
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
// (IE defaults to false instead of true if it's in an optgroup)
|
||||||
support.optSelected = opt.selected;
|
support.optSelected = opt.selected;
|
||||||
|
|
||||||
// Tests for enctype support on a form (#6743)
|
|
||||||
support.enctype = !!document.createElement("form").enctype;
|
|
||||||
|
|
||||||
// Make sure that the options inside disabled selects aren't marked as disabled
|
// Make sure that the options inside disabled selects aren't marked as disabled
|
||||||
// (WebKit marks them as disabled)
|
// (WebKit marks them as disabled)
|
||||||
select.disabled = true;
|
select.disabled = true;
|
||||||
|
@ -96,7 +96,8 @@ jQuery.extend({
|
|||||||
for ( ; i < max; i++ ) {
|
for ( ; i < max; i++ ) {
|
||||||
option = options[ i ];
|
option = options[ i ];
|
||||||
|
|
||||||
// oldIE doesn't update selected after form reset (#2551)
|
// Support: IE<10
|
||||||
|
// IE8-9 doesn't update selected after form reset (#2551)
|
||||||
if ( ( option.selected || i === index ) &&
|
if ( ( option.selected || i === index ) &&
|
||||||
// Don't return options that are disabled or in a disabled optgroup
|
// Don't return options that are disabled or in a disabled optgroup
|
||||||
( support.optDisabled ?
|
( support.optDisabled ?
|
||||||
@ -129,24 +130,9 @@ jQuery.extend({
|
|||||||
|
|
||||||
while ( i-- ) {
|
while ( i-- ) {
|
||||||
option = options[ i ];
|
option = options[ i ];
|
||||||
|
if ( (option.selected =
|
||||||
if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
|
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0) ) {
|
||||||
|
optionSet = true;
|
||||||
// Support: IE6
|
|
||||||
// When new option element is added to select box we need to
|
|
||||||
// force reflow of newly added node in order to workaround delay
|
|
||||||
// of initialization properties
|
|
||||||
try {
|
|
||||||
option.selected = optionSet = true;
|
|
||||||
|
|
||||||
} catch ( _ ) {
|
|
||||||
|
|
||||||
// Will be executed only in IE6
|
|
||||||
option.scrollHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
option.selected = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +158,6 @@ jQuery.each([ "radio", "checkbox" ], function() {
|
|||||||
};
|
};
|
||||||
if ( !support.checkOn ) {
|
if ( !support.checkOn ) {
|
||||||
jQuery.valHooks[ this ].get = function( elem ) {
|
jQuery.valHooks[ this ].get = function( elem ) {
|
||||||
// Support: Webkit
|
|
||||||
// "" is returned instead of "on" if a value isn't specified
|
|
||||||
return elem.getAttribute("value") === null ? "on" : elem.value;
|
return elem.getAttribute("value") === null ? "on" : elem.value;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -285,9 +285,7 @@ jQuery.extend({
|
|||||||
|
|
||||||
script.text = data;
|
script.text = data;
|
||||||
|
|
||||||
// Support: IE6
|
head.appendChild( script );
|
||||||
// Circumvent bugs with base elements (#2709 and #4378) by prepending
|
|
||||||
head.insertBefore( script, head.firstChild );
|
|
||||||
head.removeChild( script );
|
head.removeChild( script );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ var rootjQuery,
|
|||||||
|
|
||||||
// Handle HTML strings
|
// Handle HTML strings
|
||||||
if ( typeof selector === "string" ) {
|
if ( typeof selector === "string" ) {
|
||||||
if ( selector.charAt(0) === "<" &&
|
if ( selector[ 0 ] === "<" &&
|
||||||
selector.charAt( selector.length - 1 ) === ">" &&
|
selector[ selector.length - 1 ] === ">" &&
|
||||||
selector.length >= 3 ) {
|
selector.length >= 3 ) {
|
||||||
|
|
||||||
// Assume that strings that start and end with <> are HTML and skip the regex check
|
// Assume that strings that start and end with <> are HTML and skip the regex check
|
||||||
@ -73,16 +73,8 @@ var rootjQuery,
|
|||||||
} else {
|
} else {
|
||||||
elem = document.getElementById( match[2] );
|
elem = document.getElementById( match[2] );
|
||||||
|
|
||||||
// Check parentNode to catch when Blackberry 4.6 returns
|
if ( elem ) {
|
||||||
// nodes that are no longer in the document #6963
|
// Inject the element directly into the jQuery object
|
||||||
if ( elem && elem.parentNode ) {
|
|
||||||
// Handle the case where IE and Opera return items
|
|
||||||
// by name instead of ID
|
|
||||||
if ( elem.id !== match[2] ) {
|
|
||||||
return rootjQuery.find( selector );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, we inject the element directly into the jQuery object
|
|
||||||
this.length = 1;
|
this.length = 1;
|
||||||
this[0] = elem;
|
this[0] = elem;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ function detach() {
|
|||||||
document.removeEventListener( "DOMContentLoaded", completed, false );
|
document.removeEventListener( "DOMContentLoaded", completed, false );
|
||||||
window.removeEventListener( "load", completed, false );
|
window.removeEventListener( "load", completed, false );
|
||||||
|
|
||||||
|
// Support: IE<9
|
||||||
} else {
|
} else {
|
||||||
document.detachEvent( "onreadystatechange", completed );
|
document.detachEvent( "onreadystatechange", completed );
|
||||||
window.detachEvent( "onload", completed );
|
window.detachEvent( "onload", completed );
|
||||||
@ -114,6 +115,7 @@ jQuery.ready.promise = function( obj ) {
|
|||||||
// A fallback to window.onload, that will always work
|
// A fallback to window.onload, that will always work
|
||||||
window.addEventListener( "load", completed, false );
|
window.addEventListener( "load", completed, false );
|
||||||
|
|
||||||
|
// Support: IE<9
|
||||||
// If IE event model is used
|
// If IE event model is used
|
||||||
} else {
|
} else {
|
||||||
// Ensure firing before onload, maybe late but safe also for iframes
|
// Ensure firing before onload, maybe late but safe also for iframes
|
||||||
@ -121,38 +123,12 @@ jQuery.ready.promise = function( obj ) {
|
|||||||
|
|
||||||
// A fallback to window.onload, that will always work
|
// A fallback to window.onload, that will always work
|
||||||
window.attachEvent( "onload", completed );
|
window.attachEvent( "onload", completed );
|
||||||
|
|
||||||
// If IE and not a frame
|
|
||||||
// continually check to see if the document is ready
|
|
||||||
var top = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
top = window.frameElement == null && document.documentElement;
|
|
||||||
} catch ( e ) {}
|
|
||||||
|
|
||||||
if ( top && top.doScroll ) {
|
|
||||||
(function doScrollCheck() {
|
|
||||||
if ( !jQuery.isReady ) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Use the trick by Diego Perini
|
|
||||||
// http://javascript.nwbox.com/IEContentLoaded/
|
|
||||||
top.doScroll("left");
|
|
||||||
} catch ( e ) {
|
|
||||||
return setTimeout( doScrollCheck, 50 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// detach all dom ready events
|
|
||||||
detach();
|
|
||||||
|
|
||||||
// and execute any waiting functions
|
|
||||||
jQuery.ready();
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return readyList.promise( obj );
|
return readyList.promise( obj );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Kick off the DOM ready check even if the user does not
|
||||||
|
jQuery.ready.promise();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
13
src/css.js
13
src/css.js
@ -38,7 +38,7 @@ var
|
|||||||
fontWeight: "400"
|
fontWeight: "400"
|
||||||
},
|
},
|
||||||
|
|
||||||
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
|
cssPrefixes = [ "Webkit", "Moz", "ms" ];
|
||||||
|
|
||||||
// BuildExclude
|
// BuildExclude
|
||||||
curCSS = curCSS.curCSS;
|
curCSS = curCSS.curCSS;
|
||||||
@ -52,7 +52,7 @@ function vendorPropName( style, name ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check for vendor prefixed names
|
// check for vendor prefixed names
|
||||||
var capName = name.charAt(0).toUpperCase() + name.slice(1),
|
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
|
||||||
origName = name,
|
origName = name,
|
||||||
i = cssPrefixes.length;
|
i = cssPrefixes.length;
|
||||||
|
|
||||||
@ -174,8 +174,7 @@ function getWidthOrHeight( elem, name, extra ) {
|
|||||||
var valueIsBorderBox = true,
|
var valueIsBorderBox = true,
|
||||||
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
||||||
styles = getStyles( elem ),
|
styles = getStyles( elem ),
|
||||||
isBorderBox = support.boxSizing &&
|
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
||||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
|
||||||
|
|
||||||
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
||||||
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
||||||
@ -302,7 +301,7 @@ jQuery.extend({
|
|||||||
if ( !hooks || !("set" in hooks) ||
|
if ( !hooks || !("set" in hooks) ||
|
||||||
(value = hooks.set( elem, value, extra )) !== undefined ) {
|
(value = hooks.set( elem, value, extra )) !== undefined ) {
|
||||||
|
|
||||||
// Support: IE
|
// Support: IE<9
|
||||||
// Swallow errors from 'invalid' CSS values (#5509)
|
// Swallow errors from 'invalid' CSS values (#5509)
|
||||||
try {
|
try {
|
||||||
style[ name ] = value;
|
style[ name ] = value;
|
||||||
@ -380,7 +379,6 @@ jQuery.each([ "height", "width" ], function( i, name ) {
|
|||||||
elem,
|
elem,
|
||||||
name,
|
name,
|
||||||
extra,
|
extra,
|
||||||
support.boxSizing &&
|
|
||||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||||
styles
|
styles
|
||||||
) : 0
|
) : 0
|
||||||
@ -437,11 +435,10 @@ if ( !support.opacity ) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support: Android 2.3
|
||||||
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
|
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
|
||||||
function( elem, computed ) {
|
function( elem, computed ) {
|
||||||
if ( computed ) {
|
if ( computed ) {
|
||||||
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
|
||||||
// Work around by temporarily setting element display to inline-block
|
|
||||||
return jQuery.swap( elem, { "display": "inline-block" },
|
return jQuery.swap( elem, { "display": "inline-block" },
|
||||||
curCSS, [ elem, "marginRight" ] );
|
curCSS, [ elem, "marginRight" ] );
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,11 @@ if ( window.getComputedStyle ) {
|
|||||||
ret = jQuery.style( elem, name );
|
ret = jQuery.style( elem, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support: Android 4.0-4.3
|
||||||
// A tribute to the "awesome hack by Dean Edwards"
|
// A tribute to the "awesome hack by Dean Edwards"
|
||||||
// Chrome < 17 and Safari 5.0 uses "computed value"
|
// Android Browser returns percentage for some values,
|
||||||
// instead of "used value" for margin-right
|
// but width seems to be reliably pixels.
|
||||||
// Safari 5.1.7 (at least) returns percentage for a larger set of values,
|
// This is against the CSSOM draft spec:
|
||||||
// but width seems to be reliably pixels
|
|
||||||
// this is against the CSSOM draft spec:
|
|
||||||
// http://dev.w3.org/csswg/cssom/#resolved-values
|
// http://dev.w3.org/csswg/cssom/#resolved-values
|
||||||
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ if ( window.getComputedStyle ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support: IE
|
// Support: IE9-11+
|
||||||
// IE returns zIndex value as an integer.
|
// IE returns zIndex value as an integer.
|
||||||
return ret === undefined ?
|
return ret === undefined ?
|
||||||
ret :
|
ret :
|
||||||
@ -115,7 +114,7 @@ if ( window.getComputedStyle ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support: IE
|
// Support: IE<9
|
||||||
// IE returns zIndex value as an integer.
|
// IE returns zIndex value as an integer.
|
||||||
return ret === undefined ?
|
return ret === undefined ?
|
||||||
ret :
|
ret :
|
||||||
|
@ -6,11 +6,9 @@ define([
|
|||||||
], function( jQuery, support ) {
|
], function( jQuery, support ) {
|
||||||
|
|
||||||
jQuery.expr.filters.hidden = function( elem ) {
|
jQuery.expr.filters.hidden = function( elem ) {
|
||||||
// Support: Opera <= 12.12
|
|
||||||
// Opera reports offsetWidths and offsetHeights less than zero on some elements
|
|
||||||
// Use OR instead of AND as the element is not visible if either is true
|
// Use OR instead of AND as the element is not visible if either is true
|
||||||
// See tickets #10406 and #13132
|
// See tickets #10406 and #13132
|
||||||
return elem.offsetWidth <= 0 || elem.offsetHeight <= 0 ||
|
return !elem.offsetWidth || !elem.offsetHeight ||
|
||||||
(!support.reliableHiddenOffsets() &&
|
(!support.reliableHiddenOffsets() &&
|
||||||
((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
||||||
};
|
};
|
||||||
|
@ -33,11 +33,6 @@ define([
|
|||||||
div.cloneNode( true ).style.backgroundClip = "";
|
div.cloneNode( true ).style.backgroundClip = "";
|
||||||
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
||||||
|
|
||||||
// Support: Firefox<29, Android 2.3
|
|
||||||
// Vendor-prefix box-sizing
|
|
||||||
support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
|
|
||||||
style.WebkitBoxSizing === "";
|
|
||||||
|
|
||||||
jQuery.extend(support, {
|
jQuery.extend(support, {
|
||||||
reliableHiddenOffsets: function() {
|
reliableHiddenOffsets: function() {
|
||||||
if ( reliableHiddenOffsetsVal == null ) {
|
if ( reliableHiddenOffsetsVal == null ) {
|
||||||
@ -71,9 +66,9 @@ define([
|
|||||||
|
|
||||||
function computeStyleTests() {
|
function computeStyleTests() {
|
||||||
// Minified: var b,c,d,j
|
// Minified: var b,c,d,j
|
||||||
var div, body, container, contents;
|
var div, container, contents,
|
||||||
|
body = document.body;
|
||||||
|
|
||||||
body = document.getElementsByTagName( "body" )[ 0 ];
|
|
||||||
if ( !body || !body.style ) {
|
if ( !body || !body.style ) {
|
||||||
// Test fired too early or in an unsupported environment, exit.
|
// Test fired too early or in an unsupported environment, exit.
|
||||||
return;
|
return;
|
||||||
@ -86,10 +81,10 @@ define([
|
|||||||
body.appendChild( container ).appendChild( div );
|
body.appendChild( container ).appendChild( div );
|
||||||
|
|
||||||
div.style.cssText =
|
div.style.cssText =
|
||||||
// Support: Firefox<29, Android 2.3
|
// Support: Android 2.3
|
||||||
// Vendor-prefix box-sizing
|
// Vendor-prefix box-sizing
|
||||||
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
|
"-webkit-box-sizing:border-box;box-sizing:border-box;" +
|
||||||
"box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
|
"display:block;margin-top:1%;top:1%;" +
|
||||||
"border:1px;padding:1px;width:4px;position:absolute";
|
"border:1px;padding:1px;width:4px;position:absolute";
|
||||||
|
|
||||||
// Support: IE<9
|
// Support: IE<9
|
||||||
@ -111,10 +106,10 @@ define([
|
|||||||
|
|
||||||
// Reset CSS: box-sizing; display; margin; border; padding
|
// Reset CSS: box-sizing; display; margin; border; padding
|
||||||
contents.style.cssText = div.style.cssText =
|
contents.style.cssText = div.style.cssText =
|
||||||
// Support: Firefox<29, Android 2.3
|
// Support: Android 2.3
|
||||||
// Vendor-prefix box-sizing
|
// Vendor-prefix box-sizing
|
||||||
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
|
"-webkit-box-sizing:content-box;box-sizing:content-box;" +
|
||||||
"box-sizing:content-box;display:block;margin:0;border:0;padding:0";
|
"display:block;margin:0;border:0;padding:0";
|
||||||
contents.style.marginRight = contents.style.width = "0";
|
contents.style.marginRight = contents.style.width = "0";
|
||||||
div.style.width = "1px";
|
div.style.width = "1px";
|
||||||
|
|
||||||
@ -124,7 +119,7 @@ define([
|
|||||||
div.removeChild( contents );
|
div.removeChild( contents );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support: IE8
|
// Support: IE<9
|
||||||
// Check if table cells still have offsetWidth/Height when they are set
|
// Check if table cells still have offsetWidth/Height when they are set
|
||||||
// to display:none and there are still other visible table cells in a
|
// to display:none and there are still other visible table cells in a
|
||||||
// table row; if so, offsetWidth/Height are not reliable for use when
|
// table row; if so, offsetWidth/Height are not reliable for use when
|
||||||
|
@ -29,7 +29,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
|||||||
|
|
||||||
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
|
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
|
||||||
// whichever is greatest
|
// whichever is greatest
|
||||||
// unfortunately, this causes bug #3838 in IE6/8 only,
|
// unfortunately, this causes bug #3838 in IE8 only,
|
||||||
// but there is currently no good, small way to fix it.
|
// but there is currently no good, small way to fix it.
|
||||||
return Math.max(
|
return Math.max(
|
||||||
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
|
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
|
||||||
|
15
src/effects.js
vendored
15
src/effects.js
vendored
@ -4,7 +4,6 @@ define([
|
|||||||
"./css/var/cssExpand",
|
"./css/var/cssExpand",
|
||||||
"./css/var/isHidden",
|
"./css/var/isHidden",
|
||||||
"./css/defaultDisplay",
|
"./css/defaultDisplay",
|
||||||
"./effects/support",
|
|
||||||
|
|
||||||
"./core/init",
|
"./core/init",
|
||||||
"./effects/Tween",
|
"./effects/Tween",
|
||||||
@ -12,7 +11,7 @@ define([
|
|||||||
"./css",
|
"./css",
|
||||||
"./deferred",
|
"./deferred",
|
||||||
"./traversing"
|
"./traversing"
|
||||||
], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay, support ) {
|
], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay ) {
|
||||||
|
|
||||||
var
|
var
|
||||||
fxNow, timerId,
|
fxNow, timerId,
|
||||||
@ -177,27 +176,18 @@ function defaultPrefilter( elem, props, opts ) {
|
|||||||
jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
|
jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
|
||||||
|
|
||||||
if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
|
if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
|
||||||
|
|
||||||
// inline-level elements accept inline-block;
|
|
||||||
// block-level elements need to be inline with layout
|
|
||||||
if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
|
|
||||||
style.display = "inline-block";
|
style.display = "inline-block";
|
||||||
} else {
|
|
||||||
style.zoom = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( opts.overflow ) {
|
if ( opts.overflow ) {
|
||||||
style.overflow = "hidden";
|
style.overflow = "hidden";
|
||||||
if ( !support.shrinkWrapBlocks() ) {
|
|
||||||
anim.always(function() {
|
anim.always(function() {
|
||||||
style.overflow = opts.overflow[ 0 ];
|
style.overflow = opts.overflow[ 0 ];
|
||||||
style.overflowX = opts.overflow[ 1 ];
|
style.overflowX = opts.overflow[ 1 ];
|
||||||
style.overflowY = opts.overflow[ 2 ];
|
style.overflowY = opts.overflow[ 2 ];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// show/hide pass
|
// show/hide pass
|
||||||
for ( prop in props ) {
|
for ( prop in props ) {
|
||||||
@ -320,7 +310,8 @@ function Animation( elem, properties, options ) {
|
|||||||
}
|
}
|
||||||
var currentTime = fxNow || createFxNow(),
|
var currentTime = fxNow || createFxNow(),
|
||||||
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
||||||
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
|
// Support: Android 2.3
|
||||||
|
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
|
||||||
temp = remaining / animation.duration || 0,
|
temp = remaining / animation.duration || 0,
|
||||||
percent = 1 - temp,
|
percent = 1 - temp,
|
||||||
index = 0,
|
index = 0,
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
define([
|
|
||||||
"../var/support"
|
|
||||||
], function( support ) {
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var shrinkWrapBlocksVal;
|
|
||||||
|
|
||||||
support.shrinkWrapBlocks = function() {
|
|
||||||
if ( shrinkWrapBlocksVal != null ) {
|
|
||||||
return shrinkWrapBlocksVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Will be changed later if needed.
|
|
||||||
shrinkWrapBlocksVal = false;
|
|
||||||
|
|
||||||
// Minified: var b,c,d
|
|
||||||
var div, body, container;
|
|
||||||
|
|
||||||
body = document.getElementsByTagName( "body" )[ 0 ];
|
|
||||||
if ( !body || !body.style ) {
|
|
||||||
// Test fired too early or in an unsupported environment, exit.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup
|
|
||||||
div = document.createElement( "div" );
|
|
||||||
container = document.createElement( "div" );
|
|
||||||
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
|
|
||||||
body.appendChild( container ).appendChild( div );
|
|
||||||
|
|
||||||
// Support: IE6
|
|
||||||
// Check if elements with layout shrink-wrap their children
|
|
||||||
if ( typeof div.style.zoom !== "undefined" ) {
|
|
||||||
// Reset CSS: box-sizing; display; margin; border
|
|
||||||
div.style.cssText =
|
|
||||||
// Support: Firefox<29, Android 2.3
|
|
||||||
// Vendor-prefix box-sizing
|
|
||||||
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
|
|
||||||
"box-sizing:content-box;display:block;margin:0;border:0;" +
|
|
||||||
"padding:1px;width:1px;zoom:1";
|
|
||||||
div.appendChild( document.createElement( "div" ) ).style.width = "5px";
|
|
||||||
shrinkWrapBlocksVal = div.offsetWidth !== 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.removeChild( container );
|
|
||||||
|
|
||||||
return shrinkWrapBlocksVal;
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
return support;
|
|
||||||
|
|
||||||
});
|
|
@ -340,8 +340,9 @@ jQuery.event = {
|
|||||||
jQuery.acceptData( elem ) ) {
|
jQuery.acceptData( elem ) ) {
|
||||||
|
|
||||||
// Call a native DOM method on the target with the same name name as the event.
|
// Call a native DOM method on the target with the same name name as the event.
|
||||||
// Can't use an .isFunction() check here because IE6/7 fails that test.
|
|
||||||
// Don't do default actions on window, that's where global variables be (#6170)
|
// Don't do default actions on window, that's where global variables be (#6170)
|
||||||
|
// Support: IE<9
|
||||||
|
// Can't use an .isFunction() check here because IE8 fails that test.
|
||||||
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
|
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
|
||||||
|
|
||||||
// Don't re-trigger an onFOO event when we call its FOO() method
|
// Don't re-trigger an onFOO event when we call its FOO() method
|
||||||
@ -514,7 +515,7 @@ jQuery.event = {
|
|||||||
event.target = originalEvent.srcElement || document;
|
event.target = originalEvent.srcElement || document;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support: Chrome 23+, Safari?
|
// Support: Safari 6.0+
|
||||||
// Target should not be a text node (#504, #13143)
|
// Target should not be a text node (#504, #13143)
|
||||||
if ( event.target.nodeType === 3 ) {
|
if ( event.target.nodeType === 3 ) {
|
||||||
event.target = event.target.parentNode;
|
event.target = event.target.parentNode;
|
||||||
@ -677,7 +678,7 @@ jQuery.removeEvent = document.removeEventListener ?
|
|||||||
|
|
||||||
if ( elem.detachEvent ) {
|
if ( elem.detachEvent ) {
|
||||||
|
|
||||||
// #8545, #7054, preventing memory leaks for custom events in IE6-8
|
// #8545, #7054, preventing memory leaks for custom events in IE8
|
||||||
// detachEvent needed property on element, by name of that event,
|
// detachEvent needed property on element, by name of that event,
|
||||||
// to properly expose it to GC
|
// to properly expose it to GC
|
||||||
if ( typeof elem[ name ] === "undefined" ) {
|
if ( typeof elem[ name ] === "undefined" ) {
|
||||||
|
@ -36,7 +36,6 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
|
|||||||
rleadingWhitespace = /^\s+/,
|
rleadingWhitespace = /^\s+/,
|
||||||
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
|
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
|
||||||
rtagName = /<([\w:]+)/,
|
rtagName = /<([\w:]+)/,
|
||||||
rtbody = /<tbody/i,
|
|
||||||
rhtml = /<|&#?\w+;/,
|
rhtml = /<|&#?\w+;/,
|
||||||
rnoInnerhtml = /<(?:script|style|link)/i,
|
rnoInnerhtml = /<(?:script|style|link)/i,
|
||||||
// checked="checked" or checked
|
// checked="checked" or checked
|
||||||
@ -56,7 +55,7 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
|
|||||||
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
||||||
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
||||||
|
|
||||||
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
|
// IE8 can't serialize link, script, style, or any html5 (NoScope) tags,
|
||||||
// unless wrapped in a div with non-breaking characters in front of it.
|
// unless wrapped in a div with non-breaking characters in front of it.
|
||||||
_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
|
_default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
|
||||||
},
|
},
|
||||||
@ -91,14 +90,6 @@ function getAll( context, tag ) {
|
|||||||
found;
|
found;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used in buildFragment, fixes the defaultChecked property
|
|
||||||
function fixDefaultChecked( elem ) {
|
|
||||||
if ( rcheckableType.test( elem.type ) ) {
|
|
||||||
elem.defaultChecked = elem.checked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Support: IE<8
|
|
||||||
// Manipulating tables requires a tbody
|
// Manipulating tables requires a tbody
|
||||||
function manipulationTarget( elem, content ) {
|
function manipulationTarget( elem, content ) {
|
||||||
return jQuery.nodeName( elem, "table" ) &&
|
return jQuery.nodeName( elem, "table" ) &&
|
||||||
@ -175,7 +166,6 @@ function fixCloneNodeIssues( src, dest ) {
|
|||||||
|
|
||||||
nodeName = dest.nodeName.toLowerCase();
|
nodeName = dest.nodeName.toLowerCase();
|
||||||
|
|
||||||
// IE6-8 copies events bound via attachEvent when using cloneNode.
|
|
||||||
if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
|
if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
|
||||||
data = jQuery._data( dest );
|
data = jQuery._data( dest );
|
||||||
|
|
||||||
@ -187,45 +177,26 @@ function fixCloneNodeIssues( src, dest ) {
|
|||||||
dest.removeAttribute( jQuery.expando );
|
dest.removeAttribute( jQuery.expando );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support: IE<9
|
||||||
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
|
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
|
||||||
if ( nodeName === "script" && dest.text !== src.text ) {
|
if ( nodeName === "script" && dest.text !== src.text ) {
|
||||||
disableScript( dest ).text = src.text;
|
disableScript( dest ).text = src.text;
|
||||||
restoreScript( dest );
|
restoreScript( dest );
|
||||||
|
|
||||||
// IE6-10 improperly clones children of object elements using classid.
|
// Support: IE<9
|
||||||
// IE10 throws NoModificationAllowedError if parent is null, #12132.
|
// IE8 fails to persist the checked state of a cloned checkbox
|
||||||
} else if ( nodeName === "object" ) {
|
// or radio button.
|
||||||
if ( dest.parentNode ) {
|
|
||||||
dest.outerHTML = src.outerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This path appears unavoidable for IE9. When cloning an object
|
|
||||||
// element in IE9, the outerHTML strategy above is not sufficient.
|
|
||||||
// If the src has innerHTML and the destination does not,
|
|
||||||
// copy the src.innerHTML into the dest.innerHTML. #10324
|
|
||||||
if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
|
|
||||||
dest.innerHTML = src.innerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
|
} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
|
||||||
// IE6-8 fails to persist the checked state of a cloned checkbox
|
dest.checked = src.checked;
|
||||||
// or radio button. Worse, IE6-7 fail to give the cloned element
|
|
||||||
// a checked appearance if the defaultChecked value isn't also set
|
|
||||||
|
|
||||||
dest.defaultChecked = dest.checked = src.checked;
|
// Support: IE<9
|
||||||
|
// IE8 fails to return the selected option to the default selected
|
||||||
// IE6-7 get confused and end up setting the value of a cloned
|
|
||||||
// checkbox/radio button to an empty string instead of "on"
|
|
||||||
if ( dest.value !== src.value ) {
|
|
||||||
dest.value = src.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE6-8 fails to return the selected option to the default selected
|
|
||||||
// state when cloning options
|
// state when cloning options
|
||||||
} else if ( nodeName === "option" ) {
|
} else if ( nodeName === "option" ) {
|
||||||
dest.defaultSelected = dest.selected = src.defaultSelected;
|
dest.defaultSelected = dest.selected = src.defaultSelected;
|
||||||
|
|
||||||
// IE6-8 fails to set the defaultValue to the correct value when
|
// Support: IE<9
|
||||||
|
// IE8 fails to set the defaultValue to the correct value when
|
||||||
// cloning other types of input fields
|
// cloning other types of input fields
|
||||||
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
||||||
dest.defaultValue = src.defaultValue;
|
dest.defaultValue = src.defaultValue;
|
||||||
@ -292,7 +263,7 @@ jQuery.extend({
|
|||||||
|
|
||||||
buildFragment: function( elems, context, scripts, selection ) {
|
buildFragment: function( elems, context, scripts, selection ) {
|
||||||
var j, elem, contains,
|
var j, elem, contains,
|
||||||
tmp, tag, tbody, wrap,
|
tmp, tag, wrap,
|
||||||
l = elems.length,
|
l = elems.length,
|
||||||
|
|
||||||
// Ensure a safe fragment
|
// Ensure a safe fragment
|
||||||
@ -335,28 +306,6 @@ jQuery.extend({
|
|||||||
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
|
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove IE's autoinserted <tbody> from table fragments
|
|
||||||
if ( !support.tbody ) {
|
|
||||||
|
|
||||||
// String was a <table>, *may* have spurious <tbody>
|
|
||||||
elem = tag === "table" && !rtbody.test( elem ) ?
|
|
||||||
tmp.firstChild :
|
|
||||||
|
|
||||||
// String was a bare <thead> or <tfoot>
|
|
||||||
wrap[1] === "<table>" && !rtbody.test( elem ) ?
|
|
||||||
tmp :
|
|
||||||
0;
|
|
||||||
|
|
||||||
j = elem && elem.childNodes.length;
|
|
||||||
while ( j-- ) {
|
|
||||||
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) &&
|
|
||||||
!tbody.childNodes.length ) {
|
|
||||||
|
|
||||||
elem.removeChild( tbody );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jQuery.merge( nodes, tmp.childNodes );
|
jQuery.merge( nodes, tmp.childNodes );
|
||||||
|
|
||||||
// Fix #12392 for WebKit and IE > 9
|
// Fix #12392 for WebKit and IE > 9
|
||||||
@ -378,12 +327,6 @@ jQuery.extend({
|
|||||||
safe.removeChild( tmp );
|
safe.removeChild( tmp );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset defaultChecked for any radios and checkboxes
|
|
||||||
// about to be appended to the DOM in IE 6/7 (#8060)
|
|
||||||
if ( !support.appendChecked ) {
|
|
||||||
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
|
|
||||||
}
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while ( (elem = nodes[ i++ ]) ) {
|
while ( (elem = nodes[ i++ ]) ) {
|
||||||
|
|
||||||
@ -687,6 +630,8 @@ jQuery.fn.extend({
|
|||||||
|
|
||||||
// Keep references to cloned scripts for later restoration
|
// Keep references to cloned scripts for later restoration
|
||||||
if ( hasScripts ) {
|
if ( hasScripts ) {
|
||||||
|
// Support: Android<4.1, PhantomJS<2
|
||||||
|
// push.apply(_, arraylike) throws on ancient WebKit
|
||||||
jQuery.merge( scripts, getAll( node, "script" ) );
|
jQuery.merge( scripts, getAll( node, "script" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -749,7 +694,8 @@ jQuery.each({
|
|||||||
elems = i === last ? this : this.clone(true);
|
elems = i === last ? this : this.clone(true);
|
||||||
jQuery( insert[i] )[ original ]( elems );
|
jQuery( insert[i] )[ original ]( elems );
|
||||||
|
|
||||||
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
|
// Support: IE<9, Android<4.1, PhantomJS<2
|
||||||
|
// .get() because push.apply(_, arraylike) throws on ancient WebKit
|
||||||
push.apply( ret, elems.get() );
|
push.apply( ret, elems.get() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,21 +3,15 @@ define([
|
|||||||
], function( support ) {
|
], function( support ) {
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
// Minified: var a,b,c
|
var div = document.createElement( "div" ),
|
||||||
var input = document.createElement( "input" ),
|
|
||||||
div = document.createElement( "div" ),
|
|
||||||
fragment = document.createDocumentFragment();
|
fragment = document.createDocumentFragment();
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
div.innerHTML = " <link/><a href='/a'></a>";
|
||||||
|
|
||||||
// IE strips leading whitespace when .innerHTML is used
|
// IE strips leading whitespace when .innerHTML is used
|
||||||
support.leadingWhitespace = div.firstChild.nodeType === 3;
|
support.leadingWhitespace = div.firstChild.nodeType === 3;
|
||||||
|
|
||||||
// Make sure that tbody elements aren't automatically inserted
|
|
||||||
// IE will insert them into empty tables
|
|
||||||
support.tbody = !div.getElementsByTagName( "tbody" ).length;
|
|
||||||
|
|
||||||
// Make sure that link elements get serialized correctly by innerHTML
|
// Make sure that link elements get serialized correctly by innerHTML
|
||||||
// This requires a wrapper element in IE
|
// This requires a wrapper element in IE
|
||||||
support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
|
support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
|
||||||
@ -27,15 +21,8 @@ define([
|
|||||||
support.html5Clone =
|
support.html5Clone =
|
||||||
document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
|
document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
|
||||||
|
|
||||||
// Check if a disconnected checkbox will retain its checked
|
|
||||||
// value of true after appended to the DOM (IE6/7)
|
|
||||||
input.type = "checkbox";
|
|
||||||
input.checked = true;
|
|
||||||
fragment.appendChild( input );
|
|
||||||
support.appendChecked = input.checked;
|
|
||||||
|
|
||||||
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
// Make sure textarea (and checkbox) defaultValue is properly cloned
|
||||||
// Support: IE6-IE11+
|
// Support: IE8-IE11+
|
||||||
div.innerHTML = "<textarea>x</textarea>";
|
div.innerHTML = "<textarea>x</textarea>";
|
||||||
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
|
||||||
|
|
||||||
@ -43,8 +30,8 @@ define([
|
|||||||
fragment.appendChild( div );
|
fragment.appendChild( div );
|
||||||
div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
|
div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
|
||||||
|
|
||||||
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
|
// Support: Android<4.2
|
||||||
// old WebKit doesn't clone checked state correctly in fragments
|
// Older WebKit doesn't clone checked state correctly in fragments
|
||||||
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
||||||
|
|
||||||
// Support: IE<9
|
// Support: IE<9
|
||||||
|
@ -103,11 +103,7 @@ jQuery.fn.extend({
|
|||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we don't have gBCR, just use 0,0 rather than error
|
|
||||||
// BlackBerry 5, iOS 3 (original iPhone)
|
|
||||||
if ( typeof elem.getBoundingClientRect !== "undefined" ) {
|
|
||||||
box = elem.getBoundingClientRect();
|
box = elem.getBoundingClientRect();
|
||||||
}
|
|
||||||
win = getWindow( doc );
|
win = getWindow( doc );
|
||||||
return {
|
return {
|
||||||
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
|
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
|
||||||
|
@ -15,43 +15,5 @@ for ( i in jQuery( support ) ) {
|
|||||||
support.ownLast = i !== "0";
|
support.ownLast = i !== "0";
|
||||||
|
|
||||||
// Note: most support tests are defined in their respective modules.
|
// Note: most support tests are defined in their respective modules.
|
||||||
// false until the test is run
|
|
||||||
support.inlineBlockNeedsLayout = false;
|
|
||||||
|
|
||||||
// Execute ASAP in case we need to set body.style.zoom
|
|
||||||
jQuery(function() {
|
|
||||||
// Minified: var a,b,c,d
|
|
||||||
var val, div, body, container;
|
|
||||||
|
|
||||||
body = document.getElementsByTagName( "body" )[ 0 ];
|
|
||||||
if ( !body || !body.style ) {
|
|
||||||
// Return for frameset docs that don't have a body
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup
|
|
||||||
div = document.createElement( "div" );
|
|
||||||
container = document.createElement( "div" );
|
|
||||||
container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
|
|
||||||
body.appendChild( container ).appendChild( div );
|
|
||||||
|
|
||||||
if ( typeof div.style.zoom !== "undefined" ) {
|
|
||||||
// Support: IE<8
|
|
||||||
// Check if natively block-level elements act like inline-block
|
|
||||||
// elements when setting their display to 'inline' and giving
|
|
||||||
// them layout
|
|
||||||
div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
|
|
||||||
|
|
||||||
support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
|
|
||||||
if ( val ) {
|
|
||||||
// Prevent IE 6 from affecting layout for positioned elements #11048
|
|
||||||
// Prevent IE from shrinking the body in IE 7 mode #12869
|
|
||||||
// Support: IE<8
|
|
||||||
body.style.zoom = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body.removeChild( container );
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
<style>
|
<style>
|
||||||
#test {
|
#test {
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
@ -2,16 +2,6 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="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" />
|
||||||
<style>
|
|
||||||
html {
|
|
||||||
/**
|
|
||||||
* we need to null out border-width, because it causes bug #3838
|
|
||||||
* and until we drop IE6, this test will fail in IE6 if we didn't
|
|
||||||
* special case this situation.
|
|
||||||
**/
|
|
||||||
border-width: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div>
|
|
||||||
<script src="../../jquery.js"></script>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
jQuery(function() {
|
|
||||||
window.parent.iframeCallback( jQuery.support.shrinkWrapBlocks() );
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,7 +1,7 @@
|
|||||||
/* for testing opacity set in styles in IE */
|
/* for testing opacity set in styles in IE */
|
||||||
ol#empty {
|
ol#empty {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
filter:Alpha(opacity=0) progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff');
|
-ms-filter: "Alpha(opacity=0) progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff')";
|
||||||
}
|
}
|
||||||
|
|
||||||
div#fx-tests h4 {
|
div#fx-tests h4 {
|
||||||
@ -47,7 +47,7 @@ div.largeheight {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.largeopacity {
|
div.largeopacity {
|
||||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
|
||||||
}
|
}
|
||||||
|
|
||||||
div.medwidth {
|
div.medwidth {
|
||||||
@ -60,7 +60,7 @@ div.medheight {
|
|||||||
|
|
||||||
div.medopacity {
|
div.medopacity {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
|
||||||
}
|
}
|
||||||
|
|
||||||
div.nowidth {
|
div.nowidth {
|
||||||
@ -73,7 +73,7 @@ div.noheight {
|
|||||||
|
|
||||||
div.noopacity {
|
div.noopacity {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)";
|
||||||
}
|
}
|
||||||
|
|
||||||
div.hidden {
|
div.hidden {
|
||||||
@ -143,8 +143,8 @@ dfn { display: none; }
|
|||||||
/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
|
/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
|
||||||
body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
|
body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
|
||||||
|
|
||||||
/* #6652 REMOVE FILTER:ALPHA(OPACITY=100) AFTER ANIMATION */
|
/* #6652 Remove -ms-filter: "alpha(opacity=100)" after animation */
|
||||||
#t6652 div { filter: alpha(opacity=50); }
|
#t6652 div { -ms-filter: "alpha(opacity=50)"; }
|
||||||
|
|
||||||
/* #10501 */
|
/* #10501 */
|
||||||
section { background:#f0f; display:block; }
|
section { background:#f0f; display:block; }
|
||||||
|
@ -1014,9 +1014,7 @@ module( "ajax", {
|
|||||||
" (no cache)": false
|
" (no cache)": false
|
||||||
},
|
},
|
||||||
function( label, cache ) {
|
function( label, cache ) {
|
||||||
var isOpera = !!window.opera;
|
asyncTest( "jQuery.ajax() - If-Modified-Since support" + label, 4, function() {
|
||||||
|
|
||||||
asyncTest( "jQuery.ajax() - If-Modified-Since support" + label, 3, function() {
|
|
||||||
var url = "data/if_modified_since.php?ts=" + ifModifiedNow++;
|
var url = "data/if_modified_since.php?ts=" + ifModifiedNow++;
|
||||||
|
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
@ -1030,33 +1028,15 @@ module( "ajax", {
|
|||||||
url: url,
|
url: url,
|
||||||
ifModified: true,
|
ifModified: true,
|
||||||
cache: cache,
|
cache: cache,
|
||||||
success: function( data, status ) {
|
success: function( data, status, jqXHR ) {
|
||||||
if ( data === "FAIL" ) {
|
strictEqual( status, "notmodified", "Following status is 'notmodified'" );
|
||||||
ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-Modified-Since')." );
|
strictEqual( jqXHR.status, 304, "XHR status is 304" );
|
||||||
ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-Modified-Since')." );
|
equal( data, null, "no response body is given" );
|
||||||
} else {
|
|
||||||
strictEqual( status, "notmodified" );
|
|
||||||
ok( data == null, "response body should be empty" );
|
|
||||||
}
|
|
||||||
start();
|
|
||||||
},
|
},
|
||||||
error: function() {
|
complete: function() {
|
||||||
// Do this because opera simply refuses to implement 304 handling :(
|
|
||||||
// A feature-driven way of detecting this would be appreciated
|
|
||||||
// See: http://gist.github.com/599419
|
|
||||||
ok( isOpera, "error" );
|
|
||||||
ok( isOpera, "error" );
|
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
error: function() {
|
|
||||||
strictEqual( false, "error" );
|
|
||||||
// Do this because opera simply refuses to implement 304 handling :(
|
|
||||||
// A feature-driven way of detecting this would be appreciated
|
|
||||||
// See: http://gist.github.com/599419
|
|
||||||
ok( isOpera, "error" );
|
|
||||||
start();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1076,31 +1056,13 @@ module( "ajax", {
|
|||||||
ifModified: true,
|
ifModified: true,
|
||||||
cache: cache,
|
cache: cache,
|
||||||
success: function( data, status ) {
|
success: function( data, status ) {
|
||||||
if ( data === "FAIL" ) {
|
|
||||||
ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-None-Match')." );
|
|
||||||
ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-None-Match')." );
|
|
||||||
} else {
|
|
||||||
strictEqual( status, "notmodified" );
|
strictEqual( status, "notmodified" );
|
||||||
ok( data == null, "response body should be empty" );
|
ok( data == null, "response body should be empty" );
|
||||||
}
|
|
||||||
start();
|
|
||||||
},
|
},
|
||||||
error: function() {
|
complete: function() {
|
||||||
// Do this because opera simply refuses to implement 304 handling :(
|
|
||||||
// A feature-driven way of detecting this would be appreciated
|
|
||||||
// See: http://gist.github.com/599419
|
|
||||||
ok( isOpera, "error" );
|
|
||||||
ok( isOpera, "error" );
|
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
error: function() {
|
|
||||||
// Do this because opera simply refuses to implement 304 handling :(
|
|
||||||
// A feature-driven way of detecting this would be appreciated
|
|
||||||
// See: http://gist.github.com/599419
|
|
||||||
ok( isOpera, "error" );
|
|
||||||
start();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -46,10 +46,6 @@ test( "jQuery.propFix integrity test", function() {
|
|||||||
"contenteditable": "contentEditable"
|
"contenteditable": "contentEditable"
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( !jQuery.support.enctype ) {
|
|
||||||
props.enctype = "encoding";
|
|
||||||
}
|
|
||||||
|
|
||||||
deepEqual( props, jQuery.propFix, "jQuery.propFix passes integrity check" );
|
deepEqual( props, jQuery.propFix, "jQuery.propFix passes integrity check" );
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -594,8 +590,7 @@ test( "removeAttr(String)", function() {
|
|||||||
$first = jQuery("<div Case='mixed'></div>");
|
$first = jQuery("<div Case='mixed'></div>");
|
||||||
equal( $first.attr("Case"), "mixed", "case of attribute doesn't matter" );
|
equal( $first.attr("Case"), "mixed", "case of attribute doesn't matter" );
|
||||||
$first.removeAttr("Case");
|
$first.removeAttr("Case");
|
||||||
// IE 6/7 return empty string here, not undefined
|
equal( $first.attr("Case"), undefined, "mixed-case attribute was removed" );
|
||||||
ok( !$first.attr("Case"), "mixed-case attribute was removed" );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "removeAttr(String) in XML", function() {
|
test( "removeAttr(String) in XML", function() {
|
||||||
|
@ -231,8 +231,6 @@ test("css(String, Object)", function() {
|
|||||||
j = jQuery("#nonnodes").contents();
|
j = jQuery("#nonnodes").contents();
|
||||||
j.css("overflow", "visible");
|
j.css("overflow", "visible");
|
||||||
equal( j.css("overflow"), "visible", "Check node,textnode,comment css works" );
|
equal( j.css("overflow"), "visible", "Check node,textnode,comment css works" );
|
||||||
// opera sometimes doesn't update 'display' correctly, see #2037
|
|
||||||
jQuery("#t2037")[0].innerHTML = jQuery("#t2037")[0].innerHTML;
|
|
||||||
equal( jQuery("#t2037 .hidden").css("display"), "none", "Make sure browser thinks it is hidden" );
|
equal( jQuery("#t2037 .hidden").css("display"), "none", "Make sure browser thinks it is hidden" );
|
||||||
|
|
||||||
div = jQuery("#nothiddendiv");
|
div = jQuery("#nothiddendiv");
|
||||||
@ -297,11 +295,7 @@ if ( !jQuery.support.opacity ) {
|
|||||||
test2 = test.find( "div" ).css( "opacity", 1 );
|
test2 = test.find( "div" ).css( "opacity", 1 );
|
||||||
|
|
||||||
function hasFilter( elem ) {
|
function hasFilter( elem ) {
|
||||||
var match = rfilter.exec( elem[0].style.cssText );
|
return !!rfilter.exec( elem[0].style.cssText );
|
||||||
if ( match ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
expect( 2 );
|
expect( 2 );
|
||||||
ok( !hasFilter( test ), "Removed filter attribute on element without filter in stylesheet" );
|
ok( !hasFilter( test ), "Removed filter attribute on element without filter in stylesheet" );
|
||||||
@ -455,7 +449,7 @@ test("show();", function() {
|
|||||||
|
|
||||||
expect( 18 );
|
expect( 18 );
|
||||||
|
|
||||||
var hiddendiv, div, pass, old, test;
|
var hiddendiv, div, pass, test;
|
||||||
hiddendiv = jQuery("div.hidden");
|
hiddendiv = jQuery("div.hidden");
|
||||||
|
|
||||||
equal(jQuery.css( hiddendiv[0], "display"), "none", "hiddendiv is display: none");
|
equal(jQuery.css( hiddendiv[0], "display"), "none", "hiddendiv is display: none");
|
||||||
@ -478,10 +472,7 @@ test("show();", function() {
|
|||||||
ok( pass, "Show" );
|
ok( pass, "Show" );
|
||||||
|
|
||||||
// #show-tests * is set display: none in CSS
|
// #show-tests * is set display: none in CSS
|
||||||
jQuery("#qunit-fixture").append("<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div><table id='test-table'></table>");
|
jQuery("#qunit-fixture").append("<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>");
|
||||||
|
|
||||||
old = jQuery("#test-table").show().css("display") !== "table";
|
|
||||||
jQuery("#test-table").remove();
|
|
||||||
|
|
||||||
test = {
|
test = {
|
||||||
"div" : "block",
|
"div" : "block",
|
||||||
@ -490,14 +481,14 @@ test("show();", function() {
|
|||||||
"code" : "inline",
|
"code" : "inline",
|
||||||
"pre" : "block",
|
"pre" : "block",
|
||||||
"span" : "inline",
|
"span" : "inline",
|
||||||
"table" : old ? "block" : "table",
|
"table" : "table",
|
||||||
"thead" : old ? "block" : "table-header-group",
|
"thead" : "table-header-group",
|
||||||
"tbody" : old ? "block" : "table-row-group",
|
"tbody" : "table-row-group",
|
||||||
"tr" : old ? "block" : "table-row",
|
"tr" : "table-row",
|
||||||
"th" : old ? "block" : "table-cell",
|
"th" : "table-cell",
|
||||||
"td" : old ? "block" : "table-cell",
|
"td" : "table-cell",
|
||||||
"ul" : "block",
|
"ul" : "block",
|
||||||
"li" : old ? "block" : "list-item"
|
"li" : "list-item"
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery.each(test, function(selector, expected) {
|
jQuery.each(test, function(selector, expected) {
|
||||||
@ -848,8 +839,8 @@ test("Do not append px (#9548, #12990)", function() {
|
|||||||
test("css('width') and css('height') should respect box-sizing, see #11004", function() {
|
test("css('width') and css('height') should respect box-sizing, see #11004", function() {
|
||||||
expect( 4 );
|
expect( 4 );
|
||||||
|
|
||||||
// Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
|
// Support: Android 2.3 (-webkit-box-sizing).
|
||||||
var el_dis = jQuery("<div style='width:300px;height:300px;margin:2px;padding:2px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>"),
|
var el_dis = jQuery("<div style='width:300px;height:300px;margin:2px;padding:2px;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>"),
|
||||||
el = el_dis.clone().appendTo("#qunit-fixture");
|
el = el_dis.clone().appendTo("#qunit-fixture");
|
||||||
|
|
||||||
equal( el.css("width"), el.css("width", el.css("width")).css("width"), "css('width') is not respecting box-sizing, see #11004");
|
equal( el.css("width"), el.css("width", el.css("width")).css("width"), "css('width') is not respecting box-sizing, see #11004");
|
||||||
@ -930,13 +921,13 @@ test( "css opacity consistency across browsers (#12685)", function() {
|
|||||||
fixture = jQuery("#qunit-fixture");
|
fixture = jQuery("#qunit-fixture");
|
||||||
|
|
||||||
// Append style element
|
// Append style element
|
||||||
jQuery("<style>.opacityWithSpaces_t12685 { opacity: 0.1; filter: alpha(opacity = 10); } .opacityNoSpaces_t12685 { opacity: 0.2; filter: alpha(opacity=20); }</style>").appendTo( fixture );
|
jQuery("<style>.opacityWithSpaces_t12685 { opacity: 0.1; -ms-filter: 'alpha(opacity = 10)'; } .opacityNoSpaces_t12685 { opacity: 0.2; -ms-filter: 'alpha(opacity=20)'; }</style>").appendTo( fixture );
|
||||||
|
|
||||||
el = jQuery("<div class='opacityWithSpaces_t12685'></div>").appendTo(fixture);
|
el = jQuery("<div class='opacityWithSpaces_t12685'></div>").appendTo(fixture);
|
||||||
|
|
||||||
equal( Math.round( el.css("opacity") * 100 ), 10, "opacity from style sheet (filter:alpha with spaces)" );
|
equal( Math.round( el.css("opacity") * 100 ), 10, "opacity from style sheet (-ms-filter:alpha with spaces)" );
|
||||||
el.removeClass("opacityWithSpaces_t12685").addClass("opacityNoSpaces_t12685");
|
el.removeClass("opacityWithSpaces_t12685").addClass("opacityNoSpaces_t12685");
|
||||||
equal( Math.round( el.css("opacity") * 100 ), 20, "opacity from style sheet (filter:alpha without spaces)" );
|
equal( Math.round( el.css("opacity") * 100 ), 20, "opacity from style sheet (-ms-filter:alpha without spaces)" );
|
||||||
el.css( "opacity", 0.3 );
|
el.css( "opacity", 0.3 );
|
||||||
equal( Math.round( el.css("opacity") * 100 ), 30, "override opacity" );
|
equal( Math.round( el.css("opacity") * 100 ), 30, "override opacity" );
|
||||||
el.css( "opacity", "" );
|
el.css( "opacity", "" );
|
||||||
|
@ -415,8 +415,8 @@ test( "getters on non elements should return null", function() {
|
|||||||
test("setters with and without box-sizing:border-box", function(){
|
test("setters with and without box-sizing:border-box", function(){
|
||||||
expect(20);
|
expect(20);
|
||||||
|
|
||||||
// Support: Firefox<29, Android 2.3 (Prefixed box-sizing versions).
|
// Support: Android 2.3 (-webkit-box-sizing).
|
||||||
var el_bb = jQuery("<div style='width:114px;height:114px;margin:5px;padding:3px;border:4px solid white;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>").appendTo("#qunit-fixture"),
|
var el_bb = jQuery("<div style='width:114px;height:114px;margin:5px;padding:3px;border:4px solid white;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>").appendTo("#qunit-fixture"),
|
||||||
el = jQuery("<div style='width:100px;height:100px;margin:5px;padding:3px;border:4px solid white;'>test</div>").appendTo("#qunit-fixture"),
|
el = jQuery("<div style='width:100px;height:100px;margin:5px;padding:3px;border:4px solid white;'>test</div>").appendTo("#qunit-fixture"),
|
||||||
expected = 100;
|
expected = 100;
|
||||||
|
|
||||||
|
123
test/unit/effects.js
vendored
123
test/unit/effects.js
vendored
@ -47,7 +47,7 @@ test("show() basic", 2, function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("show()", 27, function () {
|
test("show()", 27, function () {
|
||||||
var div, speeds, old, test,
|
var div, speeds, test,
|
||||||
displaysActual, displaysExpected,
|
displaysActual, displaysExpected,
|
||||||
hiddendiv = jQuery("div.hidden");
|
hiddendiv = jQuery("div.hidden");
|
||||||
|
|
||||||
@ -97,10 +97,7 @@ test("show()", 27, function () {
|
|||||||
QUnit.expectJqData( this, div, "olddisplay" );
|
QUnit.expectJqData( this, div, "olddisplay" );
|
||||||
|
|
||||||
// #show-tests * is set display: none in CSS
|
// #show-tests * is set display: none in CSS
|
||||||
jQuery("#qunit-fixture").append("<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div><table id='test-table'></table>");
|
jQuery("#qunit-fixture").append("<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>");
|
||||||
|
|
||||||
old = jQuery("#test-table").show().css("display") !== "table";
|
|
||||||
jQuery("#test-table").remove();
|
|
||||||
|
|
||||||
test = {
|
test = {
|
||||||
"div" : "block",
|
"div" : "block",
|
||||||
@ -109,14 +106,14 @@ test("show()", 27, function () {
|
|||||||
"code" : "inline",
|
"code" : "inline",
|
||||||
"pre" : "block",
|
"pre" : "block",
|
||||||
"span" : "inline",
|
"span" : "inline",
|
||||||
"table" : old ? "block" : "table",
|
"table" : "table",
|
||||||
"thead" : old ? "block" : "table-header-group",
|
"thead" : "table-header-group",
|
||||||
"tbody" : old ? "block" : "table-row-group",
|
"tbody" : "table-row-group",
|
||||||
"tr" : old ? "block" : "table-row",
|
"tr" : "table-row",
|
||||||
"th" : old ? "block" : "table-cell",
|
"th" : "table-cell",
|
||||||
"td" : old ? "block" : "table-cell",
|
"td" : "table-cell",
|
||||||
"ul" : "block",
|
"ul" : "block",
|
||||||
"li" : old ? "block" : "list-item"
|
"li" : "list-item"
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery.each(test, function(selector, expected) {
|
jQuery.each(test, function(selector, expected) {
|
||||||
@ -136,31 +133,27 @@ test("show(Number) - other displays", function() {
|
|||||||
|
|
||||||
|
|
||||||
// #show-tests * is set display: none in CSS
|
// #show-tests * is set display: none in CSS
|
||||||
jQuery("#qunit-fixture").append("<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div><table id='test-table'></table>");
|
jQuery("#qunit-fixture").append("<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div>");
|
||||||
|
|
||||||
var test,
|
|
||||||
old = jQuery("#test-table").show().css("display") !== "table";
|
|
||||||
jQuery("#test-table").remove();
|
|
||||||
|
|
||||||
// Note: inline elements are expected to be inline-block
|
// Note: inline elements are expected to be inline-block
|
||||||
// because we're showing width/height
|
// because we're showing width/height
|
||||||
// Can't animate width/height inline
|
// Can't animate width/height inline
|
||||||
// See #14344
|
// See #14344
|
||||||
test = {
|
var test = {
|
||||||
"div" : "block",
|
"div" : "block",
|
||||||
"p" : "block",
|
"p" : "block",
|
||||||
"a" : "inline-block",
|
"a" : "inline-block",
|
||||||
"code" : "inline-block",
|
"code" : "inline-block",
|
||||||
"pre" : "block",
|
"pre" : "block",
|
||||||
"span" : "inline-block",
|
"span" : "inline-block",
|
||||||
"table" : old ? "block" : "table",
|
"table" : "table",
|
||||||
"thead" : old ? "block" : "table-header-group",
|
"thead" : "table-header-group",
|
||||||
"tbody" : old ? "block" : "table-row-group",
|
"tbody" : "table-row-group",
|
||||||
"tr" : old ? "block" : "table-row",
|
"tr" : "table-row",
|
||||||
"th" : old ? "block" : "table-cell",
|
"th" : "table-cell",
|
||||||
"td" : old ? "block" : "table-cell",
|
"td" : "table-cell",
|
||||||
"ul" : "block",
|
"ul" : "block",
|
||||||
"li" : old ? "block" : "list-item"
|
"li" : "list-item"
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery.each(test, function(selector, expected) {
|
jQuery.each(test, function(selector, expected) {
|
||||||
@ -289,37 +282,26 @@ test("animate negative padding", function() {
|
|||||||
test("animate block as inline width/height", function() {
|
test("animate block as inline width/height", function() {
|
||||||
expect(3);
|
expect(3);
|
||||||
|
|
||||||
var span = jQuery("<span>").css("display", "inline-block").appendTo("body"),
|
var span = jQuery("<span>").css("display", "inline-block").appendTo("body");
|
||||||
expected = span.css("display");
|
|
||||||
|
|
||||||
span.remove();
|
span.remove();
|
||||||
|
|
||||||
if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) {
|
|
||||||
|
|
||||||
jQuery("#foo").css({ display: "inline", width: "", height: "" }).animate({ width: 42, height: 42 }, 100, function() {
|
jQuery("#foo").css({ display: "inline", width: "", height: "" }).animate({ width: 42, height: 42 }, 100, function() {
|
||||||
equal( jQuery(this).css("display"), jQuery.support.inlineBlockNeedsLayout ? "inline" : "inline-block", "inline-block was set on non-floated inline element when animating width/height" );
|
equal( jQuery(this).css("display"), "inline-block", "inline-block was set on non-floated inline element when animating width/height" );
|
||||||
equal( this.offsetWidth, 42, "width was animated" );
|
equal( this.offsetWidth, 42, "width was animated" );
|
||||||
equal( this.offsetHeight, 42, "height was animated" );
|
equal( this.offsetHeight, 42, "height was animated" );
|
||||||
});
|
});
|
||||||
|
|
||||||
// Browser doesn't support inline-block
|
|
||||||
} else {
|
|
||||||
ok( true, "Browser doesn't support inline-block" );
|
|
||||||
ok( true, "Browser doesn't support inline-block" );
|
|
||||||
ok( true, "Browser doesn't support inline-block" );
|
|
||||||
}
|
|
||||||
this.clock.tick( 100 );
|
this.clock.tick( 100 );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("animate native inline width/height", function() {
|
test("animate native inline width/height", function() {
|
||||||
expect(3);
|
expect(3);
|
||||||
|
|
||||||
var span = jQuery("<span>").css("display", "inline-block").appendTo("body"),
|
var span = jQuery("<span>").css("display", "inline-block").appendTo("body");
|
||||||
expected = span.css("display");
|
|
||||||
|
|
||||||
span.remove();
|
span.remove();
|
||||||
|
|
||||||
if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) {
|
|
||||||
jQuery("#foo").css({ display: "", width: "", height: "" })
|
jQuery("#foo").css({ display: "", width: "", height: "" })
|
||||||
.append("<span>text</span>")
|
.append("<span>text</span>")
|
||||||
.children("span")
|
.children("span")
|
||||||
@ -329,12 +311,6 @@ test("animate native inline width/height", function() {
|
|||||||
equal( this.offsetHeight, 42, "height was animated" );
|
equal( this.offsetHeight, 42, "height was animated" );
|
||||||
});
|
});
|
||||||
|
|
||||||
// Browser doesn't support inline-block
|
|
||||||
} else {
|
|
||||||
ok( true, "Browser doesn't support inline-block" );
|
|
||||||
ok( true, "Browser doesn't support inline-block" );
|
|
||||||
ok( true, "Browser doesn't support inline-block" );
|
|
||||||
}
|
|
||||||
this.clock.tick( 100 );
|
this.clock.tick( 100 );
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -365,30 +341,24 @@ test( "animate block width/height", function() {
|
|||||||
this.clock.tick( 100 );
|
this.clock.tick( 100 );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("animate table width/height", function() {
|
test( "animate table width/height", function() {
|
||||||
expect(1);
|
expect(1);
|
||||||
|
|
||||||
var displayMode = jQuery("#table").css("display") !== "table" ? "block" : "table";
|
jQuery( "#table" ).animate({ width: 42, height: 42 }, 100, function() {
|
||||||
|
equal( jQuery( this ).css( "display" ), "table", "display mode is correct" );
|
||||||
jQuery("#table").animate({ width: 42, height: 42 }, 100, function() {
|
|
||||||
equal( jQuery(this).css("display"), displayMode, "display mode is correct" );
|
|
||||||
});
|
});
|
||||||
this.clock.tick( 100 );
|
this.clock.tick( 100 );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("animate table-row width/height", function() {
|
test("animate table-row width/height", function() {
|
||||||
expect(3);
|
expect(3);
|
||||||
var displayMode,
|
var tr = jQuery("#table")
|
||||||
tr = jQuery("#table")
|
|
||||||
.attr({ "cellspacing": 0, "cellpadding": 0, "border": 0 })
|
.attr({ "cellspacing": 0, "cellpadding": 0, "border": 0 })
|
||||||
.html("<tr style='height:42px;'><td style='padding:0;'><div style='width:20px;height:20px;'></div></td></tr>")
|
.html("<tr style='height:42px;'><td style='padding:0;'><div style='width:20px;height:20px;'></div></td></tr>")
|
||||||
.find("tr");
|
.find("tr");
|
||||||
|
|
||||||
// IE<8 uses "block" instead of the correct display type
|
|
||||||
displayMode = tr.css("display") !== "table-row" ? "block" : "table-row";
|
|
||||||
|
|
||||||
tr.animate({ width: 10, height: 10 }, 100, function() {
|
tr.animate({ width: 10, height: 10 }, 100, function() {
|
||||||
equal( jQuery(this).css("display"), displayMode, "display mode is correct" );
|
equal( jQuery( this ).css( "display" ), "table-row", "display mode is correct" );
|
||||||
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
|
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
|
||||||
equal( this.offsetHeight, 20, "height animated to shrink wrap point" );
|
equal( this.offsetHeight, 20, "height animated to shrink wrap point" );
|
||||||
});
|
});
|
||||||
@ -398,17 +368,13 @@ test("animate table-row width/height", function() {
|
|||||||
test("animate table-cell width/height", function() {
|
test("animate table-cell width/height", function() {
|
||||||
expect(3);
|
expect(3);
|
||||||
|
|
||||||
var displayMode,
|
var td = jQuery( "#table" )
|
||||||
td = jQuery( "#table" )
|
|
||||||
.attr({ "cellspacing": 0, "cellpadding": 0, "border": 0 })
|
.attr({ "cellspacing": 0, "cellpadding": 0, "border": 0 })
|
||||||
.html( "<tr><td style='width:42px;height:42px;padding:0;'><div style='width:20px;height:20px;'></div></td></tr>" )
|
.html( "<tr><td style='width:42px;height:42px;padding:0;'><div style='width:20px;height:20px;'></div></td></tr>" )
|
||||||
.find( "td" );
|
.find( "td" );
|
||||||
|
|
||||||
// IE<8 uses "block" instead of the correct display type
|
|
||||||
displayMode = td.css( "display" ) !== "table-cell" ? "block" : "table-cell";
|
|
||||||
|
|
||||||
td.animate({ width: 10, height: 10 }, 100, function() {
|
td.animate({ width: 10, height: 10 }, 100, function() {
|
||||||
equal( jQuery(this).css("display"), displayMode, "display mode is correct" );
|
equal( jQuery( this ).css( "display" ), "table-cell", "display mode is correct" );
|
||||||
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
|
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
|
||||||
equal( this.offsetHeight, 20, "height animated to shrink wrap point" );
|
equal( this.offsetHeight, 20, "height animated to shrink wrap point" );
|
||||||
});
|
});
|
||||||
@ -1050,11 +1016,10 @@ jQuery.each({
|
|||||||
|
|
||||||
test("Effects chaining", function() {
|
test("Effects chaining", function() {
|
||||||
var remaining = 16,
|
var remaining = 16,
|
||||||
shrinkwrap = jQuery.support.shrinkWrapBlocks(),
|
|
||||||
props = [ "opacity", "height", "width", "display", "overflow" ],
|
props = [ "opacity", "height", "width", "display", "overflow" ],
|
||||||
setup = function( name, selector, hiddenOverflow ) {
|
setup = function( name, selector ) {
|
||||||
var $el = jQuery( selector );
|
var $el = jQuery( selector );
|
||||||
return $el.data( getProps( $el[0], hiddenOverflow ) ).data( "name", name );
|
return $el.data( getProps( $el[0] ) ).data( "name", name );
|
||||||
},
|
},
|
||||||
assert = function() {
|
assert = function() {
|
||||||
var data = jQuery.data( this ),
|
var data = jQuery.data( this ),
|
||||||
@ -1075,21 +1040,19 @@ test("Effects chaining", function() {
|
|||||||
|
|
||||||
expect( remaining );
|
expect( remaining );
|
||||||
|
|
||||||
// We need to pass jQuery.support.shrinkWrapBlocks for all methods that
|
|
||||||
// set overflow hidden (slide* and show/hide with speed)
|
|
||||||
setup( ".fadeOut().fadeIn()", "#fadein div" ).fadeOut("fast").fadeIn( "fast", assert );
|
setup( ".fadeOut().fadeIn()", "#fadein div" ).fadeOut("fast").fadeIn( "fast", assert );
|
||||||
setup( ".fadeIn().fadeOut()", "#fadeout div" ).fadeIn("fast").fadeOut( "fast", assert );
|
setup( ".fadeIn().fadeOut()", "#fadeout div" ).fadeIn("fast").fadeOut( "fast", assert );
|
||||||
setup( ".hide().show()", "#show div", shrinkwrap ).hide("fast").show( "fast", assert );
|
setup( ".hide().show()", "#show div" ).hide("fast").show( "fast", assert );
|
||||||
setup( ".show().hide()", "#hide div", shrinkwrap ).show("fast").hide( "fast", assert );
|
setup( ".show().hide()", "#hide div" ).show("fast").hide( "fast", assert );
|
||||||
setup( ".show().hide(easing)", "#easehide div", shrinkwrap ).show("fast").hide( "fast", "linear", assert );
|
setup( ".show().hide(easing)", "#easehide div" ).show("fast").hide( "fast", "linear", assert );
|
||||||
setup( ".toggle().toggle() - in", "#togglein div", shrinkwrap ).toggle("fast").toggle( "fast", assert );
|
setup( ".toggle().toggle() - in", "#togglein div" ).toggle("fast").toggle( "fast", assert );
|
||||||
setup( ".toggle().toggle() - out", "#toggleout div", shrinkwrap ).toggle("fast").toggle( "fast", assert );
|
setup( ".toggle().toggle() - out", "#toggleout div" ).toggle("fast").toggle( "fast", assert );
|
||||||
setup( ".toggle().toggle(easing) - out", "#easetoggleout div", shrinkwrap ).toggle("fast").toggle( "fast", "linear", assert );
|
setup( ".toggle().toggle(easing) - out", "#easetoggleout div" ).toggle("fast").toggle( "fast", "linear", assert );
|
||||||
setup( ".slideDown().slideUp()", "#slidedown div", shrinkwrap ).slideDown("fast").slideUp( "fast", assert );
|
setup( ".slideDown().slideUp()", "#slidedown div" ).slideDown("fast").slideUp( "fast", assert );
|
||||||
setup( ".slideUp().slideDown()", "#slideup div", shrinkwrap ).slideUp("fast").slideDown( "fast", assert );
|
setup( ".slideUp().slideDown()", "#slideup div" ).slideUp("fast").slideDown( "fast", assert );
|
||||||
setup( ".slideUp().slideDown(easing)", "#easeslideup div", shrinkwrap ).slideUp("fast").slideDown( "fast", "linear", assert );
|
setup( ".slideUp().slideDown(easing)", "#easeslideup div" ).slideUp("fast").slideDown( "fast", "linear", assert );
|
||||||
setup( ".slideToggle().slideToggle() - in", "#slidetogglein div", shrinkwrap ).slideToggle("fast").slideToggle( "fast", assert );
|
setup( ".slideToggle().slideToggle() - in", "#slidetogglein div" ).slideToggle("fast").slideToggle( "fast", assert );
|
||||||
setup( ".slideToggle().slideToggle() - out", "#slidetoggleout div", shrinkwrap ).slideToggle("fast").slideToggle( "fast", assert );
|
setup( ".slideToggle().slideToggle() - out", "#slidetoggleout div" ).slideToggle("fast").slideToggle( "fast", assert );
|
||||||
setup( ".fadeToggle().fadeToggle() - in", "#fadetogglein div" ).fadeToggle("fast").fadeToggle( "fast", assert );
|
setup( ".fadeToggle().fadeToggle() - in", "#fadetogglein div" ).fadeToggle("fast").fadeToggle( "fast", assert );
|
||||||
setup( ".fadeToggle().fadeToggle() - out", "#fadetoggleout div" ).fadeToggle("fast").fadeToggle( "fast", assert );
|
setup( ".fadeToggle().fadeToggle() - out", "#fadetoggleout div" ).fadeToggle("fast").fadeToggle( "fast", assert );
|
||||||
setup( ".fadeTo(0.5).fadeTo(1.0, easing)", "#fadeto div" ).fadeTo( "fast", 0.5 ).fadeTo( "fast", 1.0, "linear", assert );
|
setup( ".fadeTo(0.5).fadeTo(1.0, easing)", "#fadeto div" ).fadeTo( "fast", 0.5 ).fadeTo( "fast", 1.0, "linear", assert );
|
||||||
@ -1912,12 +1875,8 @@ test( "Animate properly sets overflow hidden when animating width/height (#12117
|
|||||||
equal( div.css( "overflow" ), "hidden",
|
equal( div.css( "overflow" ), "hidden",
|
||||||
"overflow: hidden set when animating " + prop + " to " + value );
|
"overflow: hidden set when animating " + prop + " to " + value );
|
||||||
div.stop();
|
div.stop();
|
||||||
if ( jQuery.support.shrinkWrapBlocks ) {
|
|
||||||
ok( true, "cannot restore overflow, shrinkWrapBlocks" );
|
|
||||||
} else {
|
|
||||||
equal( div.css( "overflow" ), "auto",
|
equal( div.css( "overflow" ), "auto",
|
||||||
"overflow: auto restored after animating " + prop + " to " + value );
|
"overflow: auto restored after animating " + prop + " to " + value );
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -408,15 +408,7 @@ test("on bubbling, isDefaultPrevented, stopImmediatePropagation", function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
$main.on("click", "#foo", function(e) {
|
$main.on("click", "#foo", function(e) {
|
||||||
var orig = e.originalEvent;
|
|
||||||
|
|
||||||
if ( typeof(orig.defaultPrevented) === "boolean" || typeof(orig.returnValue) === "boolean" || orig["getPreventDefault"] ) {
|
|
||||||
equal( e.isDefaultPrevented(), true, "isDefaultPrevented true passed to bubbled event" );
|
equal( e.isDefaultPrevented(), true, "isDefaultPrevented true passed to bubbled event" );
|
||||||
|
|
||||||
} else {
|
|
||||||
// Opera < 11 doesn't implement any interface we can use, so give it a pass
|
|
||||||
ok( true, "isDefaultPrevented not supported by this browser, test skipped" );
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
fakeClick( $anchor2 );
|
fakeClick( $anchor2 );
|
||||||
$anchor2.off( "click" );
|
$anchor2.off( "click" );
|
||||||
@ -1432,7 +1424,7 @@ test("Submit event can be stopped (#11049)", function() {
|
|||||||
form.remove();
|
form.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Test beforeunload event only if it supported (i.e. not Opera)
|
// Test beforeunload event only if it supported.
|
||||||
// Support: iOS 7+, Android<4.0
|
// Support: iOS 7+, Android<4.0
|
||||||
// iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
|
// iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
|
||||||
// handler making it impossible to feature-detect the support.
|
// handler making it impossible to feature-detect the support.
|
||||||
@ -1440,7 +1432,6 @@ if ( window.onbeforeunload === null &&
|
|||||||
!/(ipad|iphone|ipod|android 2\.3)/i.test( navigator.userAgent ) ) {
|
!/(ipad|iphone|ipod|android 2\.3)/i.test( navigator.userAgent ) ) {
|
||||||
asyncTest("on(beforeunload)", 4, function() {
|
asyncTest("on(beforeunload)", 4, function() {
|
||||||
var win,
|
var win,
|
||||||
forIE6 = 0,
|
|
||||||
fired = false,
|
fired = false,
|
||||||
iframe = jQuery("<iframe src='data/iframe.html' />");
|
iframe = jQuery("<iframe src='data/iframe.html' />");
|
||||||
|
|
||||||
@ -1454,33 +1445,7 @@ if ( window.onbeforeunload === null &&
|
|||||||
|
|
||||||
strictEqual( win.onbeforeunload, null, "onbeforeunload property on window object still equals null" );
|
strictEqual( win.onbeforeunload, null, "onbeforeunload property on window object still equals null" );
|
||||||
|
|
||||||
// In old Safari beforeunload event will not fire on iframes
|
|
||||||
jQuery( win ).on( "unload", function() {
|
|
||||||
if ( !fired ) {
|
|
||||||
ok( true, "This is suppose to be true only in old Safari" );
|
|
||||||
checker();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery( win ).on( "beforeunload", function() {
|
|
||||||
|
|
||||||
// On iframe in IE6 beforeunload event will not fire if event is binded through window object,
|
|
||||||
// nevertheless, test should continue
|
|
||||||
window.setTimeout(function() {
|
|
||||||
if ( !forIE6 ) {
|
|
||||||
checker();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
win.onbeforeunload = function() {
|
win.onbeforeunload = function() {
|
||||||
if ( !forIE6 ) {
|
|
||||||
forIE6++;
|
|
||||||
checker();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function checker() {
|
|
||||||
ok( true, "window.onbeforeunload handler is called" );
|
ok( true, "window.onbeforeunload handler is called" );
|
||||||
iframe = jQuery("<iframe src='data/iframe.html' />");
|
iframe = jQuery("<iframe src='data/iframe.html' />");
|
||||||
|
|
||||||
@ -1503,7 +1468,7 @@ if ( window.onbeforeunload === null &&
|
|||||||
|
|
||||||
win.location.reload();
|
win.location.reload();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
win.location.reload();
|
win.location.reload();
|
||||||
});
|
});
|
||||||
@ -2519,7 +2484,6 @@ testIframeWithCallback( "focusin from an iframe", "event/focusinCrossFrame.html"
|
|||||||
|
|
||||||
var input = jQuery( frameDoc ).find( "#frame-input" );
|
var input = jQuery( frameDoc ).find( "#frame-input" );
|
||||||
|
|
||||||
if ( input.length ) {
|
|
||||||
// Create a focusin handler on the parent; shouldn't affect the iframe's fate
|
// Create a focusin handler on the parent; shouldn't affect the iframe's fate
|
||||||
jQuery ( "body" ).on( "focusin.iframeTest", function() {
|
jQuery ( "body" ).on( "focusin.iframeTest", function() {
|
||||||
ok( false, "fired a focusin event in the parent document" );
|
ok( false, "fired a focusin event in the parent document" );
|
||||||
@ -2540,11 +2504,6 @@ testIframeWithCallback( "focusin from an iframe", "event/focusinCrossFrame.html"
|
|||||||
|
|
||||||
// Remove body handler manually since it's outside the fixture
|
// Remove body handler manually since it's outside the fixture
|
||||||
jQuery( "body" ).off( "focusin.iframeTest" );
|
jQuery( "body" ).off( "focusin.iframeTest" );
|
||||||
|
|
||||||
} else {
|
|
||||||
// Opera 12 (pre-Blink) doesn't select anything
|
|
||||||
ok( true, "SOFTFAIL: no focus event fired in the iframe" );
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testIframeWithCallback( "jQuery.ready promise", "event/promiseReady.html", function( isOk ) {
|
testIframeWithCallback( "jQuery.ready promise", "event/promiseReady.html", function( isOk ) {
|
||||||
@ -2749,7 +2708,8 @@ if ( !(/firefox/i.test( window.navigator.userAgent )) ) {
|
|||||||
$text = jQuery("#text1"),
|
$text = jQuery("#text1"),
|
||||||
$radio = jQuery("#radio1").trigger("focus");
|
$radio = jQuery("#radio1").trigger("focus");
|
||||||
|
|
||||||
// IE6-10 fire focus/blur events asynchronously; this is the resulting mess.
|
// Support: IE<11
|
||||||
|
// IE8-10 fire focus/blur events asynchronously; this is the resulting mess.
|
||||||
// IE's browser window must be topmost for this to work properly!!
|
// IE's browser window must be topmost for this to work properly!!
|
||||||
stop();
|
stop();
|
||||||
$radio[0].focus();
|
$radio[0].focus();
|
||||||
|
@ -77,8 +77,7 @@ function testText( valueObj ) {
|
|||||||
equal( jQuery( j[ 0 ] ).text(), "hi!", "Check node,textnode,comment with text()" );
|
equal( jQuery( j[ 0 ] ).text(), "hi!", "Check node,textnode,comment with text()" );
|
||||||
equal( j[ 1 ].nodeValue, " there ", "Check node,textnode,comment with text()" );
|
equal( j[ 1 ].nodeValue, " there ", "Check node,textnode,comment with text()" );
|
||||||
|
|
||||||
// Blackberry 4.6 doesn't maintain comments in the DOM
|
equal( j[ 2 ].nodeType, 8, "Check node,textnode,comment with text()" );
|
||||||
equal( jQuery("#nonnodes")[ 0 ].childNodes.length < 3 ? 8 : j[ 2 ].nodeType, 8, "Check node,textnode,comment with text()" );
|
|
||||||
|
|
||||||
// Update multiple elements #11809
|
// Update multiple elements #11809
|
||||||
expected = "New";
|
expected = "New";
|
||||||
|
@ -182,16 +182,13 @@ testIframe("offset/absolute", "absolute", function( $ ) {
|
|||||||
testIframe("offset/relative", "relative", function( $ ) {
|
testIframe("offset/relative", "relative", function( $ ) {
|
||||||
expect(60);
|
expect(60);
|
||||||
|
|
||||||
var ie, tests;
|
var tests;
|
||||||
|
|
||||||
// IE is collapsing the top margin of 1px; detect and adjust accordingly
|
|
||||||
ie = $("#relative-1").offset().top === 6;
|
|
||||||
|
|
||||||
// get offset
|
// get offset
|
||||||
tests = [
|
tests = [
|
||||||
{ "id": "#relative-1", "top": ie ? 6 : 7, "left": 7 },
|
{ "id": "#relative-1", "top": 7, "left": 7 },
|
||||||
{ "id": "#relative-1-1", "top": ie ? 13 : 15, "left": 15 },
|
{ "id": "#relative-1-1", "top": 15, "left": 15 },
|
||||||
{ "id": "#relative-2", "top": ie ? 141 : 142, "left": 27 }
|
{ "id": "#relative-2", "top": 142, "left": 27 }
|
||||||
];
|
];
|
||||||
jQuery.each( tests, function() {
|
jQuery.each( tests, function() {
|
||||||
equal( $( this["id"] ).offset().top, this["top"], "jQuery('" + this["id"] + "').offset().top" );
|
equal( $( this["id"] ).offset().top, this["top"], "jQuery('" + this["id"] + "').offset().top" );
|
||||||
@ -201,9 +198,9 @@ testIframe("offset/relative", "relative", function( $ ) {
|
|||||||
|
|
||||||
// get position
|
// get position
|
||||||
tests = [
|
tests = [
|
||||||
{ "id": "#relative-1", "top": ie ? 5 : 6, "left": 6 },
|
{ "id": "#relative-1", "top": 6, "left": 6 },
|
||||||
{ "id": "#relative-1-1", "top": ie ? 4 : 5, "left": 5 },
|
{ "id": "#relative-1-1", "top": 5, "left": 5 },
|
||||||
{ "id": "#relative-2", "top": ie ? 140 : 141, "left": 26 }
|
{ "id": "#relative-2", "top": 141, "left": 26 }
|
||||||
];
|
];
|
||||||
jQuery.each( tests, function() {
|
jQuery.each( tests, function() {
|
||||||
equal( $( this["id"] ).position().top, this["top"], "jQuery('" + this["id"] + "').position().top" );
|
equal( $( this["id"] ).position().top, this["top"], "jQuery('" + this["id"] + "').position().top" );
|
||||||
@ -245,17 +242,14 @@ testIframe("offset/relative", "relative", function( $ ) {
|
|||||||
testIframe("offset/static", "static", function( $ ) {
|
testIframe("offset/static", "static", function( $ ) {
|
||||||
expect( 80 );
|
expect( 80 );
|
||||||
|
|
||||||
var ie, tests;
|
var tests;
|
||||||
|
|
||||||
// IE is collapsing the top margin of 1px; detect and adjust accordingly
|
|
||||||
ie = $("#static-1").offset().top === 6;
|
|
||||||
|
|
||||||
// get offset
|
// get offset
|
||||||
tests = [
|
tests = [
|
||||||
{ "id": "#static-1", "top": ie ? 6 : 7, "left": 7 },
|
{ "id": "#static-1", "top": 7, "left": 7 },
|
||||||
{ "id": "#static-1-1", "top": ie ? 13 : 15, "left": 15 },
|
{ "id": "#static-1-1", "top": 15, "left": 15 },
|
||||||
{ "id": "#static-1-1-1", "top": ie ? 20 : 23, "left": 23 },
|
{ "id": "#static-1-1-1", "top": 23, "left": 23 },
|
||||||
{ "id": "#static-2", "top": ie ? 121 : 122, left: 7 }
|
{ "id": "#static-2", "top": 122, left: 7 }
|
||||||
];
|
];
|
||||||
jQuery.each( tests, function() {
|
jQuery.each( tests, function() {
|
||||||
equal( $( this["id"] ).offset().top, this["top"], "jQuery('" + this["id"] + "').offset().top" );
|
equal( $( this["id"] ).offset().top, this["top"], "jQuery('" + this["id"] + "').offset().top" );
|
||||||
@ -265,10 +259,10 @@ testIframe("offset/static", "static", function( $ ) {
|
|||||||
|
|
||||||
// get position
|
// get position
|
||||||
tests = [
|
tests = [
|
||||||
{ "id": "#static-1", "top": ie ? 5 : 6, "left": 6 },
|
{ "id": "#static-1", "top": 6, "left": 6 },
|
||||||
{ "id": "#static-1-1", "top": ie ? 12 : 14, "left": 14 },
|
{ "id": "#static-1-1", "top": 14, "left": 14 },
|
||||||
{ "id": "#static-1-1-1", "top": ie ? 19 : 22, "left": 22 },
|
{ "id": "#static-1-1-1", "top": 22, "left": 22 },
|
||||||
{ "id": "#static-2", "top": ie ? 120 : 121, "left": 6 }
|
{ "id": "#static-2", "top": 121, "left": 6 }
|
||||||
];
|
];
|
||||||
jQuery.each( tests, function() {
|
jQuery.each( tests, function() {
|
||||||
equal( $( this["id"] ).position().top, this["top"], "jQuery('" + this["top"] + "').position().top" );
|
equal( $( this["id"] ).position().top, this["top"], "jQuery('" + this["top"] + "').position().top" );
|
||||||
@ -314,25 +308,22 @@ testIframe("offset/static", "static", function( $ ) {
|
|||||||
testIframe("offset/fixed", "fixed", function( $ ) {
|
testIframe("offset/fixed", "fixed", function( $ ) {
|
||||||
expect(34);
|
expect(34);
|
||||||
|
|
||||||
var ie, tests, $noTopLeft;
|
var tests, $noTopLeft;
|
||||||
|
|
||||||
// IE is collapsing the top margin of 1px; detect and adjust accordingly
|
|
||||||
ie = $("#fixed-1").position().top === 2;
|
|
||||||
|
|
||||||
tests = [
|
tests = [
|
||||||
{
|
{
|
||||||
"id": "#fixed-1",
|
"id": "#fixed-1",
|
||||||
"offsetTop": 1001,
|
"offsetTop": 1001,
|
||||||
"offsetLeft": 1001,
|
"offsetLeft": 1001,
|
||||||
"positionTop": ie ? 2 : 0,
|
"positionTop": 0,
|
||||||
"positionLeft": ie ? 2 : 0
|
"positionLeft": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "#fixed-2",
|
"id": "#fixed-2",
|
||||||
"offsetTop": 1021,
|
"offsetTop": 1021,
|
||||||
"offsetLeft": 1021,
|
"offsetLeft": 1021,
|
||||||
"positionTop": ie ? 22 : 20,
|
"positionTop": 20,
|
||||||
"positionLeft": ie ? 22 : 20
|
"positionLeft": 20
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -415,7 +406,7 @@ testIframe("offset/scroll", "scroll", function( $, win ) {
|
|||||||
expect(24);
|
expect(24);
|
||||||
|
|
||||||
// If we're going to bastardize the tests, let's just DO it
|
// If we're going to bastardize the tests, let's just DO it
|
||||||
var ie = /msie [678]/i.test( navigator.userAgent );
|
var ie = /msie 8/i.test( navigator.userAgent );
|
||||||
|
|
||||||
if ( ie ) {
|
if ( ie ) {
|
||||||
ok( true, "TestSwarm's iframe has hosed this test in oldIE, we surrender" );
|
ok( true, "TestSwarm's iframe has hosed this test in oldIE, we surrender" );
|
||||||
|
@ -272,7 +272,7 @@ test("disconnected nodes - jQuery only", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQuery, window, document ) {
|
testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQuery, window, document ) {
|
||||||
expect( 35 );
|
expect( 37 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of elements with the given IDs
|
* Returns an array of elements with the given IDs
|
||||||
@ -330,10 +330,10 @@ testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQue
|
|||||||
t( "Attribute Exists", "[indeterminate]", []);
|
t( "Attribute Exists", "[indeterminate]", []);
|
||||||
t( "Attribute Exists", "[ismap]", ["img1"]);
|
t( "Attribute Exists", "[ismap]", ["img1"]);
|
||||||
t( "Attribute Exists", "[itemscope]", ["div1"]);
|
t( "Attribute Exists", "[itemscope]", ["div1"]);
|
||||||
// t( "Attribute Exists", "[loop]", ["video1"]); // IE 6/7 cannot differentiate here. loop is also used on img, input, and marquee tags as well as video/audio. getAttributeNode unfortunately also retrieves the property value.
|
t( "Attribute Exists", "[loop]", ["video1"]);
|
||||||
t( "Attribute Exists", "[multiple]", ["select1"]);
|
t( "Attribute Exists", "[multiple]", ["select1"]);
|
||||||
t( "Attribute Exists", "[muted]", ["audio1"]);
|
t( "Attribute Exists", "[muted]", ["audio1"]);
|
||||||
// t( "Attribute Exists", "[nohref]", ["area1"]); // IE 6/7 keep this set to false regardless of presence. The attribute node is not retrievable.
|
t( "Attribute Exists", "[nohref]", ["area1"]);
|
||||||
t( "Attribute Exists", "[noresize]", ["textarea1"]);
|
t( "Attribute Exists", "[noresize]", ["textarea1"]);
|
||||||
t( "Attribute Exists", "[noshade]", ["hr1"]);
|
t( "Attribute Exists", "[noshade]", ["hr1"]);
|
||||||
t( "Attribute Exists", "[nowrap]", ["td1", "div1"]);
|
t( "Attribute Exists", "[nowrap]", ["td1", "div1"]);
|
||||||
|
@ -110,7 +110,7 @@ test("jQuery.param() Constructed prop values", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("serialize()", function() {
|
test("serialize()", function() {
|
||||||
expect(5);
|
expect( 6 );
|
||||||
|
|
||||||
// Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
|
// Add html5 elements only for serialize because selector can't yet find them on non-html5 browsers
|
||||||
jQuery("#search").after(
|
jQuery("#search").after(
|
||||||
@ -139,10 +139,8 @@ 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.
|
|
||||||
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&select5=3&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");
|
||||||
*/
|
|
||||||
jQuery("#html5email, #html5number").remove();
|
jQuery("#html5email, #html5number").remove();
|
||||||
});
|
});
|
||||||
|
@ -20,11 +20,7 @@ var computedSupport = getComputedSupport( jQuery.support );
|
|||||||
test( "zoom of doom (#13089)", function() {
|
test( "zoom of doom (#13089)", function() {
|
||||||
expect( 1 );
|
expect( 1 );
|
||||||
|
|
||||||
if ( computedSupport.inlineBlockNeedsLayout ) {
|
|
||||||
ok( document.body.style.zoom, "Added a zoom to the body (#11048, #12869)" );
|
|
||||||
} else {
|
|
||||||
ok( !document.body.style.zoom, "No zoom added to the body" );
|
ok( !document.body.style.zoom, "No zoom added to the body" );
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if ( jQuery.css ) {
|
if ( jQuery.css ) {
|
||||||
@ -50,11 +46,6 @@ testIframeWithCallback( "A background on the testElement does not cause IE8 to c
|
|||||||
ok( true, "IE8 does not crash" );
|
ok( true, "IE8 does not crash" );
|
||||||
});
|
});
|
||||||
|
|
||||||
testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlocks", "support/shrinkWrapBlocks.html", function( shrinkWrapBlocks ) {
|
|
||||||
expect( 1 );
|
|
||||||
strictEqual( shrinkWrapBlocks, computedSupport.shrinkWrapBlocks, "jQuery.support.shrinkWrapBlocks properties are the same" );
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// This test checkes CSP only for browsers with "Content-Security-Policy" header support
|
// This test checkes CSP only for browsers with "Content-Security-Policy" header support
|
||||||
// i.e. no old WebKit or old Firefox
|
// i.e. no old WebKit or old Firefox
|
||||||
@ -78,10 +69,10 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
userAgent = window.navigator.userAgent;
|
userAgent = window.navigator.userAgent;
|
||||||
|
|
||||||
if ( /chrome/i.test( userAgent ) ) {
|
if ( /chrome/i.test( userAgent ) ) {
|
||||||
|
// Catches Chrome on Android as well (i.e. the default
|
||||||
|
// Android browser on Android >= 4.4).
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -90,13 +81,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -109,53 +96,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
|
||||||
} else if ( /opera.*version\/12\.1/i.test( userAgent ) ) {
|
|
||||||
expected = {
|
|
||||||
"ajax": true,
|
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
|
||||||
"changeBubbles": true,
|
|
||||||
"checkClone": true,
|
|
||||||
"checkOn": true,
|
|
||||||
"clearCloneStyle": true,
|
|
||||||
"cors": true,
|
|
||||||
"cssFloat": true,
|
|
||||||
"deleteExpando": true,
|
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
|
||||||
"htmlSerialize": true,
|
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
|
||||||
"leadingWhitespace": true,
|
|
||||||
"noCloneChecked": true,
|
|
||||||
"noCloneEvent": true,
|
|
||||||
"opacity": true,
|
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
|
||||||
"ownLast": false,
|
|
||||||
"pixelPosition": true,
|
|
||||||
"radioValue": false,
|
|
||||||
"reliableHiddenOffsets": true,
|
|
||||||
"reliableMarginRight": true,
|
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
|
||||||
"submitBubbles": true,
|
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /trident\/7\.0/i.test( userAgent ) ) {
|
} else if ( /trident\/7\.0/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": false,
|
"boxSizingReliable": false,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -164,13 +110,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": true,
|
"focusinBubbles": true,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": false,
|
"noCloneChecked": false,
|
||||||
@ -183,16 +125,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": false,
|
"radioValue": false,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /msie 10\.0/i.test( userAgent ) ) {
|
} else if ( /msie 10\.0/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": false,
|
"boxSizingReliable": false,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -201,13 +139,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": true,
|
"focusinBubbles": true,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": false,
|
"noCloneChecked": false,
|
||||||
@ -220,16 +154,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": false,
|
"radioValue": false,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /msie 9\.0/i.test( userAgent ) ) {
|
} else if ( /msie 9\.0/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": false,
|
"boxSizingReliable": false,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -238,13 +168,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": false,
|
"cors": false,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": true,
|
"focusinBubbles": true,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": false,
|
"noCloneChecked": false,
|
||||||
@ -257,16 +183,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": false,
|
"radioValue": false,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /msie 8\.0/i.test( userAgent ) ) {
|
} else if ( /msie 8\.0/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": false,
|
"boxSizingReliable": false,
|
||||||
"changeBubbles": false,
|
"changeBubbles": false,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -275,13 +197,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": false,
|
"cors": false,
|
||||||
"cssFloat": false,
|
"cssFloat": false,
|
||||||
"deleteExpando": false,
|
"deleteExpando": false,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": true,
|
"focusinBubbles": true,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": false,
|
"html5Clone": false,
|
||||||
"htmlSerialize": false,
|
"htmlSerialize": false,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": false,
|
"input": false,
|
||||||
"leadingWhitespace": false,
|
"leadingWhitespace": false,
|
||||||
"noCloneChecked": false,
|
"noCloneChecked": false,
|
||||||
@ -294,90 +212,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": false,
|
"radioValue": false,
|
||||||
"reliableHiddenOffsets": false,
|
"reliableHiddenOffsets": false,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": false,
|
"style": false,
|
||||||
"submitBubbles": false,
|
"submitBubbles": false
|
||||||
"tbody": true
|
|
||||||
};
|
|
||||||
} else if ( /msie 7\.0/i.test( userAgent ) ) {
|
|
||||||
expected = {
|
|
||||||
"ajax": true,
|
|
||||||
"appendChecked": false,
|
|
||||||
"boxSizing": false,
|
|
||||||
"boxSizingReliable": false,
|
|
||||||
"changeBubbles": false,
|
|
||||||
"checkClone": true,
|
|
||||||
"checkOn": true,
|
|
||||||
"clearCloneStyle": true,
|
|
||||||
"cors": false,
|
|
||||||
"cssFloat": false,
|
|
||||||
"deleteExpando": false,
|
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": true,
|
|
||||||
"getSetAttribute": false,
|
|
||||||
"hrefNormalized": false,
|
|
||||||
"html5Clone": false,
|
|
||||||
"htmlSerialize": false,
|
|
||||||
"inlineBlockNeedsLayout": true,
|
|
||||||
"input": true,
|
|
||||||
"leadingWhitespace": false,
|
|
||||||
"noCloneChecked": false,
|
|
||||||
"noCloneEvent": false,
|
|
||||||
"opacity": false,
|
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": false,
|
|
||||||
"ownLast": true,
|
|
||||||
"pixelPosition": false,
|
|
||||||
"radioValue": false,
|
|
||||||
"reliableHiddenOffsets": false,
|
|
||||||
"reliableMarginRight": true,
|
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": false,
|
|
||||||
"submitBubbles": false,
|
|
||||||
"tbody": false
|
|
||||||
};
|
|
||||||
} else if ( /msie 6\.0/i.test( userAgent ) ) {
|
|
||||||
expected = {
|
|
||||||
"ajax": true,
|
|
||||||
"appendChecked": false,
|
|
||||||
"boxSizing": false,
|
|
||||||
"boxSizingReliable": false,
|
|
||||||
"changeBubbles": false,
|
|
||||||
"checkClone": true,
|
|
||||||
"checkOn": true,
|
|
||||||
"clearCloneStyle": true,
|
|
||||||
"cors": false,
|
|
||||||
"cssFloat": false,
|
|
||||||
"deleteExpando": false,
|
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": true,
|
|
||||||
"getSetAttribute": false,
|
|
||||||
"hrefNormalized": false,
|
|
||||||
"html5Clone": false,
|
|
||||||
"htmlSerialize": false,
|
|
||||||
"inlineBlockNeedsLayout": true,
|
|
||||||
"input": true,
|
|
||||||
"leadingWhitespace": false,
|
|
||||||
"noCloneChecked": false,
|
|
||||||
"noCloneEvent": false,
|
|
||||||
"opacity": false,
|
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": false,
|
|
||||||
"ownLast": true,
|
|
||||||
"pixelPosition": false,
|
|
||||||
"radioValue": false,
|
|
||||||
"reliableHiddenOffsets": false,
|
|
||||||
"reliableMarginRight": true,
|
|
||||||
"shrinkWrapBlocks": true,
|
|
||||||
"style": false,
|
|
||||||
"submitBubbles": false,
|
|
||||||
"tbody": false
|
|
||||||
};
|
};
|
||||||
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -386,13 +226,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -405,16 +241,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /6\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
} else if ( /6\.0(\.\d+|) safari/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -423,13 +255,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -442,53 +270,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
|
||||||
} else if ( /5\.1(\.\d+|) safari/i.test( userAgent ) ) {
|
|
||||||
expected = {
|
|
||||||
"ajax": true,
|
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
|
||||||
"changeBubbles": true,
|
|
||||||
"checkClone": false,
|
|
||||||
"checkOn": false,
|
|
||||||
"clearCloneStyle": true,
|
|
||||||
"cors": true,
|
|
||||||
"cssFloat": true,
|
|
||||||
"deleteExpando": true,
|
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
|
||||||
"htmlSerialize": true,
|
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
|
||||||
"leadingWhitespace": true,
|
|
||||||
"noCloneChecked": true,
|
|
||||||
"noCloneEvent": true,
|
|
||||||
"opacity": true,
|
|
||||||
"optDisabled": true,
|
|
||||||
"optSelected": true,
|
|
||||||
"ownLast": false,
|
|
||||||
"pixelPosition": false,
|
|
||||||
"radioValue": true,
|
|
||||||
"reliableHiddenOffsets": true,
|
|
||||||
"reliableMarginRight": true,
|
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
|
||||||
"submitBubbles": true,
|
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /firefox/i.test( userAgent ) ) {
|
} else if ( /firefox/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -497,13 +284,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -516,16 +299,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /iphone os (?:6|7)_/i.test( userAgent ) ) {
|
} else if ( /iphone os/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -534,13 +313,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -553,16 +328,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /android 2\.3/i.test( userAgent ) ) {
|
} else if ( /android 2\.3/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": true,
|
"checkClone": true,
|
||||||
@ -571,13 +342,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -590,16 +357,12 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": false,
|
"reliableMarginRight": false,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
|
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
|
||||||
expected = {
|
expected = {
|
||||||
"ajax": true,
|
"ajax": true,
|
||||||
"appendChecked": true,
|
|
||||||
"boxSizing": true,
|
|
||||||
"boxSizingReliable": true,
|
"boxSizingReliable": true,
|
||||||
"changeBubbles": true,
|
"changeBubbles": true,
|
||||||
"checkClone": false,
|
"checkClone": false,
|
||||||
@ -608,13 +371,9 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"cors": true,
|
"cors": true,
|
||||||
"cssFloat": true,
|
"cssFloat": true,
|
||||||
"deleteExpando": true,
|
"deleteExpando": true,
|
||||||
"enctype": true,
|
|
||||||
"focusinBubbles": false,
|
"focusinBubbles": false,
|
||||||
"getSetAttribute": true,
|
|
||||||
"hrefNormalized": true,
|
|
||||||
"html5Clone": true,
|
"html5Clone": true,
|
||||||
"htmlSerialize": true,
|
"htmlSerialize": true,
|
||||||
"inlineBlockNeedsLayout": false,
|
|
||||||
"input": true,
|
"input": true,
|
||||||
"leadingWhitespace": true,
|
"leadingWhitespace": true,
|
||||||
"noCloneChecked": true,
|
"noCloneChecked": true,
|
||||||
@ -627,10 +386,8 @@ testIframeWithCallback( "Check CSP (https://developer.mozilla.org/en-US/docs/Sec
|
|||||||
"radioValue": true,
|
"radioValue": true,
|
||||||
"reliableHiddenOffsets": true,
|
"reliableHiddenOffsets": true,
|
||||||
"reliableMarginRight": true,
|
"reliableMarginRight": true,
|
||||||
"shrinkWrapBlocks": false,
|
|
||||||
"style": true,
|
"style": true,
|
||||||
"submitBubbles": true,
|
"submitBubbles": true
|
||||||
"tbody": true
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,7 @@ function testWrap( val ) {
|
|||||||
j = jQuery("#nonnodes").contents();
|
j = jQuery("#nonnodes").contents();
|
||||||
j.wrap( val("<i></i>") );
|
j.wrap( val("<i></i>") );
|
||||||
|
|
||||||
// Blackberry 4.6 doesn't maintain comments in the DOM
|
equal( jQuery("#nonnodes > i").length, 3, "Check node,textnode,comment wraps ok" );
|
||||||
equal( jQuery("#nonnodes > i").length, jQuery("#nonnodes")[ 0 ].childNodes.length, "Check node,textnode,comment wraps ok" );
|
|
||||||
equal( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" );
|
equal( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" );
|
||||||
|
|
||||||
// Try wrapping a disconnected node
|
// Try wrapping a disconnected node
|
||||||
|
Loading…
Reference in New Issue
Block a user