Commit 0e2642d2 authored by Arne de Bree's avatar Arne de Bree Committed by Dave Methvin

Fix 11547. XML and IE DOM can't be force-lowercase in removeAttr().

See discussion on pull request: https://github.com/jquery/jquery/pull/724
parent d7217cc2
...@@ -356,7 +356,12 @@ jQuery.extend({ ...@@ -356,7 +356,12 @@ jQuery.extend({
i = 0; i = 0;
if ( value && elem.nodeType === 1 ) { if ( value && elem.nodeType === 1 ) {
attrNames = value.toLowerCase().split( rspace );
if ( !jQuery.isXMLDoc( elem ) ) {
value = value.toLowerCase();
}
attrNames = value.split( rspace );
l = attrNames.length; l = attrNames.length;
for ( ; i < l; i++ ) { for ( ; i < l; i++ ) {
......
...@@ -1192,3 +1192,16 @@ test("coords returns correct values in IE6/IE7, see #10828", function() { ...@@ -1192,3 +1192,16 @@ test("coords returns correct values in IE6/IE7, see #10828", function() {
area = map.html("<area shape='rect' href='#' alt='a' /></map>").find("area"); area = map.html("<area shape='rect' href='#' alt='a' /></map>").find("area");
equal( area.attr("coords"), undefined, "did not retrieve coords correctly"); equal( area.attr("coords"), undefined, "did not retrieve coords correctly");
}); });
test("Handle cased attributes on XML DOM correctly in removeAttr()", function() {
expect(1);
var xmlStr = "<root><item fooBar='123' /></root>",
$xmlDoc = jQuery( jQuery.parseXML( xmlStr ) ),
$item = $xmlDoc.find( "item" ),
el = $item[0];
$item.removeAttr( "fooBar" );
equal( el.attributes.length, 0, "attribute with upper case did not get removed" );
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment