Skip to content
This repository
Browse code

Test against lastest minor releases of 1.5 and 1.6

  • Loading branch information...
commit 299e42f0c1a47bd4c186dd35a4a5ea68c79cacbc 1 parent 8416d30
Jörn Zaefferer authored May 14, 2011
464  lib/jquery-1.5.1.js → lib/jquery-1.5.2.js
... ...
@@ -1,5 +1,5 @@
1 1
 /*!
2  
- * jQuery JavaScript Library v1.5.1
  2
+ * jQuery JavaScript Library v1.5.2
3 3
  * http://jquery.com/
4 4
  *
5 5
  * Copyright 2011, John Resig
@@ -11,7 +11,7 @@
11 11
  * Copyright 2011, The Dojo Foundation
12 12
  * Released under the MIT, BSD, and GPL Licenses.
13 13
  *
14  
- * Date: Wed Feb 23 13:55:29 2011 -0500
  14
+ * Date: Thu Mar 31 15:28:23 2011 -0400
15 15
  */
16 16
 (function( window, undefined ) {
17 17
 
@@ -69,15 +69,9 @@ var jQuery = function( selector, context ) {
69 69
 	// For matching the engine and version of the browser
70 70
 	browserMatch,
71 71
 
72  
-	// Has the ready events already been bound?
73  
-	readyBound = false,
74  
-
75 72
 	// The deferred used on DOM ready
76 73
 	readyList,
77 74
 
78  
-	// Promise methods
79  
-	promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
80  
-
81 75
 	// The ready event handler
82 76
 	DOMContentLoaded,
83 77
 
@@ -202,7 +196,7 @@ jQuery.fn = jQuery.prototype = {
202 196
 	selector: "",
203 197
 
204 198
 	// The current version of jQuery being used
205  
-	jquery: "1.5.1",
  199
+	jquery: "1.5.2",
206 200
 
207 201
 	// The default length of a jQuery object is 0
208 202
 	length: 0,
@@ -427,11 +421,11 @@ jQuery.extend({
427 421
 	},
428 422
 
429 423
 	bindReady: function() {
430  
-		if ( readyBound ) {
  424
+		if ( readyList ) {
431 425
 			return;
432 426
 		}
433 427
 
434  
-		readyBound = true;
  428
+		readyList = jQuery._Deferred();
435 429
 
436 430
 		// Catch cases where $(document).ready() is called after the
437 431
 		// browser event has already occurred.
@@ -811,6 +805,123 @@ jQuery.extend({
811 805
 		return (new Date()).getTime();
812 806
 	},
813 807
 
  808
+	// Use of jQuery.browser is frowned upon.
  809
+	// More details: http://docs.jquery.com/Utilities/jQuery.browser
  810
+	uaMatch: function( ua ) {
  811
+		ua = ua.toLowerCase();
  812
+
  813
+		var match = rwebkit.exec( ua ) ||
  814
+			ropera.exec( ua ) ||
  815
+			rmsie.exec( ua ) ||
  816
+			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
  817
+			[];
  818
+
  819
+		return { browser: match[1] || "", version: match[2] || "0" };
  820
+	},
  821
+
  822
+	sub: function() {
  823
+		function jQuerySubclass( selector, context ) {
  824
+			return new jQuerySubclass.fn.init( selector, context );
  825
+		}
  826
+		jQuery.extend( true, jQuerySubclass, this );
  827
+		jQuerySubclass.superclass = this;
  828
+		jQuerySubclass.fn = jQuerySubclass.prototype = this();
  829
+		jQuerySubclass.fn.constructor = jQuerySubclass;
  830
+		jQuerySubclass.subclass = this.subclass;
  831
+		jQuerySubclass.fn.init = function init( selector, context ) {
  832
+			if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
  833
+				context = jQuerySubclass(context);
  834
+			}
  835
+
  836
+			return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
  837
+		};
  838
+		jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
  839
+		var rootjQuerySubclass = jQuerySubclass(document);
  840
+		return jQuerySubclass;
  841
+	},
  842
+
  843
+	browser: {}
  844
+});
  845
+
  846
+// Populate the class2type map
  847
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
  848
+	class2type[ "[object " + name + "]" ] = name.toLowerCase();
  849
+});
  850
+
  851
+browserMatch = jQuery.uaMatch( userAgent );
  852
+if ( browserMatch.browser ) {
  853
+	jQuery.browser[ browserMatch.browser ] = true;
  854
+	jQuery.browser.version = browserMatch.version;
  855
+}
  856
+
  857
+// Deprecated, use jQuery.browser.webkit instead
  858
+if ( jQuery.browser.webkit ) {
  859
+	jQuery.browser.safari = true;
  860
+}
  861
+
  862
+if ( indexOf ) {
  863
+	jQuery.inArray = function( elem, array ) {
  864
+		return indexOf.call( array, elem );
  865
+	};
  866
+}
  867
+
  868
+// IE doesn't match non-breaking spaces with \s
  869
+if ( rnotwhite.test( "\xA0" ) ) {
  870
+	trimLeft = /^[\s\xA0]+/;
  871
+	trimRight = /[\s\xA0]+$/;
  872
+}
  873
+
  874
+// All jQuery objects should point back to these
  875
+rootjQuery = jQuery(document);
  876
+
  877
+// Cleanup functions for the document ready method
  878
+if ( document.addEventListener ) {
  879
+	DOMContentLoaded = function() {
  880
+		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  881
+		jQuery.ready();
  882
+	};
  883
+
  884
+} else if ( document.attachEvent ) {
  885
+	DOMContentLoaded = function() {
  886
+		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  887
+		if ( document.readyState === "complete" ) {
  888
+			document.detachEvent( "onreadystatechange", DOMContentLoaded );
  889
+			jQuery.ready();
  890
+		}
  891
+	};
  892
+}
  893
+
  894
+// The DOM ready check for Internet Explorer
  895
+function doScrollCheck() {
  896
+	if ( jQuery.isReady ) {
  897
+		return;
  898
+	}
  899
+
  900
+	try {
  901
+		// If IE is used, use the trick by Diego Perini
  902
+		// http://javascript.nwbox.com/IEContentLoaded/
  903
+		document.documentElement.doScroll("left");
  904
+	} catch(e) {
  905
+		setTimeout( doScrollCheck, 1 );
  906
+		return;
  907
+	}
  908
+
  909
+	// and execute any waiting functions
  910
+	jQuery.ready();
  911
+}
  912
+
  913
+// Expose jQuery to the global object
  914
+return jQuery;
  915
+
  916
+})();
  917
+
  918
+
  919
+var // Promise methods
  920
+	promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
  921
+	// Static reference to slice
  922
+	sliceDeferred = [].slice;
  923
+
  924
+jQuery.extend({
814 925
 	// Create a simple deferred (one callbacks list)
815 926
 	_Deferred: function() {
816 927
 		var // callbacks list
@@ -856,18 +967,14 @@ jQuery.extend({
856 967
 				// resolve with given context and args
857 968
 				resolveWith: function( context, args ) {
858 969
 					if ( !cancelled && !fired && !firing ) {
  970
+						// make sure args are available (#8421)
  971
+						args = args || [];
859 972
 						firing = 1;
860 973
 						try {
861 974
 							while( callbacks[ 0 ] ) {
862 975
 								callbacks.shift().apply( context, args );
863 976
 							}
864 977
 						}
865  
-						// We have to add a catch block for
866  
-						// IE prior to 8 or else the finally
867  
-						// block will never get executed
868  
-						catch (e) {
869  
-							throw e;
870  
-						}
871 978
 						finally {
872 979
 							fired = [ context, args ];
873 980
 							firing = 0;
@@ -878,7 +985,7 @@ jQuery.extend({
878 985
 
879 986
 				// resolve with this as context and given arguments
880 987
 				resolve: function() {
881  
-					deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments );
  988
+					deferred.resolveWith( this, arguments );
882 989
 					return this;
883 990
 				},
884 991
 
@@ -941,153 +1048,44 @@ jQuery.extend({
941 1048
 	},
942 1049
 
943 1050
 	// Deferred helper
944  
-	when: function( object ) {
945  
-		var lastIndex = arguments.length,
946  
-			deferred = lastIndex <= 1 && object && jQuery.isFunction( object.promise ) ?
947  
-				object :
948  
-				jQuery.Deferred(),
949  
-			promise = deferred.promise();
950  
-
951  
-		if ( lastIndex > 1 ) {
952  
-			var array = slice.call( arguments, 0 ),
953  
-				count = lastIndex,
954  
-				iCallback = function( index ) {
955  
-					return function( value ) {
956  
-						array[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;
957  
-						if ( !( --count ) ) {
958  
-							deferred.resolveWith( promise, array );
959  
-						}
960  
-					};
961  
-				};
962  
-			while( ( lastIndex-- ) ) {
963  
-				object = array[ lastIndex ];
964  
-				if ( object && jQuery.isFunction( object.promise ) ) {
965  
-					object.promise().then( iCallback(lastIndex), deferred.reject );
  1051
+	when: function( firstParam ) {
  1052
+		var args = arguments,
  1053
+			i = 0,
  1054
+			length = args.length,
  1055
+			count = length,
  1056
+			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
  1057
+				firstParam :
  1058
+				jQuery.Deferred();
  1059
+		function resolveFunc( i ) {
  1060
+			return function( value ) {
  1061
+				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  1062
+				if ( !( --count ) ) {
  1063
+					// Strange bug in FF4:
  1064
+					// Values changed onto the arguments object sometimes end up as undefined values
  1065
+					// outside the $.when method. Cloning the object into a fresh array solves the issue
  1066
+					deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
  1067
+				}
  1068
+			};
  1069
+		}
  1070
+		if ( length > 1 ) {
  1071
+			for( ; i < length; i++ ) {
  1072
+				if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
  1073
+					args[ i ].promise().then( resolveFunc(i), deferred.reject );
966 1074
 				} else {
967 1075
 					--count;
968 1076
 				}
969 1077
 			}
970 1078
 			if ( !count ) {
971  
-				deferred.resolveWith( promise, array );
972  
-			}
973  
-		} else if ( deferred !== object ) {
974  
-			deferred.resolve( object );
975  
-		}
976  
-		return promise;
977  
-	},
978  
-
979  
-	// Use of jQuery.browser is frowned upon.
980  
-	// More details: http://docs.jquery.com/Utilities/jQuery.browser
981  
-	uaMatch: function( ua ) {
982  
-		ua = ua.toLowerCase();
983  
-
984  
-		var match = rwebkit.exec( ua ) ||
985  
-			ropera.exec( ua ) ||
986  
-			rmsie.exec( ua ) ||
987  
-			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
988  
-			[];
989  
-
990  
-		return { browser: match[1] || "", version: match[2] || "0" };
991  
-	},
992  
-
993  
-	sub: function() {
994  
-		function jQuerySubclass( selector, context ) {
995  
-			return new jQuerySubclass.fn.init( selector, context );
996  
-		}
997  
-		jQuery.extend( true, jQuerySubclass, this );
998  
-		jQuerySubclass.superclass = this;
999  
-		jQuerySubclass.fn = jQuerySubclass.prototype = this();
1000  
-		jQuerySubclass.fn.constructor = jQuerySubclass;
1001  
-		jQuerySubclass.subclass = this.subclass;
1002  
-		jQuerySubclass.fn.init = function init( selector, context ) {
1003  
-			if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
1004  
-				context = jQuerySubclass(context);
  1079
+				deferred.resolveWith( deferred, args );
1005 1080
 			}
1006  
-
1007  
-			return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
1008  
-		};
1009  
-		jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
1010  
-		var rootjQuerySubclass = jQuerySubclass(document);
1011  
-		return jQuerySubclass;
1012  
-	},
1013  
-
1014  
-	browser: {}
1015  
-});
1016  
-
1017  
-// Create readyList deferred
1018  
-readyList = jQuery._Deferred();
1019  
-
1020  
-// Populate the class2type map
1021  
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
1022  
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
1023  
-});
1024  
-
1025  
-browserMatch = jQuery.uaMatch( userAgent );
1026  
-if ( browserMatch.browser ) {
1027  
-	jQuery.browser[ browserMatch.browser ] = true;
1028  
-	jQuery.browser.version = browserMatch.version;
1029  
-}
1030  
-
1031  
-// Deprecated, use jQuery.browser.webkit instead
1032  
-if ( jQuery.browser.webkit ) {
1033  
-	jQuery.browser.safari = true;
1034  
-}
1035  
-
1036  
-if ( indexOf ) {
1037  
-	jQuery.inArray = function( elem, array ) {
1038  
-		return indexOf.call( array, elem );
1039  
-	};
1040  
-}
1041  
-
1042  
-// IE doesn't match non-breaking spaces with \s
1043  
-if ( rnotwhite.test( "\xA0" ) ) {
1044  
-	trimLeft = /^[\s\xA0]+/;
1045  
-	trimRight = /[\s\xA0]+$/;
1046  
-}
1047  
-
1048  
-// All jQuery objects should point back to these
1049  
-rootjQuery = jQuery(document);
1050  
-
1051  
-// Cleanup functions for the document ready method
1052  
-if ( document.addEventListener ) {
1053  
-	DOMContentLoaded = function() {
1054  
-		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
1055  
-		jQuery.ready();
1056  
-	};
1057  
-
1058  
-} else if ( document.attachEvent ) {
1059  
-	DOMContentLoaded = function() {
1060  
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
1061  
-		if ( document.readyState === "complete" ) {
1062  
-			document.detachEvent( "onreadystatechange", DOMContentLoaded );
1063  
-			jQuery.ready();
  1081
+		} else if ( deferred !== firstParam ) {
  1082
+			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
1064 1083
 		}
1065  
-	};
1066  
-}
1067  
-
1068  
-// The DOM ready check for Internet Explorer
1069  
-function doScrollCheck() {
1070  
-	if ( jQuery.isReady ) {
1071  
-		return;
  1084
+		return deferred.promise();
1072 1085
 	}
  1086
+});
1073 1087
 
1074  
-	try {
1075  
-		// If IE is used, use the trick by Diego Perini
1076  
-		// http://javascript.nwbox.com/IEContentLoaded/
1077  
-		document.documentElement.doScroll("left");
1078  
-	} catch(e) {
1079  
-		setTimeout( doScrollCheck, 1 );
1080  
-		return;
1081  
-	}
1082  
-
1083  
-	// and execute any waiting functions
1084  
-	jQuery.ready();
1085  
-}
1086  
-
1087  
-// Expose jQuery to the global object
1088  
-return jQuery;
1089 1088
 
1090  
-})();
1091 1089
 
1092 1090
 
1093 1091
 (function() {
@@ -1157,7 +1155,8 @@ return jQuery;
1157 1155
 		boxModel: null,
1158 1156
 		inlineBlockNeedsLayout: false,
1159 1157
 		shrinkWrapBlocks: false,
1160  
-		reliableHiddenOffsets: true
  1158
+		reliableHiddenOffsets: true,
  1159
+		reliableMarginRight: true
1161 1160
 	};
1162 1161
 
1163 1162
 	input.checked = true;
@@ -1175,15 +1174,15 @@ return jQuery;
1175 1174
 				script = document.createElement("script"),
1176 1175
 				id = "script" + jQuery.now();
1177 1176
 
  1177
+			// Make sure that the execution of code works by injecting a script
  1178
+			// tag with appendChild/createTextNode
  1179
+			// (IE doesn't support this, fails, and uses .text instead)
1178 1180
 			try {
1179 1181
 				script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
1180 1182
 			} catch(e) {}
1181 1183
 
1182 1184
 			root.insertBefore( script, root.firstChild );
1183 1185
 
1184  
-			// Make sure that the execution of code works by injecting a script
1185  
-			// tag with appendChild/createTextNode
1186  
-			// (IE doesn't support this, fails, and uses .text instead)
1187 1186
 			if ( window[ id ] ) {
1188 1187
 				_scriptEval = true;
1189 1188
 				delete window[ id ];
@@ -1192,8 +1191,6 @@ return jQuery;
1192 1191
 			}
1193 1192
 
1194 1193
 			root.removeChild( script );
1195  
-			// release memory in IE
1196  
-			root = script = id  = null;
1197 1194
 		}
1198 1195
 
1199 1196
 		return _scriptEval;
@@ -1278,6 +1275,17 @@ return jQuery;
1278 1275
 		jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
1279 1276
 		div.innerHTML = "";
1280 1277
 
  1278
+		// Check if div with explicit width and no margin-right incorrectly
  1279
+		// gets computed margin-right based on width of container. For more
  1280
+		// info see bug #3333
  1281
+		// Fails in WebKit before Feb 2011 nightlies
  1282
+		// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  1283
+		if ( document.defaultView && document.defaultView.getComputedStyle ) {
  1284
+			div.style.width = "1px";
  1285
+			div.style.marginRight = "0";
  1286
+			jQuery.support.reliableMarginRight = ( parseInt(document.defaultView.getComputedStyle(div, null).marginRight, 10) || 0 ) === 0;
  1287
+		}
  1288
+
1281 1289
 		body.removeChild( div ).style.display = "none";
1282 1290
 		div = tds = null;
1283 1291
 	});
@@ -1301,8 +1309,6 @@ return jQuery;
1301 1309
 			el.setAttribute(eventName, "return;");
1302 1310
 			isSupported = typeof el[eventName] === "function";
1303 1311
 		}
1304  
-		el = null;
1305  
-
1306 1312
 		return isSupported;
1307 1313
 	};
1308 1314
 
@@ -2194,10 +2200,10 @@ jQuery.event = {
2194 2200
 		}
2195 2201
 
2196 2202
 		if ( !eventHandle ) {
2197  
-			elemData.handle = eventHandle = function() {
  2203
+			elemData.handle = eventHandle = function( e ) {
2198 2204
 				// Handle the second event of a trigger and when
2199 2205
 				// an event is called after a page has unloaded
2200  
-				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
  2206
+				return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
2201 2207
 					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
2202 2208
 					undefined;
2203 2209
 			};
@@ -2504,7 +2510,7 @@ jQuery.event = {
2504 2510
 							target[ "on" + targetType ] = null;
2505 2511
 						}
2506 2512
 
2507  
-						jQuery.event.triggered = true;
  2513
+						jQuery.event.triggered = event.type;
2508 2514
 						target[ targetType ]();
2509 2515
 					}
2510 2516
 
@@ -2515,7 +2521,7 @@ jQuery.event = {
2515 2521
 					target[ "on" + targetType ] = old;
2516 2522
 				}
2517 2523
 
2518  
-				jQuery.event.triggered = false;
  2524
+				jQuery.event.triggered = undefined;
2519 2525
 			}
2520 2526
 		}
2521 2527
 	},
@@ -2785,7 +2791,7 @@ var withinElement = function( event ) {
2785 2791
 
2786 2792
 		// Chrome does something similar, the parentNode property
2787 2793
 		// can be accessed but is null.
2788  
-		if ( parent !== document && !parent.parentNode ) {
  2794
+		if ( parent && parent !== document && !parent.parentNode ) {
2789 2795
 			return;
2790 2796
 		}
2791 2797
 		// Traverse up the tree
@@ -2992,19 +2998,33 @@ function trigger( type, elem, args ) {
2992 2998
 // Create "bubbling" focus and blur events
2993 2999
 if ( document.addEventListener ) {
2994 3000
 	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  3001
+	
  3002
+		// Attach a single capturing handler while someone wants focusin/focusout
  3003
+		var attaches = 0;
  3004
+		
2995 3005
 		jQuery.event.special[ fix ] = {
2996 3006
 			setup: function() {
2997  
-				this.addEventListener( orig, handler, true );
  3007
+				if ( attaches++ === 0 ) {
  3008
+					document.addEventListener( orig, handler, true );
  3009
+				}
2998 3010
 			},
2999 3011
 			teardown: function() {
3000  
-				this.removeEventListener( orig, handler, true );
  3012
+				if ( --attaches === 0 ) {
  3013
+					document.removeEventListener( orig, handler, true );
  3014
+				}
3001 3015
 			}
3002 3016
 		};
3003 3017
 
3004  
-		function handler( e ) {
3005  
-			e = jQuery.event.fix( e );
  3018
+		function handler( donor ) {
  3019
+			// Donor event is always a native one; fix it and switch its type.
  3020
+			// Let focusin/out handler cancel the donor focus/blur event.
  3021
+			var e = jQuery.event.fix( donor );
3006 3022
 			e.type = fix;
3007  
-			return jQuery.event.handle.call( this, e );
  3023
+			e.originalEvent = {};
  3024
+			jQuery.event.trigger( e, null, e.target );
  3025
+			if ( e.isDefaultPrevented() ) {
  3026
+				donor.preventDefault();
  3027
+			}
3008 3028
 		}
3009 3029
 	});
3010 3030
 }
@@ -3918,10 +3938,12 @@ var Expr = Sizzle.selectors = {
3918 3938
 		},
3919 3939
 
3920 3940
 		text: function( elem ) {
  3941
+			var attr = elem.getAttribute( "type" ), type = elem.type;
3921 3942
 			// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) 
3922 3943
 			// use getAttribute instead to test this case
3923  
-			return "text" === elem.getAttribute( 'type' );
  3944
+			return "text" === type && ( attr === type || attr === null );
3924 3945
 		},
  3946
+
3925 3947
 		radio: function( elem ) {
3926 3948
 			return "radio" === elem.type;
3927 3949
 		},
@@ -4496,19 +4518,23 @@ if ( document.querySelectorAll ) {
4496 4518
 
4497 4519
 (function(){
4498 4520
 	var html = document.documentElement,
4499  
-		matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
4500  
-		pseudoWorks = false;
  4521
+		matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
4501 4522
 
4502  
-	try {
4503  
-		// This should fail with an exception
4504  
-		// Gecko does not error, returns false instead
4505  
-		matches.call( document.documentElement, "[test!='']:sizzle" );
  4523
+	if ( matches ) {
  4524
+		// Check to see if it's possible to do matchesSelector
  4525
+		// on a disconnected node (IE 9 fails this)
  4526
+		var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
  4527
+			pseudoWorks = false;
  4528
+
  4529
+		try {
  4530
+			// This should fail with an exception
  4531
+			// Gecko does not error, returns false instead
  4532
+			matches.call( document.documentElement, "[test!='']:sizzle" );
4506 4533
 	
4507  
-	} catch( pseudoError ) {
4508  
-		pseudoWorks = true;
4509  
-	}
  4534
+		} catch( pseudoError ) {
  4535
+			pseudoWorks = true;
  4536
+		}
4510 4537
 
4511  
-	if ( matches ) {
4512 4538
 		Sizzle.matchesSelector = function( node, expr ) {
4513 4539
 			// Make sure that attribute selectors are quoted
4514 4540
 			expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
@@ -4516,7 +4542,15 @@ if ( document.querySelectorAll ) {
4516 4542
 			if ( !Sizzle.isXML( node ) ) {
4517 4543
 				try { 
4518 4544
 					if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
4519  
-						return matches.call( node, expr );
  4545
+						var ret = matches.call( node, expr );
  4546
+
  4547
+						// IE 9's matchesSelector returns false on disconnected nodes
  4548
+						if ( ret || !disconnectedMatch ||
  4549
+								// As well, disconnected nodes are said to be in a document
  4550
+								// fragment in IE 9, so check for that
  4551
+								node.document && node.document.nodeType !== 11 ) {
  4552
+							return ret;
  4553
+						}
4520 4554
 					}
4521 4555
 				} catch(e) {}
4522 4556
 			}
@@ -5260,7 +5294,9 @@ jQuery.fn.extend({
5260 5294
 				}
5261 5295
 			});
5262 5296
 		} else {
5263  
-			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
  5297
+			return this.length ?
  5298
+				this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
  5299
+				this;
5264 5300
 		}
5265 5301
 	},
5266 5302
 
@@ -5707,7 +5743,8 @@ function evalScript( i, elem ) {
5707 5743
 var ralpha = /alpha\([^)]*\)/i,
5708 5744
 	ropacity = /opacity=([^)]*)/,
5709 5745
 	rdashAlpha = /-([a-z])/ig,
5710  
-	rupper = /([A-Z])/g,
  5746
+	// fixed for IE9, see #8346
  5747
+	rupper = /([A-Z]|^ms)/g,
5711 5748
 	rnumpx = /^-?\d+(?:px)?$/i,
5712 5749
 	rnum = /^-?\d/,
5713 5750
 
@@ -5944,6 +5981,28 @@ if ( !jQuery.support.opacity ) {
5944 5981
 	};
5945 5982
 }
5946 5983
 
  5984
+jQuery(function() {
  5985
+	// This hook cannot be added until DOM ready because the support test
  5986
+	// for it is not run until after DOM ready
  5987
+	if ( !jQuery.support.reliableMarginRight ) {
  5988
+		jQuery.cssHooks.marginRight = {
  5989
+			get: function( elem, computed ) {
  5990
+				// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  5991
+				// Work around by temporarily setting element display to inline-block
  5992
+				var ret;
  5993
+				jQuery.swap( elem, { "display": "inline-block" }, function() {
  5994
+					if ( computed ) {
  5995
+						ret = curCSS( elem, "margin-right", "marginRight" );
  5996
+					} else {
  5997
+						ret = elem.style.marginRight;
  5998
+					}
  5999
+				});
  6000
+				return ret;
  6001
+			}
  6002
+		};
  6003
+	}
  6004
+});
  6005
+
5947 6006
 if ( document.defaultView && document.defaultView.getComputedStyle ) {
5948 6007
 	getComputedStyle = function( elem, newName, name ) {
5949 6008
 		var ret, defaultView, computedStyle;
@@ -6048,7 +6107,7 @@ var r20 = /%20/g,
6048 6107
 	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
6049 6108
 	rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
6050 6109
 	// #7653, #8125, #8152: local protocol detection
6051  
-	rlocalProtocol = /(?:^file|^widget|\-extension):$/,
  6110
+	rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
6052 6111
 	rnoContent = /^(?:GET|HEAD)$/,
6053 6112
 	rprotocol = /^\/\//,
6054 6113
 	rquery = /\?/,
@@ -6060,7 +6119,7 @@ var r20 = /%20/g,
6060 6119
 	rucHeadersFunc = function( _, $1, $2 ) {
6061 6120
 		return $1 + $2.toUpperCase();
6062 6121
 	},
6063  
-	rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,
  6122
+	rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
6064 6123
 
6065 6124
 	// Keep a copy of the old load method
6066 6125
 	_load = jQuery.fn.load,
@@ -6102,7 +6161,7 @@ try {
6102 6161
 }
6103 6162
 
6104 6163
 // Segment location into parts
6105  
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() );
  6164
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
6106 6165
 
6107 6166
 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
6108 6167
 function addToPrefiltersOrTransports( structure ) {
@@ -6360,7 +6419,6 @@ jQuery.extend({
6360 6419
 		cache: null,
6361 6420
 		traditional: false,
6362 6421
 		headers: {},
6363  
-		crossDomain: null,
6364 6422
 		*/
6365 6423
 
6366 6424
 		accepts: {
@@ -6645,7 +6703,7 @@ jQuery.extend({
6645 6703
 		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
6646 6704
 
6647 6705
 		// Determine if a cross-domain request is in order
6648  
-		if ( !s.crossDomain ) {
  6706
+		if ( s.crossDomain == null ) {
6649 6707
 			parts = rurl.exec( s.url.toLowerCase() );
6650 6708
 			s.crossDomain = !!( parts &&
6651 6709
 				( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
@@ -7024,7 +7082,7 @@ function ajaxConvert( s, response ) {
7024 7082
 
7025 7083
 
7026 7084
 var jsc = jQuery.now(),
7027  
-	jsre = /(\=)\?(&|$)|()\?\?()/i;
  7085
+	jsre = /(\=)\?(&|$)|\?\?/i;
7028 7086
 
7029 7087
 // Default jsonp settings
7030 7088
 jQuery.ajaxSetup({
@@ -7285,11 +7343,12 @@ if ( jQuery.support.ajax ) {
7285 7343
 						xhr.overrideMimeType( s.mimeType );
7286 7344
 					}
7287 7345
 
7288  
-					// Requested-With header
7289  
-					// Not set for crossDomain requests with no content
7290  
-					// (see why at http://trac.dojotoolkit.org/ticket/9486)
7291  
-					// Won't change header if already provided
7292  
-					if ( !( s.crossDomain && !s.hasContent ) && !headers["X-Requested-With"] ) {
  7346
+					// X-Requested-With header
  7347
+					// For cross-domain requests, seeing as conditions for a preflight are
  7348
+					// akin to a jigsaw puzzle, we simply never set it to be sure.
  7349
+					// (it can always be set on a per-request basis or even using ajaxSetup)
  7350
+					// For same-domain requests, won't change header if already provided.
  7351
+					if ( !s.crossDomain && !headers["X-Requested-With"] ) {
7293 7352
 						headers[ "X-Requested-With" ] = "XMLHttpRequest";
7294 7353
 					}
7295 7354
 
@@ -7979,8 +8038,8 @@ if ( "getBoundingClientRect" in document.documentElement ) {
7979 8038
 			win = getWindow(doc),
7980 8039
 			clientTop  = docElem.clientTop  || body.clientTop  || 0,
7981 8040
 			clientLeft = docElem.clientLeft || body.clientLeft || 0,
7982  
-			scrollTop  = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ),
7983  
-			scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
  8041
+			scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
  8042
+			scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
7984 8043
 			top  = box.top  + scrollTop  - clientTop,
7985 8044
 			left = box.left + scrollLeft - clientLeft;
7986 8045
 
@@ -8093,7 +8152,6 @@ jQuery.offset = {
8093 8152
 		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
8094 8153
 
8095 8154
 		body.removeChild( container );
8096  
-		body = container = innerDiv = checkDiv = table = td = null;
8097 8155
 		jQuery.offset.initialize = jQuery.noop;
8098 8156
 	},
8099 8157
 
@@ -8123,10 +8181,10 @@ jQuery.offset = {
8123 8181
 			curOffset = curElem.offset(),
8124 8182
 			curCSSTop = jQuery.css( elem, "top" ),
8125 8183
 			curCSSLeft = jQuery.css( elem, "left" ),
8126  
-			calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
  8184
+			calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1,
8127 8185
 			props = {}, curPosition = {}, curTop, curLeft;
8128 8186
 
8129  
-		// need to be able to calculate position if either top or left is auto and position is absolute
  8187
+		// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
8130 8188
 		if ( calculatePosition ) {
8131 8189
 			curPosition = curElem.position();
8132 8190
 		}
8,176  lib/jquery-1.5.js
0 additions, 8176 deletions not shown
287  lib/jquery-1.6.js → lib/jquery-1.6.1.js
... ...
@@ -1,5 +1,5 @@
1 1
 /*!
2  
- * jQuery JavaScript Library v1.6
  2
+ * jQuery JavaScript Library v1.6.1
3 3
  * http://jquery.com/
4 4
  *
5 5
  * Copyright 2011, John Resig
@@ -11,7 +11,7 @@
11 11
  * Copyright 2011, The Dojo Foundation
12 12
  * Released under the MIT, BSD, and GPL Licenses.
13 13
  *
14  
- * Date: Mon May 2 13:50:00 2011 -0400
  14
+ * Date: Thu May 12 15:04:36 2011 -0400
15 15
  */
16 16
 (function( window, undefined ) {
17 17
 
@@ -204,7 +204,7 @@ jQuery.fn = jQuery.prototype = {
204 204
 	selector: "",
205 205
 
206 206
 	// The current version of jQuery being used
207  
-	jquery: "1.6",
  207
+	jquery: "1.6.1",
208 208
 
209 209
 	// The default length of a jQuery object is 0
210 210
 	length: 0,
@@ -1055,7 +1055,7 @@ jQuery.extend({
1055 1055
 						if ( jQuery.isFunction( fn ) ) {
1056 1056
 							deferred[ handler ](function() {
1057 1057
 								returned = fn.apply( this, arguments );
1058  
-								if ( jQuery.isFunction( returned.promise ) ) {
  1058
+								if ( returned && jQuery.isFunction( returned.promise ) ) {
1059 1059
 									returned.promise().then( newDefer.resolve, newDefer.reject );
1060 1060
 								} else {
1061 1061
 									newDefer[ action ]( returned );
@@ -1137,6 +1137,7 @@ jQuery.extend({
1137 1137
 jQuery.support = (function() {
1138 1138
 
1139 1139
 	var div = document.createElement( "div" ),
  1140
+		documentElement = document.documentElement,
1140 1141
 		all,
1141 1142
 		a,
1142 1143
 		select,
@@ -1284,7 +1285,7 @@ jQuery.support = (function() {
1284 1285
 		body.style[ i ] = bodyStyle[ i ];
1285 1286
 	}
1286 1287
 	body.appendChild( div );
1287  
-	document.documentElement.appendChild( body );
  1288
+	documentElement.insertBefore( body, documentElement.firstChild );
1288 1289
 
1289 1290
 	// Check if a disconnected checkbox will retain its checked
1290 1291
 	// value of true after appended to the DOM (IE6/7)
@@ -1339,12 +1340,12 @@ jQuery.support = (function() {
1339 1340
 		marginDiv.style.marginRight = "0";
1340 1341
 		div.appendChild( marginDiv );
1341 1342
 		support.reliableMarginRight =
1342  
-			( parseInt( document.defaultView.getComputedStyle( marginDiv, null ).marginRight, 10 ) || 0 ) === 0;
  1343
+			( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
1343 1344
 	}
1344 1345
 
1345 1346
 	// Remove the body element we added
1346 1347
 	body.innerHTML = "";
1347  
-	document.documentElement.removeChild( body );
  1348
+	documentElement.removeChild( body );
1348 1349
 
1349 1350
 	// Technique from Juriy Zaytsev
1350 1351
 	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
@@ -1475,7 +1476,7 @@ jQuery.extend({
1475 1476
 		}
1476 1477
 
1477 1478
 		if ( data !== undefined ) {
1478  
-			thisCache[ name ] = data;
  1479
+			thisCache[ jQuery.camelCase( name ) ] = data;
1479 1480
 		}
1480 1481
 
1481 1482
 		// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
@@ -1485,7 +1486,7 @@ jQuery.extend({
1485 1486
 			return thisCache[ internalKey ] && thisCache[ internalKey ].events;
1486 1487
 		}
1487 1488
 
1488  
-		return getByName ? thisCache[ name ] : thisCache;
  1489
+		return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache;
1489 1490
 	},
1490 1491
 
1491 1492
 	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
@@ -1661,7 +1662,7 @@ function dataAttr( elem, key, data ) {
1661 1662
 	// If nothing was found internally, try to fetch any
1662 1663
 	// data from the HTML5 data-* attribute
1663 1664
 	if ( data === undefined && elem.nodeType === 1 ) {
1664  
-		name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
  1665
+		var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
1665 1666
 
1666 1667
 		data = elem.getAttribute( name );
1667 1668
 
@@ -1850,7 +1851,8 @@ jQuery.fn.extend({
1850 1851
 			count = 1,
1851 1852
 			deferDataKey = type + "defer",
1852 1853
 			queueDataKey = type + "queue",
1853  
-			markDataKey = type + "mark";
  1854
+			markDataKey = type + "mark",
  1855
+			tmp;
1854 1856
 		function resolve() {
1855 1857
 			if ( !( --count ) ) {
1856 1858
 				defer.resolveWith( elements, [ elements ] );
@@ -1879,9 +1881,9 @@ var rclass = /[\n\t\r]/g,
1879 1881
 	rtype = /^(?:button|input)$/i,
1880 1882
 	rfocusable = /^(?:button|input|object|select|textarea)$/i,
1881 1883
 	rclickable = /^a(?:rea)?$/i,
1882  
-	rspecial = /^(?:data-|aria-)/,
  1884
+	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
1883 1885
 	rinvalidChar = /\:/,
1884  
-	formHook;
  1886
+	formHook, boolHook;
1885 1887
 
1886 1888
 jQuery.fn.extend({
1887 1889
 	attr: function( name, value ) {
@@ -1899,6 +1901,7 @@ jQuery.fn.extend({
1899 1901
 	},
1900 1902
 	
1901 1903
 	removeProp: function( name ) {
  1904
+		name = jQuery.propFix[ name ] || name;
1902 1905
 		return this.each(function() {
1903 1906
 			// try/catch handles cases where IE balks (such as removing a property on window)
1904 1907
 			try {
@@ -2072,7 +2075,7 @@ jQuery.fn.extend({
2072 2075
 			hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
2073 2076
 
2074 2077
 			// If set returns undefined, fall back to normal setting
2075  
-			if ( !hooks || ("set" in hooks && hooks.set( this, val, "value" ) === undefined) ) {
  2078
+			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
2076 2079
 				this.value = val;
2077 2080
 			}
2078 2081
 		});
@@ -2091,7 +2094,8 @@ jQuery.extend({
2091 2094
 		},
2092 2095
 		select: {
2093 2096
 			get: function( elem ) {
2094  
-				var index = elem.selectedIndex,
  2097
+				var value,
  2098
+					index = elem.selectedIndex,
2095 2099
 					values = [],
2096 2100
 					options = elem.options,
2097 2101
 					one = elem.type === "select-one";
@@ -2158,8 +2162,7 @@ jQuery.extend({
2158 2162
 	
2159 2163
 	attrFix: {
2160 2164
 		// Always normalize to ensure hook usage
2161  
-		tabindex: "tabIndex",
2162  
-		readonly: "readOnly"
  2165
+		tabindex: "tabIndex"
2163 2166
 	},
2164 2167
 	
2165 2168
 	attr: function( elem, name, value, pass ) {
@@ -2173,23 +2176,36 @@ jQuery.extend({
2173 2176
 		if ( pass && name in jQuery.attrFn ) {
2174 2177
 			return jQuery( elem )[ name ]( value );
2175 2178
 		}
2176  
-		
  2179
+
  2180
+		// Fallback to prop when attributes are not supported
  2181
+		if ( !("getAttribute" in elem) ) {
  2182
+			return jQuery.prop( elem, name, value );
  2183
+		}
  2184
+
2177 2185
 		var ret, hooks,
2178 2186
 			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2179  
-		
  2187
+
2180 2188
 		// Normalize the name if needed
2181 2189
 		name = notxml && jQuery.attrFix[ name ] || name;
2182 2190
 
2183  
-		// Get the appropriate hook, or the formHook
2184  
-		// if getSetAttribute is not supported and we have form objects in IE6/7
2185  
-		hooks = jQuery.attrHooks[ name ] ||
2186  
-			( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ?
2187  
-				formHook :
2188  
-				undefined );
  2191
+		hooks = jQuery.attrHooks[ name ];
  2192
+
  2193
+		if ( !hooks ) {
  2194
+			// Use boolHook for boolean attributes
  2195
+			if ( rboolean.test( name ) &&
  2196
+				(typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) {
  2197
+
  2198
+				hooks = boolHook;
  2199
+
  2200
+			// Use formHook for forms and if the name contains certain characters
  2201
+			} else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
  2202
+				hooks = formHook;
  2203
+			}
  2204
+		}
2189 2205
 
2190 2206
 		if ( value !== undefined ) {
2191 2207
 
2192  
-			if ( value === null || (value === false && !rspecial.test( name )) ) {
  2208
+			if ( value === null ) {
2193 2209
 				jQuery.removeAttr( elem, name );
2194 2210
 				return undefined;
2195 2211
 
@@ -2197,34 +2213,26 @@ jQuery.extend({
2197 2213
 				return ret;
2198 2214
 
2199 2215
 			} else {
2200  
-
2201  
-				// Set boolean attributes to the same name
2202  
-				if ( value === true && !rspecial.test( name ) ) {
2203  
-					value = name;
2204  
-				}
2205  
-
2206 2216
 				elem.setAttribute( name, "" + value );
2207 2217
 				return value;
2208 2218
 			}
2209 2219
 
2210  
-		} else {
2211  
-
2212  
-			if ( hooks && "get" in hooks && notxml ) {
2213  
-				return hooks.get( elem, name );
  2220
+		} else if ( hooks && "get" in hooks && notxml ) {
  2221
+			return hooks.get( elem, name );
2214 2222
 
2215  
-			} else {
  2223
+		} else {
2216 2224
 
2217  
-				ret = elem.getAttribute( name );
  2225
+			ret = elem.getAttribute( name );
2218 2226
 
2219  
-				// Non-existent attributes return null, we normalize to undefined
2220  
-				return ret === null ?
2221  
-					undefined :
2222  
-					ret;
2223  
-			}
  2227
+			// Non-existent attributes return null, we normalize to undefined
  2228
+			return ret === null ?
  2229
+				undefined :
  2230
+				ret;
2224 2231
 		}
2225 2232
 	},
2226  
-	
  2233
+
2227 2234
 	removeAttr: function( elem, name ) {
  2235
+		var propName;
2228 2236
 		if ( elem.nodeType === 1 ) {
2229 2237
 			name = jQuery.attrFix[ name ] || name;
2230 2238
 		
@@ -2235,6 +2243,11 @@ jQuery.extend({
2235 2243
 				jQuery.attr( elem, name, "" );
2236 2244
 				elem.removeAttributeNode( elem.getAttributeNode( name ) );
2237 2245
 			}
  2246
+
  2247
+			// Set corresponding property to false for boolean attributes
  2248
+			if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
  2249
+				elem[ propName ] = false;
  2250
+			}
2238 2251
 		}
2239 2252
 	},
2240 2253
 
@@ -2248,7 +2261,7 @@ jQuery.extend({
2248 2261
 					// Setting the type on a radio button after the value resets the value in IE6-9
2249 2262
 					// Reset value to it's default in case type is set after value
2250 2263
 					// This is for element creation
2251  
-					var val = elem.getAttribute("value");
  2264
+					var val = elem.value;
2252 2265
 					elem.setAttribute( "type", value );
2253 2266
 					if ( val ) {
2254 2267
 						elem.value = val;
@@ -2271,37 +2284,50 @@ jQuery.extend({
2271 2284
 			}
2272 2285
 		}
2273 2286
 	},
2274  
-	
2275  
-	propFix: {},
  2287
+
  2288
+	propFix: {
  2289
+		tabindex: "tabIndex",
  2290
+		readonly: "readOnly",
  2291
+		"for": "htmlFor",
  2292
+		"class": "className",
  2293
+		maxlength: "maxLength",
  2294
+		cellspacing: "cellSpacing",
  2295
+		cellpadding: "cellPadding",
  2296
+		rowspan: "rowSpan",
  2297
+		colspan: "colSpan",
  2298
+		usemap: "useMap",
  2299
+		frameborder: "frameBorder",
  2300
+		contenteditable: "contentEditable"
  2301
+	},
2276 2302
 	
2277 2303
 	prop: function( elem, name, value ) {
2278 2304
 		var nType = elem.nodeType;
2279  
-		
  2305
+
2280 2306
 		// don't get/set properties on text, comment and attribute nodes
2281 2307
 		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2282 2308
 			return undefined;
2283 2309
 		}
2284  
-		
  2310
+
2285 2311
 		var ret, hooks,
2286 2312
 			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2287  
-		
  2313
+
2288 2314
 		// Try to normalize/fix the name
2289 2315
 		name = notxml && jQuery.propFix[ name ] || name;
2290 2316
 		
2291 2317
 		hooks = jQuery.propHooks[ name ];
2292  
-		
  2318
+
2293 2319
 		if ( value !== undefined ) {
2294 2320
 			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2295 2321
 				return ret;
2296  
-			
  2322
+
2297 2323
 			} else {
2298 2324
 				return (elem[ name ] = value);
2299 2325
 			}
2300  
-		
  2326
+
2301 2327
 		} else {
2302 2328
 			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
2303 2329
 				return ret;
2304  
-				
  2330
+
2305 2331
 			} else {
2306 2332
 				return elem[ name ];
2307 2333
 			}
@@ -2311,30 +2337,65 @@ jQuery.extend({
2311 2337
 	propHooks: {}
2312 2338
 });
2313 2339
 
  2340
+// Hook for boolean attributes
  2341
+boolHook = {
  2342
+	get: function( elem, name ) {
  2343
+		// Align boolean attributes with corresponding properties
  2344
+		return elem[ jQuery.propFix[ name ] || name ] ?
  2345
+			name.toLowerCase() :
  2346
+			undefined;
  2347
+	},
  2348
+	set: function( elem, value, name ) {
  2349
+		var propName;
  2350
+		if ( value === false ) {
  2351
+			// Remove boolean attributes when set to false
  2352
+			jQuery.removeAttr( elem, name );
  2353
+		} else {
  2354
+			// value is true since we know at this point it's type boolean and not false
  2355
+			// Set boolean attributes to the same name and set the DOM property
  2356
+			propName = jQuery.propFix[ name ] || name;
  2357
+			if ( propName in elem ) {
  2358
+				// Only set the IDL specifically if it already exists on the element
  2359
+				elem[ propName ] = value;
  2360
+			}
  2361
+
  2362
+			elem.setAttribute( name, name.toLowerCase() );
  2363
+		}
  2364
+		return name;
  2365
+	}
  2366
+};
  2367
+
  2368
+// Use the value property for back compat
  2369
+// Use the formHook for button elements in IE6/7 (#1954)
  2370
+jQuery.attrHooks.value = {
  2371
+	get: function( elem, name ) {
  2372
+		if ( formHook && jQuery.nodeName( elem, "button" ) ) {
  2373
+			return formHook.get( elem, name );
  2374
+		}
  2375
+		return elem.value;
  2376
+	},
  2377
+	set: function( elem, value, name ) {
  2378
+		if ( formHook && jQuery.nodeName( elem, "button" ) ) {
  2379
+			return formHook.set( elem, value, name );
  2380
+		}
  2381
+		// Does not return so that setAttribute is also used
  2382
+		elem.value = value;
  2383
+	}
  2384
+};
  2385
+
2314 2386
 // IE6/7 do not support getting/setting some attributes with get/setAttribute
2315 2387
 if ( !jQuery.support.getSetAttribute ) {
2316  
-	jQuery.attrFix = jQuery.extend( jQuery.attrFix, {
2317  
-		"for": "htmlFor",
2318  
-		"class": "className",
2319  
-		maxlength: "maxLength",
2320  
-		cellspacing: "cellSpacing",
2321  
-		cellpadding: "cellPadding",
2322  
-		rowspan: "rowSpan",
2323  
-		colspan: "colSpan",
2324  
-		usemap: "useMap",
2325  
-		frameborder: "frameBorder"
2326  
-	});
  2388
+
  2389
+	// propFix is more comprehensive and contains all fixes
  2390
+	jQuery.attrFix = jQuery.propFix;
2327 2391
 	
2328 2392
 	// Use this for any attribute on a form in IE6/7
2329  
-	formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = {
  2393
+	formHook = jQuery.attrHooks.name = jQuery.valHooks.button = {
2330 2394
 		get: function( elem, name ) {
2331 2395
 			var ret;
2332  
-			if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
2333  
-				return elem.getAttribute( name );
2334  
-			}
2335 2396
 			ret = elem.getAttributeNode( name );
2336  
-			// Return undefined if not specified instead of empty string
2337  
-			return ret && ret.specified ?
  2397
+			// Return undefined if nodeValue is empty string
  2398
+			return ret && ret.nodeValue !== "" ?