Skip to main content

Bug Tracker

Side navigation

#11547 closed bug (fixed)

Opened April 02, 2012 10:24PM UTC

Closed July 12, 2012 03:14AM UTC

XML DOM .removeAttr() doesn't remove cased attributes

Reported by: adebree Owned by: dmethvin
Priority: low Milestone: 1.8
Component: attributes Version: 1.7
Keywords: Cc:
Blocked by: Blocking:
Description

In case of an XML DOM the .removeAttr() function doesn't remove cased attributes. XML is case sensitive so attributes provided with uppercase should be handled accordingly.

jsFiddle with the reproduction:

http://jsfiddle.net/23w2d/

This problem seems to be introduced in 1.7, caused by an unconditioned .toLowerCase() in the removeAttr().

Pull request with the fix will be made after this ticket is created.

Attachments (0)
Change History (5)

Changed April 02, 2012 10:39PM UTC by adebree comment:1

Changed April 03, 2012 12:23AM UTC by rwaldron comment:2

status: newopen

Originally introduced here: https://github.com/jquery/jquery/commit/ce8d9c0ca59a8f03e119c80ed29c7dbc65efdd85#L0R357

The problem is that there were no tests that would've caught the regression.

Changed June 02, 2012 03:15PM UTC by dmethvin comment:3

owner: → dmethvin
status: openassigned

Changed July 12, 2012 01:55AM UTC by dmethvin comment:4

component: unfiledattributes
milestone: None1.8
priority: undecidedlow

Changed July 12, 2012 03:14AM UTC by Dave Methvin comment:5

resolution: → fixed
status: assignedclosed

Fix #11547. toLowerCase not work good on XML attributes.

This was fixed to some extent in gh-724 but there were insufficient test cases. Removing the lowercase completely allows IE 6/7 to work properly since there you need an exact case match for attributes, even in HTML docs. More discussion and test cases in the comments on gh-724.

Changeset: f4e5c1729a2efe6086ac2407f82e928b26991f83