Changeset 3959
- Timestamp:
- 11/28/07 01:01:49 (11 months ago)
- Location:
- trunk/jquery
- Files:
-
- 3 modified
-
src/core.js (modified) (4 diffs)
-
test/index.html (modified) (1 diff)
-
test/unit/core.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/core.js
r3958 r3959 44 44 45 45 // Handle HTML strings 46 } else if ( typeof selector == "string" ) {46 } else if ( typeof selector == "string" ) { 47 47 // Are we dealing with HTML string or an ID? 48 48 var match = quickExpr.exec( selector ); … … 195 195 196 196 css: function( key, value ) { 197 // ignore negative width and height values 198 if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) 199 value = undefined; 197 200 return this.attr( key, value, "curCSS" ); 198 201 }, … … 361 364 if ( this.length ) { 362 365 var elem = this[0]; 363 366 364 367 // We need to handle select boxes special 365 368 if ( jQuery.nodeName( elem, "select" ) ) { … … 1322 1325 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater (Mozilla reports scrollWidth the same as offsetWidth) 1323 1326 Math.max( document.body[ "scroll" + name ], document.body[ "offset" + name ] ) : 1324 1327 1325 1328 // Get or set width or height on the element 1326 1329 size == undefined ? -
trunk/jquery/test/index.html
r3856 r3959 21 21 22 22 <!-- Test HTML --> 23 <div id="nothiddendiv" style="height:1px;background:white;"></div> 23 24 <dl id="dl" style="display:none;"> 24 25 <div id="main" style="display: none;"> -
trunk/jquery/test/unit/core.js
r3856 r3959 409 409 ok( !! $(":checkbox:first", $checkedtest).attr("checked"), "Check first checkbox still checked." ); 410 410 ok( ! $(":checkbox:last", $checkedtest).attr("checked"), "Check last checkbox still NOT checked." ); 411 }); 412 413 test("width()", function() { 414 expect(2); 415 416 $("#nothiddendiv").width(30); 417 equals($("#nothiddendiv").width(), 30, "Test set to 30 correctly"); 418 $("#nothiddendiv").width(-1); // handle negative numbers by ignoring #1599 419 equals($("#nothiddendiv").width(), 30, "Test negative width ignored"); 411 420 }); 412 421
