Ticket #1591: ie-table-attr-namespace.patch
File ie-table-attr-namespace.patch, 2.1 KB (added by , 14 years ago) |
---|
-
src/core.js
1072 1072 // browsers index elements by id/name on forms, give priority to attributes. 1073 1073 if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) 1074 1074 return elem.getAttributeNode( name ).nodeValue; 1075 1076 if ( msie && jQuery.nodeName( elem, "table" ) && name.indexOf(':') > -1 && elem.attributes[name] === undefined ) 1077 return undefined; 1075 1078 1076 1079 return elem[ name ]; 1077 1080 } … … 1368 1371 // Helper function used by the dimensions and offset modules 1369 1372 function num(elem, prop) { 1370 1373 return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; 1371 } 1372 No newline at end of file 1374 } -
test/unit/core.js
317 317 }); 318 318 319 319 test("attr(String)", function() { 320 expect(2 6);320 expect(28); 321 321 equals( jQuery('#text1').attr('value'), "Test", 'Check for value attribute' ); 322 322 equals( jQuery('#text1').attr('value', "Test2").attr('defaultValue'), "Test", 'Check for defaultValue attribute' ); 323 323 equals( jQuery('#text1').attr('type'), "text", 'Check for type attribute' ); … … 341 341 jQuery('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path 342 342 equals( jQuery('#tAnchor5').attr('href'), "#5", 'Check for non-absolute href (an anchor)' ); 343 343 344 // Related to [1591] - IE 6 & 7 throw Invalid Parameter error when a namespaced attribute on a table tag is non-existent 345 ok( jQuery('#foo').attr('non:existent') === undefined, 'Make sure namespaced:attributes for div return undefined if non-existent' ); 346 ok( jQuery('#table').attr('non:existent') === undefined, 'Make sure namespaced:attributes for table tag return undefined if non-existent (IE6+)' ); 344 347 345 348 // Related to [5574] and [5683] 346 349 var body = document.body, $body = jQuery(body);